tianheng-ui 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tianheng-ui.js
CHANGED
@@ -111,6 +111,6 @@ t.read=function(e,t,n,i,o){var r,a,s=8*o-i-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,h=
|
|
111
111
|
* @license MIT
|
112
112
|
*
|
113
113
|
* BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00)
|
114
|
-
*/i="undefined"!=typeof window?window:this,void 0!==(n=function(){return function(e,t){var n=(void 0!==this?this:e).SVG=function(e){if(n.supported)return e=new n.Doc(e),n.parser.draw||n.prepare(),e};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!t.createElementNS&&!!t.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(e){return"Svgjs"+u(e)+n.did++},n.create=function(e){var n=t.createElementNS(this.ns,e);return n.setAttribute("id",this.eid(e)),n},n.extend=function(){var e,t,i,o;for(t=(e=[].slice.call(arguments)).pop(),o=e.length-1;o>=0;o--)if(e[o])for(i in t)e[o].prototype[i]=t[i];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(e){var t="function"==typeof e.create?e.create:function(){this.constructor.call(this,n.create(e.create))};return e.inherit&&(t.prototype=new e.inherit),e.extend&&n.extend(t,e.extend),e.construct&&n.extend(e.parent||n.Container,e.construct),t},n.adopt=function(t){return t?t.instance?t.instance:((i="svg"==t.nodeName?t.parentNode instanceof e.SVGElement?new n.Nested:new n.Doc:"linearGradient"==t.nodeName?new n.Gradient("linear"):"radialGradient"==t.nodeName?new n.Gradient("radial"):n[u(t.nodeName)]?new(n[u(t.nodeName)]):new n.Element(t)).type=t.nodeName,i.node=t,t.instance=i,i instanceof n.Doc&&i.namespace().defs(),i.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),i):null;var i},n.prepare=function(){var e=t.getElementsByTagName("body")[0],i=(e?new n.Doc(e):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:e||t.documentElement,draw:i.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:i.polyline().node,path:i.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},t.addEventListener("DOMContentLoaded",(function(){n.parser.draw||n.prepare()}),!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(e,t){var n,i=e.length,o=[];for(n=0;n<i;n++)o.push(t(e[n]));return o},filter:function(e,t){var n,i=e.length,o=[];for(n=0;n<i;n++)t(e[n])&&o.push(e[n]);return o},radians:function(e){return e%360*Math.PI/180},degrees:function(e){return 180*e/Math.PI%360},filterSVGElements:function(t){return this.filter(t,(function(t){return t instanceof e.SVGElement}))}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(e){var t;this.r=0,this.g=0,this.b=0,e&&("string"==typeof e?n.regex.isRgb.test(e)?(t=n.regex.rgb.exec(e.replace(n.regex.whitespace,"")),this.r=parseInt(t[1]),this.g=parseInt(t[2]),this.b=parseInt(t[3])):n.regex.isHex.test(e)&&(t=n.regex.hex.exec(function(e){return 4==e.length?["#",e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(""):e}(e)),this.r=parseInt(t[1],16),this.g=parseInt(t[2],16),this.b=parseInt(t[3],16)):"object"==typeof e&&(this.r=e.r,this.g=e.g,this.b=e.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+d(this.r)+d(this.g)+d(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(e){return this.destination=new n.Color(e),this},at:function(e){return this.destination?(e=e<0?0:e>1?1:e,new n.Color({r:~~(this.r+(this.destination.r-this.r)*e),g:~~(this.g+(this.destination.g-this.g)*e),b:~~(this.b+(this.destination.b-this.b)*e)})):this}}),n.Color.test=function(e){return e+="",n.regex.isHex.test(e)||n.regex.isRgb.test(e)},n.Color.isRgb=function(e){return e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b},n.Color.isColor=function(e){return n.Color.isRgb(e)||n.Color.test(e)},n.Array=function(e,t){0==(e=(e||[]).valueOf()).length&&t&&(e=t.valueOf()),this.value=this.parse(e)},n.extend(n.Array,{morph:function(e){if(this.destination=this.parse(e),this.value.length!=this.destination.length){for(var t=this.value[this.value.length-1],n=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(n);for(;this.value.length<this.destination.length;)this.value.push(t)}return this},settle:function(){for(var e=0,t=this.value.length,n=[];e<t;e++)-1==n.indexOf(this.value[e])&&n.push(this.value[e]);return this.value=n},at:function(e){if(!this.destination)return this;for(var t=0,i=this.value.length,o=[];t<i;t++)o.push(this.value[t]+(this.destination[t]-this.value[t])*e);return new n.Array(o)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(e){return e=e.valueOf(),Array.isArray(e)?e:this.split(e)},split:function(e){return e.trim().split(n.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var e=new this.constructor;return e.value=function e(t){for(var n=t.slice(0),i=n.length;i--;)Array.isArray(n[i])&&(n[i]=e(n[i]));return n}(this.value),e}}),n.PointArray=function(e,t){n.Array.call(this,e,t||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var e=0,t=this.value.length,n=[];e<t;e++)n.push(this.value[e].join(","));return n.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(e){if(!this.destination)return this;for(var t=0,i=this.value.length,o=[];t<i;t++)o.push([this.value[t][0]+(this.destination[t][0]-this.value[t][0])*e,this.value[t][1]+(this.destination[t][1]-this.value[t][1])*e]);return new n.PointArray(o)},parse:function(e){var t=[];if(e=e.valueOf(),Array.isArray(e)){if(Array.isArray(e[0]))return e.map((function(e){return e.slice()}));if(null!=e[0].x)return e.map((function(e){return[e.x,e.y]}))}else e=e.trim().split(n.regex.delimiter).map(parseFloat);e.length%2!=0&&e.pop();for(var i=0,o=e.length;i<o;i+=2)t.push([e[i],e[i+1]]);return t},move:function(e,t){var n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(var i=this.value.length-1;i>=0;i--)this.value[i]=[this.value[i][0]+e,this.value[i][1]+t];return this},size:function(e,t){var n,i=this.bbox();for(n=this.value.length-1;n>=0;n--)i.width&&(this.value[n][0]=(this.value[n][0]-i.x)*e/i.width+i.x),i.height&&(this.value[n][1]=(this.value[n][1]-i.y)*t/i.height+i.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(e,t,n){return t.x=n.x=e[0],t.y=n.y=e[1],["M",t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],["L",e[0],e[1]]},H:function(e,t){return t.x=e[0],["H",e[0]]},V:function(e,t){return t.y=e[0],["V",e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],["C",e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],["S",e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],["Q",e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],["T",e[0],e[1]]},Z:function(e,t,n){return t.x=n.x,t.y=n.y,["Z"]},A:function(e,t){return t.x=e[5],t.y=e[6],["A",e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},o="mlhvqtcsaz".split(""),r=0,a=o.length;r<a;++r)i[o[r]]=function(e){return function(t,n,o){if("H"==e)t[0]=t[0]+n.x;else if("V"==e)t[0]=t[0]+n.y;else if("A"==e)t[5]=t[5]+n.x,t[6]=t[6]+n.y;else for(var r=0,a=t.length;r<a;++r)t[r]=t[r]+(r%2?n.y:n.x);return i[e](t,n,o)}}(o[r].toUpperCase());n.PathArray=function(e,t){n.Array.call(this,e,t||[["M",0,0]])},n.PathArray.prototype=new n.Array,n.PathArray.prototype.constructor=n.PathArray,n.extend(n.PathArray,{toString:function(){return function(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t][0],null!=e[t][1]&&(i+=e[t][1],null!=e[t][2]&&(i+=" ",i+=e[t][2],null!=e[t][3]&&(i+=" ",i+=e[t][3],i+=" ",i+=e[t][4],null!=e[t][5]&&(i+=" ",i+=e[t][5],i+=" ",i+=e[t][6],null!=e[t][7]&&(i+=" ",i+=e[t][7])))));return i+" "}(this.value)},move:function(e,t){var n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(var i,o=this.value.length-1;o>=0;o--)"M"==(i=this.value[o][0])||"L"==i||"T"==i?(this.value[o][1]+=e,this.value[o][2]+=t):"H"==i?this.value[o][1]+=e:"V"==i?this.value[o][1]+=t:"C"==i||"S"==i||"Q"==i?(this.value[o][1]+=e,this.value[o][2]+=t,this.value[o][3]+=e,this.value[o][4]+=t,"C"==i&&(this.value[o][5]+=e,this.value[o][6]+=t)):"A"==i&&(this.value[o][6]+=e,this.value[o][7]+=t);return this},size:function(e,t){var n,i,o=this.bbox();for(n=this.value.length-1;n>=0;n--)"M"==(i=this.value[n][0])||"L"==i||"T"==i?(this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x,this.value[n][2]=(this.value[n][2]-o.y)*t/o.height+o.y):"H"==i?this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x:"V"==i?this.value[n][1]=(this.value[n][1]-o.y)*t/o.height+o.y:"C"==i||"S"==i||"Q"==i?(this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x,this.value[n][2]=(this.value[n][2]-o.y)*t/o.height+o.y,this.value[n][3]=(this.value[n][3]-o.x)*e/o.width+o.x,this.value[n][4]=(this.value[n][4]-o.y)*t/o.height+o.y,"C"==i&&(this.value[n][5]=(this.value[n][5]-o.x)*e/o.width+o.x,this.value[n][6]=(this.value[n][6]-o.y)*t/o.height+o.y)):"A"==i&&(this.value[n][1]=this.value[n][1]*e/o.width,this.value[n][2]=this.value[n][2]*t/o.height,this.value[n][6]=(this.value[n][6]-o.x)*e/o.width+o.x,this.value[n][7]=(this.value[n][7]-o.y)*t/o.height+o.y);return this},equalCommands:function(e){var t,i,o;for(e=new n.PathArray(e),o=this.value.length===e.value.length,t=0,i=this.value.length;o&&t<i;t++)o=this.value[t][0]===e.value[t][0];return o},morph:function(e){return e=new n.PathArray(e),this.equalCommands(e)?this.destination=e:this.destination=null,this},at:function(e){if(!this.destination)return this;var t,i,o,r,a=this.value,s=this.destination.value,l=[],c=new n.PathArray;for(t=0,i=a.length;t<i;t++){for(l[t]=[a[t][0]],o=1,r=a[t].length;o<r;o++)l[t][o]=a[t][o]+(s[t][o]-a[t][o])*e;"A"===l[t][0]&&(l[t][4]=+(0!=l[t][4]),l[t][5]=+(0!=l[t][5]))}return c.value=l,c},parse:function(e){if(e instanceof n.PathArray)return e.valueOf();var t,o={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};e="string"==typeof e?e.replace(n.regex.numbersWithDots,l).replace(n.regex.pathLetters," $& ").replace(n.regex.hyphen,"$1 -").trim().split(n.regex.delimiter):e.reduce((function(e,t){return[].concat.call(e,t)}),[]);var r=[],a=new n.Point,s=new n.Point,c=0,u=e.length;do{n.regex.isPathLetter.test(e[c])?(t=e[c],++c):"M"==t?t="L":"m"==t&&(t="l"),r.push(i[t].call(null,e.slice(c,c+=o[t.toUpperCase()]).map(parseFloat),a,s))}while(u>c);return r},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(e,t){this.value=0,this.unit=t||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(t=e.match(n.regex.numberAndUnit))&&(this.value=parseFloat(t[1]),"%"==t[5]?this.value/=100:"s"==t[5]&&(this.value*=1e3),this.unit=t[5]):e instanceof n.Number&&(this.value=e.valueOf(),this.unit=e.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(e){return e=new n.Number(e),new n.Number(this+e,this.unit||e.unit)},minus:function(e){return e=new n.Number(e),new n.Number(this-e,this.unit||e.unit)},times:function(e){return e=new n.Number(e),new n.Number(this*e,this.unit||e.unit)},divide:function(e){return e=new n.Number(e),new n.Number(this/e,this.unit||e.unit)},to:function(e){var t=new n.Number(this);return"string"==typeof e&&(t.unit=e),t},morph:function(e){return this.destination=new n.Number(e),e.relative&&(this.destination.value+=this.value),this},at:function(e){return this.destination?new n.Number(this.destination).minus(this).times(e).plus(this):this}}}),n.Element=n.invent({create:function(e){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=e)&&(this.type=e.nodeName,this.node.instance=this,this._events=e._events||{},this._stroke=e.getAttribute("stroke")||this._stroke)},extend:{x:function(e){return this.attr("x",e)},y:function(e){return this.attr("y",e)},cx:function(e){return null==e?this.x()+this.width()/2:this.x(e-this.width()/2)},cy:function(e){return null==e?this.y()+this.height()/2:this.y(e-this.height()/2)},move:function(e,t){return this.x(e).y(t)},center:function(e,t){return this.cx(e).cy(t)},width:function(e){return this.attr("width",e)},height:function(e){return this.attr("height",e)},size:function(e,t){var i=h(this,e,t);return this.width(new n.Number(i.width)).height(new n.Number(i.height))},clone:function(e){this.writeDataToDom();var t=g(this.node.cloneNode(!0));return e?e.add(t):this.after(t),t},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(e){return this.after(e).remove(),e},addTo:function(e){return e.put(this)},putIn:function(e){return e.add(this)},id:function(e){return this.attr("id",e)},inside:function(e,t){var n=this.bbox();return e>n.x&&t>n.y&&e<n.x+n.width&&t<n.y+n.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var e=this.attr("class");return null==e?[]:e.trim().split(n.regex.delimiter)},hasClass:function(e){return-1!=this.classes().indexOf(e)},addClass:function(e){if(!this.hasClass(e)){var t=this.classes();t.push(e),this.attr("class",t.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter((function(t){return t!=e})).join(" ")),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)},reference:function(e){return n.get(this.attr(e))},parent:function(t){var i=this;if(!i.node.parentNode)return null;if(i=n.adopt(i.node.parentNode),!t)return i;for(;i&&i.node instanceof e.SVGElement;){if("string"==typeof t?i.matches(t):i instanceof t)return i;if(!i.node.parentNode||"#document"==i.node.parentNode.nodeName||"#document-fragment"==i.node.parentNode.nodeName)return null;i=n.adopt(i.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(e){var t=[],n=this;do{if(!(n=n.parent(e))||!n.node)break;t.push(n)}while(n.parent);return t},matches:function(e){return function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}(this.node,e)},native:function(){return this.node},svg:function(e){var i=t.createElement("svg");if(!(e&&this instanceof n.Parent))return i.appendChild(e=t.createElement("svg")),this.writeDataToDom(),e.appendChild(this.node.cloneNode(!0)),i.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");i.innerHTML="<svg>"+e.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var o=0,r=i.firstChild.childNodes.length;o<r;o++)this.node.appendChild(i.firstChild.firstChild);return this},writeDataToDom:function(){(this.each||this.lines)&&(this.each?this:this.lines()).each((function(){this.writeDataToDom()}));return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(e){return this.dom=e,this},is:function(e){return function(e,t){return e instanceof t}(this,e)}}}),n.easing={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)}},n.morph=function(e){return function(t,i){return new n.MorphObj(t,i).at(e)}},n.Situation=n.invent({create:function(e){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(e.duration).valueOf(),this.delay=new n.Number(e.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=e.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(e){this._target=e,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(e,t,i){"object"==typeof e&&(t=e.ease,i=e.delay,e=e.duration);var o=new n.Situation({duration:e||1e3,delay:i||0,ease:n.easing[t||"-"]||t});return this.queue(o),this},delay:function(e){var t=new n.Situation({duration:e,delay:0,ease:n.easing["-"]});return this.queue(t)},target:function(e){return e&&e instanceof n.Element?(this._target=e,this):this._target},timeToAbsPos:function(e){return(e-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(e){return this.situation.duration/this._speed*e+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(e){return("function"==typeof e||e instanceof n.Situation)&&this.situations.push(e),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var e,t,i,o=this.situation;if(o.init)return this;for(e in o.animations)for(i=this.target()[e](),Array.isArray(i)||(i=[i]),Array.isArray(o.animations[e])||(o.animations[e]=[o.animations[e]]),t=i.length;t--;)o.animations[e][t]instanceof n.Number&&(i[t]=new n.Number(i[t])),o.animations[e][t]=i[t].morph(o.animations[e][t]);for(e in o.attrs)o.attrs[e]=new n.MorphObj(this.target().attr(e),o.attrs[e]);for(e in o.styles)o.styles[e]=new n.MorphObj(this.target().style(e),o.styles[e]);return o.initialTransformation=this.target().matrixify(),o.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(e,t){var n=this.active;return this.active=!1,t&&this.clearQueue(),e&&this.situation&&(!n&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var e=this.situation;this.stop(),this.situation=e,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(e,t){var n=this.situation.duration/this._speed;return this.absPos=e,t||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*n,this.situation.finish=this.situation.start+n,this.step(!0)},speed:function(e){return 0===e?this.pause():e?(this._speed=e,this.at(this.absPos,!0)):this._speed},loop:function(e,t){var n=this.last();return n.loops=null==e||e,n.loop=0,t&&(n.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(e){var t=this.last();return t.reversed=void 0===e?!t.reversed:e,this},progress:function(e){return e?this.situation.ease(this.pos):this.pos},after:function(e){var t=this.last();return this.target().on("finished.fx",(function n(i){i.detail.situation==t&&(e.call(this,t),this.off("finished.fx",n))})),this._callStart()},during:function(e){var t=this.last(),i=function(i){i.detail.situation==t&&e.call(this,i.detail.pos,n.morph(i.detail.pos),i.detail.eased,t)};return this.target().off("during.fx",i).on("during.fx",i),this.after((function(){this.off("during.fx",i)})),this._callStart()},afterAll:function(e){var t=function t(n){e.call(this),this.off("allfinished.fx",t)};return this.target().off("allfinished.fx",t).on("allfinished.fx",t),this._callStart()},duringAll:function(e){var t=function(t){e.call(this,t.detail.pos,n.morph(t.detail.pos),t.detail.eased,t.detail.situation)};return this.target().off("during.fx",t).on("during.fx",t),this.afterAll((function(){this.off("during.fx",t)})),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(e,t,n){return this.last()[n||"animations"][e]=t,this._callStart()},step:function(e){var t,n,i;(e||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops)?(t=Math.max(this.absPos,0),n=Math.floor(t),!0===this.situation.loops||n<this.situation.loops?(this.pos=t-n,i=this.situation.loop,this.situation.loop=n):(this.absPos=this.situation.loops,this.pos=1,i=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-i)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos);this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var o=this.situation.ease(this.pos);for(var r in this.situation.once)r>this.lastPos&&r<=o&&(this.situation.once[r].call(this.target(),this.pos,o),delete this.situation.once[r]);return this.active&&this.target().fire("during",{pos:this.pos,eased:o,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=o,this):this},eachAt:function(){var e,t,i,o=this,r=this.target(),a=this.situation;for(e in a.animations)i=[].concat(a.animations[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r[e].apply(r,i);for(e in a.attrs)i=[e].concat(a.attrs[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r.attr.apply(r,i);for(e in a.styles)i=[e].concat(a.styles[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r.style.apply(r,i);if(a.transforms.length){for(i=a.initialTransformation,e=0,t=a.transforms.length;e<t;e++){var s=a.transforms[e];s instanceof n.Matrix?i=s.relative?i.multiply((new n.Matrix).morph(s).at(a.ease(this.pos))):i.morph(s).at(a.ease(this.pos)):(s.relative||s.undo(i.extract()),i=i.multiply(s.at(a.ease(this.pos))))}r.matrix(i)}return this},once:function(e,t,n){var i=this.last();return n||(e=i.ease(e)),i.once[e]=t,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:n.Element,construct:{animate:function(e,t,i){return(this.fx||(this.fx=new n.FX(this))).animate(e,t,i)},delay:function(e){return(this.fx||(this.fx=new n.FX(this))).delay(e)},stop:function(e,t){return this.fx&&this.fx.stop(e,t),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(e){if(this.fx){if(null==e)return this.fx.speed();this.fx.speed(e)}return this}}}),n.MorphObj=n.invent({create:function(e,t){return n.Color.isColor(t)?new n.Color(e).morph(t):n.regex.delimiter.test(e)?n.regex.pathLetters.test(e)?new n.PathArray(e).morph(t):new n.Array(e).morph(t):n.regex.numberAndUnit.test(t)?new n.Number(e).morph(t):(this.value=e,void(this.destination=t))},extend:{at:function(e,t){return t<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(e,t,n){if("object"==typeof e)for(var i in e)this.attr(i,e[i]);else this.add(e,t,"attrs");return this},style:function(e,t){if("object"==typeof e)for(var n in e)this.style(n,e[n]);else this.add(e,t,"styles");return this},x:function(e,t){if(this.target()instanceof n.G)return this.transform({x:e},t),this;var i=new n.Number(e);return i.relative=t,this.add("x",i)},y:function(e,t){if(this.target()instanceof n.G)return this.transform({y:e},t),this;var i=new n.Number(e);return i.relative=t,this.add("y",i)},cx:function(e){return this.add("cx",new n.Number(e))},cy:function(e){return this.add("cy",new n.Number(e))},move:function(e,t){return this.x(e).y(t)},center:function(e,t){return this.cx(e).cy(t)},size:function(e,t){var i;this.target()instanceof n.Text?this.attr("font-size",e):(e&&t||(i=this.target().bbox()),e||(e=i.width/i.height*t),t||(t=i.height/i.width*e),this.add("width",new n.Number(e)).add("height",new n.Number(t)));return this},width:function(e){return this.add("width",new n.Number(e))},height:function(e){return this.add("height",new n.Number(e))},plot:function(e,t,n,i){return 4==arguments.length?this.plot([e,t,n,i]):this.add("plot",new(this.target().morphArray)(e))},leading:function(e){return this.target().leading?this.add("leading",new n.Number(e)):this},viewbox:function(e,t,i,o){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(e,t,i,o)),this},update:function(e){if(this.target()instanceof n.Stop){if("number"==typeof e||e instanceof n.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",e.offset)}return this}}),n.Box=n.invent({create:function(e,t,i,o){if(!("object"!=typeof e||e instanceof n.Element))return n.Box.call(this,null!=e.left?e.left:e.x,null!=e.top?e.top:e.y,e.width,e.height);4==arguments.length&&(this.x=e,this.y=t,this.width=i,this.height=o),v(this)},extend:{merge:function(e){var t=new this.constructor;return t.x=Math.min(this.x,e.x),t.y=Math.min(this.y,e.y),t.width=Math.max(this.x+this.width,e.x+e.width)-t.x,t.height=Math.max(this.y+this.height,e.y+e.height)-t.y,v(t)},transform:function(e){var t,i=1/0,o=-1/0,r=1/0,a=-1/0;return[new n.Point(this.x,this.y),new n.Point(this.x2,this.y),new n.Point(this.x,this.y2),new n.Point(this.x2,this.y2)].forEach((function(t){t=t.transform(e),i=Math.min(i,t.x),o=Math.max(o,t.x),r=Math.min(r,t.y),a=Math.max(a,t.y)})),(t=new this.constructor).x=i,t.width=o-i,t.y=r,t.height=a-r,v(t),t}}}),n.BBox=n.invent({create:function(e){if(n.Box.apply(this,[].slice.call(arguments)),e instanceof n.Element){var i;try{if(t.documentElement.contains){if(!t.documentElement.contains(e.node))throw new Exception("Element not in the dom")}else{for(var o=e.node;o.parentNode;)o=o.parentNode;if(o!=t)throw new Exception("Element not in the dom")}i=e.node.getBBox()}catch(o){if(e instanceof n.Shape){var r=e.clone(n.parser.draw.instance).show();i=r.node.getBBox(),r.remove()}else i={x:e.node.clientLeft,y:e.node.clientTop,width:e.node.clientWidth,height:e.node.clientHeight}}n.Box.call(this,i)}},inherit:n.Box,parent:n.Element,construct:{bbox:function(){return new n.BBox(this)}}}),n.BBox.prototype.constructor=n.BBox,n.extend(n.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),n.RBox=n.invent({create:function(e){n.Box.apply(this,[].slice.call(arguments)),e instanceof n.Element&&n.Box.call(this,e.node.getBoundingClientRect())},inherit:n.Box,parent:n.Element,extend:{addOffset:function(){return this.x+=e.pageXOffset,this.y+=e.pageYOffset,this}},construct:{rbox:function(e){return e?new n.RBox(this).transform(e.screenCTM().inverse()):new n.RBox(this).addOffset()}}}),n.RBox.prototype.constructor=n.RBox,n.Matrix=n.invent({create:function(e){var t,i=f([1,0,0,1,0,0]);for(e=e instanceof n.Element?e.matrixify():"string"==typeof e?f(e.split(n.regex.delimiter).map(parseFloat)):6==arguments.length?f([].slice.call(arguments)):Array.isArray(e)?f(e):"object"==typeof e?e:i,t=y.length-1;t>=0;--t)this[y[t]]=null!=e[y[t]]?e[y[t]]:i[y[t]]},extend:{extract:function(){var e=p(this,0,1),t=p(this,1,0),i=180/Math.PI*Math.atan2(e.y,e.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(i*Math.PI/180)+this.f*Math.sin(i*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(i*Math.PI/180)+this.e*Math.sin(-i*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-i,skewY:180/Math.PI*Math.atan2(t.y,t.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:i,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(e){return this.destination=new n.Matrix(e),this},at:function(e){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*e,b:this.b+(this.destination.b-this.b)*e,c:this.c+(this.destination.c-this.c)*e,d:this.d+(this.destination.d-this.d)*e,e:this.e+(this.destination.e-this.e)*e,f:this.f+(this.destination.f-this.f)*e}):this},multiply:function(e){return new n.Matrix(this.native().multiply(function(e){e instanceof n.Matrix||(e=new n.Matrix(e));return e}(e).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(e,t){return new n.Matrix(this.native().translate(e||0,t||0))},scale:function(e,t,i,o){return 1==arguments.length?t=e:3==arguments.length&&(o=i,i=t,t=e),this.around(i,o,new n.Matrix(e,0,0,t,0,0))},rotate:function(e,t,i){return e=n.utils.radians(e),this.around(t,i,new n.Matrix(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0))},flip:function(e,t){return"x"==e?this.scale(-1,1,t,0):"y"==e?this.scale(1,-1,0,t):this.scale(-1,-1,e,null!=t?t:e)},skew:function(e,t,i,o){return 1==arguments.length?t=e:3==arguments.length&&(o=i,i=t,t=e),e=n.utils.radians(e),t=n.utils.radians(t),this.around(i,o,new n.Matrix(1,Math.tan(t),Math.tan(e),1,0,0))},skewX:function(e,t,n){return this.skew(e,0,t,n)},skewY:function(e,t,n){return this.skew(0,e,t,n)},around:function(e,t,i){return this.multiply(new n.Matrix(1,0,0,1,e||0,t||0)).multiply(i).multiply(new n.Matrix(1,0,0,1,-e||0,-t||0))},native:function(){for(var e=n.parser.native.createSVGMatrix(),t=y.length-1;t>=0;t--)e[y[t]]=this[y[t]];return e},toString:function(){return"matrix("+b(this.a)+","+b(this.b)+","+b(this.c)+","+b(this.d)+","+b(this.e)+","+b(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new n.Matrix(t)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(e,t){var n;n=Array.isArray(e)?{x:e[0],y:e[1]}:"object"==typeof e?{x:e.x,y:e.y}:null!=e?{x:e,y:null!=t?t:e}:{x:0,y:0},this.x=n.x,this.y=n.y},extend:{clone:function(){return new n.Point(this)},morph:function(e,t){return this.destination=new n.Point(e,t),this},at:function(e){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*e,y:this.y+(this.destination.y-this.y)*e}):this},native:function(){var e=n.parser.native.createSVGPoint();return e.x=this.x,e.y=this.y,e},transform:function(e){return new n.Point(this.native().matrixTransform(e.native()))}}}),n.extend(n.Element,{point:function(e,t){return new n.Point(e,t).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(e,t,i){if(null==e){for(e={},i=(t=this.node.attributes).length-1;i>=0;i--)e[t[i].nodeName]=n.regex.isNumber.test(t[i].nodeValue)?parseFloat(t[i].nodeValue):t[i].nodeValue;return e}if("object"==typeof e)for(t in e)this.attr(t,e[t]);else if(null===t)this.node.removeAttribute(e);else{if(null==t)return null==(t=this.node.getAttribute(e))?n.defaults.attrs[e]:n.regex.isNumber.test(t)?parseFloat(t):t;"stroke-width"==e?this.attr("stroke",parseFloat(t)>0?this._stroke:null):"stroke"==e&&(this._stroke=t),"fill"!=e&&"stroke"!=e||(n.regex.isImage.test(t)&&(t=this.doc().defs().image(t,0,0)),t instanceof n.Image&&(t=this.doc().defs().pattern(0,0,(function(){this.add(t)})))),"number"==typeof t?t=new n.Number(t):n.Color.isColor(t)?t=new n.Color(t):Array.isArray(t)&&(t=new n.Array(t)),"leading"==e?this.leading&&this.leading(t):"string"==typeof i?this.node.setAttributeNS(i,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||"font-size"!=e&&"x"!=e||this.rebuild(e,t)}return this}}),n.extend(n.Element,{transform:function(e,t){var i,o,r=this;if("object"!=typeof e)return i=new n.Matrix(r).extract(),"string"==typeof e?i[e]:i;if(i=new n.Matrix(r),t=!!t||!!e.relative,null!=e.a)i=t?i.multiply(new n.Matrix(e)):new n.Matrix(e);else if(null!=e.rotation)m(e,r),i=t?i.rotate(e.rotation,e.cx,e.cy):i.rotate(e.rotation-i.extract().rotation,e.cx,e.cy);else if(null!=e.scale||null!=e.scaleX||null!=e.scaleY){if(m(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,!t){var a=i.extract();e.scaleX=1*e.scaleX/a.scaleX,e.scaleY=1*e.scaleY/a.scaleY}i=i.scale(e.scaleX,e.scaleY,e.cx,e.cy)}else if(null!=e.skew||null!=e.skewX||null!=e.skewY){if(m(e,r),e.skewX=null!=e.skew?e.skew:null!=e.skewX?e.skewX:0,e.skewY=null!=e.skew?e.skew:null!=e.skewY?e.skewY:0,!t){a=i.extract();i=i.multiply((new n.Matrix).skew(a.skewX,a.skewY,e.cx,e.cy).inverse())}i=i.skew(e.skewX,e.skewY,e.cx,e.cy)}else e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(o=r.bbox(),e.flip=o.cx,e.offset=o.cy):e.flip=e.offset,i=(new n.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(t?i=i.translate(e.x,e.y):(null!=e.x&&(i.e=e.x),null!=e.y&&(i.f=e.y)));return this.attr("transform",i)}}),n.extend(n.FX,{transform:function(e,t){var i,o,r=this.target();return"object"!=typeof e?(i=new n.Matrix(r).extract(),"string"==typeof e?i[e]:i):(t=!!t||!!e.relative,null!=e.a?i=new n.Matrix(e):null!=e.rotation?(m(e,r),i=new n.Rotate(e.rotation,e.cx,e.cy)):null!=e.scale||null!=e.scaleX||null!=e.scaleY?(m(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,i=new n.Scale(e.scaleX,e.scaleY,e.cx,e.cy)):null!=e.skewX||null!=e.skewY?(m(e,r),e.skewX=null!=e.skewX?e.skewX:0,e.skewY=null!=e.skewY?e.skewY:0,i=new n.Skew(e.skewX,e.skewY,e.cx,e.cy)):e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(o=r.bbox(),e.flip=o.cx,e.offset=o.cy):e.flip=e.offset,i=(new n.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(i=new n.Translate(e.x,e.y)),i?(i.relative=t,this.last().transforms.push(i),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map((function(e){var t=e.trim().split("(");return[t[0],t[1].split(n.regex.delimiter).map((function(e){return parseFloat(e)}))]})).reduce((function(e,t){return"matrix"==t[0]?e.multiply(f(t[1])):e[t[0]].apply(e,t[1])}),new n.Matrix)},toParent:function(e){if(this==e)return this;var t=this.screenCTM(),n=e.screenCTM().inverse();return this.addTo(e).untransform().transform(n.multiply(t)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(e,t){if(arguments.length>1&&"boolean"!=typeof t)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(e))for(var n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=e[n];else if("object"==typeof e)for(n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=e[this.arguments[n]];this.inversed=!1,!0===t&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(e){for(var t=[],i=0,o=this.arguments.length;i<o;++i)t.push(this[this.arguments[i]]);var r=this._undo||new n.Matrix;return r=(new n.Matrix).morph(n.Matrix.prototype[this.method].apply(r,t)).at(e),this.inversed?r.inverse():r},undo:function(e){for(var t=0,i=this.arguments.length;t<i;++t)e[this.arguments[t]]=void 0===this[this.arguments[t]]?0:e[this.arguments[t]];return e.cx=this.cx,e.cy=this.cy,this._undo=new(n[u(this.method)])(e,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),n.Rotate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(e){var t=(new n.Matrix).rotate((new n.Number).morph(this.rotation-(this._undo?this._undo.rotation:0)).at(e),this.cx,this.cy);return this.inversed?t.inverse():t},undo:function(e){return this._undo=e,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),n.Skew=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(e,t){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"==typeof e)for(t in e)this.style(t,e[t]);else{if(!n.regex.isCss.test(e))return this.node.style[c(e)];for(e=e.split(/\s*;\s*/).filter((function(e){return!!e})).map((function(e){return e.split(/\s*:\s*/)}));t=e.pop();)this.style(t[0],t[1])}else this.node.style[c(e)]=null===t||n.regex.isBlank.test(t)?"":t;return this}}),n.Parent=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Element,extend:{children:function(){return n.utils.map(n.utils.filterSVGElements(this.node.childNodes),(function(e){return n.adopt(e)}))},add:function(e,t){return null==t?this.node.appendChild(e.node):e.node!=this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this},put:function(e,t){return this.add(e,t),e},has:function(e){return this.index(e)>=0},index:function(e){return[].slice.call(this.node.childNodes).indexOf(e.node)},get:function(e){return n.adopt(this.node.childNodes[e])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(e,t){var i,o,r=this.children();for(i=0,o=r.length;i<o;i++)r[i]instanceof n.Element&&e.apply(r[i],[i,r]),t&&r[i]instanceof n.Container&&r[i].each(e,t);return this},removeElement:function(e){return this.node.removeChild(e.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(e,t){return 0===t||this instanceof n.Defs||this.node==n.parser.draw||(e=e||(this instanceof n.Doc?this:this.parent(n.Parent)),t=t||1/0,this.each((function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(e,t-1):this.toParent(e)})),this.node.firstChild||this.remove()),this},flatten:function(e,t){return this.ungroup(e,t)}}),n.Container=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(e){var t,i,o,r,a,s,l,c=[0,0,0,0],u=1,d=1,h=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(e instanceof n.Element){for(s=e,l=e,a=(e.attr("viewBox")||"").match(h),e.bbox,o=new n.Number(e.width()),r=new n.Number(e.height());"%"==o.unit;)u*=o.value,o=new n.Number(s instanceof n.Doc?s.parent().offsetWidth:s.parent().width()),s=s.parent();for(;"%"==r.unit;)d*=r.value,r=new n.Number(l instanceof n.Doc?l.parent().offsetHeight:l.parent().height()),l=l.parent();this.x=0,this.y=0,this.width=o*u,this.height=r*d,this.zoom=1,a&&(t=parseFloat(a[0]),i=parseFloat(a[1]),o=parseFloat(a[2]),r=parseFloat(a[3]),this.zoom=this.width/this.height>o/r?this.height/r:this.width/o,this.x=t,this.y=i,this.width=o,this.height=r)}else e="string"==typeof e?e.match(h).map((function(e){return parseFloat(e)})):Array.isArray(e)?e:"object"==typeof e?[e.x,e.y,e.width,e.height]:4==arguments.length?[].slice.call(arguments):c,this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(e,t,i,o){return this.destination=new n.ViewBox(e,t,i,o),this},at:function(e){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*e,this.y+(this.destination.y-this.y)*e,this.width+(this.destination.width-this.width)*e,this.height+(this.destination.height-this.height)*e]):this}},parent:n.Container,construct:{viewbox:function(e,t,i,o){return 0==arguments.length?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(e,t,i,o))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach((function(e){n.Element.prototype[e]=function(t){return null==t?n.off(this,e):n.on(this,e,t),this}})),n.listenerId=0,n.on=function(e,t,i,o,r){var a=i.bind(o||e),s=e instanceof n.Element?e.node:e;s.instance=s.instance||{_events:{}};var l=s.instance._events;i._svgjsListenerId||(i._svgjsListenerId=++n.listenerId),t.split(n.regex.delimiter).forEach((function(e){var t=e.split(".")[0],n=e.split(".")[1]||"*";l[t]=l[t]||{},l[t][n]=l[t][n]||{},l[t][n][i._svgjsListenerId]=a,s.addEventListener(t,a,r||!1)}))},n.off=function(e,t,i,o){var r=e instanceof n.Element?e.node:e;if(r.instance&&("function"!=typeof i||(i=i._svgjsListenerId))){var a=r.instance._events;(t||"").split(n.regex.delimiter).forEach((function(e){var t,s,l=e&&e.split(".")[0],c=e&&e.split(".")[1];if(i)a[l]&&a[l][c||"*"]&&(r.removeEventListener(l,a[l][c||"*"][i],o||!1),delete a[l][c||"*"][i]);else if(l&&c){if(a[l]&&a[l][c]){for(s in a[l][c])n.off(r,[l,c].join("."),s);delete a[l][c]}}else if(c)for(e in a)for(t in a[e])c===t&&n.off(r,[e,c].join("."));else if(l){if(a[l]){for(t in a[l])n.off(r,[l,t].join("."));delete a[l]}}else{for(e in a)n.off(r,e);r.instance._events={}}}))}},n.extend(n.Element,{on:function(e,t,i,o){return n.on(this,e,t,i,o),this},off:function(e,t){return n.off(this.node,e,t),this},fire:function(t,i){return t instanceof e.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new n.CustomEvent(t,{detail:i,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(e){return null==e?this.transform("x"):this.transform({x:e-this.x()},!0)},y:function(e){return null==e?this.transform("y"):this.transform({y:e-this.y()},!0)},cx:function(e){return null==e?this.gbox().cx:this.x(e-this.gbox().width/2)},cy:function(e){return null==e?this.gbox().cy:this.y(e-this.gbox().height/2)},gbox:function(){var e=this.bbox(),t=this.transform();return e.x+=t.x,e.x2+=t.x,e.cx+=t.x,e.y+=t.y,e.y2+=t.y,e.cy+=t.y,e}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(e){e&&("svg"==(e="string"==typeof e?t.getElementById(e):e).nodeName?this.constructor.call(this,e):(this.constructor.call(this,n.create("svg")),e.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var e;this._defs||((e=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(e):this._defs=new n.Defs,this.node.appendChild(this._defs.node));return this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName&&"#document-fragment"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var e=this.node.getScreenCTM();return e&&this.style("left",-e.e%1+"px").style("top",-e.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(e){this.writeDataToDom();var t=this.node,n=g(t.cloneNode(!0));return e?(e.node||e).appendChild(n.node):t.parentNode.insertBefore(n.node,t.nextSibling),n}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var e=this.position()+1,t=this.parent();return t.removeElement(this).add(this,e),t instanceof n.Doc&&t.node.appendChild(t.defs().node),this},backward:function(){var e=this.position();return e>0&&this.parent().removeElement(this).add(this,e-1),this},front:function(){var e=this.parent();return e.node.appendChild(this.node),e instanceof n.Doc&&e.node.appendChild(e.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(e){e.remove();var t=this.position();return this.parent().add(e,t),this},after:function(e){e.remove();var t=this.position();return this.parent().add(e,t+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(e){return this.masker=e instanceof n.Mask?e:this.parent().mask().add(e),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(e){return this.clipper=e instanceof n.ClipPath?e:this.parent().clip().add(e),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(e){this.constructor.call(this,n.create(e+"Gradient")),this.type=e},inherit:n.Container,extend:{at:function(e,t,i){return this.put(new n.Stop).update(e,t,i)},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(e,t,i){return"transform"==e&&(e="gradientTransform"),n.Container.prototype.attr.call(this,e,t,i)}},construct:{gradient:function(e,t){return this.defs().gradient(e,t)}}}),n.extend(n.Gradient,n.FX,{from:function(e,t){return"radial"==(this._target||this).type?this.attr({fx:new n.Number(e),fy:new n.Number(t)}):this.attr({x1:new n.Number(e),y1:new n.Number(t)})},to:function(e,t){return"radial"==(this._target||this).type?this.attr({cx:new n.Number(e),cy:new n.Number(t)}):this.attr({x2:new n.Number(e),y2:new n.Number(t)})}}),n.extend(n.Defs,{gradient:function(e,t){return this.put(new n.Gradient(e)).update(t)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(e){return("number"==typeof e||e instanceof n.Number)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",new n.Number(e.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},toString:function(){return this.fill()},attr:function(e,t,i){return"transform"==e&&(e="patternTransform"),n.Container.prototype.attr.call(this,e,t,i)}},construct:{pattern:function(e,t,n){return this.defs().pattern(e,t,n)}}}),n.extend(n.Defs,{pattern:function(e,t,i){return this.put(new n.Pattern).update(i).attr({x:0,y:0,width:e,height:t,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Element}),n.Bare=n.invent({create:function(e,t){if(this.constructor.call(this,n.create(e)),t)for(var i in t.prototype)"function"==typeof t.prototype[i]&&(this[i]=t.prototype[i])},inherit:n.Element,extend:{words:function(e){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(e)),this}}}),n.extend(n.Parent,{element:function(e,t){return this.put(new n.Bare(e,t))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(e,t){return this.attr("href",(t||"")+"#"+e,n.xlink)}},construct:{use:function(e,t){return this.put(new n.Use).element(e,t)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(e,t){return this.put(new n.Rect).size(e,t)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(e){return this.put(new n.Circle).rx(new n.Number(e).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(e){return this.attr("r",e)},ry:function(e){return this.rx(e)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(e,t){return this.put(new n.Ellipse).size(e,t).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(e){return this.attr("rx",e)},ry:function(e){return this.attr("ry",e)}}),n.extend(n.Circle,n.Ellipse,{x:function(e){return null==e?this.cx()-this.rx():this.cx(e+this.rx())},y:function(e){return null==e?this.cy()-this.ry():this.cy(e+this.ry())},cx:function(e){return null==e?this.attr("cx"):this.attr("cx",e)},cy:function(e){return null==e?this.attr("cy"):this.attr("cy",e)},width:function(e){return null==e?2*this.rx():this.rx(new n.Number(e).divide(2))},height:function(e){return null==e?2*this.ry():this.ry(new n.Number(e).divide(2))},size:function(e,t){var i=h(this,e,t);return this.rx(new n.Number(i.width).divide(2)).ry(new n.Number(i.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(e,t,i,o){return null==e?this.array():(e=void 0!==t?{x1:e,y1:t,x2:i,y2:o}:new n.PointArray(e).toLine(),this.attr(e))},move:function(e,t){return this.attr(this.array().move(e,t).toLine())},size:function(e,t){var n=h(this,e,t);return this.attr(this.array().size(n.width,n.height).toLine())}},construct:{line:function(e,t,i,o){return n.Line.prototype.plot.apply(this.put(new n.Line),null!=e?[e,t,i,o]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(e){return this.put(new n.Polyline).plot(e||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(e){return this.put(new n.Polygon).plot(e||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(e){return null==e?this.array():this.clear().attr("points","string"==typeof e?e:this._array=new n.PointArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("points",this.array().move(e,t))},size:function(e,t){var n=h(this,e,t);return this.attr("points",this.array().size(n.width,n.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},width:function(e){var t=this.bbox();return null==e?t.width:this.size(e,t.height)},height:function(e){var t=this.bbox();return null==e?t.height:this.size(t.width,e)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(e){return null==e?this.array():this.clear().attr("d","string"==typeof e?e:this._array=new n.PathArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("d",this.array().move(e,t))},x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},size:function(e,t){var n=h(this,e,t);return this.attr("d",this.array().size(n.width,n.height))},width:function(e){return null==e?this.bbox().width:this.size(e,this.bbox().height)},height:function(e){return null==e?this.bbox().height:this.size(this.bbox().width,e)}},construct:{path:function(e){return this.put(new n.Path).plot(e||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(t){if(!t)return this;var i=this,o=new e.Image;return n.on(o,"load",(function(){n.off(o);var e=i.parent(n.Pattern);null!==e&&(0==i.width()&&0==i.height()&&i.size(o.width,o.height),e&&0==e.width()&&0==e.height()&&e.size(i.width(),i.height()),"function"==typeof i._loaded&&i._loaded.call(i,{width:o.width,height:o.height,ratio:o.width/o.height,url:t}))})),n.on(o,"error",(function(e){n.off(o),"function"==typeof i._error&&i._error.call(i,e)})),this.attr("href",o.src=this.src=t,n.xlink)},loaded:function(e){return this._loaded=e,this},error:function(e){return this._error=e,this}},construct:{image:function(e,t,i){return this.put(new n.Image).load(e).size(t||0,i||t||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(e){return null==e?this.attr("x"):this.attr("x",e)},y:function(e){var t=this.attr("y"),n="number"==typeof t?t-this.bbox().y:0;return null==e?"number"==typeof t?t-n:t:this.attr("y","number"==typeof e.valueOf()?e+n:e)},cx:function(e){return null==e?this.bbox().cx:this.x(e-this.bbox().width/2)},cy:function(e){return null==e?this.bbox().cy:this.y(e-this.bbox().height/2)},text:function(e){if(void 0===e){e="";for(var t=this.node.childNodes,i=0,o=t.length;i<o;++i)0!=i&&3!=t[i].nodeType&&1==n.adopt(t[i]).dom.newLined&&(e+="\n"),e+=t[i].textContent;return e}if(this.clear().build(!0),"function"==typeof e)e.call(this,this);else{i=0;for(var r=(e=e.split("\n")).length;i<r;i++)this.tspan(e[i]).newLine()}return this.build(!1).rebuild()},size:function(e){return this.attr("font-size",e).rebuild()},leading:function(e){return null==e?this.dom.leading:(this.dom.leading=new n.Number(e),this.rebuild())},lines:function(){var e=(this.textPath&&this.textPath()||this).node,t=n.utils.map(n.utils.filterSVGElements(e.childNodes),(function(e){return n.adopt(e)}));return new n.Set(t)},rebuild:function(e){if("boolean"==typeof e&&(this._rebuild=e),this._rebuild){var t=this,i=0,o=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each((function(){this.dom.newLined&&(t.textPath()||this.attr("x",t.attr("x")),"\n"==this.text()?i+=o:(this.attr("dy",o+i),i=0))})),this.fire("rebuild")}return this},build:function(e){return this._build=!!e,this},setData:function(e){return this.dom=e,this.dom.leading=new n.Number(e.leading||1.3),this}},construct:{text:function(e){return this.put(new n.Text).text(e)},plain:function(e){return this.put(new n.Text).plain(e)}}}),n.Tspan=n.invent({create:"tspan",inherit:n.Shape,extend:{text:function(e){return null==e?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof e?e.call(this,this):this.plain(e),this)},dx:function(e){return this.attr("dx",e)},dy:function(e){return this.attr("dy",e)},newLine:function(){var e=this.parent(n.Text);return this.dom.newLined=!0,this.dy(e.dom.leading*e.attr("font-size")).attr("x",e.x())}}}),n.extend(n.Text,n.Tspan,{plain:function(e){return!1===this._build&&this.clear(),this.node.appendChild(t.createTextNode(e)),this},tspan:function(e){var t=(this.textPath&&this.textPath()||this).node,i=new n.Tspan;return!1===this._build&&this.clear(),t.appendChild(i.node),i.text(e)},clear:function(){for(var e=(this.textPath&&this.textPath()||this).node;e.hasChildNodes();)e.removeChild(e.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),n.TextPath=n.invent({create:"textPath",inherit:n.Parent,parent:n.Text,construct:{morphArray:n.PathArray,path:function(e){for(var t=new n.TextPath,i=this.doc().defs().path(e);this.node.hasChildNodes();)t.node.appendChild(this.node.firstChild);return this.node.appendChild(t.node),t.attr("href","#"+i,n.xlink),this},array:function(){var e=this.track();return e?e.array():null},plot:function(e){var t=this.track(),n=null;return t&&(n=t.plot(e)),null==e?n:this},track:function(){var e=this.textPath();if(e)return e.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return n.adopt(this.node.firstChild)}}}),n.Nested=n.invent({create:function(){this.constructor.call(this,n.create("svg")),this.style("overflow","visible")},inherit:n.Container,construct:{nested:function(){return this.put(new n.Nested)}}}),n.A=n.invent({create:"a",inherit:n.Container,extend:{to:function(e){return this.attr("href",e,n.xlink)},show:function(e){return this.attr("show",e,n.xlink)},target:function(e){return this.attr("target",e)}},construct:{link:function(e){return this.put(new n.A).to(e)}}}),n.extend(n.Element,{linkTo:function(e){var t=new n.A;return"function"==typeof e?e.call(t,t):t.to(e),this.parent().put(t).put(this)}}),n.Marker=n.invent({create:"marker",inherit:n.Container,extend:{width:function(e){return this.attr("markerWidth",e)},height:function(e){return this.attr("markerHeight",e)},ref:function(e,t){return this.attr("refX",e).attr("refY",t)},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(e,t,n){return this.defs().marker(e,t,n)}}}),n.extend(n.Defs,{marker:function(e,t,i){return this.put(new n.Marker).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr("orient","auto").update(i)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(e,t,i,o){var r=["marker"];return"all"!=e&&r.push(e),r=r.join("-"),e=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(t,i,o),this.attr(r,e)}});var s={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(e,t){return"color"==t?e:e+"-"+t}};function l(e,t,i,o){return i+o.replace(n.regex.dots," .")}function c(e){return e.toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e){var t=e.toString(16);return 1==t.length?"0"+t:t}function h(e,t,n){if(null==t||null==n){var i=e.bbox();null==t?t=i.width/i.height*n:null==n&&(n=i.height/i.width*t)}return{width:t,height:n}}function p(e,t,n){return{x:t*e.a+n*e.c+0,y:t*e.b+n*e.d+0}}function f(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}function m(e,t){e.cx=null==e.cx?t.bbox().cx:e.cx,e.cy=null==e.cy?t.bbox().cy:e.cy}function g(t){for(var i=t.childNodes.length-1;i>=0;i--)t.childNodes[i]instanceof e.SVGElement&&g(t.childNodes[i]);return n.adopt(t).id(n.eid(t.nodeName))}function v(e){return null==e.x&&(e.x=0,e.y=0,e.width=0,e.height=0),e.w=e.width,e.h=e.height,e.x2=e.x+e.width,e.y2=e.y+e.height,e.cx=e.x+e.width/2,e.cy=e.y+e.height/2,e}function b(e){return Math.abs(e)>1e-37?e:0}["fill","stroke"].forEach((function(e){var t,i={};i[e]=function(i){if(void 0===i)return this;if("string"==typeof i||n.Color.isRgb(i)||i&&"function"==typeof i.fill)this.attr(e,i);else for(t=s[e].length-1;t>=0;t--)null!=i[s[e][t]]&&this.attr(s.prefix(e,s[e][t]),i[s[e][t]]);return this},n.extend(n.Element,n.FX,i)})),n.extend(n.Element,n.FX,{rotate:function(e,t,n){return this.transform({rotation:e,cx:t,cy:n})},skew:function(e,t,n,i){return 1==arguments.length||3==arguments.length?this.transform({skew:e,cx:t,cy:n}):this.transform({skewX:e,skewY:t,cx:n,cy:i})},scale:function(e,t,n,i){return 1==arguments.length||3==arguments.length?this.transform({scale:e,cx:t,cy:n}):this.transform({scaleX:e,scaleY:t,cx:n,cy:i})},translate:function(e,t){return this.transform({x:e,y:t})},flip:function(e,t){return t="number"==typeof e?e:t,this.transform({flip:e||"both",offset:t})},matrix:function(e){return this.attr("transform",new n.Matrix(6==arguments.length?[].slice.call(arguments):e))},opacity:function(e){return this.attr("opacity",e)},dx:function(e){return this.x(new n.Number(e).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(e){return this.y(new n.Number(e).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(e,t){return this.dx(e).dy(t)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(e,t){var i=(this._target||this).type;return"radial"==i||"circle"==i?this.attr("r",new n.Number(e)):this.rx(e).ry(null==t?e:t)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(e){return this.node.getPointAtLength(e)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(e,t){if("object"==typeof e)for(t in e)this.font(t,e[t]);return"leading"==e?this.leading(t):"anchor"==e?this.attr("text-anchor",t):"size"==e||"family"==e||"weight"==e||"stretch"==e||"variant"==e||"style"==e?this.attr("font-"+e,t):this.attr(e,t)}}),n.Set=n.invent({create:function(e){e instanceof n.Set?this.members=e.members.slice():Array.isArray(e)?this.members=e:this.clear()},extend:{add:function(){var e,t,n=[].slice.call(arguments);for(e=0,t=n.length;e<t;e++)this.members.push(n[e]);return this},remove:function(e){var t=this.index(e);return t>-1&&this.members.splice(t,1),this},each:function(e){for(var t=0,n=this.members.length;t<n;t++)e.apply(this.members[t],[t,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(e){return this.index(e)>=0},index:function(e){return this.members.indexOf(e)},get:function(e){return this.members[e]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new n.RBox;var e=this.members[0].rbox(this.members[0].doc());return this.each((function(){e=e.merge(this.rbox(this.doc()))})),e}},construct:{set:function(e){return new n.Set(e)}}}),n.FX.Set=n.invent({create:function(e){this.set=e}}),n.Set.inherit=function(){var e=[];for(var t in n.Shape.prototype)"function"==typeof n.Shape.prototype[t]&&"function"!=typeof n.Set.prototype[t]&&e.push(t);for(var t in e.forEach((function(e){n.Set.prototype[e]=function(){for(var t=0,i=this.members.length;t<i;t++)this.members[t]&&"function"==typeof this.members[t][e]&&this.members[t][e].apply(this.members[t],arguments);return"animate"==e?this.fx||(this.fx=new n.FX.Set(this)):this}})),e=[],n.FX.prototype)"function"==typeof n.FX.prototype[t]&&"function"!=typeof n.FX.Set.prototype[t]&&e.push(t);e.forEach((function(e){n.FX.Set.prototype[e]=function(){for(var t=0,n=this.set.members.length;t<n;t++)this.set.members[t].fx[e].apply(this.set.members[t].fx,arguments);return this}}))},n.extend(n.Element,{data:function(e,t,n){if("object"==typeof e)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),n.extend(n.Element,{remember:function(e,t){if("object"==typeof arguments[0])for(var t in e)this.remember(t,e[t]);else{if(1==arguments.length)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(e){var i=t.getElementById(function(e){var t=(e||"").toString().match(n.regex.reference);if(t)return t[1]}(e)||e);return n.adopt(i)},n.select=function(e,i){return new n.Set(n.utils.map((i||t).querySelectorAll(e),(function(e){return n.adopt(e)})))},n.extend(n.Parent,{select:function(e){return n.select(e,this.node)}});var y="abcdef".split("");if("function"!=typeof e.CustomEvent){var w=function(e,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var i=t.createEvent("CustomEvent");return i.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),i};w.prototype=e.Event.prototype,n.CustomEvent=w}else n.CustomEvent=e.CustomEvent;for(var x=e,_=0,k=["moz","webkit"],E=0;E<k.length&&!e.requestAnimationFrame;++E)x.requestAnimationFrame=x[k[E]+"RequestAnimationFrame"],x.cancelAnimationFrame=x[k[E]+"CancelAnimationFrame"]||x[k[E]+"CancelRequestAnimationFrame"];return x.requestAnimationFrame=x.requestAnimationFrame||function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-_)),i=x.setTimeout((function(){e(t+n)}),n);return _=t+n,i},x.cancelAnimationFrame=x.cancelAnimationFrame||x.clearTimeout,n}(i,i.document)}.call(t,n,t,e))&&(e.exports=n)},function(e,t){function n(e,t){return t.querySelector(e)}(t=e.exports=function(e,t){return n(e,t=t||document)}).all=function(e,t){return(t=t||document).querySelectorAll(e)},t.engine=function(e){if(!e.one)throw new Error(".one callback required");if(e.all)return n=e.one,t.all=e.all,t;throw new Error(".all callback required")}},function(e,t){e.exports.getMid=function(e){return{x:(e=e.bbox()).x+e.width/2,y:e.y+e.height/2}},e.exports.distance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},function(e,t,n){e.exports=n(476)},function(e,t,n){"use strict";var i=n(10).isAncestor,o=n(8),r=o.TOGGLE_MODE_EVENT,a=o.RESET_SIMULATION_EVENT,s=o.TERMINATE_EVENT,l=o.UPDATE_ELEMENTS_EVENT,c=o.UPDATE_ELEMENT_EVENT,u=o.PROCESS_INSTANCE_SHOWN_EVENT,d=n(477),h=n(480),p=n(481),f=n(482),m=n(483);function g(e,t,n,i,o,g){var v=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=o,this._processInstances=g,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",h),this.registerHandler("bpmn:IntermediateCatchEvent",p),this.registerHandler("bpmn:SubProcess",f),this.registerHandler("bpmn:SubProcess",d),this.registerHandler("bpmn:StartEvent",m),e.on(r,500,(function(e){e.simulationModeActive?v.openContextPads():v.closeContextPads()})),e.on(a,500,(function(){v.closeContextPads(),v.openContextPads()})),e.on(s,500,(function(e){e=e.element.parent,v.closeContextPads(e)})),e.on(l,500,(function(e){e.elements.forEach((function(e){v.closeElementContextPads(e),v.openElementContextPads(e)}))})),e.on(c,500,(function(e){e=e.element,v.closeElementContextPads(e),v.openElementContextPads(e)})),e.on(u,(function(e){e=e.processInstanceId,e=g.getProcessInstance(e).parent,v.closeContextPads(e),v.openContextPads(e)}))}g.prototype.registerHandler=function(e,t){t=this._injector.instantiate(t),this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(t)},g.prototype.openContextPads=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){t.handlers[n.type]&&i(e,n)&&t.openElementContextPads(n)}))},g.prototype.openElementContextPads=function(e){var t,n;this.handlers[e.type]&&(t=[],this.handlers[e.type].forEach((function(n){(n=n.createContextPads(e))&&n.forEach((function(e){e&&t.push(e)}))})),n=this,t.forEach((function(e){var t=n._overlays.add(e.element,"context-menu",{position:{top:-15,left:-15},html:e.html,show:{minZoom:.5}});n.overlayIds[e.element.id]=t})))},g.prototype.closeContextPads=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){i(e,n)&&t.closeElementContextPads(n)}))},g.prototype.closeElementContextPads=function(e){var t=this,n=(e.attachers&&0<e.attachers.length&&e.attachers.forEach((function(e){t.closeElementContextPads(e)})),e.children&&0<e.children.length&&e.children.forEach((function(e){t.closeElementContextPads(e)})),this.overlayIds[e.id]);n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},g.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"],e.exports=g},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=(n=n(8)).GENERATE_TOKEN_EVENT,s=n.UPDATE_ELEMENT_EVENT;function l(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}l.prototype.createContextPads=function(e){var t,n,l;if(e.attachers.length&&this._processInstances.getProcessInstances(e).length)return t=e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})),n=this,l=[],e.attachers.forEach((function(c){var u=c.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")}));t.length&&u.length&&(u=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),l.push({element:c,html:u}),o.bind(u,"click",(function(){n._processInstances.getProcessInstances(e).forEach((function(t){var i=t.parentProcessInstanceId;c.businessObject.cancelActivity&&(e.children.forEach((function(e){e.tokenCount&&e.tokenCount[t.processInstanceId]&&e.tokenCount[t.processInstanceId]--})),n._processInstances.finish(t.processInstanceId),n._eventBus.fire(s,{element:e})),n._eventBus.fire(a,{element:c,processInstanceId:i})}))})))})),l},l.$inject=["eventBus","processInstances","processInstanceSettings"],e.exports=l},function(e,t){e=!(e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");if(t=t||document,!(a=/<([\w:]+)/.exec(e)))return t.createTextNode(e);if(e=e.replace(/^\s+|\s+$/g,""),"body"==(a=a[1]))return(n=t.createElement("html")).innerHTML=e,n.removeChild(n.lastChild);var n,o=(a=Object.prototype.hasOwnProperty.call(i,a)?i[a]:i._default)[0],r=a[1],a=a[2];for((n=t.createElement("div")).innerHTML=r+e+a;o--;)n=n.lastChild;if(n.firstChild==n.lastChild)return n.removeChild(n.firstChild);for(var s=t.createDocumentFragment();n.firstChild;)s.appendChild(n.removeChild(n.firstChild));return s});var n,i=("undefined"!=typeof document&&((n=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',e=!n.getElementsByTagName("link").length,n=void 0),{legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:e?[1,"X<div>","</div>"]:[0,"",""]});i.td=i.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],i.option=i.optgroup=[1,'<select multiple="multiple">',"</select>"],i.thead=i.tbody=i.colgroup=i.caption=i.tfoot=[1,"<table>","</table>"],i.polyline=i.ellipse=i.polygon=i.circle=i.text=i.line=i.path=i.rect=i.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},function(e,t){var n=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!=n?"on":"";t.bind=function(e,t,i,r){return e[n](o+t,i,r||!1),i},t.unbind=function(e,t,n,r){return e[i](o+t,n,r||!1),n}},function(e,t,n){"use strict";var i=n(10).is,o=n(13),r=n(18);function a(e){this._exclusiveGatewaySettings=e}a.prototype.createContextPads=function(e){var t=this,n=e.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")}));if(!(n.length<2))return n=o('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>'),r.bind(n,"click",(function(){t._exclusiveGatewaySettings.setSequenceFlow(e)})),[{element:e,html:n}]},a.$inject=["exclusiveGatewaySettings"],e.exports=a},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=n(8).GENERATE_TOKEN_EVENT;function s(e){this._eventBus=e}s.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})),s=[],l=(n.forEach((function(e){e=e.source,r(e,"bpmn:EventBasedGateway")&&e.tokenCount&&e.tokenCount[t]&&s.push(e)})),e.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")})));if(n.length&&l.length){var c,u=this;if(e.tokenCount&&e.tokenCount[t])c=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),o.bind(c,"click",(function(){e.tokenCount[t]--,u._eventBus.fire(a,{element:e,processInstanceId:t})}));else{if(!s.length)return;c=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),o.bind(c,"click",(function(){s.forEach((function(e){e.tokenCount[t]--})),u._eventBus.fire(a,{element:e,processInstanceId:t})}))}return[{element:e,html:c}]}},s.$inject=["eventBus"],e.exports=s},function(e,t,n){"use strict";var i=n(13),o=n(18);function r(e,t){this._processInstances=e,this._processInstanceSettings=t}r.prototype.createContextPads=function(e){var t=this,n=this._processInstances.getProcessInstances(e).filter((function(e){return!e.isFinished}));if(!(n.length<2))return n=i('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>'),o.bind(n,"click",(function(){t._processInstanceSettings.showNext(e)})),[{element:e,html:n}]},r.$inject=["processInstances","processInstanceSettings"],e.exports=r},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=n(8).GENERATE_TOKEN_EVENT;function s(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}s.prototype.createContextPads=function(e){var t,n,s=!1;if(this._elementRegistry.forEach((function(e){e.tokenCount&&Object.values(e.tokenCount).forEach((function(e){e&&(s=!0)}))})),!(r(e.parent,"bpmn:SubProcess")||s||this._animation.animations.length))return t=this,n=i('<div class="context-pad"><i class="fa fa-play"></i></div>'),o.bind(n,"click",(function(){t._eventBus.fire(a,{element:e})})),[{element:e,html:n}]},s.$inject=["eventBus","elementRegistry","animation"],e.exports=s},function(e,t,n){e.exports=n(485)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t,n,o,r,a,s,l){var c=this;function u(e,t,n){var i=e[t];e[t]=function(){return n.call(this,i,arguments)}}function d(e,t){u(e,t,(function(e,t){if(!c.modelingDisabled)return e.apply(this,t)}))}function h(e,t){u(e,t,(function(e,t){if(c.modelingDisabled)throw new Error("model is read-only");return e.apply(this,t)}))}this._eventBus=e,this.modelingDisabled=!1,e.on(i,10001,(function(e){e=e.simulationModeActive,c.modelingDisabled=e,c.modelingDisabled&&(o.cancel(),t.close(),n.cancel()),s._update()})),d(t,"open"),d(n,"init"),d(o,"activate"),d(n,"init"),d(o,"activate"),h(a,"moveShape"),h(a,"updateAttachment"),h(a,"moveElements"),h(a,"moveConnection"),h(a,"layoutConnection"),h(a,"createConnection"),h(a,"createShape"),h(a,"createLabel"),h(a,"appendShape"),h(a,"removeElements"),h(a,"distributeElements"),h(a,"removeShape"),h(a,"removeConnection"),h(a,"replaceShape"),h(a,"pasteElements"),h(a,"alignElements"),h(a,"resizeShape"),h(a,"createSpace"),h(a,"updateWaypoints"),h(a,"reconnectStart"),h(a,"reconnectEnd"),u(r,"trigger",(function(e,t){var n=t[0];if(!(c.modelingDisabled&&-1<["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"].indexOf(n)))return e.apply(this,t)}))}o.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"],e.exports=o},function(e,t,n){e.exports=n(487)},function(e,t,n){"use strict";var i=n(13),o=(n=n(8)).TOGGLE_MODE_EVENT,r=n.RESET_SIMULATION_EVENT,a=n.GENERATE_TOKEN_EVENT;function s(e,t){var n=this;this._overlays=e,t.on(o,(function(e){e.simulationModeActive||n.removeElementNotifications()})),t.on([r,a],(function(){n.removeElementNotifications()}))}s.prototype.addElementNotifications=function(e,t){var n=this;e.forEach((function(e){n.addElementNotification(e,t)}))},s.prototype.addElementNotification=function(e,t){t='<div class="element-notification '+(t.type||"")+'">'+(t.icon?'<i class="fa '+t.icon+'"></i>':"")+('<span class="text">'+t.text+"</span>"||!1)+"</div>",t=i(t);this._overlays.add(e,"element-notification",{position:{top:-15,right:15},html:t,show:{minZoom:.5}})},s.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach((function(e){t.removeElementNotification(e)})):this._overlays.remove({type:"element-notification"})},s.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},s.$inject=["overlays","eventBus"],e.exports=s},function(e,t,n){e.exports=n(489)},function(e,t,n){"use strict";var i,o=n(27),r=(i=n(10)).is,a=i.supportedElements,s=(i=n(8)).TOGGLE_MODE_EVENT,l=i.GENERATE_TOKEN_EVENT,c=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function u(e){return e.labelTarget}function d(e,t,n,i,a){var c=this;this._eventBus=e,this._elementRegistry=t,this._elementNotifications=a,this._notifications=i,this.canvasParent=n.getContainer().parentNode,e.on(l,2e4,(function(e){return e=e.element,!r(e,"bpmn:StartEvent")||c.allElementsSupported()?void 0:(c.showWarnings(),o(c.canvasParent).add("warning"),!0)})),e.on(s,(function(e){e.simulationModeActive||o(c.canvasParent).remove("warning")}))}d.prototype.allElementsSupported=function(){var e=!0;return this._elementRegistry.forEach((function(t){r(t,c)||r(t,a)||u(t)||(e=!1)})),e},d.prototype.showWarnings=function(e){var t=this,n=[];this._elementRegistry.forEach((function(e){r(e,c)||r(e,a)||u(e)||(t.showWarning(e),n.indexOf(e.type)&&(t._notifications.showNotification(e.type+" not supported","warning"),n.push(e.type)))}))},d.prototype.showWarning=function(e){this._elementNotifications.addElementNotification(e,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},d.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"],e.exports=d},function(e,t,n){try{var i=n(146)}catch(e){i=n(146)}var o=/\s+/,r=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}e.exports=function(e){return new a(e)},a.prototype.add=function(e){var t;return this.list?this.list.add(e):(t=this.array(),~i(t,e)||t.push(e),this.el.className=t.join(" ")),this},a.prototype.remove=function(e){var t;return"[object RegExp]"==r.call(e)?this.removeMatching(e):(this.list?this.list.remove(e):(t=this.array(),~(e=i(t,e))&&t.splice(e,1),this.el.className=t.join(" ")),this)},a.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},a.prototype.toggle=function(e,t){return this.list?void 0!==t&&t===this.list.toggle(e,t)||this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},a.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(o);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~i(this.array(),e)}},function(e,t,n){e.exports=n(492)},function(e,t,n){"use strict";var i=n(10).is,o=n(8).TOGGLE_MODE_EVENT,r=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),a=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function s(e){return i(e,"bpmn:SequenceFlow")}function l(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,e.on(o,(function(e){e.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()}))}l.prototype.setSequenceFlowsDefault=function(){var e=this;this._elementRegistry.filter((function(e){return i(e,"bpmn:ExclusiveGateway")})).forEach((function(t){t.outgoing.filter(s).length&&e.setSequenceFlow(t,t.outgoing.filter(s)[0])}))},l.prototype.resetSequenceFlows=function(){var e=this;this._elementRegistry.filter((function(e){return i(e,"bpmn:ExclusiveGateway")})).forEach((function(t){t.outgoing.filter(s).length&&e.resetSequenceFlow(t)}))},l.prototype.resetSequenceFlow=function(e){e.sequenceFlow&&delete e.sequenceFlow},l.prototype.setSequenceFlow=function(e){var t,n,i=this,o=e.outgoing.filter(s);o.length&&(t=e.sequenceFlow,e.sequenceFlow=t?(t=(n=(t=e).outgoing.filter(s)).indexOf(t.sequenceFlow),n[t+1]||n[0]):o[0],e.outgoing.forEach((function(t){t===e.sequenceFlow?i.setColor(t,a):i.setColor(t,r)})))},l.prototype.setColor=function(e,t){e.businessObject.di.set("stroke",t),t=this._elementRegistry.getGraphics(e),this._graphicsFactory.update("connection",e,t)},l.$inject=["eventBus","elementRegistry","graphicsFactory"],e.exports=l},function(e,t,n){e.exports=n(494)},function(e,t,n){"use strict";var i,o=n(13),r=n(27),a=n(18),s=n(48),l=(i=n(10)).getBusinessObject,c=i.is,u=i.isTypedEvent,d=(i=n(8)).GENERATE_TOKEN_EVENT,h=i.CONSUME_TOKEN_EVENT,p=i.TOGGLE_MODE_EVENT,f=i.RESET_SIMULATION_EVENT,m=i.PROCESS_INSTANCE_CREATED_EVENT;function g(e){return e&&e.businessObject.name}function v(e,t,n,i){var o=this;this._notifications=t,this._tokenSimulationPalette=n,this._canvas=i,this._init(),e.on(d,(function(e){var t=g(e=e.element);c(e,"bpmn:BusinessRuleTask")?o.log(t||"Business Rule Task","info","bpmn-icon-business-rule"):c(e,"bpmn:CallActivity")?o.log(t||"Call Activity","info","bpmn-icon-call-activity"):c(e,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"])?o.log(t||"Intermediate Event","info","bpmn-icon-intermediate-event-none"):c(e,"bpmn:ManualTask")?o.log(t||"Manual Task","info","bpmn-icon-manual"):c(e,"bpmn:ScriptTask")?o.log(t||"Script Task","info","bpmn-icon-script"):c(e,"bpmn:ServiceTask")?o.log(t||"Service Task","info","bpmn-icon-service"):c(e,"bpmn:StartEvent")?o.log(t||"Start Event","info","bpmn-icon-start-event-none"):c(e,"bpmn:Task")?o.log(t||"Task","info","bpmn-icon-task"):c(e,"bpmn:UserTask")?o.log(t||"User Task","info","bpmn-icon-user"):!c(e,"bpmn:ExclusiveGateway")||e.outgoing.length<2||(t=t||"Gateway",(e=g(e.sequenceFlow))&&(t=t.concat(' <i class="fa fa-angle-right" aria-hidden="true"></i> '+e)),o.log(t,"info","bpmn-icon-gateway-xor"))})),e.on(h,(function(e){var t=g(e=e.element);c(e,"bpmn:EndEvent")&&(u(l(e),"bpmn:TerminateEventDefinition")?o.log(t||"Terminate End Event","info","bpmn-icon-end-event-terminate"):o.log(t||"End Event","info","bpmn-icon-end-event-none"))})),e.on(m,(function(e){var t=e.processInstanceId;e=e.parent;c(e,"bpmn:Process")?o.log("Process "+t+" started","success","fa-check"):o.log("Subprocess "+t+" started","info","fa-check")})),e.on(p,(function(e){e.simulationModeActive||(o.emptyLog(),r(o.container).add("hidden"))})),e.on(f,(function(e){o.emptyLog(),r(o.container).add("hidden")}))}v.prototype._init=function(){var e=this;this.container=o('<div class="token-simulation-log hidden"><div class="header"><i class="fa fa-align-left"></i><button class="close"><i class="fa fa-times" aria-hidden="true"></i></button></div><div class="content"><p class="entry placeholder">No Entries</p></div></div>'),this.placeholder=s(".placeholder",this.container),this.content=s(".content",this.container),a.bind(this.content,"wheel",(function(e){e.stopPropagation()})),a.bind(this.content,"mousedown",(function(e){e.stopPropagation()})),this.close=s(".close",this.container),a.bind(this.close,"click",(function(){r(e.container).add("hidden")})),this.icon=s(".fa-align-left",this.container),a.bind(this.icon,"click",(function(){r(e.container).add("hidden")})),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=o('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),a.bind(this.paletteEntry,"click",(function(){r(e.container).remove("hidden")})),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},v.prototype.toggle=function(){var e=this.container;r(e).has("hidden")?r(e).remove("hidden"):r(e).add("hidden")},v.prototype.log=function(e,t,n){r(this.placeholder).add("hidden");var i=(i=new Date).toLocaleTimeString()+":"+i.getUTCMilliseconds();this._notifications.showNotification(e,t,n),n=(n=n||"fa-info").includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>',t=o('<p class="entry '+t+'"><span class="date">'+i+"</span>"+n+"</span>"+e+"</p>");this.content.appendChild(t),this.content.scrollTop=this.content.scrollHeight},v.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=o('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},v.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"],e.exports=v},function(e,t,n){e.exports=n(496)},function(e,t,n){"use strict";var i=n(13),o=n(8).TOGGLE_MODE_EVENT;function r(e,t){var n=this;this._eventBus=e,this._canvas=t,this._init(),e.on(o,(function(e){e.simulationModeActive||n.removeAll()}))}r.prototype._init=function(){this.container=i('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},r.prototype.showNotification=function(e,t,n){n=(n=n||"fa-info").includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var o=i('<div class="notification '+t+'"><span class="icon">'+n+"</span>"+e+"</div>");for(this.container.appendChild(o);5<this.container.children.length;)this.container.children[0].remove();setTimeout((function(){o.remove()}),2e3)},r.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},r.$inject=["eventBus","canvas"],e.exports=r},function(e,t,n){e.exports=n(498)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=(n=n(8)).TOGGLE_MODE_EVENT,s=n.PLAY_SIMULATION_EVENT,l=n.PAUSE_SIMULATION_EVENT,c=n.RESET_SIMULATION_EVENT,u=n.ANIMATION_CREATED_EVENT,d=n.PROCESS_INSTANCE_CREATED_EVENT,h='<i class="fa fa-play"></i>';function p(e,t,n,i){var o=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),e.on(d,(function(e){e.parent.parent||(o.activate(),o.unpause(),n.showNotification("Start Simulation","info"))})),e.on([c,a],(function(){o.deactivate(),o.unpause()})),e.on(u,(function(e){e=e.animation,o.isPaused&&e.pause()}))}p.prototype._init=function(){this.paletteEntry=i('<div class="entry disabled" title="Play/Pause Simulation">'+h+"</div>"),r.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},p.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},p.prototype.pause=function(){this.isActive&&(o(this.paletteEntry).remove("active"),o(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=h,this._eventBus.fire(l),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},p.prototype.unpause=function(){this.isActive&&(o(this.paletteEntry).add("active"),o(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(s),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},p.prototype.activate=function(){this.isActive=!0,o(this.paletteEntry).remove("disabled")},p.prototype.deactivate=function(){this.isActive=!1,o(this.paletteEntry).remove("active"),o(this.paletteEntry).add("disabled")},p.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"],e.exports=p},function(e,t,n){e.exports=n(500)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t,n){var o=this;this._elementRegistry=t,this._graphicsFactory=n,this.elementColors={},e.on(i,5e4,(function(e){e.simulationModeActive?o.preserveColors():o.resetColors()}))}o.prototype.preserveColors=function(){var e=this;this._elementRegistry.forEach((function(t){e.elementColors[t.id]={stroke:t.businessObject.di.get("stroke"),fill:t.businessObject.di.get("fill")},e.setColor(t,"#000","#fff")}))},o.prototype.resetColors=function(){var e=this;this._elementRegistry.forEach((function(t){e.elementColors[t.id]&&e.setColor(t,e.elementColors[t.id].stroke,e.elementColors[t.id].fill)})),this.elementColors={}},o.prototype.setColor=function(e,t,n){(i=e.businessObject).di.set("stroke",t),i.di.set("fill",n),t=this._elementRegistry.getGraphics(e);var i=e.waypoints?"connection":"shape";this._graphicsFactory.update(i,e,t)},o.$inject=["eventBus","elementRegistry","graphicsFactory"],e.exports=o},function(e,t,n){e.exports=n(502)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.RESET_SIMULATION_EVENT;function r(e){this.nextProcessInstanceId=1,e.on(i,this.reset.bind(this)),e.on(o,this.reset.bind(this))}r.prototype.getNext=function(){var e=this.nextProcessInstanceId;return this.nextProcessInstanceId++,e},r.prototype.reset=function(){this.nextProcessInstanceId=1},r.$inject=["eventBus"],e.exports=r},function(e,t,n){e.exports=n(504)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.PROCESS_INSTANCE_CREATED_EVENT,r=n.PROCESS_INSTANCE_FINISHED_EVENT,a=n.PROCESS_INSTANCE_SHOWN_EVENT,s=n.PROCESS_INSTANCE_HIDDEN_EVENT;function l(e,t,n,a){var s=this;this._animation=e,this._eventBus=t,this._processInstances=n,this._elementRegistry=a,this._eventBus.on(o,500,(function(e){var t=e.parent,i=(e=e.processInstanceId,n.getProcessInstances(t).filter((function(e){return!e.isFinished})));1===i.length?s.showProcessInstance(e,t):1<i.length&&s.hideProcessInstance(e)})),this._eventBus.on(r,500,(function(e){var t=e.parent,i=e.processInstanceId;(e=n.getProcessInstances(t).filter((function(e){return i!==e.processInstanceId&&!e.isFinished}))).length&&i===t.shownProcessInstance?s.showProcessInstance(e[0].processInstanceId,t):delete t.shownProcessInstance,t.parent||a.forEach((function(e){delete e.shownProcessInstance}))})),t.on(i,(function(){a.forEach((function(e){delete e.shownProcessInstance}))}))}l.prototype.showProcessInstance=function(e,t){this._animation.showProcessInstanceAnimations(e),t.shownProcessInstance=e,this._eventBus.fire(a,{processInstanceId:e})},l.prototype.hideProcessInstance=function(e){this._animation.hideProcessInstanceAnimations(e),this._eventBus.fire(s,{processInstanceId:e})},l.prototype.showNext=function(e){var t=this,n=this._processInstances.getProcessInstances(e),i=e.shownProcessInstance,o=0;for(let e=0;e<n.length&&n[e].processInstanceId!==i;e++)o++;n.forEach((function(e){t.hideProcessInstance(e.processInstanceId)})),o===n.length-1?this.showProcessInstance(n[0].processInstanceId,e):this.showProcessInstance(n[o+1].processInstanceId,e)},l.$inject=["animation","eventBus","processInstances","elementRegistry"],e.exports=l},function(e,t,n){e.exports=n(506)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.RESET_SIMULATION_EVENT,r=n.PROCESS_INSTANCE_CREATED_EVENT,a=n.PROCESS_INSTANCE_FINISHED_EVENT;function s(e,t){var n=this;this._eventBus=e,this._processInstanceIds=t,this.processInstances=[],e.on([i,o],(function(){n.processInstances=[]}))}s.prototype.create=function(e,t){var n=this._processInstanceIds.getNext();e={parent:e,processInstanceId:n,parentProcessInstanceId:t};return this.processInstances.push(e),this._eventBus.fire(r,e),n},s.prototype.remove=function(e){this.processInstances=this.processInstances.filter((function(t){return t.processInstanceId!==e}))},s.prototype.finish=function(e){var t=this.processInstances.find((function(t){return t.processInstanceId===e}));this._eventBus.fire(a,t),t.isFinished=!0},s.prototype.getProcessInstances=function(e,t){var n;return e?(n=this.processInstances.filter((function(t){return t.parent===e})),t&&!0!==t.includeFinished?n.filter((function(e){return!e.isFinished})):n):this.processInstances},s.prototype.getProcessInstance=function(e){return this.processInstances.find((function(t){return t.processInstanceId===e}))},s.$inject=["eventBus","processInstanceIds"],e.exports=s},function(e,t,n){e.exports=n(508)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(10).is,s=(n=n(8)).TOGGLE_MODE_EVENT,l=n.GENERATE_TOKEN_EVENT,c=n.RESET_SIMULATION_EVENT;function u(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this._elementRegistry=i,this._init(),e.on(l,(function(e){a(e.element,"bpmn:StartEvent")&&o(r.paletteEntry).remove("disabled")})),e.on(s,(function(e){e.simulationModeActive||r.resetSimulation()}))}u.prototype._init=function(){var e=this;this.paletteEntry=i('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),r.bind(this.paletteEntry,"click",(function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")})),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},u.prototype.resetSimulation=function(){o(this.paletteEntry).add("disabled"),this._elementRegistry.forEach((function(e){void 0!==e.tokenCount&&delete e.tokenCount})),this._eventBus.fire(c)},u.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"],e.exports=u},function(e,t,n){e.exports=n(510)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(8).TOGGLE_MODE_EVENT;function l(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(s,(function(e){e.simulationModeActive?o(i.container).remove("hidden"):o(i.container).add("hidden")}))}l.prototype._init=function(){var e=this,t=(this.container=i('<div class="set-animation-speed hidden"><i title="Set Animation Speed" class="fa fa-tachometer" aria-hidden="true"></i><div class="animation-speed-buttons"><div title="Slow" id="animation-speed-1" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Normal" id="animation-speed-2" class="animation-speed-button active"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Fast" id="animation-speed-3" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div></div></div>'),a("#animation-speed-1",this.container)),n=a("#animation-speed-2",this.container),o=a("#animation-speed-3",this.container);r.bind(t,"click",(function(){e.setActive(t),e._animation.setAnimationSpeed(.5)})),r.bind(n,"click",(function(){e.setActive(n),e._animation.setAnimationSpeed(1)})),r.bind(o,"click",(function(){e.setActive(o),e._animation.setAnimationSpeed(1.5)})),this._canvas.getContainer().appendChild(this.container)},l.prototype.setActive=function(e){a.all(".animation-speed-button",this.container).forEach((function(e){o(e).remove("active")})),o(e).add("active")},l.$inject=["canvas","animation","eventBus"],e.exports=l},function(e,t,n){e.exports=n(512)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(513),l=(n=n(8)).TOGGLE_MODE_EVENT,c=n.PROCESS_INSTANCE_CREATED_EVENT,u=n.PROCESS_INSTANCE_FINISHED_EVENT,d=n.PROCESS_INSTANCE_SHOWN_EVENT,h=n.PROCESS_INSTANCE_HIDDEN_EVENT,p=n.RESET_SIMULATION_EVENT,f=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),m=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function g(e){return null===e}function v(e,t,n,i,r,a){var f=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=a,this.highlightedElement=null,this._init(),e.on(l,(function(e){e.simulationModeActive?o(f.container).remove("hidden"):(o(f.container).add("hidden"),s(f.container),g(f.highlightedElement)||(f.removeHighlightFromProcess(f.highlightedElement.element),f.highlightedElement=null))})),e.on(c,(function(e){f.addInstance(e)})),e.on(u,(function(e){f.removeInstance(e)})),e.on(d,(function(e){f.setInstanceShown(e.processInstanceId)})),e.on(h,(function(e){f.setInstanceHidden(e.processInstanceId)})),e.on(p,(function(){f.removeAllInstances()}))}v.prototype._init=function(){this.container=i('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},v.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,o=e.parent;e=i('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");r.bind(e,"click",(function(){t._processInstances.getProcessInstances(o).forEach((function(e){t._processInstanceSettings.hideProcessInstance(e.processInstanceId)})),t._processInstanceSettings.showProcessInstance(n,o)})),r.bind(e,"mouseenter",(function(){t.highlightedElement={element:o,stroke:o.businessObject.di.get("stroke"),fill:o.businessObject.di.get("fill")},t.addHighlightToProcess(o)})),r.bind(e,"mouseleave",(function(){t.removeHighlightFromProcess(o),t.highlightedElement=null})),this.container.appendChild(e)},v.prototype.removeInstance=function(e){e=e.processInstanceId,(e=a("#instance-"+e,this.container))&&e.remove()},v.prototype.removeAllInstances=function(){this.container.innerHTML=""},v.prototype.setInstanceShown=function(e){(e=a("#instance-"+e,this.container))&&o(e).add("active")},v.prototype.setInstanceHidden=function(e){(e=a("#instance-"+e,this.container))&&o(e).remove("active")},v.prototype.addHighlightToProcess=function(e){this.setColor(e,m,f),e.parent||o(this._canvas.getContainer()).add("highlight")},v.prototype.removeHighlightFromProcess=function(e){g(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent)||o(this._canvas.getContainer()).remove("highlight")},v.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n),t=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,t)},v.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"],e.exports=v},function(e,t){e.exports=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}},function(e,t,n){e.exports=n(515)},function(e,t,n){"use strict";var i=n(10),o=i.getBusinessObject,r=i.is,a=i.isAncestor,s=i.isTypedEvent,l=n(8).CONSUME_TOKEN_EVENT;function c(e,t,n,i,o,r,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=o,this._canvas=r,this._processInstances=a,e.on(l,250,(function(){}))}c.prototype.isDeadlock=function(){var e=this,t=[],n=(this._elementRegistry.forEach((function(e){e.tokenCount&&t.push(e)})),[]),i=[];t.forEach((function(e){e.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")})).length||n.push(e),r(e,"bpmn:ParallelGateway")&&e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})).length>e.tokenCount&&n.push(e);var t=[];!function e(n){n.outgoing.forEach((function(r){-1===t.indexOf(r.target)&&(t.push(r.target),s(o(r.target),"bpmn:TerminateEventDefinition")&&i.push(n),e(r.target))}))}(e)})),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach((function(t){e._elementNotifications.addElementNotification(t,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})})))},c.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1,o=((n=n||this._canvas.getRootElement()).children.forEach((function(e){e.tokenCount&&e.tokenCount[t]&&e.tokenCount[t].length&&(i=!0)})),!1);if(this._animation.animations.forEach((function(e){a(n,e.element)&&e.processInstanceId===t&&(o=!0)})),!i&&!o)return r(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},c.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"],e.exports=c},function(e,t,n){e.exports=n(517)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(8).TOGGLE_MODE_EVENT;function l(e,t,n,i){var o=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",(function(){o.canvasParent=o._canvas.getContainer().parentNode,o.palette=a(".djs-palette",o._canvas.getContainer()),o._init()}))}l.prototype._init=function(){this.container=i('\n <div class="toggle-mode">\n Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>\n </div>\n '),r.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},l.prototype.toggleMode=function(){var e;this.simulationModeActive?(this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',o(this.canvasParent).remove("simulation"),o(this.palette).remove("hidden"),this._eventBus.fire(s,{simulationModeActive:!1}),1===(e=this._selection.get()).length&&this._contextPad.open(e[0])):(this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',o(this.canvasParent).add("simulation"),o(this.palette).add("hidden"),this._eventBus.fire(s,{simulationModeActive:!0})),this.simulationModeActive=!this.simulationModeActive},l.$inject=["eventBus","canvas","selection","contextPad"],e.exports=l},function(e,t,n){e.exports=n(519)},function(e,t,n){"use strict";var i=n(13),o=n(10).isAncestor,r=(n=n(8)).TOGGLE_MODE_EVENT,a=n.GENERATE_TOKEN_EVENT,s=n.CONSUME_TOKEN_EVENT,l=n.RESET_SIMULATION_EVENT,c=n.TERMINATE_EVENT,u=n.PROCESS_INSTANCE_SHOWN_EVENT;function d(e,t,n,i,o){var d=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=o,this.overlayIds={},e.on(r,(function(e){e.simulationModeActive||d.removeTokenCounts()})),e.on(l,(function(){d.removeTokenCounts()})),e.on(c,(function(e){e=e.element.parent,d.removeTokenCounts(e)})),e.on([a,s],500,(function(e){e=e.element.parent,d.removeTokenCounts(e),d.addTokenCounts(e)})),e.on(u,(function(e){e=e.processInstanceId,e=o.getProcessInstance(e).parent,d.removeTokenCounts(e),d.addTokenCounts(e)}))}d.prototype.addTokenCounts=function(e){var t=this,n=(e=e||this._canvas.getRootElement()).shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach((function(i){o(e,i)&&t.addTokenCount(i,n)}))},d.prototype.addTokenCount=function(e,t){(t=e.tokenCount&&e.tokenCount[t])&&(t=this.createTokenCount(t),t=this._overlays.add(e,"token-count",{position:{bottom:10,left:-15},html:t,show:{minZoom:.5}}),this.overlayIds[e.id]=t)},d.prototype.createTokenCount=function(e){return i('<div class="token-count waiting">'+e+"</div>")},d.prototype.removeTokenCounts=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){o(e,n)&&t.removeTokenCount(n)}))},d.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},d.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"],e.exports=d},function(e,t,n){e.exports=n(521)},function(e,t,n){"use strict";var i=n(522),o=n(523),r=n(524),a=n(525),s=n(526),l=n(527),c=n(528),u=n(529),d=n(530),h=n(531),p=(n=n(8)).GENERATE_TOKEN_EVENT,f=n.CONSUME_TOKEN_EVENT;function m(e,t,n){var m=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",i),this.registerHandler("bpmn:EventBasedGateway",o),this.registerHandler("bpmn:ExclusiveGateway",r),this.registerHandler("bpmn:IntermediateCatchEvent",a),this.registerHandler("bpmn:IntermediateThrowEvent",s),this.registerHandler("bpmn:ParallelGateway",l),this.registerHandler("bpmn:StartEvent",c),this.registerHandler("bpmn:SubProcess",u),this.registerHandler("bpmn:BoundaryEvent",d),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],h),e.on(p,(function(e){var t=e.element;if(!m.handlers[t.type])throw new Error("no handler for type "+t.type);m.handlers[t.type].generate(e)})),e.on(f,(function(e){var t=e.element;if(!m.handlers[t.type])throw new Error("no handler for type "+t.type);m.handlers[t.type].consume(e)}))}m.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);(e=Array.isArray(e)?e:[e]).forEach((function(e){n.handlers[e]=i}))},m.$inject=["eventBus","animation","injector"],e.exports=m},function(e,t,n){"use strict";var i,o=(i=n(10)).getBusinessObject,r=i.is,a=i.isAncestor,s=i.getDescendants,l=i.isTypedEvent,c=(i=n(8)).GENERATE_TOKEN_EVENT,u=i.TERMINATE_EVENT,d=i.UPDATE_ELEMENTS_EVENT;function h(e,t,n,i,o,r){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=o,this._processInstances=r}h.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=l(o(t),"bpmn:TerminateEventDefinition"),h=r(t.parent,"bpmn:SubProcess");(e=(i&&(this._eventBus.fire(u,e),this._elementRegistry.forEach((function(e){a(t.parent,e)&&e.tokenCount&&e.tokenCount[n]&&delete e.tokenCount[n]})),this._processInstances.finish(n)),this._simulationState.isFinished(t,n)))&&this._processInstances.finish(n),(e||i)&&h&&(e=this._processInstances.getProcessInstance(n),this._eventBus.fire(c,{element:t.parent,processInstanceId:e.parentProcessInstanceId})),this._eventBus.fire(d,{elements:s(this._elementRegistry.getAll(),t.parent)})},h.prototype.generate=function(e){},h.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"],e.exports=h},function(e,t,n){"use strict";var i=n(10).is,o=n(8).UPDATE_ELEMENTS_EVENT;function r(e,t){this._eventBus=e,this._animation=t}r.prototype.consume=function(e){var t=e.element,n=(e=e.processInstanceId,e=(t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,t.outgoing),[]);e.forEach((function(e){e=e.target,i(e,"bpmn:IntermediateCatchEvent")&&n.push(e)})),this._eventBus.fire(o,{elements:n})},r.prototype.generate=function(){},r.$inject=["eventBus","animation"],e.exports=r},function(e,t,n){"use strict";var i=(n=n(8)).CONSUME_TOKEN_EVENT,o=n.GENERATE_TOKEN_EVENT;function r(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}r.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(o,e)},r.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var o=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,(function(){o._eventBus.fire(i,{element:r.target,processInstanceId:n})}))},r.$inject=["eventBus","animation","elementRegistry"],e.exports=r},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENT_EVENT,a=n.UPDATE_ELEMENTS_EVENT;function s(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}s.prototype.consume=function(e){var t=e.element;e=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,this._eventBus.fire(r,{element:t})},s.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId,s=(n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))})),n.parent);e=this._elementRegistry.filter((function(e){return i(e,"bpmn:IntermediateCatchEvent")&&e.parent===s}));this._eventBus.fire(a,{elements:e})},s.$inject=["animation","eventBus","elementRegistry"],e.exports=s},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){this._eventBus.fire(r,{element:e})},a.prototype.generate=function(e){var t=this;e.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,(function(){t._eventBus.fire(o,{element:e.target})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(r,e),t.tokenCount[n]=0)},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENTS_EVENT;function a(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}a.prototype.consume=function(){},a.prototype.generate=function(e){var t=this,n=e.element,a=(e=e.parentProcessInstanceId,n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")}))),s=n.parent,l=this._processInstances.create(s,e);a.forEach((function(e){t._animation.createAnimation(e,l,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:l})}))})),i(n.parent,"bpmn:SubProcess")||(s=this._elementRegistry.filter((function(e){return i(e,"bpmn:StartEvent")})),this._eventBus.fire(r,{elements:s}))},a.$inject=["animation","eventBus","elementRegistry","processInstances"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT,a=n.UPDATE_ELEMENT_EVENT;function s(e,t,n){this._animation=e,this._eventBus=t,this._log=n}s.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,o=t.children.filter((function(e){return i(e,"bpmn:StartEvent")}))[0];o?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(r,{element:o,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(r,e)),this._eventBus.fire(a,{element:t})},s.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))})),this._eventBus.fire(a,{element:n})},s.$inject=["animation","eventBus","log"],e.exports=s},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENT_EVENT;function a(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}a.prototype.consume=function(e){var t=e.element;e=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,this._eventBus.fire(r,{element:t})},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus","elementRegistry"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){this._eventBus.fire(r,e)},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){e.exports=n(533)},function(e,t,n){"use strict";function i(e,t,n,i,o,r){r.register({toggleTokenSimulation:function(){t.toggleMode()}}),r.register({togglePauseTokenSimulation:function(){n.toggle()}}),r.register({resetTokenSimulation:function(){o.resetSimulation()}}),r.register({toggleTokenSimulationLog:function(){i.toggle()}})}i.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"],e.exports=i},function(e,t,n){e.exports=n(535)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t){var n,o=t.get("editorActions",!1),a=t.get("keyboard",!1);a&&o&&(n=!1,e.on("keyboard.init",(function(){a.addListener(1e4,(function(e){r(["t","T"],e=e=e.keyEvent)?o.trigger("toggleTokenSimulation"):n&&(r(["l","L"],e)?o.trigger("toggleTokenSimulationLog"):r([" ","Spacebar"],e)?o.trigger("togglePauseTokenSimulation"):r(["r","R"],e)&&o.trigger("resetTokenSimulation"))}))})),e.on(i,(function(e){e=e.simulationModeActive,n=!!e})))}function r(e,t){return-1<e.indexOf(t.key)}o.$inject=["eventBus","injector"],e.exports=o},function(e,t,n){e.exports=n(537)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(8).TOGGLE_MODE_EVENT;function a(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(r,(function(e){e.simulationModeActive?o(n.container).remove("hidden"):o(n.container).add("hidden")}))}a.prototype._init=function(){this.container=i('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},a.prototype.addEntry=function(e,t){var n=0;this.entries.forEach((function(e){t>=e.index&&n++})),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},a.$inject=["eventBus","canvas"],e.exports=a},function(e,t,n){"use strict";var i=n(0).isFunction,o=n(0).isObject,r=n(0).some;function a(e){var t=this;e.on("moddleCopy.canCopyProperty",(function(e){var n=e.property;e=e.parent;return t.canCopyProperty(n,e)}))}function s(e,t){return e&&i(e.$instanceOf)&&e.$instanceOf(t)}function l(e,t){return r(t,(function(t){return s(e,t)}))}function c(e,t){return t?s(e,t)?e:e.$parent?c(e.$parent,t):void 0:e.$parent}a.$inject=["eventBus"],a.prototype.canCopyProperty=function(e,t){return!(o(e)&&!function(e,t){return!(e=(e=e.$type&&e.$model.getTypeDescriptor(e.$type))&&e.meta&&e.meta.allowedIn)||function(e){return-1!==e.indexOf("*")}(e)||r(e,(function(e){return c(t,e)}))}(e,t)||s(e,"camunda:InputOutput")&&!this.canHostInputOutput(t)||l(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t)||s(e,"camunda:In")&&!this.canHostIn(t))&&void 0},a.prototype.canHostInputOutput=function(e){return!!c(e,"camunda:Connector")||!!(e=c(e,"bpmn:FlowNode"))&&!(l(e,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])||s(e,"bpmn:SubProcess")&&e.get("triggeredByEvent"))},a.prototype.canHostConnector=function(e){return!s(c(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||c(e,"bpmn:IntermediateThrowEvent")||c(e,"bpmn:EndEvent")},a.prototype.canHostIn=function(e){return!!c(e,"bpmn:CallActivity")||!c(e,"bpmn:SignalEventDefinition")||c(e,"bpmn:IntermediateThrowEvent")||c(e,"bpmn:EndEvent")},e.exports=a},function(e,t,n){"use strict";var i=n(0).some,o={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function r(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function a(e,t){return(n=e)&&n.length&&i(e,(function(e){return r(e,t)}));var n}function s(e,t,n){t=t.name;var a,s=o[t.replace(/activiti:/,"")];return t===e&&(a=n,i(s,(function(e){return r(a,e)})))}function l(e){e.on("property.clone",(function(e){var t=e.newElement;e=e.propertyDescriptor;this.canCloneProperty(t,e)}),this)}l.$inject=["eventBus"],l.prototype.canCloneProperty=function(e,t){return s("activiti:FailedJobRetryTimeCycle",t,e)?a(e.eventDefinitions,"bpmn:TimerEventDefinition")||a(e.eventDefinitions,"bpmn:SignalEventDefinition")||r(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):s("activiti:Connector",t,e)||s("activiti:Field",t,e)?a(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0},e.exports=l},function(e,t,n){"use strict";var i=n(0).some,o={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function r(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function a(e,t){return(n=e)&&n.length&&i(e,(function(e){return r(e,t)}));var n}function s(e,t,n){t=t.name;var a,s=o[t.replace(/flowable:/,"")];return t===e&&(a=n,i(s,(function(e){return r(a,e)})))}function l(e){e.on("property.clone",(function(e){var t=e.newElement;e=e.propertyDescriptor;this.canCloneProperty(t,e)}),this)}l.$inject=["eventBus"],l.prototype.canCloneProperty=function(e,t){return s("flowable:FailedJobRetryTimeCycle",t,e)?a(e.eventDefinitions,"bpmn:TimerEventDefinition")||a(e.eventDefinitions,"bpmn:SignalEventDefinition")||r(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):s("flowable:Connector",t,e)||s("flowable:Field",t,e)?a(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0},e.exports=l},function(e,t,n){"use strict";var i=n(147);function o(e,t,n){var o=i.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:o}),o.length&&o.forEach((function(i){e.set(i,t.inverse,n)}))}function r(e,t){if(!(this instanceof r))return new r(e,t);(e.inverse=t).inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}r.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}var n,i,r,a;t.collection?o(this,t,e):(n=this,i=e,r=(e=t).inverse,a=i[e.name],Object.defineProperty(i,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return a},set:function(e){var t;e!==a&&(t=a,a=null,t&&n.unset(t,r,i),a=e,n.set(a,r,i))}}))},r.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return i.isExtended(n)||o(this,t,e),n},r.prototype.ensureBound=function(e,t){var n;n=t,Object.prototype.hasOwnProperty.call(e,n.name||n)||this.bind(e,t)},r.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},r.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)},e.exports=r},function(e,t,n){"use strict";n.r(t);var i=n(7),o=(i=n.n(i),n(110));n=n.n(o),o={insert:"head",singleton:!1};i()(n.a,o),t.default=n.a.locals||{}},function(e,t,n){var i=n(544);(i="string"==typeof(i=i.__esModule?i.default:i)?[[e.i,i,""]]:i).locals&&(e.exports=i.locals),(0,n(5).default)("3ae8271d",i,!0,{})},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".taskMenus-item[data-v-44afa99a]{display:flex;align-items:center;height:40px}.taskMenus/deep/.el-checkbox[data-v-44afa99a]{margin-right:20px}",""])},function(e){e.exports=JSON.parse('{"name":"tianheng-ui","description":"A Vue.js project","version":"0.0.90","author":"shu lang <403732931@qq.com>","license":"MIT","private":false,"main":"./lib/tianheng-ui.js","style":"lib/theme-chalk/index.css","scripts":{"dev":"cross-env NODE_ENV=development webpack-dev-server --open --hot --mode=development","build":"cross-env NODE_ENV=preview webpack --progress --hide-modules --mode=production","build:npm":"cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production"},"dependencies":{"ace-builds":"^1.4.13","axios":"^0.27.2","bpmn-js-sketchy":"^0.5.3","bpmn-js-task-resize":"^1.2.0","bpmn-js-token-simulation":"^0.10.0","clipboard":"^2.0.11","diagram-js-minimap":"^2.0.4","element-ui":"^2.15.6","highlight.js":"^10.5.0","min-dash":"^3.5.2","mini-css-extract-plugin":"^1.6.2","normalize.css":"^8.0.1","nprogress":"^0.2.0","viewerjs":"^1.10.5","vue":"^2.5.11","vue-i18n":"^5.0.3","vue-router":"^3.5.3","vue2-editor":"^2.10.3","vuedraggable":"^2.24.3","vuex":"^3.6.2","x2js":"^3.4.2","xlsx":"^0.18.5","xml-js":"^1.6.11"},"browserslist":["> 1%","last 2 versions","not ie <= 8"],"devDependencies":{"@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/preset-env":"^7.0.0","@types/ace":"0.0.42","@vue/babel-helper-vue-jsx-merge-props":"^1.4.0","@vue/babel-preset-jsx":"^1.4.0","babel-loader":"^8.2.5","babel-plugin-component":"^1.1.1","babel-plugin-import":"^1.13.5","bpmn-js":"^8.8.3","bpmn-js-properties-panel":"^0.37.2","camunda-bpmn-moddle":"^4.4.1","cross-env":"^5.0.5","css-loader":"^0.28.7","file-loader":"^1.1.4","html-webpack-plugin":"^4.5.0","less":"^3.9.0","less-loader":"^4.1.0","sass":"^1.55.0","sass-loader":"^7.3.1","style-loader":"^2.0.0","uglifyjs-webpack-plugin":"^2.2.0","vue-loader":"^14.2.4","vue-template-compiler":"^2.4.4","webpack":"^4.46.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.3"},"files":["lib","packages"],"homepage":"https://tianhengui.demo.tianhengyun.com/","keywords":["tianheng","tianheng-ui"]}')},function(e,t,n){"use strict";n.r(t),n.d(t,"install",(function(){return rS})),n.d(t,"Cell",(function(){return o})),n.d(t,"Icons",(function(){return a})),n.d(t,"Table",(function(){return d})),n.d(t,"TableAction",(function(){return p})),n.d(t,"TableSearch",(function(){return m})),n.d(t,"TableTools",(function(){return v})),n.d(t,"Empty",(function(){return y})),n.d(t,"Dialog",(function(){return x})),n.d(t,"Card",(function(){return k})),n.d(t,"Grid",(function(){return C})),n.d(t,"GridItem",(function(){return T})),n.d(t,"CodeEditor",(function(){return O})),n.d(t,"VueEditor",(function(){return D})),n.d(t,"Button",(function(){return R})),n.d(t,"Image",(function(){return I})),n.d(t,"ImagePreview",(function(){return F})),n.d(t,"Row",(function(){return B})),n.d(t,"Col",(function(){return z})),n.d(t,"Upload",(function(){return Y})),n.d(t,"FormMaking",(function(){return Cl})),n.d(t,"FormGenerate",(function(){return Sl})),n.d(t,"TableMaking",(function(){return Ml})),n.d(t,"TableGenerate",(function(){return ql})),n.d(t,"Workflow",(function(){return iS}));var i=n(21),o=(i.a.install=function(e){e.component(i.a.name,i.a)},i.a),r=n(37),a=(r.a.install=function(e){e.component(r.a.name,r.a)},r.a),s={name:"TableColumn",props:{options:{type:Array,default:function(){return[]}}}},l=n(1);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}s={name:"ThTable",components:{TableColumn:Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._l(e.options,(function(t,i){return[t.hide?e._e():[t.type?n("el-table-column",{key:i,attrs:{type:t.type,label:t.label,width:"50"}}):t.children?n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align,fixed:t.fixed,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip}},[n("TableColumn",{key:i,attrs:{options:t.children}})],1):n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align,fixed:t.fixed,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip},scopedSlots:e._u([{key:"default",fn:function(i){return[t.slot?e._t("slot",null,{scope:i,option:t}):n("span",[e._v(e._s(i.row[t.prop]))])]}}],null,!0)})]]}))],2)}),[],!1,(function(e){n(221)}),null,null).exports},props:{data:{type:Array,default:function(){return[]}},options:{type:Array,default:function(){return[]}},dblclick:{type:Function,default:function(){return null}},stripe:{type:Boolean,default:function(){return!1}},treeProps:{type:Object,default:function(){return{}}},pageInfo:{type:Object,default:function(){return{}}},loading:{type:Boolean,default:function(){return!1}},height:String|Number,rowKey:String|Function,showPage:{type:Boolean,default:function(){return!0}},emptyText:{type:String,default:function(){return"暂无数据"}},loadingText:{type:String,default:function(){return"加载中"}},border:{type:Boolean,default:function(){return!1}},highlightCurrentRow:{type:Boolean,default:function(){return!1}}},data:function(){return{}},computed:{widgetList:function(){return this.options.filter((function(e){return!e.hide}))}},methods:{handleSelectionChange:function(e){e&&this.$emit("selection-change",e)},handleSingleSelect:function(e,t){e&&this.$emit("current-change",e)},handleSizeChange:function(e){this.pageInfo.pageSize=e,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize)},handleCurrentChange:function(e){this.pageInfo.currentPage=e,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize)},handlePrevClick:function(){1!==this.pageInfo.currentPage&&(--this.pageInfo.currentPage,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize))},handleNextClick:function(){this.pageInfo.currentPage!==this.pageInfo.pageCount&&(this.pageInfo.currentPage+=1,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize))},getTable:function(){return this.$refs.th_table},handleFormatTime:function(e,t){var n;return 0===arguments.length?null:(t=t||"yyyy-MM-dd HH:mm:ss",null==e||"null"===e?"":(n={yyyy:(e="object"===c(e)?e:("number"==typeof(e="string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e):e)&&10===e.toString().length&&(e*=1e3),new Date(e))).getFullYear(),MM:e.getMonth()+1,dd:e.getDate(),HH:e.getHours(),mm:e.getMinutes(),ss:e.getSeconds(),a:e.getDay()},t.replace(/(yyyy|MM|dd|HH|mm|ss|a)/g,(function(e,t){var i=n[t];return"a"===t?["日","一","二","三","四","五","六"][i]:(i=0<e.length&&i<10?"0"+i:i)||0}))))},objectSpanMethod:function(e){this.$emit("span-method",e)}}};var u=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"th_table",attrs:{height:e.height,data:e.data,"row-key":e.rowKey,stripe:e.stripe,border:e.border,"highlight-current-row":e.highlightCurrentRow,"tree-props":e.treeProps,"span-method":e.objectSpanMethod},on:{"current-change":e.handleSingleSelect,"row-dblclick":e.dblclick,"selection-change":e.handleSelectionChange},scopedSlots:e._u([{key:"empty",fn:function(){return[n("div",[e._v("\n "+e._s(e.loading?e.loadingText||"加载中":e.emptyText||"暂无数据")+"\n ")])]},proxy:!0}])},[e._l(e.widgetList,(function(t,i){return[t.type?n("el-table-column",{key:i,attrs:{type:t.type,label:t.label,width:"50"}}):t.children?n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align||"left",fixed:t.fixed||null,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip}},[n("table-column",{attrs:{options:t.children}})],1):n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align||"left",fixed:t.fixed||null,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip},scopedSlots:e._u([{key:"default",fn:function(i){return[t.slot?e._t(t.slot,null,{scope:i,option:t}):t.formatTime?n("span",[e._v("\n "+e._s(e.handleFormatTime(i.row[t.alias||t.prop],t.format))+"\n ")]):t.format?n("span",[e._v("\n "+e._s(t.format(i.row))+"\n ")]):t.alias?n("span",[e._v(e._s(i.row[t.alias]))]):n("span",[e._v(e._s(i.row[t.prop]))])]}}],null,!0)})]}))],2),e._v(" "),0<Object.keys(e.pageInfo).length&&e.showPage?n("div",{staticClass:"pagination"},[n("el-pagination",{attrs:{"current-page":e.pageInfo.currentPage,"page-sizes":e.pageInfo.sizes,"page-size":e.pageInfo.pageSize,layout:"total, prev, pager, next, sizes",total:e.pageInfo.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"prev-click":e.handlePrevClick,"next-click":e.handleNextClick}})],1):e._e()],1)}),[],!1,(function(e){n(219)}),"data-v-37f6d710",null).exports,d=(u.install=function(e){e.component(u.name,u)},u);s={name:"ThTableAction",props:{actions:{type:Array,default:function(){return[]}},scope:{type:Object|String},permission:{type:Object,required:!1},msg:{type:String,default:"确定删除本条数据吗?"}},data:function(){return{pop:!1,loadingDel:!1}},computed:{btnDisabled:function(){var e=this;return function(t){return"boolean"==typeof t.disabled?t.disabled:"function"==typeof t.disabled?t.disabled(e.scope):void 0}},btnHide:function(){var e=this;return function(t){return"boolean"==typeof t.hide?t.hide:"function"==typeof t.hide?t.hide(e.scope):void 0}}},methods:{handleCancel:function(){this.loadingDel=!1,this.pop=!1},handleClick:function(e,t){this.$emit("on-click",e,t)},handleDelete:function(e){var t=this;this.loadingDel=!0,this.handleClick(e,(function(e){e?t.handleCancel():t.loadingDel=!1}))},handleMore:function(e,t,n){for(var i=0;i<n.children.length;i++){var o=n.children[i];if(o.act===e){this.handleClick(o);break}}}}};var h=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-action",on:{click:function(e){e.stopPropagation()}}},[e._l(e.actions,(function(t,i){return["delete"!==t.act||e.btnHide(t)?"more"!==t.act||e.btnHide(t)?e.btnHide(t)?e._e():n("el-button",{key:i,style:t.style,attrs:{type:t.type,icon:t.icon,disabled:e.btnDisabled(t)},on:{click:function(n){return e.handleClick(t)}}},[e._v(e._s(t.name))]):n("el-dropdown",{key:i,attrs:{trigger:t.trigger||"click",placement:t.placement||"bottom-end",disabled:e.btnDisabled(t)},on:{command:function(n){e.handleMore(n,i,t)}}},[n("el-button",{style:t.style,attrs:{disabled:e.loadingDel||e.btnDisabled(t),type:t.type,icon:t.icon}},[e._v(e._s(t.name))]),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(t.children,(function(t,i){return n("el-dropdown-item",{key:i,style:t.style,attrs:{command:t.act,icon:t.icon,disabled:t.disabled}},[e._v(e._s(t.name))])})),1)],1):n("el-popover",{key:i,attrs:{placement:"top",width:"180",trigger:"manual"},model:{value:e.pop,callback:function(t){e.pop=t},expression:"pop"}},[n("p",[e._v(e._s(t.delmsg||e.msg))]),e._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0"}},[n("el-button",{attrs:{type:"text",disabled:e.loadingDel},on:{click:e.handleCancel}},[e._v("取消")]),e._v(" "),n("el-button",{attrs:{type:"text",loading:e.loadingDel},on:{click:function(n){return e.handleDelete(t)}}},[e._v("确定")])],1),e._v(" "),n("el-button",{style:t.style,attrs:{slot:"reference",disabled:e.loadingDel||e.btnDisabled(t),type:t.type,icon:t.icon},on:{click:function(t){e.pop=!0}},slot:"reference"},[e._v(e._s(t.name))])],1)]}))],2)}),[],!1,(function(e){n(223)}),null,null).exports,p=(h.install=function(e){e.component(h.name,h)},h);s={name:"ThTableSearch",props:{options:{type:Array,default:function(){return[]}},data:{type:Object,default:function(){return{}}}},data:function(){return{params:this.data,datePickerTypes:["year","month","date","dates","week","datetime","datetimerange","daterange","monthrange"]}},watch:{options:{handler:function(e,t){var n=this;e&&e.length&&e.map((function(e){n.$set(n.params,e.options.prop,e.options.defaultValue)}))},deep:!0,immediate:!0},data:function(e){this.params=e},params:{deep:!0,handler:function(e){this.$emit("update:data",e)}}},methods:{doSearch:function(){this.$emit("on-search",this.params)},doReset:function(){var e=this;this.options.map((function(t){e.$set(e.params,t.prop,t.defaultValue||"")})),this.$emit("on-reset",this.params)}}};var f=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-search"},[e._l(e.options,(function(t,i){return n("div",{key:i,staticClass:"th-table-search-item"},[n("span",{staticClass:"th-table-search-item-title"},[e._v(e._s(t.options.name)+":")]),e._v(" "),"input"===t.type?n("el-input",{style:{width:t.options.width+"px"},attrs:{placeholder:t.options.placeholder||"请输入",disabled:t.options.disabled,clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}}):e._e(),e._v(" "),"date"===t.type?n("el-date-picker",{style:{width:t.options.width+"px"},attrs:{type:t.options.dateType||"date",format:t.options.format,"value-format":t.options.valueFormat,"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}}):e._e(),e._v(" "),"select"===t.type?n("el-select",{style:{width:t.options.width+"px"},attrs:{placeholder:t.options.placeholder||"请选择",multiple:t.options.multiple,"multiple-limit":t.options.multipleLimit,filterable:t.options.filterable,disabled:t.options.disabled,clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}},[t.options.remote?e._l(t.options.options,(function(e){return n("el-option",{key:e[t.options.props.value],attrs:{label:e[t.options.props.label],value:e[t.options.props.value]}})})):e._l(t.options.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],2):e._e()],1)})),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-search",plain:""},on:{click:e.doSearch}},[e._v("查询")]),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-refresh-right",plain:""},on:{click:e.doReset}},[e._v("重置")])],2)}),[],!1,(function(e){n(225)}),"data-v-3195cc72",null).exports,m=(f.install=function(e){e.component(f.name,f)},f);s={name:"ThTableTools",props:{options:{type:Array,default:function(){return[]}},disabled:{type:Object,default:function(){return{}}}},data:function(){return{}},methods:{handleClick:function(e){this.$emit("on-click",e)}}};var g=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-tools"},e._l(e.options,(function(t,i){return n("el-button",{key:i,style:t.style,attrs:{type:t.type,icon:t.icon,disabled:t.disabled||e.disabled[t.act],loading:t.loading},on:{click:function(n){return e.handleClick(t)}}},[e._v(e._s(t.name))])})),1)}),[],!1,(function(e){n(227)}),"data-v-4faa6b2f",null).exports,v=(g.install=function(e){e.component(g.name,g)},g),b=(s={name:"ThEmpty",props:{image:{type:String,default:""},imageSize:{type:Number,default:300},description:{type:String,default:"暂无数据"}},computed:{imageStyle:function(){return{width:this.imageSize?"".concat(this.imageSize,"px"):""}}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-empty"},[e.image?t("img",{staticClass:"th-empty-img",style:e.imageStyle,attrs:{src:e.image,alt:""}}):e._t("image"),e._v(" "),e.$slots.description?e._t("description"):t("p",{staticClass:"th-empty-description"},[e._v(e._s(e.description))]),e._v(" "),e.$slots.default?t("div",{staticClass:"th-empty-bottom"},[e._t("default")],2):e._e()],2)}),[],!1,null,null,null).exports),y=(b.install=function(e){e.component(b.name,b)},b),w=(s={name:"ThDialog",model:{prop:"visible",event:"input"},props:{visible:Boolean,title:{type:String,default:""},width:{type:String,default:"800px"},fullscreen:{type:Boolean,default:!1},top:{type:String,default:"15vh"},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},customClass:String,closeOnClickModal:{type:Boolean,default:!1},closeOnPressEscape:{type:Boolean,default:!1},beforeClose:Function,destroyOnClose:{type:Boolean,default:!1},showAffirm:{type:Boolean,default:!0},affirmLoading:Boolean,affirmText:{type:String,default:"确 认"},showCancel:{type:Boolean,default:!0},cancelText:{type:String,default:"取 消"},showClose:{type:Boolean,default:!0},closeIcon:{type:String,default:"el-icon-close"},showFullscreen:{type:Boolean,default:!0},fullscreenIcon:{type:String,default:"el-icon-full-screen"},showFooter:{type:Boolean,default:!0}},data:function(){return{formRules:{},dialogFullscreen:this.fullscreen}},watch:{fullscreen:function(e){this.dialogFullscreen=e}},methods:{handleClose:function(){this.$emit("input",!this.visible),this.$emit("on-close")},handleBeforeClose:function(e){var t=this;this.beforeClose?this.beforeClose((function(){t.handleClose()})):this.handleClose()},handleAffirm:function(){this.$emit("on-affirm")},handleFullscreenChange:function(){var e=this;this.dialogFullscreen=!this.dialogFullscreen,this.$nextTick((function(){e.$emit("on-fullscreen")}))}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("el-dialog",{staticClass:"th-dialog",class:[e.customClass],attrs:{visible:e.visible,width:e.width,top:e.top,fullscreen:e.dialogFullscreen,"close-on-click-modal":e.closeOnClickModal,"close-on-press-escape":e.closeOnPressEscape,"show-close":!1,modal:e.modal,"modal-append-to-body":e.modalAppendToBody,"append-to-body":e.appendToBody,"before-close":e.handleBeforeClose,"destroy-on-close":e.destroyOnClose},on:{"update:visible":function(t){e.visible=t}}},[t("div",{staticClass:"th-dialog__header",attrs:{slot:"title"},slot:"title"},[t("div",{staticClass:"th-dialog__title"},[e._v(e._s(e.title))]),e._v(" "),t("div",{staticClass:"th-dialog__action"},[e.showFullscreen?t("i",{staticClass:"th-dialog__action_item",class:e.fullscreenIcon,on:{click:e.handleFullscreenChange}}):e._e(),e._v(" "),e.showClose?t("i",{staticClass:"th-dialog__action_item",class:e.closeIcon,on:{click:e.handleBeforeClose}}):e._e()])]),e._v(" "),e._t("default"),e._v(" "),e.$slots.footer?t("template",{slot:"footer"},[e._t("footer")],2):e.showFooter?t("template",{slot:"footer"},[e.showAffirm?t("el-button",{attrs:{type:"primary",loading:e.affirmLoading},on:{click:e.handleAffirm}},[e._v(e._s(e.affirmText))]):e._e(),e._v(" "),e.showCancel?t("el-button",{on:{click:e.handleClose}},[e._v(e._s(e.cancelText))]):e._e()],1):e._e()],2)}),[],!1,null,null,null).exports),x=(w.install=function(e){e.component(w.name,w)},w),_=(s={name:"ThCard",props:{showHeader:{type:Boolean,default:!0},title:String,label:String,bodyStyle:String|Object,shadow:{type:String,default:"always"},border:Boolean},computed:{seflClass:function(){var e="".concat(this.shadow,"-shadow");return this.border?"".concat(e," th-is_border"):e}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-card",class:e.seflClass},[e.showHeader?[e.$slots.header?e._t("header"):t("div",{staticClass:"th-card-header"},[e.title?t("span",[e._v(e._s(e.title))]):e._t("title"),e._v(" "),e.label?t("span",[e._v(e._s(e.label))]):e._t("label")],2)]:e._e(),e._v(" "),t("div",{staticClass:"th-card-body",style:e.bodyStyle},[e._t("default")],2)],2)}),[],!1,null,null,null).exports),k=(_.install=function(e){e.component(_.name,_)},_),E=(s={name:"ThGrid",props:{column:Number|String,position:{type:String,default:"block"},border:Boolean},data:function(){return{}},mounted:function(){},methods:{}},Object(l.a)(s,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"th-grid",class:{"th-grid__border":this.border}},[this._t("default")],2)}),[],!1,null,null,null).exports),C=(E.install=function(e){e.component(E.name,E)},E),S=(s={name:"ThGridItem",props:{title:String,icon:String},data:function(){return{position:"",border:!1}},computed:{isIcon:function(){return!this.icon||"http"!==this.icon.substring(0,4)},selfStyle:function(){for(var e=this.$parent;e&&"ThGrid"!==e.$options.name;)e=e.$parent;var t=0,n=(e&&(t=e.column,this.position=e.position,this.border=e.border),{});return t&&(n.flex="none",n.flexBasis="".concat(100/t,"%")),n}},mounted:function(){},methods:{}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-grid-item",class:{"th-grid-item__border":e.border},style:e.selfStyle},[e.$slots.default?e._t("default"):t("div",{staticClass:"th-grid-item-content",class:"th-grid-item-content_"+e.position},[e.isIcon?t("i",{class:["th-icon",e.icon]}):t("img",{staticClass:"th-grid-item-img",attrs:{src:"",alt:""}}),e._v(" "),e.$slots.title?e._t("title"):t("p",{staticClass:"th-grid-item-title"},[e._v(e._s(e.title))])],2)],2)}),[],!1,null,null,null).exports),T=(S.install=function(e){e.component(S.name,Grid)},S),A=n(11),O=(A.a.install=function(e){e.component(A.a.name,A.a)},A.a);s={name:"ThVueEditor",components:{VueEditor:n(43).a},model:{prop:"value",event:"upload:value"},props:{value:String,disabled:Boolean},data:function(){return{data:this.value}},watch:{data:{handler:function(e){this.$emit("upload:value",e)},deep:!0},value:function(e){this.data=e}},methods:{}};var M=Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("vue-editor",{attrs:{disabled:e.disabled},model:{value:e.data,callback:function(t){e.data=t},expression:"data"}})}),[],!1,(function(e){n(241)}),null,null).exports,D=(M.install=function(e){e.component(M.name,M)},M),P=(s={name:"ThButton",inject:{thForm:{default:""},thFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{selfClass:function(){return[this.type?"th-button-"+this.type:"",this.buttonSize?"th-button-size-"+this.buttonSize:"",{"is-disabled":this.buttonDisabled,"is-loading":this.loading,"is-plain":this.plain,"is-round":this.round,"is-circle":this.circle}]},_thFormItemSize:function(){return(this.thFormItem||{}).thFormItemSize},buttonSize:function(){return this.size||this._thFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return(this.$options.propsData.hasOwnProperty("disabled")?this:this.thForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("button",{staticClass:"th-button",class:e.selfClass,attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?t("i",{staticClass:"el-icon-loading"}):e._e(),e._v(" "),e.icon&&!e.loading?t("i",{class:e.icon}):e._e(),e._v(" "),e.$slots.default?t("span",[e._t("default")],2):e._e()])}),[],!1,null,null,null).exports),R=(P.install=function(e){e.component(P.name,P)},P),L=n(22),I=(L.a.install=function(e){e.component(L.a.name,L.a)},L.a),N=n(36),F=(N.a.install=function(e){e.component(N.a.name,N.a)},N.a),j=n(23),B=(j.a.install=function(e){e.component(j.a.name,j.a)},j.a),q=n(24),z=(q.a.install=function(e){e.component(q.a.name,q.a)},q.a),V=(s=n(206),n.n(s)),W=(s={name:"ElProgress",props:{type:{type:String,default:"line",validator:e=>-1<["line","circle","dashboard"].indexOf(e)},percentage:{type:Number,default:0,required:!0,validator:e=>0<=e&&e<=100},status:{type:String,validator:e=>-1<["success","exception","warning"].indexOf(e)},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth(){return(this.strokeWidth/this.width*100).toFixed(1)},radius(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath(){var e=this.radius,t="dashboard"===this.type;return`\n M 50 50\n m 0 ${t?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${t?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${t?"":"-"}${2*e}\n `},perimeter(){return 2*Math.PI*this.radius},rate(){return"dashboard"===this.type?.75:1},strokeDashoffset(){return-1*this.perimeter*(1-this.rate)/2+"px"},trailPathStyle(){return{strokeDasharray:`${this.perimeter*this.rate}px, ${this.perimeter}px`,strokeDashoffset:this.strokeDashoffset}},circlePathStyle(){return{strokeDasharray:`${this.perimeter*this.rate*(this.percentage/100)}px, ${this.perimeter}px`,strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke(){let e;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content(){return"function"==typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor(e){return"function"==typeof this.color?this.color(e):"string"==typeof this.color?this.color:this.getLevelColor(e)},getLevelColor(e){var t=this.getColorArray().sort((e,t)=>e.percentage-t.percentage);for(let n=0;n<t.length;n++)if(t[n].percentage>e)return t[n].color;return t[t.length-1].color},getColorArray(){var e=this.color;const t=100/e.length;return e.map((e,n)=>"string"==typeof e?{color:e,percentage:(n+1)*t}:e)}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"el-progress",class:["el-progress--"+e.type,e.status?"is-"+e.status:"",{"el-progress--without-text":!e.showText,"el-progress--text-inside":e.textInside}],attrs:{role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===e.type?t("div",{staticClass:"el-progress-bar"},[t("div",{staticClass:"el-progress-bar__outer",style:{height:e.strokeWidth+"px"}},[t("div",{staticClass:"el-progress-bar__inner",style:e.barStyle},[e.showText&&e.textInside?t("div",{staticClass:"el-progress-bar__innerText"},[e._v(e._s(e.content))]):e._e()])])]):t("div",{staticClass:"el-progress-circle",style:{height:e.width+"px",width:e.width+"px"}},[t("svg",{attrs:{viewBox:"0 0 100 100"}},[t("path",{staticClass:"el-progress-circle__track",style:e.trailPathStyle,attrs:{d:e.trackPath,stroke:"#e5e9f2","stroke-width":e.relativeStrokeWidth,fill:"none"}}),e._v(" "),t("path",{staticClass:"el-progress-circle__path",style:e.circlePathStyle,attrs:{d:e.trackPath,stroke:e.stroke,fill:"none","stroke-linecap":e.strokeLinecap,"stroke-width":e.percentage?e.relativeStrokeWidth:0}})])]),e._v(" "),e.showText&&!e.textInside?t("div",{staticClass:"el-progress__text",style:{fontSize:e.progressTextSize+"px"}},[e.status?t("i",{class:e.iconClass}):[e._v(e._s(e.content))]],2):e._e()])}),[],!1,null,null,null).exports),H={name:"ThUploadList",data:function(){return{focusing:!1}},components:{ElProgress:s=(W.install=function(e){e.component(W.name,W)},W)},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(e){return parseInt(e,10)},handleClick:function(e){this.handlePreview&&this.handlePreview(e)}}},U=Object(l.a)(H,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition-group",{class:["th-upload-list","th-upload-list--"+e.listType,{"is-disabled":e.disabled}],attrs:{tag:"ul",name:"th-list"}},e._l(e.files,(function(t){return n("li",{key:t.uid,class:["th-upload-list__item","is-"+t.status,e.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"delete",[8,46],n.key,["Backspace","Delete","Del"]))return null;e.disabled||e.$emit("remove",t)},focus:function(t){e.focusing=!0},blur:function(t){e.focusing=!1},click:function(t){e.focusing=!1}}},[e._t("default",(function(){return["uploading"!==t.status&&-1<["picture-card","picture"].indexOf(e.listType)?n("img",{staticClass:"th-upload-list__item-thumbnail",attrs:{src:t.url,alt:""}}):e._e(),e._v(" "),n("a",{staticClass:"th-upload-list__item-name",on:{click:function(n){return e.handleClick(t)}}},[n("i",{staticClass:"el-icon-document"}),e._v(e._s(t.name)+"\n ")]),e._v(" "),n("label",{staticClass:"th-upload-list__item-status-label"},[n("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===e.listType,"el-icon-check":-1<["picture-card","picture"].indexOf(e.listType)}})]),e._v(" "),e.disabled?e._e():n("i",{staticClass:"el-icon-close",on:{click:function(n){return e.$emit("remove",t)}}}),e._v(" "),"uploading"===t.status?n("el-progress",{attrs:{type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:e.parsePercentage(t.percentage)}}):e._e(),e._v(" "),"picture-card"===e.listType?n("span",{staticClass:"th-upload-list__item-actions"},[e.handlePreview&&"picture-card"===e.listType?n("span",{staticClass:"th-upload-list__item-preview",on:{click:function(n){return e.handlePreview(t)}}},[n("i",{staticClass:"el-icon-zoom-in"})]):e._e(),e._v(" "),e.disabled?e._e():n("span",{staticClass:"th-upload-list__item-delete",on:{click:function(n){return e.$emit("remove",t)}}},[n("i",{staticClass:"el-icon-delete"})])]):e._e()]}),{file:t})],2)})),0)}),[],!1,null,null,null).exports;function G(){}H={name:"ThUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(e){var t;!this.disabled&&this.uploader&&(t=this.uploader.accept,this.dragover=!1,t?this.$emit("file",[].slice.call(e.dataTransfer.files).filter((function(e){var n=e.type,i=-1<(e=e.name).indexOf(".")?".".concat(e.split(".").pop()):"",o=n.replace(/\/.*$/,"");return t.split(",").map((function(e){return e.trim()})).filter((function(e){return e})).some((function(e){return/\..+$/.test(e)?i===e:/\/\*$/.test(e)?o===e.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(e)&&n===e}))}))):this.$emit("file",e.dataTransfer.files))}}},H={inject:["uploader"],components:{UploadDragger:Object(l.a)(H,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"th-upload-dragger",class:{"is-dragover":e.dragover},on:{drop:function(t){return t.preventDefault(),e.onDrop.apply(null,arguments)},dragover:function(t){return t.preventDefault(),e.onDragover.apply(null,arguments)},dragleave:function(t){t.preventDefault(),e.dragover=!1}}},[e._t("default")],2)}),[],!1,null,null,null).exports},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:function(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,i=e.action,o=(n.upload&&(n.upload.onprogress=function(t){0<t.total&&(t.percent=t.loaded/t.total*100),e.onProgress(t)}),new FormData),r=(e.data&&Object.keys(e.data).forEach((function(t){o.append(t,e.data[t])})),o.append(e.filename,e.file,e.file.name),n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||300<=n.status)return e.onError((t=i,r=(o=n).response?"".concat(o.response.error||o.response):o.responseText?"".concat(o.responseText):"fail to post ".concat(t," ").concat(o.status),(r=new Error(r)).status=o.status,r.method="post",r.url=t,r));var t,o,r;e.onSuccess(function(e){if(!(e=e.responseText||e.response))return e;try{return JSON.parse(e)}catch(t){return e}}(n))},n.open("post",i,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0),e.headers||{});for(t in r)r.hasOwnProperty(t)&&null!==r[t]&&n.setRequestHeader(t,r[t]);return n.send(o),n}}},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},computed:{classMatch:function(){var e={"th-upload":!0};return e["th-upload--".concat(this.listType)]=!0,e}},methods:{isImage:function(e){return-1!==e.indexOf("image")},handleChange:function(e){(e=e.target.files)&&this.uploadFiles(e)},uploadFiles:function(e){var t=this;this.limit&&this.fileList.length+e.length>this.limit?this.onExceed&&this.onExceed(e,this.fileList):(e=Array.prototype.slice.call(e),0!==(e=this.multiple?e:e.slice(0,1)).length&&e.forEach((function(e){t.onStart(e),t.autoUpload&&t.upload(e)})))},upload:function(e){var t=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(e);var n=this.beforeUpload(e);n&&n.then?n.then((function(n){var i=Object.prototype.toString.call(n);if("[object File]"===i||"[object Blob]"===i){for(var o in"[object Blob]"===i&&(n=new File([n],e.name,{type:e.type})),e)e.hasOwnProperty(o)&&(n[o]=e[o]);t.post(n)}else t.post(e)}),(function(){t.onRemove(null,e)})):!1!==n?this.post(e):this.onRemove(null,e)},abort:function(e){var t,n=this.reqs;e?((t=e).uid&&(t=e.uid),n[t]&&n[t].abort()):Object.keys(n).forEach((function(e){n[e]&&n[e].abort(),delete n[e]}))},post:function(e){var t=this,n=e.uid,i={headers:this.headers,withCredentials:this.withCredentials,file:e,data:this.data,filename:this.name,action:this.action,onProgress:function(n){t.onProgress(n,e)},onSuccess:function(i){t.onSuccess(i,e),delete t.reqs[n]},onError:function(i){t.onError(i,e),delete t.reqs[n]}},o=this.httpRequest(i);(this.reqs[n]=o)&&o.then&&o.then(i.onSuccess,i.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(e){e.target!==e.currentTarget||13!==e.keyCode&&32!==e.keyCode||this.handleClick()}}},H=Object(l.a)(H,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{class:e.classMatch,attrs:{tabindex:"0"},on:{click:e.handleClick,keydown:e.handleKeydown}},[e.drag?t("upload-dragger",{attrs:{disabled:e.disabled},on:{file:e.uploadFiles}},[e._t("default")],2):e._t("default"),e._v(" "),t("input",{ref:"input",staticClass:"th-upload__input",attrs:{type:"file",name:e.name,multiple:e.multiple,accept:e.accept},on:{change:e.handleChange}})],2)}),[],!1,null,null,null).exports;s={name:"ThUpload",components:{ElProgress:s,UploadList:U,Upload:H},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:G},onChange:{type:Function,default:G},onPreview:{type:Function},onSuccess:{type:Function,default:G},onProgress:{type:Function,default:G},onError:{type:Function,default:G},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:G}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(e){"picture-card"!==e&&"picture"!==e||(this.uploadFiles=this.uploadFiles.map((function(e){if(!e.url&&e.raw)try{e.url=URL.createObjectURL(e.raw)}catch(e){console.error("[Element Error][Upload]",e)}return e})))},fileList:{immediate:!0,handler:function(e){var t=this;this.uploadFiles=e.map((function(e){return e.uid=e.uid||Date.now()+t.tempIndex++,e.status=e.status||"success",e}))}}},methods:{handleStart:function(e){e.uid=Date.now()+this.tempIndex++;var t={status:"ready",name:e.name,size:e.size,percentage:0,uid:e.uid,raw:e};if("picture-card"===this.listType||"picture"===this.listType)try{t.url=URL.createObjectURL(e)}catch(e){return void console.error("[Element Error][Upload]",e)}this.uploadFiles.push(t),this.onChange(t,this.uploadFiles)},handleProgress:function(e,t){t=this.getFile(t),this.onProgress(e,t,this.uploadFiles),t.status="uploading",t.percentage=e.percent||0},handleSuccess:function(e,t){(t=this.getFile(t))&&(t.status="success",t.response=e,this.onSuccess(e,t,this.uploadFiles),this.onChange(t,this.uploadFiles))},handleError:function(e,t){t=this.getFile(t);var n=this.uploadFiles;t.status="fail",n.splice(n.indexOf(t),1),this.onError(e,t,this.uploadFiles),this.onChange(t,this.uploadFiles)},handleRemove:function(e,t){function n(){i.abort(e);var t=i.uploadFiles;t.splice(t.indexOf(e),1),i.onRemove(e,t)}var i=this;t&&(e=this.getFile(t)),this.beforeRemove?"function"==typeof this.beforeRemove&&((t=this.beforeRemove(e,this.uploadFiles))&&t.then?t.then((function(){n()}),G):!1!==t&&n()):n()},getFile:function(e){var t;return this.uploadFiles.every((function(n){return!(t=e.uid===n.uid?n:null)})),t},abort:function(e){this.$refs["upload-inner"].abort(e)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var e=this;this.uploadFiles.filter((function(e){return"ready"===e.status})).forEach((function(t){e.$refs["upload-inner"].upload(t.raw)}))}},beforeDestroy:function(){this.uploadFiles.forEach((function(e){e.url&&0===e.url.indexOf("blob:")&&URL.revokeObjectURL(e.url)}))},render:function(e){var t,n=this,i=(this.showFileList&&(t=e(U,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}},[function(e){if(n.$scopedSlots.file)return n.$scopedSlots.file({file:e.file})}])),{props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"}),o=this.$slots.trigger||this.$slots.default;i=e("upload",V()([{},i]),[o]);return e("div",["picture-card"===this.listType?t:"",this.$slots.trigger?[i,this.$slots.default]:i,this.$slots.tip,"picture-card"!==this.listType?t:""])}};var K=Object(l.a)(s,void 0,void 0,!1,null,null,null).exports,Y=(K.install=function(e){e.component(K.name,K)},K),X=(H=n(7),s=n.n(H),H=n(93),H=n.n(H),{insert:"head",singleton:!1}),J=(X=(s()(H.a,X),H.a.locals,n(94)),H=n.n(X),X={insert:"head",singleton:!1},X=(s()(H.a,X),H.a.locals,n(95)),H=n.n(X),X={insert:"head",singleton:!1},X=(s()(H.a,X),H.a.locals,n(6)),H=n.n(X),X=n(207),n.n(X)),Z=n(62);X={components:{ThDialog:w,ThCodeEditor:A.a},props:{data:{type:Object,default:function(){return{}}},remoteApis:{type:Array,default:function(){return[]}},config:{type:Object,default:function(){return{}}}},data:function(){return{compsData:JSON.parse(JSON.stringify(Z.a)),validator:{type:null,required:null,pattern:null,range:null,length:null},eventsDialog:{visible:!1,eventScript:[],active:null},aceCompletions:[{meta:"设置数据",caption:"setData",value:"setData({ })",score:1},{meta:"获取数据",caption:"getData",value:"getData()",score:1},{meta:"显示组件",caption:"display",value:"display([ ])",score:1},{meta:"隐藏组件",caption:"hide",value:"hide([ ])",score:1}]}},computed:{show:function(){return!!(this.data&&0<Object.keys(this.data).length)}},created:function(){for(var e=0,t=Object.keys(this.compsData);e<t.length;e++){var i=t[e];this.compsData[i].content=n(259)("./".concat(i)).default}},methods:{generateRule:function(){var e=this;this.data.rules=[],Object.keys(this.validator).forEach((function(t){e.validator[t]&&e.data.rules.push(e.validator[t])}))},validateRequired:function(e){var t=this;this.validator.required=e?{required:!0,message:"".concat(this.data.name,"必须填写")}:null,this.$nextTick((function(){t.generateRule()}))},validateDataType:function(e){if(!this.show)return!1;this.validator.type=e?{type:e,message:this.data.name+"格式不正确"}:null,this.generateRule()},valiatePattern:function(e){if(!this.show)return!1;this.validator.pattern=e?{pattern:e,message:this.data.name+"格式不匹配"}:null,this.generateRule()},handleInputNumberChange:function(){this.data.options.minRows>this.data.options.maxRows&&(this.data.options.maxRows=this.data.options.minRows)},handleImguploadType:function(e){"picture-card"==e&&(this.data.options.drag=!1)},handleImguploadDrag:function(e){e&&(this.data.options.listType="default")},handleEventDialogShow:function(){this.eventsDialog={visible:!0,eventScript:JSON.parse(JSON.stringify(this.config.eventScript)),active:null}},handleAddEvent:function(){var e={key:e=(new Date).getTime(),name:e,func:""};this.eventsDialog.eventScript.push(e),this.eventsDialog.active=e},handleEventDialogAffirm:function(){this.config.eventScript=this.eventsDialog.eventScript,this.eventsDialog={visible:!1,eventScript:[],active:null}},handleEventDialogDelete:function(e,t){var n=this;this.$confirm("确定要删除该方法 ".concat(e.name," ?"),"",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.eventsDialog.active&&e.key===n.eventsDialog.active.key&&(n.eventsDialog.active=null),n.eventsDialog.eventScript.splice(t,1)})).catch()},handleEventsCollapseClick:function(e){for(var t=0;t<this.config.eventScript.length;t++)if(this.config.eventScript[t].key===e){var n=JSON.parse(JSON.stringify(this.config.eventScript));this.eventsDialog={visible:!0,eventScript:n,active:n[t]};break}}},watch:{"data.options.isRange":function(e){void 0!==e&&(e?this.data.options.defaultValue=null:0<=Object.keys(this.data.options).indexOf("defaultValue")&&(this.data.options.defaultValue=""))},"data.options.required":function(e){this.validateRequired(e)},"data.options.dataType":function(e){this.validateDataType(e)},"data.options.pattern":function(e){this.valiatePattern(e)},"data.name":function(e){this.data.options&&(this.validateRequired(this.data.options.required),this.validateDataType(this.data.options.dataType),this.valiatePattern(this.data.options.pattern))}}};X=Object(l.a)(X,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.show?n("div",{staticClass:"widgetConfig"},[n(e.compsData[e.data.type].content,{tag:"component",attrs:{widget:e.data,config:e.config,remoteApis:e.remoteApis},on:{"events-show":e.handleEventDialogShow,"events-edit":e.handleEventsCollapseClick}}),e._v(" "),n("th-dialog",{attrs:{title:"动作设置","modal-append-to-body":!1},on:{"on-fullscreen":function(t){e.$refs.codeEditor&&e.$refs.codeEditor.resize()}},model:{value:e.eventsDialog.visible,callback:function(t){e.$set(e.eventsDialog,"visible",t)},expression:"eventsDialog.visible"}},[n("div",{staticClass:"eventsSetting"},[n("div",{staticClass:"list"},[n("div",{staticClass:"list-header",on:{click:e.handleAddEvent}},[n("div",[e._v("动作库")]),e._v(" "),n("el-button",{attrs:{type:"text",icon:"el-icon-plus",size:"mini"}},[e._v("添加")])],1),e._v(" "),e._l(e.eventsDialog.eventScript,(function(t,i){return n("div",{key:t.key,staticClass:"list-item",on:{click:function(n){e.eventsDialog.active=t}}},[n("div",{staticClass:"list-item-title"},[e._v("Function")]),e._v(" "),n("div",{staticClass:"list-item-value"},[e._v(e._s(t.name))]),e._v(" "),n("i",{staticClass:"el-icon-delete",on:{click:function(n){return n.stopPropagation(),e.handleEventDialogDelete(t,i)}}})])}))],2),e._v(" "),e.eventsDialog.active?n("div",{staticClass:"detail"},[n("div",[n("span",[e._v("Function Name")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入动作名称",size:"small",disabled:"mounted"===e.eventsDialog.active.name||"refresh"===e.eventsDialog.active.name},model:{value:e.eventsDialog.active.name,callback:function(t){e.$set(e.eventsDialog.active,"name",t)},expression:"eventsDialog.active.name"}})],1),e._v(" "),n("div",[n("div",[e._v("\n function(\n "+e._s("mounted"!==e.eventsDialog.active.name&&"refresh"!==e.eventsDialog.active.name?"item,value":"")+"\n ) {\n\n "),n("el-popover",{attrs:{placement:"top-start",title:"可用Api",width:"200",trigger:"hover"}},[n("i",{staticClass:"el-icon-question",staticStyle:{float:"right"},attrs:{slot:"reference"},slot:"reference"}),e._v(" "),n("div",{staticClass:"functions"},[n("div",[e._v("setData")]),e._v(" "),n("div",[e._v("getData")]),e._v(" "),n("div",[e._v("display")]),e._v(" "),n("div",[e._v("hide")])])])],1),e._v(" "),n("th-code-editor",{ref:"codeEditor",staticStyle:{height:"calc(100% - 48px)"},attrs:{completions:e.aceCompletions},model:{value:e.eventsDialog.active.func,callback:function(t){e.$set(e.eventsDialog.active,"func",t)},expression:"eventsDialog.active.func"}}),e._v(" "),n("div",[e._v("}")])],1)]):e._e()]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:function(t){e.eventsDialog.visible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.handleEventDialogAffirm}},[e._v("保 存")])],1)])],1):e._e()}),[],!1,(function(e){n(257)}),"data-v-4d5ac79d",null).exports;var Q=Object(l.a)({props:["data"]},(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"form-config-container"},[t("el-form",{attrs:{"label-position":"top"}},[t("el-form-item",{attrs:{label:"UI"}},[t("el-radio-group",{model:{value:e.data.ui,callback:function(t){e.$set(e.data,"ui",t)},expression:"data.ui"}},[t("el-radio-button",{attrs:{label:"element"}},[e._v("Element")]),e._v(" "),t("el-radio-button",{attrs:{label:"vant",disabled:""}},[e._v("Vant")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"表单标题",required:""}},[t("el-input",{attrs:{placeholder:"请输入",clearable:""},model:{value:e.data.title,callback:function(t){e.$set(e.data,"title",t)},expression:"data.title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"表单宽度"}},[t("el-input",{model:{value:e.data.width,callback:function(t){e.$set(e.data,"width",t)},expression:"data.width"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"表单标签宽度"}},[t("el-input-number",{attrs:{min:0,max:200,step:10},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"标签对齐方式"}},[t("el-radio-group",{model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[t("el-radio-button",{attrs:{label:"left"}},[e._v("左对齐")]),e._v(" "),t("el-radio-button",{attrs:{label:"right"}},[e._v("右对齐")]),e._v(" "),t("el-radio-button",{attrs:{label:"top"}},[e._v("顶部对齐")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"组件尺寸"}},[t("el-radio-group",{model:{value:e.data.size,callback:function(t){e.$set(e.data,"size",t)},expression:"data.size"}},[t("el-radio-button",{attrs:{label:"medium"}},[e._v("medium")]),e._v(" "),t("el-radio-button",{attrs:{label:"small"}},[e._v("small")]),e._v(" "),t("el-radio-button",{attrs:{label:"mini"}},[e._v("mini")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"操作属性"}},[t("el-checkbox",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}},[e._v("禁用 ")]),e._v(" "),t("el-checkbox",{model:{value:e.data.hideLabel,callback:function(t){e.$set(e.data,"hideLabel",t)},expression:"data.hideLabel"}},[e._v("隐藏标签 ")])],1)],1)],1)}),[],!1,null,null,null).exports,ee=n(15),te=(ee={components:{Draggable:H.a,WidgetFormItem:ee.a,ThEmpty:b},props:["data","select","client"],data:function(){return{selectWidget:this.select,config:{}}},watch:{select:function(e){this.selectWidget=e},selectWidget:{handler:function(e){this.$emit("update:select",e)},deep:!0}},computed:{widgetList:function(){return this.data.list.filter((function(e){return e.key}))},formWidth:function(){return this.data.config.width||("mobile"===this.client?"375px":"")}},mounted:function(){document.body.ondrop=function(e){var t=navigator.userAgent;("string"==typeof t?-1<t.toLowerCase().indexOf("firefox"):-1<t.indexOf("firefox"))&&(e.preventDefault(),e.stopPropagation())}},methods:{handleMoveEnd:function(e){e.newIndex,e.oldIndex},handleSelectWidget:function(e){this.selectWidget=this.data.list[e]},handleWidgetAdd:function(e){var t=e.newIndex,n=(e=(e.to,Date.parse(new Date)+"_"+Math.ceil(99999*Math.random())),JSON.parse(JSON.stringify(this.data.list[t])));n.key=e,n.model=n.type+"_"+e,n.rules=[],this.$set(this.data.list,t,n),this.selectWidget=this.data.list[t]}}},ee=Object(l.a)(ee,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"formContainer",staticClass:"widget-form-container"},[0==e.data.list.length?i("th-empty",{staticClass:"form-empty",attrs:{image:n(116),description:"从左侧拖拽来添加字段"}}):e._e(),e._v(" "),i("el-form",{class:{"form-hideLabel":e.data.config.hideLabel},staticStyle:{margin:"0 auto",padding:"5px",height:"100%"},style:{width:e.formWidth},attrs:{size:e.data.config.size,"label-suffix":e.data.config.labelSuffix,"label-position":e.data.config.labelPosition,"label-width":e.data.config.labelWidth+"px",disabled:e.data.config.disabled}},[i("draggable",e._b({staticStyle:{height:"100%"},on:{end:e.handleMoveEnd,add:e.handleWidgetAdd},model:{value:e.data.list,callback:function(t){e.$set(e.data,"list",t)},expression:"data.list"}},"draggable",{group:"people",ghostClass:"ghost",animation:200,handle:".drag-widget"},!1),[i("transition-group",{staticClass:"widget-form-list",attrs:{name:"fade",tag:"div"}},e._l(e.widgetList,(function(t,n){return i("widget-form-item",{key:t.key,attrs:{widget:t,widgetIndex:n,widgetArray:e.data,config:e.data.config,select:e.selectWidget},on:{"update:select":function(t){e.selectWidget=t}}})})),1)],1)],1)],1)}),[],!1,null,null,null).exports,n(60));function ne(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}te={name:"thFormGenerate",components:{GenetateFormItem:Object(l.a)(te.a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:!e.widget.options.hidden,expression:"!widget.options.hidden"}],ref:e.widget.model,class:((t={})[e.widget.model]=!0,t["widget-form-list-"+e.widget.type]=!0,t),attrs:{label:e.widget.options.hideLabel?"":e.widget.name,"label-width":e.labelWidth,prop:e.prop||e.widget.model,rules:e.widget.rules}},["input"==e.widget.type?["number"==e.widget.options.dataType||"integer"==e.widget.options.dataType||"float"==e.widget.options.dataType?n("el-input",{style:{width:e.widget.options.width},attrs:{type:"number",placeholder:e.widget.options.placeholder,disabled:e.widget.options.disabled,readonly:e.widget.options.readonly,clearable:e.widget.options.clearable,maxlength:e.widget.options.maxlength,"show-word-limit":e.widget.options.showWordLimit,"show-password":e.widget.options.showPassword},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=e._n(t)},expression:"dataModel"}}):n("el-input",{style:{width:e.widget.options.width},attrs:{type:"text",placeholder:e.widget.options.placeholder,disabled:e.widget.options.disabled,readonly:e.widget.options.readonly,clearable:e.widget.options.clearable,maxlength:e.widget.options.maxlength,"show-word-limit":e.widget.options.showWordLimit,"show-password":e.widget.options.showPassword,"suffix-icon":e.widget.options.suffixIcon,"prefix-icon":e.widget.options.prefixIcon},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.prepend?n("template",{slot:"prepend"},[e._v(e._s(e.widget.options.prepend))]):e._e(),e._v(" "),e.widget.options.append?n("template",{slot:"append"},[e._v(e._s(e.widget.options.append))]):e._e()],2)]:e._e(),e._v(" "),"textarea"==e.widget.type?[n("el-input",{style:{width:e.widget.options.width},attrs:{type:"textarea",disabled:e.widget.options.disabled,placeholder:e.widget.options.placeholder,maxlength:e.widget.options.maxlength,clearable:e.widget.options.clearable,"show-word-limit":e.widget.options.showWordLimit,autosize:{minRows:e.widget.options.minRows,maxRows:e.widget.options.maxRows}},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"cell"==e.widget.type?[n("th-cell",{attrs:{title:e.widget.options.title,value:e.widget.options.value,label:e.widget.options.label}})]:e._e(),e._v(" "),"number"==e.widget.type?[n("el-input-number",{style:{width:e.widget.options.width},attrs:{step:e.widget.options.step,"controls-position":e.widget.options.controlsPosition?"right":"",disabled:e.widget.options.disabled,min:e.widget.options.min,max:e.widget.options.max,precision:e.widget.options.precision},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"text"==e.widget.type?[n("div",{style:{height:e.widget.options.height,textAlign:e.widget.options.textAlign},domProps:{innerHTML:e._s(e.dataModel)}})]:e._e(),e._v(" "),"radio"==e.widget.type?[n("el-radio-group",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.buttonType?e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-radio-button",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)})):e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-radio",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)}))],2)]:e._e(),e._v(" "),"checkbox"==e.widget.type?[n("el-checkbox-group",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled,min:e.widget.options.min,max:e.widget.options.max},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.buttonType?e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-checkbox-button",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)})):e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-checkbox",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)}))],2)]:e._e(),e._v(" "),"time"==e.widget.type?[n("el-time-picker",{style:{width:e.widget.options.width},attrs:{"is-range":e.widget.options.isRange,placeholder:e.widget.options.placeholder,"start-placeholder":e.widget.options.startPlaceholder,"end-placeholder":e.widget.options.endPlaceholder,readonly:e.widget.options.readonly,disabled:e.widget.options.disabled,editable:e.widget.options.editable,clearable:e.widget.options.clearable,arrowControl:e.widget.options.arrowControl,"value-format":e.widget.options.format,"picker-options":{selectableRange:e.widget.options.pickerOptions.selectableRange[0]+" - "+e.widget.options.pickerOptions.selectableRange[1]}},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"date"==e.widget.type?[n("el-date-picker",{style:{width:e.widget.options.width},attrs:{type:e.widget.options.type,"is-range":e.widget.options.isRange,placeholder:e.widget.options.placeholder,"start-placeholder":e.widget.options.startPlaceholder,"end-placeholder":e.widget.options.endPlaceholder,readonly:e.widget.options.readonly,disabled:e.widget.options.disabled,editable:e.widget.options.editable,clearable:e.widget.options.clearable,"value-format":e.widget.options.format},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"select"==e.widget.type?[n("el-select",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled,multiple:e.widget.options.multiple,clearable:e.widget.options.clearable,placeholder:e.widget.options.placeholder,collapseTags:e.widget.options.collapseTags,allowCreate:e.widget.options.allowCreate,filterable:!!e.widget.options.allowCreate||e.widget.options.filterable},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t){return n("el-option",{key:t.value,attrs:{value:t.value,label:e.widget.options.showLabel||e.widget.options.remote?t.label:t.value}})})),1)]:e._e(),e._v(" "),"color"==e.widget.type?[n("el-color-picker",{attrs:{disabled:e.widget.options.disabled,"show-alpha":e.widget.options.showAlpha},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"switch"==e.widget.type?[n("el-switch",{attrs:{width:e.widget.options.width-20,disabled:e.widget.options.disabled,"inactive-text":e.widget.options.switchInactiveText,"active-text":e.widget.options.switchActiveText,"inactive-color":e.widget.options.switchInactiveColor,"active-color":e.widget.options.switchActiveColor},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"button"==e.widget.type?[n("el-button",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{size:e.widget.options.buttonSize,type:e.widget.options.buttonType,plain:e.widget.options.buttonPlain,round:e.widget.options.buttonRound,circle:e.widget.options.buttonCircle,loading:e.widget.options.loading,disabled:e.widget.options.disabled,icon:e.widget.options.buttonIcon},on:{click:function(t){return e.handleEventAction(e.widget.events.onClick)}}},[e._v(e._s(e.widget.options.defaultValue))])]:e._e(),e._v(" "),"slider"==e.widget.type?[n("el-slider",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{min:e.widget.options.min,max:e.widget.options.max,disabled:e.widget.options.disabled,step:e.widget.options.step,"show-input":e.widget.options.showInput,range:e.widget.options.range,"show-tooltip":e.widget.options.showTooltip,"format-tooltip":function(t){return e.formatTooltip(t,e.widget.options.formatTooltip)},"show-stops":e.widget.options.showStops,vertical:e.widget.options.vertical},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"rate"==e.widget.type?[n("el-rate",{attrs:{max:e.widget.options.max,disabled:e.widget.options.disabled,"allow-half":e.widget.options.allowHalf,"show-text":e.widget.options.showText,texts:e.widget.options.auxiliaryValue},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"filler"==e.widget.type?[n("div",{style:{width:e.widget.options.width,height:e.widget.options.height}})]:e._e(),e._v(" "),"image"==e.widget.type?[n("th-image",{attrs:{src:e.widget.options.defaultValue,height:e.widget.options.height,width:e.widget.options.width,fit:e.widget.options.fit}})]:e._e(),e._v(" "),"upload"==e.widget.type?[n("el-upload",{staticClass:"upload-demo",attrs:{action:e.widget.options.remoteFunc,"on-preview":function(t){return e.handlePictureCardPreview(t,e.widget.options.listType)},"on-remove":e.handleRemove,multiple:e.widget.options.multiple,limit:e.widget.options.length,width:e.widget.options.size.width,height:e.widget.options.size.height,"list-type":e.widget.options.listType,"on-change":e.handleAvatar,"on-error":e.handleAvatarError,drag:e.widget.options.drag,disabled:e.widget.options.disabled,"auto-upload":!1}},[["default","picture"].includes(e.widget.options.listType)&&!e.widget.options.drag?n("el-button",{attrs:{size:"small",type:"primary",disabled:e.widget.options.disabled}},[e._v("点击上传")]):e._e(),e._v(" "),"picture-card"!==e.widget.options.listType||e.widget.options.drag?e._e():n("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"}),e._v(" "),e.widget.options.drag?n("i",{staticClass:"el-icon-upload"}):e._e(),e._v(" "),e.widget.options.drag?n("div",{staticClass:"el-upload__text"},[e._v("\n 将文件拖到此处,或"),n("em",[e._v("点击上传")])]):e._e(),e._v(" "),n("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},domProps:{innerHTML:e._s(e.widget.options.elUploadTip)},slot:"tip"})],1)]:e._e(),e._v(" "),"editor"==e.widget.type?[n("vue-editor",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"cascader"==e.widget.type?[n("el-cascader",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{disabled:e.widget.options.disabled,clearable:e.widget.options.clearable,placeholder:e.widget.options.placeholder,options:e.widget.options.remoteOptions,props:e.widget.options.props,"show-all-levels":!e.widget.options.showAllLevels,"collapse-tags":e.widget.options.collapseTags,filterable:e.widget.options.filterable},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},scopedSlots:e._u([{key:"default",fn:function(t){return t=t.data,[n("span",{domProps:{innerHTML:e._s(e.widget.options.prepend)}}),e._v(" "),n("span",[e._v(e._s(t.label))]),e._v(" "),n("span",{domProps:{innerHTML:e._s(e.widget.options.append)}})]}}],null,!1,1426148692),model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"blank"==e.widget.type?[e._t(e.widget.model)]:e._e(),e._v(" "),"table"==e.widget.type?[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataModel,stripe:e.widget.options.stripe,"show-header":e.widget.options.showHeader,"highlight-current-row":e.widget.options.highlightCurrentRow,border:e.widget.options.border}},[e.widget.options.isSerial?n("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center"}}):e._e(),e._v(" "),e._l(e.widget.list,(function(t){return n("el-table-column",{key:"table_"+t.key,attrs:{label:t.name,prop:t.model,width:t.options.width},scopedSlots:e._u([{key:"default",fn:function(i){return[n("genetate-form-item",{attrs:{models:e.dataModel[i.$index],widget:t,remote:e.remote,config:e.config,prop:e.prop+"."+i.$index+"."+t.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(t){return e.$set(e.dataModel,i.$index,t)}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)]}}],null,!0)})})),e._v(" "),e.widget.options.isDelete?n("el-table-column",{attrs:{fixed:"right",label:"操作",width:"60",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{staticStyle:{color:"#F56C6C"},attrs:{type:"text"},nativeOn:{click:function(n){return n.preventDefault(),e.handleTableDelete(t.$index)}}},[e._v("\n 移除\n ")])]}}],null,!1,4146503235)}):e._e(),e._v(" "),e.widget.options.isAdd?n("template",{slot:"append"},[n("div",{staticStyle:{"text-align":"center"},style:{borderTop:e.dataModel&&0!=e.dataModel.length?"":"1px solid #EBEEF5"}},[n("el-button",{attrs:{type:"text",disabled:e.widget.options.disabled},on:{click:e.handleTableAdd}},[e._v("新增")])],1)]):e._e()],2)]:e._e(),e._v(" "),"table_h5"==e.widget.type?[n("div",{staticClass:"tableH5"},[e._l(e.dataModel,(function(t,i){return n("div",{key:"table_h5_"+i,staticClass:"tableH5-item"},e._l(e.widget.list,(function(o,r){return n("div",{key:"table_h5_"+i+"_"+o.key},[n("genetate-form-item",{staticStyle:{flex:"1"},attrs:{models:t,widget:o,remote:e.remote,config:e.config,prop:"grid"===o.type?e.prop+"."+i:e.prop+"."+i+"."+o.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(e){t=e}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2),e._v(" "),e.widget.options.isDelete&&0===r&&i>=e.widget.options.deleteIndex?n("div",{staticClass:"actions"},[n("el-button",{attrs:{type:"danger"},nativeOn:{click:function(t){return t.preventDefault(),e.handleTableDelete(i)}}},[e._v(e._s(e.widget.options.deleteButtonText))])],1):e._e()],1)})),0)})),e._v(" "),e.widget.options.isAdd?n("div",{staticStyle:{"text-align":"center"}},[n("el-button",{attrs:{type:"text",disabled:e.widget.options.disabled},on:{click:e.handleTableAdd}},[e._v(e._s(e.widget.options.addButtonText))])],1):e._e()],2)]:e._e(),e._v(" "),"grid"==e.widget.type?[n("th-row",{attrs:{gutter:e.widget.options.gutter||0,justify:e.widget.options.justify,align:e.widget.options.align}},e._l(e.widget.columns,(function(t,i){return n("th-col",{key:i,attrs:{span:t.span}},e._l(t.list,(function(t){return n("genetate-form-item",{key:t.key,attrs:{widget:t,models:e.models,config:e.config,remote:e.remote,prop:e.prop?e.prop+"."+t.model:t.model,slotKeys:e.slotKeys,componentsData:e.componentsData}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)})),1)]:e._e(),e._v(" "),"tabs"==e.widget.type?[n("el-tabs",{model:{value:e.widget.options.defaultValue,callback:function(t){e.$set(e.widget.options,"defaultValue",t)},expression:"widget.options.defaultValue"}},e._l(e.widget.tabs,(function(t,i){return n("el-tab-pane",{key:"tabs_"+i,attrs:{label:t.label,name:t.value}},e._l(t.list,(function(o){return n("genetate-form-item",{key:"tabs_"+i+"_"+o.key,attrs:{widget:o,models:e.dataModel[t.value],config:e.config,remote:e.remote,prop:"grid"===o.type?e.prop+"."+t.value:e.prop+"."+t.value+"."+o.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(n){return e.$set(e.dataModel,t.value,n)}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)})),1)]:e._e(),e._v(" "),"divider"==e.widget.type?[n("el-divider",{attrs:{"content-position":e.widget.options.contentPosition}},[e._v("\n "+e._s(e.widget.options.defaultValue)+"\n ")])]:e._e(),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],2)}),[],!1,null,null,null).exports},props:{data:{type:Object,default:function(){return{}}},remoteData:{type:Object,default:function(){return{}}},value:{type:Object,default:function(){return{}}},slotKeys:{type:Array,default:function(){return[]}},client:String},data:function(){return{formJson:this.data,models:{},componentsData:[]}},computed:{formWidth:function(){return this.formJson.config.width||("mobile"===this.client?"375px":"")}},watch:{data:function(e){this.formJson=e},formJson:{handler:function(e){this.$emit("update:data",e)},deep:!0},value:{deep:!0,handler:function(e){this.models=ie(ie({},this.models),e)}}},created:function(){this.generateModle(this.formJson.list)},mounted:function(){},methods:{generateModle:function(e,t){var n=this;e&&e.map((function(e){"grid"===e.type?e.columns.forEach((function(e){n.generateModle(e.list,t)})):"tabs"===e.type?t?(n.$set(t,e.model,{}),e.tabs.forEach((function(i){n.$set(t[e.model],i.value,{}),n.generateModle(i.list,t[e.model][i.value])}))):(n.$set(n.models,e.model,{}),e.tabs.forEach((function(t){n.$set(n.models[e.model],t.value,{}),n.generateModle(t.list,n.models[e.model][t.value])}))):"table"===e.type||"table_h5"===e.type?t?(n.$set(t,e.model,JSON.parse(e.options.defaultValue||"[]")),n.generateModle(e.list,t[e.model])):(n.$set(n.models,e.model,JSON.parse(e.options.defaultValue||"[]")),n.generateModle(e.list,n.models[e.model])):(t?t[e.model]||n.$set(t,e.model,e.options.defaultValue):n.value&&0<=Object.keys(n.value).indexOf(e.model)?n.$set(n.models,e.model,n.value[e.model]):"blank"===e.type?n.$set(n.models,e.model,"String"===e.options.defaultType?"":"Object"===e.options.defaultType?{}:[]):n.$set(n.models,e.model,JSON.parse(JSON.stringify(e.options.defaultValue))),n.generateRules(e))}))},generateRules:function(e){e.rules||(e.rules=[]),e.rules.forEach((function(e){e.pattern&&(e.pattern=new RegExp(e.pattern))}))},getData:function(){var e=this;return new Promise((function(t,n){e.$refs.generateForm.validate((function(i){i?t(e.models):n(new Error("表单数据校验失败").message)}))}))},reset:function(){this.$refs.generateForm.resetFields()},onInputChange:function(e,t){this.$emit("on-change",t,e,this.models)},setJSON:function(e){this.formJson=e,this.generateModle(this.formJson.list)}}};var oe=Object(l.a)(te,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.formJson.config?n("div",[n("el-form",{ref:"generateForm",staticClass:"generateForm",class:{"form-hideLabel":e.formJson.config.hideLabel},style:{width:e.formWidth},attrs:{"label-suffix":e.formJson.config.labelSuffix,size:e.formJson.config.size,model:e.models,"label-position":e.formJson.config.labelPosition,"label-width":e.formJson.config.labelWidth+"px"}},e._l(e.formJson.list,(function(t){return n("genetate-form-item",{key:t.key,attrs:{models:e.models,widget:t,slotKeys:e.slotKeys,remote:e.remoteData,config:e.formJson.config,prop:"grid"===t.type?"":t.model,componentsData:e.componentsData},on:{"update:models":function(t){e.models=t},"input-change":e.onInputChange}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)],1):e._e()}),[],!1,(function(e){n(370)}),"data-v-0dadcd32",null).exports;function re(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}var ae=[{name:"单行文本",type:"input",icon:"icon-input",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"string",pattern:"",placeholder:"",maxlength:-1,required:!1,disabled:!1,readonly:!1,clearable:!1,showWordLimit:!1,showPassword:!1,prefixIcon:"",suffixIcon:"",prepend:"",append:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""},rules:[]},{name:"多行文本",type:"textarea",icon:"icon-diy-com-textarea",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"string",pattern:"",placeholder:"",maxlength:-1,rows:2,showWordLimit:!1,minRows:2,maxRows:5,required:!1,disabled:!1,readonly:!1,clearable:!1,hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"单元格",type:"cell",icon:"icon-ic",options:{width:"100%",height:"40px",labelWidth:100,isLabelWidth:!1,title:"标题",value:"内容",label:"副标题",defaultValue:"",customClass:"",textAlign:"right",hidden:!1,hideLabel:!1}},{name:"文字",type:"text",icon:"icon-wenzishezhi-",options:{width:"100%",height:"",labelWidth:100,isLabelWidth:!1,defaultValue:"",customClass:"",textAlign:"left",hidden:!1,hideLabel:!1}},{name:"单选框组",type:"radio",icon:"icon-radio-active",options:{width:"",labelWidth:100,isLabelWidth:!1,inline:!1,defaultValue:"",showLabel:!1,options:[{value:"Option 1",label:"Option 1"},{value:"Option 2",label:"Option 2"},{value:"Option 3",label:"Option 3"}],required:!1,remote:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",disabled:!1,border:!1,buttonType:!1},events:{onChange:""}},{name:"多选框组",type:"checkbox",icon:"icon-check-box",options:{width:"",labelWidth:100,isLabelWidth:!1,inline:!1,defaultValue:[],showLabel:!1,options:[{value:"Option 1"},{value:"Option 2"},{value:"Option 3"}],required:!1,remote:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",disabled:!1,border:!1,buttonType:!1,min:0,max:0,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"时间选择器",type:"time",icon:"icon-time",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"00:00:00",placeholder:"",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!0,format:"HH:mm:ss",pickerOptions:{selectableRange:["00:00:00","23:59:59"]},readonly:!1,disabled:!1,editable:!0,clearable:!0,required:!1,hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"日期选择器",type:"date",icon:"icon-date",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",readonly:!1,disabled:!1,editable:!0,clearable:!0,placeholder:"",startPlaceholder:"",endPlaceholder:"",type:"date",format:"yyyy-MM-dd",timestamp:!1,required:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"下拉选择框",type:"select",icon:"icon-select",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",multiple:!1,disabled:!1,clearable:!1,placeholder:"",required:!1,showLabel:!1,collapseTags:!1,allowCreate:!1,options:[{value:"Option 1"},{value:"Option 2"},{value:"Option 3"}],remote:!1,filterable:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"颜色选择器",type:"color",icon:"icon-color",options:{labelWidth:100,isLabelWidth:!1,defaultValue:"",predefine:["#1989FA","#67C23A","#FF976A","#EE0A24","#000000","#333333","#666666","#999999","#FFFFFF"],disabled:!1,showAlpha:!1,required:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"开关",type:"switch",icon:"icon-switch",options:{width:70,labelWidth:100,isLabelWidth:!1,defaultValue:!1,switchInactiveText:"",switchActiveText:"",switchInactiveColor:"#C0CCDA",switchActiveColor:"#409EFF",required:!1,disabled:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"按钮",type:"button",icon:"icon-ic",options:{customClass:"",defaultValue:"Button",width:"",height:"",labelWidth:100,isLabelWidth:!1,dataBind:!1,buttonSize:"small",buttonType:"",buttonPlain:!1,buttonRound:!1,buttonCircle:!1,buttonIcon:"",textAlign:"center",remoteFunc:"",remoteOption:"",tableColumn:!1,disabled:!1,loading:!1,hidden:!1,hideLabel:!1},events:{onClick:""},rules:[]},{name:"计数器",type:"number",icon:"icon-number",options:(re(te={width:"",labelWidth:100,isLabelWidth:!1,required:!1,defaultValue:0,min:1,max:2,step:1,disabled:!1,controlsPosition:!1},"step",1),re(te,"precision",1),re(te,"hidden",!1),re(te,"hideLabel",!1),te),events:{onChange:"",onFocus:"",onBlur:""}},{name:"滑块",type:"slider",icon:"icon-slider",options:{width:"100%",height:"40px",labelWidth:100,isLabelWidth:!1,defaultValue:0,disabled:!1,required:!1,min:0,max:100,step:1,showInput:!1,range:!1,vertical:!1,showTooltip:!0,formatTooltip:1,showStops:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"评分",type:"rate",icon:"icon-pingfen1",options:{labelWidth:100,isLabelWidth:!1,defaultValue:0,max:5,disabled:!1,allowHalf:!1,required:!1,showText:!1,hidden:!1,hideLabel:!1,auxiliaryValue:["极差","失望","一般","满意","惊喜"]},events:{onChange:""}},{name:"填充物",type:"filler",icon:"icon-ic",options:{defaultValue:"",width:"100%",height:"20px"}},{name:"图片",type:"image",icon:"icon-ic",options:{defaultValue:"https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",defaultValueArr:[{url:"https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"},{url:"https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg"},{url:"https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg"}],remote:!1,width:"",height:"200px",fit:"fill",borderRadius:"",displayStyle:"inline-block",errorSrc:"",isLoding:!1,hidden:!1,hideLabel:!1}},{name:"文件",type:"upload",icon:"icon-tupian",options:(re(te={width:"",labelWidth:100,isLabelWidth:!1,defaultValue:[],size:{width:100,height:100},tokenFunc:"funcGetToken",token:"",domain:"https://tcdn.form.making.link/",disabled:!1,length:8,autoUpload:!1,isQiniu:!1,min:0,remoteFunc:"https://jsonplaceholder.typicode.com/posts/",action:"https://jsonplaceholder.typicode.com/posts/",remoteApi:{}},"disabled",!1),re(te,"required",!1),re(te,"multiple",!1),re(te,"elUploadTip",""),re(te,"listType","default"),re(te,"drag",!1),te)},{name:"编辑器",type:"editor",icon:"icon-fuwenbenkuang",options:{width:"100%",height:"",labelWidth:100,isLabelWidth:!1,defaultValue:"",disabled:!1,required:!1,hidden:!1,hideLabel:!1}},{name:"级联选择器",type:"cascader",icon:"icon-jilianxuanze",options:{width:"",labelWidth:100,isLabelWidth:!1,defaultValue:[],placeholder:"",disabled:!1,clearable:!1,required:!1,remote:!0,showAllLevels:!1,collapseTags:!1,filterable:!1,prepend:"",append:"",remoteOptions:[],props:{value:"value",label:"label",children:"children",multiple:!1,expandTrigger:"hover",checkStrictly:!1},remoteFunc:"",hidden:!1,hideLabel:!1},events:{onChange:""}}],se=[{name:"子表单",type:"table",icon:"icon-table",options:{height:"",defaultValue:"",customClass:"",labelWidth:100,isLabelWidth:!1,dataBind:!0,validatorCheck:!1,validator:"",paging:!1,pageSize:5,remoteFunc:"",remoteOption:"",tableColumn:!1,hidden:!1,hideLabel:!1,disabled:!1,required:!1,isAdd:!0,isDelete:!0,isSerial:!0,border:!1,stripe:!1,showHeader:!0,highlightCurrentRow:!1},list:[]},{name:"子表单H5",type:"table_h5",icon:"icon-table",options:{defaultValue:"",customClass:"",labelWidth:100,isLabelWidth:!1,dataBind:!0,validatorCheck:!1,validator:"",paging:!1,pageSize:5,remoteFunc:"",remoteOption:"",tableColumn:!1,hidden:!1,hideLabel:!1,disabled:!1,required:!1,isAdd:!0,addButtonText:"新增",isDelete:!0,deleteButtonText:"删除",deleteIndex:0},list:[]},{name:"标签页",type:"tabs",icon:"icon-tabs",tabs:[{label:"选项1",value:"tab1",list:[]},{label:"选项2",value:"tab2",list:[]}],options:{defaultValue:"tab1",type:"",tabPosition:"top",customClass:"",hidden:!1,labelWidth:100,isLabelWidth:!1,hideLabel:!0,remote:!1,remoteFunc:"",remoteOption:"",tableColumn:!1},rules:[]},{name:"自定义区域",type:"blank",icon:"icon-zidingyishuju",options:{defaultType:"String",required:!1}}],le=[{name:"栅格布局",type:"grid",icon:"icon-grid-",columns:[{span:12,list:[]},{span:12,list:[]}],options:{gutter:0,justify:"start",align:"top",hideLabel:!0}},{name:"浮动布局",type:"alliance",icon:"icon-grid-",columns:[{span:12,list:[]},{span:12,list:[]}],options:{gutter:0,justify:"start",align:"top",hideLabel:!0}},{name:"分割线",type:"divider",icon:"icon-fengexian",options:{width:"100%",defaultValue:"",hidden:!1,labelWidth:100,isLabelWidth:!1,hideLabel:!0,contentPosition:"left",remoteFunc:"",remoteOption:"",tableColumn:!1},rules:[]}],ce={ui:"element",title:"",width:"",labelWidth:100,labelPosition:"right",labelSuffix:":",size:"small",disabled:!1,hideLabel:!1,eventScript:[{key:"mounted",name:"mounted",func:""},{key:"refresh",name:"refresh",func:""}]},ue=(te=n(63),n.n(te)),de=((te=ue.a.create({withCredentials:!1})).interceptors.request.use((function(e){return e}),(function(e){return console.log("error",e),Promise.reject(new Error(e).message)})),te.interceptors.response.use((function(e){return console.log(".....",e),e.data}),(function(e){return console.log("error",e),Promise.reject(new Error(e).message)})),te);function he(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"vue",n=[],i=[],o=[],r=(function e(t,n,i,o){for(var r=0;r<t.length;r++)"grid"==t[r].type?t[r].columns.forEach((function(t){e(t.list,n,i,o)})):"tabs"==t[r].type?t[r].tabs.forEach((function(t){e(t.list,n,i,o)})):"table"==t[r].type?e(t[r].list,n,i,o):"blank"==t[r].type?t[r].model&&o.push({name:t[r].model,label:t[r].name}):"upload"==t[r].type?t[r].options.tokenFunc&&i.push({func:t[r].options.tokenFunc,label:t[r].name,model:t[r].model}):t[r].options.remote&&t[r].options.remoteFunc&&n.push({func:t[r].options.remoteFunc,label:t[r].name,model:t[r].model})}(JSON.parse(e).list,n,i,o),""),a="",s=0;s<n.length;s++)r+="\n ".concat(n[s].func," (resolve) {\n // ").concat(n[s].label," ").concat(n[s].model,"\n // Call callback function once get the data from remote server\n // resolve(data)\n },\n ");for(var l=0;l<i.length;l++)r+="\n ".concat(i[l].func," (resolve) {\n // ").concat(i[l].label," ").concat(i[l].model,"\n // Call callback function once get the token\n // resolve(token)\n },\n ");for(var c=0;c<o.length;c++)a+='\n <template slot="'.concat(o[c].name,'" slot-scope="scope">\n \x3c!-- ').concat(o[c].label,' --\x3e\n \x3c!-- use v-model="scope.model.').concat(o[c].name,'" to bind data --\x3e\n </template>\n ');return"vue"==t?'\n<template>\n <div>\n <th-generate-form :data="jsonData" :remote="remoteFuncs" :value="editData" ref="generateForm">\n '.concat(a,'\n </th-generate-form>\n <el-button type="primary" @click="handleSubmit">提交</el-button>\n </div>\n</template>\n\n<script>\n export default {\n data () {\n return {\n jsonData: ').concat(e,",\n editData: {},\n remoteFuncs: {\n ").concat(r,"\n }\n }\n },\n methods: {\n handleSubmit () {\n this.$refs.generateForm.getData().then(data => {\n // data check success\n // data - form data\n }).catch(e => {\n // data check failed\n })\n }\n }\n }\n<\/script>"):'<!DOCTYPE html>\n <html>\n <head>\n <meta charset="UTF-8">\n <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">\n <link rel="stylesheet" href="https://unpkg.com/form-making/dist/FormMaking.css">\n </head>\n <body>\n <div id="app">\n <th-generate-form :data="jsonData" :remote="remoteFuncs" :value="editData" ref="generateForm">\n '.concat(a,'\n </th-generate-form>\n <el-button type="primary" @click="handleSubmit">提交</el-button>\n </div>\n <script src="https://unpkg.com/vue/dist/vue.js"><\/script>\n <script src="https://unpkg.com/element-ui/lib/index.js"><\/script>\n <script src="https://unpkg.com/form-making/dist/FormMaking.umd.js"><\/script>\n <script>\n new Vue({\n el: \'#app\',\n data: {\n jsonData: ').concat(e,",\n editData: {},\n remoteFuncs: {\n ").concat(r,"\n }\n },\n methods: {\n handleSubmit () {\n this.$refs.generateForm.getData().then(data => {\n // data check success\n // data - form data\n }).catch(e => {\n // data check failed\n })\n }\n }\n })\n <\/script>\n </body>\n </html>")}var pe=1200,fe=1252,me=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],ge={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},ve=function(e){-1!=me.indexOf(e)&&(fe=ge[0]=e)},be=function(e){ve(pe=e)};
|
114
|
+
*/i="undefined"!=typeof window?window:this,void 0!==(n=function(){return function(e,t){var n=(void 0!==this?this:e).SVG=function(e){if(n.supported)return e=new n.Doc(e),n.parser.draw||n.prepare(),e};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!t.createElementNS&&!!t.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(e){return"Svgjs"+u(e)+n.did++},n.create=function(e){var n=t.createElementNS(this.ns,e);return n.setAttribute("id",this.eid(e)),n},n.extend=function(){var e,t,i,o;for(t=(e=[].slice.call(arguments)).pop(),o=e.length-1;o>=0;o--)if(e[o])for(i in t)e[o].prototype[i]=t[i];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(e){var t="function"==typeof e.create?e.create:function(){this.constructor.call(this,n.create(e.create))};return e.inherit&&(t.prototype=new e.inherit),e.extend&&n.extend(t,e.extend),e.construct&&n.extend(e.parent||n.Container,e.construct),t},n.adopt=function(t){return t?t.instance?t.instance:((i="svg"==t.nodeName?t.parentNode instanceof e.SVGElement?new n.Nested:new n.Doc:"linearGradient"==t.nodeName?new n.Gradient("linear"):"radialGradient"==t.nodeName?new n.Gradient("radial"):n[u(t.nodeName)]?new(n[u(t.nodeName)]):new n.Element(t)).type=t.nodeName,i.node=t,t.instance=i,i instanceof n.Doc&&i.namespace().defs(),i.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),i):null;var i},n.prepare=function(){var e=t.getElementsByTagName("body")[0],i=(e?new n.Doc(e):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:e||t.documentElement,draw:i.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:i.polyline().node,path:i.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},t.addEventListener("DOMContentLoaded",(function(){n.parser.draw||n.prepare()}),!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(e,t){var n,i=e.length,o=[];for(n=0;n<i;n++)o.push(t(e[n]));return o},filter:function(e,t){var n,i=e.length,o=[];for(n=0;n<i;n++)t(e[n])&&o.push(e[n]);return o},radians:function(e){return e%360*Math.PI/180},degrees:function(e){return 180*e/Math.PI%360},filterSVGElements:function(t){return this.filter(t,(function(t){return t instanceof e.SVGElement}))}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(e){var t;this.r=0,this.g=0,this.b=0,e&&("string"==typeof e?n.regex.isRgb.test(e)?(t=n.regex.rgb.exec(e.replace(n.regex.whitespace,"")),this.r=parseInt(t[1]),this.g=parseInt(t[2]),this.b=parseInt(t[3])):n.regex.isHex.test(e)&&(t=n.regex.hex.exec(function(e){return 4==e.length?["#",e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(""):e}(e)),this.r=parseInt(t[1],16),this.g=parseInt(t[2],16),this.b=parseInt(t[3],16)):"object"==typeof e&&(this.r=e.r,this.g=e.g,this.b=e.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+d(this.r)+d(this.g)+d(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(e){return this.destination=new n.Color(e),this},at:function(e){return this.destination?(e=e<0?0:e>1?1:e,new n.Color({r:~~(this.r+(this.destination.r-this.r)*e),g:~~(this.g+(this.destination.g-this.g)*e),b:~~(this.b+(this.destination.b-this.b)*e)})):this}}),n.Color.test=function(e){return e+="",n.regex.isHex.test(e)||n.regex.isRgb.test(e)},n.Color.isRgb=function(e){return e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b},n.Color.isColor=function(e){return n.Color.isRgb(e)||n.Color.test(e)},n.Array=function(e,t){0==(e=(e||[]).valueOf()).length&&t&&(e=t.valueOf()),this.value=this.parse(e)},n.extend(n.Array,{morph:function(e){if(this.destination=this.parse(e),this.value.length!=this.destination.length){for(var t=this.value[this.value.length-1],n=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(n);for(;this.value.length<this.destination.length;)this.value.push(t)}return this},settle:function(){for(var e=0,t=this.value.length,n=[];e<t;e++)-1==n.indexOf(this.value[e])&&n.push(this.value[e]);return this.value=n},at:function(e){if(!this.destination)return this;for(var t=0,i=this.value.length,o=[];t<i;t++)o.push(this.value[t]+(this.destination[t]-this.value[t])*e);return new n.Array(o)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(e){return e=e.valueOf(),Array.isArray(e)?e:this.split(e)},split:function(e){return e.trim().split(n.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var e=new this.constructor;return e.value=function e(t){for(var n=t.slice(0),i=n.length;i--;)Array.isArray(n[i])&&(n[i]=e(n[i]));return n}(this.value),e}}),n.PointArray=function(e,t){n.Array.call(this,e,t||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var e=0,t=this.value.length,n=[];e<t;e++)n.push(this.value[e].join(","));return n.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(e){if(!this.destination)return this;for(var t=0,i=this.value.length,o=[];t<i;t++)o.push([this.value[t][0]+(this.destination[t][0]-this.value[t][0])*e,this.value[t][1]+(this.destination[t][1]-this.value[t][1])*e]);return new n.PointArray(o)},parse:function(e){var t=[];if(e=e.valueOf(),Array.isArray(e)){if(Array.isArray(e[0]))return e.map((function(e){return e.slice()}));if(null!=e[0].x)return e.map((function(e){return[e.x,e.y]}))}else e=e.trim().split(n.regex.delimiter).map(parseFloat);e.length%2!=0&&e.pop();for(var i=0,o=e.length;i<o;i+=2)t.push([e[i],e[i+1]]);return t},move:function(e,t){var n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(var i=this.value.length-1;i>=0;i--)this.value[i]=[this.value[i][0]+e,this.value[i][1]+t];return this},size:function(e,t){var n,i=this.bbox();for(n=this.value.length-1;n>=0;n--)i.width&&(this.value[n][0]=(this.value[n][0]-i.x)*e/i.width+i.x),i.height&&(this.value[n][1]=(this.value[n][1]-i.y)*t/i.height+i.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(e,t,n){return t.x=n.x=e[0],t.y=n.y=e[1],["M",t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],["L",e[0],e[1]]},H:function(e,t){return t.x=e[0],["H",e[0]]},V:function(e,t){return t.y=e[0],["V",e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],["C",e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],["S",e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],["Q",e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],["T",e[0],e[1]]},Z:function(e,t,n){return t.x=n.x,t.y=n.y,["Z"]},A:function(e,t){return t.x=e[5],t.y=e[6],["A",e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},o="mlhvqtcsaz".split(""),r=0,a=o.length;r<a;++r)i[o[r]]=function(e){return function(t,n,o){if("H"==e)t[0]=t[0]+n.x;else if("V"==e)t[0]=t[0]+n.y;else if("A"==e)t[5]=t[5]+n.x,t[6]=t[6]+n.y;else for(var r=0,a=t.length;r<a;++r)t[r]=t[r]+(r%2?n.y:n.x);return i[e](t,n,o)}}(o[r].toUpperCase());n.PathArray=function(e,t){n.Array.call(this,e,t||[["M",0,0]])},n.PathArray.prototype=new n.Array,n.PathArray.prototype.constructor=n.PathArray,n.extend(n.PathArray,{toString:function(){return function(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t][0],null!=e[t][1]&&(i+=e[t][1],null!=e[t][2]&&(i+=" ",i+=e[t][2],null!=e[t][3]&&(i+=" ",i+=e[t][3],i+=" ",i+=e[t][4],null!=e[t][5]&&(i+=" ",i+=e[t][5],i+=" ",i+=e[t][6],null!=e[t][7]&&(i+=" ",i+=e[t][7])))));return i+" "}(this.value)},move:function(e,t){var n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(var i,o=this.value.length-1;o>=0;o--)"M"==(i=this.value[o][0])||"L"==i||"T"==i?(this.value[o][1]+=e,this.value[o][2]+=t):"H"==i?this.value[o][1]+=e:"V"==i?this.value[o][1]+=t:"C"==i||"S"==i||"Q"==i?(this.value[o][1]+=e,this.value[o][2]+=t,this.value[o][3]+=e,this.value[o][4]+=t,"C"==i&&(this.value[o][5]+=e,this.value[o][6]+=t)):"A"==i&&(this.value[o][6]+=e,this.value[o][7]+=t);return this},size:function(e,t){var n,i,o=this.bbox();for(n=this.value.length-1;n>=0;n--)"M"==(i=this.value[n][0])||"L"==i||"T"==i?(this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x,this.value[n][2]=(this.value[n][2]-o.y)*t/o.height+o.y):"H"==i?this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x:"V"==i?this.value[n][1]=(this.value[n][1]-o.y)*t/o.height+o.y:"C"==i||"S"==i||"Q"==i?(this.value[n][1]=(this.value[n][1]-o.x)*e/o.width+o.x,this.value[n][2]=(this.value[n][2]-o.y)*t/o.height+o.y,this.value[n][3]=(this.value[n][3]-o.x)*e/o.width+o.x,this.value[n][4]=(this.value[n][4]-o.y)*t/o.height+o.y,"C"==i&&(this.value[n][5]=(this.value[n][5]-o.x)*e/o.width+o.x,this.value[n][6]=(this.value[n][6]-o.y)*t/o.height+o.y)):"A"==i&&(this.value[n][1]=this.value[n][1]*e/o.width,this.value[n][2]=this.value[n][2]*t/o.height,this.value[n][6]=(this.value[n][6]-o.x)*e/o.width+o.x,this.value[n][7]=(this.value[n][7]-o.y)*t/o.height+o.y);return this},equalCommands:function(e){var t,i,o;for(e=new n.PathArray(e),o=this.value.length===e.value.length,t=0,i=this.value.length;o&&t<i;t++)o=this.value[t][0]===e.value[t][0];return o},morph:function(e){return e=new n.PathArray(e),this.equalCommands(e)?this.destination=e:this.destination=null,this},at:function(e){if(!this.destination)return this;var t,i,o,r,a=this.value,s=this.destination.value,l=[],c=new n.PathArray;for(t=0,i=a.length;t<i;t++){for(l[t]=[a[t][0]],o=1,r=a[t].length;o<r;o++)l[t][o]=a[t][o]+(s[t][o]-a[t][o])*e;"A"===l[t][0]&&(l[t][4]=+(0!=l[t][4]),l[t][5]=+(0!=l[t][5]))}return c.value=l,c},parse:function(e){if(e instanceof n.PathArray)return e.valueOf();var t,o={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};e="string"==typeof e?e.replace(n.regex.numbersWithDots,l).replace(n.regex.pathLetters," $& ").replace(n.regex.hyphen,"$1 -").trim().split(n.regex.delimiter):e.reduce((function(e,t){return[].concat.call(e,t)}),[]);var r=[],a=new n.Point,s=new n.Point,c=0,u=e.length;do{n.regex.isPathLetter.test(e[c])?(t=e[c],++c):"M"==t?t="L":"m"==t&&(t="l"),r.push(i[t].call(null,e.slice(c,c+=o[t.toUpperCase()]).map(parseFloat),a,s))}while(u>c);return r},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(e,t){this.value=0,this.unit=t||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(t=e.match(n.regex.numberAndUnit))&&(this.value=parseFloat(t[1]),"%"==t[5]?this.value/=100:"s"==t[5]&&(this.value*=1e3),this.unit=t[5]):e instanceof n.Number&&(this.value=e.valueOf(),this.unit=e.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(e){return e=new n.Number(e),new n.Number(this+e,this.unit||e.unit)},minus:function(e){return e=new n.Number(e),new n.Number(this-e,this.unit||e.unit)},times:function(e){return e=new n.Number(e),new n.Number(this*e,this.unit||e.unit)},divide:function(e){return e=new n.Number(e),new n.Number(this/e,this.unit||e.unit)},to:function(e){var t=new n.Number(this);return"string"==typeof e&&(t.unit=e),t},morph:function(e){return this.destination=new n.Number(e),e.relative&&(this.destination.value+=this.value),this},at:function(e){return this.destination?new n.Number(this.destination).minus(this).times(e).plus(this):this}}}),n.Element=n.invent({create:function(e){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=e)&&(this.type=e.nodeName,this.node.instance=this,this._events=e._events||{},this._stroke=e.getAttribute("stroke")||this._stroke)},extend:{x:function(e){return this.attr("x",e)},y:function(e){return this.attr("y",e)},cx:function(e){return null==e?this.x()+this.width()/2:this.x(e-this.width()/2)},cy:function(e){return null==e?this.y()+this.height()/2:this.y(e-this.height()/2)},move:function(e,t){return this.x(e).y(t)},center:function(e,t){return this.cx(e).cy(t)},width:function(e){return this.attr("width",e)},height:function(e){return this.attr("height",e)},size:function(e,t){var i=h(this,e,t);return this.width(new n.Number(i.width)).height(new n.Number(i.height))},clone:function(e){this.writeDataToDom();var t=g(this.node.cloneNode(!0));return e?e.add(t):this.after(t),t},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(e){return this.after(e).remove(),e},addTo:function(e){return e.put(this)},putIn:function(e){return e.add(this)},id:function(e){return this.attr("id",e)},inside:function(e,t){var n=this.bbox();return e>n.x&&t>n.y&&e<n.x+n.width&&t<n.y+n.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var e=this.attr("class");return null==e?[]:e.trim().split(n.regex.delimiter)},hasClass:function(e){return-1!=this.classes().indexOf(e)},addClass:function(e){if(!this.hasClass(e)){var t=this.classes();t.push(e),this.attr("class",t.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter((function(t){return t!=e})).join(" ")),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)},reference:function(e){return n.get(this.attr(e))},parent:function(t){var i=this;if(!i.node.parentNode)return null;if(i=n.adopt(i.node.parentNode),!t)return i;for(;i&&i.node instanceof e.SVGElement;){if("string"==typeof t?i.matches(t):i instanceof t)return i;if(!i.node.parentNode||"#document"==i.node.parentNode.nodeName||"#document-fragment"==i.node.parentNode.nodeName)return null;i=n.adopt(i.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(e){var t=[],n=this;do{if(!(n=n.parent(e))||!n.node)break;t.push(n)}while(n.parent);return t},matches:function(e){return function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}(this.node,e)},native:function(){return this.node},svg:function(e){var i=t.createElement("svg");if(!(e&&this instanceof n.Parent))return i.appendChild(e=t.createElement("svg")),this.writeDataToDom(),e.appendChild(this.node.cloneNode(!0)),i.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");i.innerHTML="<svg>"+e.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var o=0,r=i.firstChild.childNodes.length;o<r;o++)this.node.appendChild(i.firstChild.firstChild);return this},writeDataToDom:function(){(this.each||this.lines)&&(this.each?this:this.lines()).each((function(){this.writeDataToDom()}));return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(e){return this.dom=e,this},is:function(e){return function(e,t){return e instanceof t}(this,e)}}}),n.easing={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)}},n.morph=function(e){return function(t,i){return new n.MorphObj(t,i).at(e)}},n.Situation=n.invent({create:function(e){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(e.duration).valueOf(),this.delay=new n.Number(e.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=e.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(e){this._target=e,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(e,t,i){"object"==typeof e&&(t=e.ease,i=e.delay,e=e.duration);var o=new n.Situation({duration:e||1e3,delay:i||0,ease:n.easing[t||"-"]||t});return this.queue(o),this},delay:function(e){var t=new n.Situation({duration:e,delay:0,ease:n.easing["-"]});return this.queue(t)},target:function(e){return e&&e instanceof n.Element?(this._target=e,this):this._target},timeToAbsPos:function(e){return(e-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(e){return this.situation.duration/this._speed*e+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(e){return("function"==typeof e||e instanceof n.Situation)&&this.situations.push(e),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var e,t,i,o=this.situation;if(o.init)return this;for(e in o.animations)for(i=this.target()[e](),Array.isArray(i)||(i=[i]),Array.isArray(o.animations[e])||(o.animations[e]=[o.animations[e]]),t=i.length;t--;)o.animations[e][t]instanceof n.Number&&(i[t]=new n.Number(i[t])),o.animations[e][t]=i[t].morph(o.animations[e][t]);for(e in o.attrs)o.attrs[e]=new n.MorphObj(this.target().attr(e),o.attrs[e]);for(e in o.styles)o.styles[e]=new n.MorphObj(this.target().style(e),o.styles[e]);return o.initialTransformation=this.target().matrixify(),o.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(e,t){var n=this.active;return this.active=!1,t&&this.clearQueue(),e&&this.situation&&(!n&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var e=this.situation;this.stop(),this.situation=e,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(e,t){var n=this.situation.duration/this._speed;return this.absPos=e,t||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*n,this.situation.finish=this.situation.start+n,this.step(!0)},speed:function(e){return 0===e?this.pause():e?(this._speed=e,this.at(this.absPos,!0)):this._speed},loop:function(e,t){var n=this.last();return n.loops=null==e||e,n.loop=0,t&&(n.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(e){var t=this.last();return t.reversed=void 0===e?!t.reversed:e,this},progress:function(e){return e?this.situation.ease(this.pos):this.pos},after:function(e){var t=this.last();return this.target().on("finished.fx",(function n(i){i.detail.situation==t&&(e.call(this,t),this.off("finished.fx",n))})),this._callStart()},during:function(e){var t=this.last(),i=function(i){i.detail.situation==t&&e.call(this,i.detail.pos,n.morph(i.detail.pos),i.detail.eased,t)};return this.target().off("during.fx",i).on("during.fx",i),this.after((function(){this.off("during.fx",i)})),this._callStart()},afterAll:function(e){var t=function t(n){e.call(this),this.off("allfinished.fx",t)};return this.target().off("allfinished.fx",t).on("allfinished.fx",t),this._callStart()},duringAll:function(e){var t=function(t){e.call(this,t.detail.pos,n.morph(t.detail.pos),t.detail.eased,t.detail.situation)};return this.target().off("during.fx",t).on("during.fx",t),this.afterAll((function(){this.off("during.fx",t)})),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(e,t,n){return this.last()[n||"animations"][e]=t,this._callStart()},step:function(e){var t,n,i;(e||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops)?(t=Math.max(this.absPos,0),n=Math.floor(t),!0===this.situation.loops||n<this.situation.loops?(this.pos=t-n,i=this.situation.loop,this.situation.loop=n):(this.absPos=this.situation.loops,this.pos=1,i=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-i)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos);this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var o=this.situation.ease(this.pos);for(var r in this.situation.once)r>this.lastPos&&r<=o&&(this.situation.once[r].call(this.target(),this.pos,o),delete this.situation.once[r]);return this.active&&this.target().fire("during",{pos:this.pos,eased:o,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=o,this):this},eachAt:function(){var e,t,i,o=this,r=this.target(),a=this.situation;for(e in a.animations)i=[].concat(a.animations[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r[e].apply(r,i);for(e in a.attrs)i=[e].concat(a.attrs[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r.attr.apply(r,i);for(e in a.styles)i=[e].concat(a.styles[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(a.ease(o.pos),o.pos):e})),r.style.apply(r,i);if(a.transforms.length){for(i=a.initialTransformation,e=0,t=a.transforms.length;e<t;e++){var s=a.transforms[e];s instanceof n.Matrix?i=s.relative?i.multiply((new n.Matrix).morph(s).at(a.ease(this.pos))):i.morph(s).at(a.ease(this.pos)):(s.relative||s.undo(i.extract()),i=i.multiply(s.at(a.ease(this.pos))))}r.matrix(i)}return this},once:function(e,t,n){var i=this.last();return n||(e=i.ease(e)),i.once[e]=t,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:n.Element,construct:{animate:function(e,t,i){return(this.fx||(this.fx=new n.FX(this))).animate(e,t,i)},delay:function(e){return(this.fx||(this.fx=new n.FX(this))).delay(e)},stop:function(e,t){return this.fx&&this.fx.stop(e,t),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(e){if(this.fx){if(null==e)return this.fx.speed();this.fx.speed(e)}return this}}}),n.MorphObj=n.invent({create:function(e,t){return n.Color.isColor(t)?new n.Color(e).morph(t):n.regex.delimiter.test(e)?n.regex.pathLetters.test(e)?new n.PathArray(e).morph(t):new n.Array(e).morph(t):n.regex.numberAndUnit.test(t)?new n.Number(e).morph(t):(this.value=e,void(this.destination=t))},extend:{at:function(e,t){return t<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(e,t,n){if("object"==typeof e)for(var i in e)this.attr(i,e[i]);else this.add(e,t,"attrs");return this},style:function(e,t){if("object"==typeof e)for(var n in e)this.style(n,e[n]);else this.add(e,t,"styles");return this},x:function(e,t){if(this.target()instanceof n.G)return this.transform({x:e},t),this;var i=new n.Number(e);return i.relative=t,this.add("x",i)},y:function(e,t){if(this.target()instanceof n.G)return this.transform({y:e},t),this;var i=new n.Number(e);return i.relative=t,this.add("y",i)},cx:function(e){return this.add("cx",new n.Number(e))},cy:function(e){return this.add("cy",new n.Number(e))},move:function(e,t){return this.x(e).y(t)},center:function(e,t){return this.cx(e).cy(t)},size:function(e,t){var i;this.target()instanceof n.Text?this.attr("font-size",e):(e&&t||(i=this.target().bbox()),e||(e=i.width/i.height*t),t||(t=i.height/i.width*e),this.add("width",new n.Number(e)).add("height",new n.Number(t)));return this},width:function(e){return this.add("width",new n.Number(e))},height:function(e){return this.add("height",new n.Number(e))},plot:function(e,t,n,i){return 4==arguments.length?this.plot([e,t,n,i]):this.add("plot",new(this.target().morphArray)(e))},leading:function(e){return this.target().leading?this.add("leading",new n.Number(e)):this},viewbox:function(e,t,i,o){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(e,t,i,o)),this},update:function(e){if(this.target()instanceof n.Stop){if("number"==typeof e||e instanceof n.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",e.offset)}return this}}),n.Box=n.invent({create:function(e,t,i,o){if(!("object"!=typeof e||e instanceof n.Element))return n.Box.call(this,null!=e.left?e.left:e.x,null!=e.top?e.top:e.y,e.width,e.height);4==arguments.length&&(this.x=e,this.y=t,this.width=i,this.height=o),v(this)},extend:{merge:function(e){var t=new this.constructor;return t.x=Math.min(this.x,e.x),t.y=Math.min(this.y,e.y),t.width=Math.max(this.x+this.width,e.x+e.width)-t.x,t.height=Math.max(this.y+this.height,e.y+e.height)-t.y,v(t)},transform:function(e){var t,i=1/0,o=-1/0,r=1/0,a=-1/0;return[new n.Point(this.x,this.y),new n.Point(this.x2,this.y),new n.Point(this.x,this.y2),new n.Point(this.x2,this.y2)].forEach((function(t){t=t.transform(e),i=Math.min(i,t.x),o=Math.max(o,t.x),r=Math.min(r,t.y),a=Math.max(a,t.y)})),(t=new this.constructor).x=i,t.width=o-i,t.y=r,t.height=a-r,v(t),t}}}),n.BBox=n.invent({create:function(e){if(n.Box.apply(this,[].slice.call(arguments)),e instanceof n.Element){var i;try{if(t.documentElement.contains){if(!t.documentElement.contains(e.node))throw new Exception("Element not in the dom")}else{for(var o=e.node;o.parentNode;)o=o.parentNode;if(o!=t)throw new Exception("Element not in the dom")}i=e.node.getBBox()}catch(o){if(e instanceof n.Shape){var r=e.clone(n.parser.draw.instance).show();i=r.node.getBBox(),r.remove()}else i={x:e.node.clientLeft,y:e.node.clientTop,width:e.node.clientWidth,height:e.node.clientHeight}}n.Box.call(this,i)}},inherit:n.Box,parent:n.Element,construct:{bbox:function(){return new n.BBox(this)}}}),n.BBox.prototype.constructor=n.BBox,n.extend(n.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),n.RBox=n.invent({create:function(e){n.Box.apply(this,[].slice.call(arguments)),e instanceof n.Element&&n.Box.call(this,e.node.getBoundingClientRect())},inherit:n.Box,parent:n.Element,extend:{addOffset:function(){return this.x+=e.pageXOffset,this.y+=e.pageYOffset,this}},construct:{rbox:function(e){return e?new n.RBox(this).transform(e.screenCTM().inverse()):new n.RBox(this).addOffset()}}}),n.RBox.prototype.constructor=n.RBox,n.Matrix=n.invent({create:function(e){var t,i=f([1,0,0,1,0,0]);for(e=e instanceof n.Element?e.matrixify():"string"==typeof e?f(e.split(n.regex.delimiter).map(parseFloat)):6==arguments.length?f([].slice.call(arguments)):Array.isArray(e)?f(e):"object"==typeof e?e:i,t=y.length-1;t>=0;--t)this[y[t]]=null!=e[y[t]]?e[y[t]]:i[y[t]]},extend:{extract:function(){var e=p(this,0,1),t=p(this,1,0),i=180/Math.PI*Math.atan2(e.y,e.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(i*Math.PI/180)+this.f*Math.sin(i*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(i*Math.PI/180)+this.e*Math.sin(-i*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-i,skewY:180/Math.PI*Math.atan2(t.y,t.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:i,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(e){return this.destination=new n.Matrix(e),this},at:function(e){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*e,b:this.b+(this.destination.b-this.b)*e,c:this.c+(this.destination.c-this.c)*e,d:this.d+(this.destination.d-this.d)*e,e:this.e+(this.destination.e-this.e)*e,f:this.f+(this.destination.f-this.f)*e}):this},multiply:function(e){return new n.Matrix(this.native().multiply(function(e){e instanceof n.Matrix||(e=new n.Matrix(e));return e}(e).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(e,t){return new n.Matrix(this.native().translate(e||0,t||0))},scale:function(e,t,i,o){return 1==arguments.length?t=e:3==arguments.length&&(o=i,i=t,t=e),this.around(i,o,new n.Matrix(e,0,0,t,0,0))},rotate:function(e,t,i){return e=n.utils.radians(e),this.around(t,i,new n.Matrix(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0))},flip:function(e,t){return"x"==e?this.scale(-1,1,t,0):"y"==e?this.scale(1,-1,0,t):this.scale(-1,-1,e,null!=t?t:e)},skew:function(e,t,i,o){return 1==arguments.length?t=e:3==arguments.length&&(o=i,i=t,t=e),e=n.utils.radians(e),t=n.utils.radians(t),this.around(i,o,new n.Matrix(1,Math.tan(t),Math.tan(e),1,0,0))},skewX:function(e,t,n){return this.skew(e,0,t,n)},skewY:function(e,t,n){return this.skew(0,e,t,n)},around:function(e,t,i){return this.multiply(new n.Matrix(1,0,0,1,e||0,t||0)).multiply(i).multiply(new n.Matrix(1,0,0,1,-e||0,-t||0))},native:function(){for(var e=n.parser.native.createSVGMatrix(),t=y.length-1;t>=0;t--)e[y[t]]=this[y[t]];return e},toString:function(){return"matrix("+b(this.a)+","+b(this.b)+","+b(this.c)+","+b(this.d)+","+b(this.e)+","+b(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new n.Matrix(t)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(e,t){var n;n=Array.isArray(e)?{x:e[0],y:e[1]}:"object"==typeof e?{x:e.x,y:e.y}:null!=e?{x:e,y:null!=t?t:e}:{x:0,y:0},this.x=n.x,this.y=n.y},extend:{clone:function(){return new n.Point(this)},morph:function(e,t){return this.destination=new n.Point(e,t),this},at:function(e){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*e,y:this.y+(this.destination.y-this.y)*e}):this},native:function(){var e=n.parser.native.createSVGPoint();return e.x=this.x,e.y=this.y,e},transform:function(e){return new n.Point(this.native().matrixTransform(e.native()))}}}),n.extend(n.Element,{point:function(e,t){return new n.Point(e,t).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(e,t,i){if(null==e){for(e={},i=(t=this.node.attributes).length-1;i>=0;i--)e[t[i].nodeName]=n.regex.isNumber.test(t[i].nodeValue)?parseFloat(t[i].nodeValue):t[i].nodeValue;return e}if("object"==typeof e)for(t in e)this.attr(t,e[t]);else if(null===t)this.node.removeAttribute(e);else{if(null==t)return null==(t=this.node.getAttribute(e))?n.defaults.attrs[e]:n.regex.isNumber.test(t)?parseFloat(t):t;"stroke-width"==e?this.attr("stroke",parseFloat(t)>0?this._stroke:null):"stroke"==e&&(this._stroke=t),"fill"!=e&&"stroke"!=e||(n.regex.isImage.test(t)&&(t=this.doc().defs().image(t,0,0)),t instanceof n.Image&&(t=this.doc().defs().pattern(0,0,(function(){this.add(t)})))),"number"==typeof t?t=new n.Number(t):n.Color.isColor(t)?t=new n.Color(t):Array.isArray(t)&&(t=new n.Array(t)),"leading"==e?this.leading&&this.leading(t):"string"==typeof i?this.node.setAttributeNS(i,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||"font-size"!=e&&"x"!=e||this.rebuild(e,t)}return this}}),n.extend(n.Element,{transform:function(e,t){var i,o,r=this;if("object"!=typeof e)return i=new n.Matrix(r).extract(),"string"==typeof e?i[e]:i;if(i=new n.Matrix(r),t=!!t||!!e.relative,null!=e.a)i=t?i.multiply(new n.Matrix(e)):new n.Matrix(e);else if(null!=e.rotation)m(e,r),i=t?i.rotate(e.rotation,e.cx,e.cy):i.rotate(e.rotation-i.extract().rotation,e.cx,e.cy);else if(null!=e.scale||null!=e.scaleX||null!=e.scaleY){if(m(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,!t){var a=i.extract();e.scaleX=1*e.scaleX/a.scaleX,e.scaleY=1*e.scaleY/a.scaleY}i=i.scale(e.scaleX,e.scaleY,e.cx,e.cy)}else if(null!=e.skew||null!=e.skewX||null!=e.skewY){if(m(e,r),e.skewX=null!=e.skew?e.skew:null!=e.skewX?e.skewX:0,e.skewY=null!=e.skew?e.skew:null!=e.skewY?e.skewY:0,!t){a=i.extract();i=i.multiply((new n.Matrix).skew(a.skewX,a.skewY,e.cx,e.cy).inverse())}i=i.skew(e.skewX,e.skewY,e.cx,e.cy)}else e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(o=r.bbox(),e.flip=o.cx,e.offset=o.cy):e.flip=e.offset,i=(new n.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(t?i=i.translate(e.x,e.y):(null!=e.x&&(i.e=e.x),null!=e.y&&(i.f=e.y)));return this.attr("transform",i)}}),n.extend(n.FX,{transform:function(e,t){var i,o,r=this.target();return"object"!=typeof e?(i=new n.Matrix(r).extract(),"string"==typeof e?i[e]:i):(t=!!t||!!e.relative,null!=e.a?i=new n.Matrix(e):null!=e.rotation?(m(e,r),i=new n.Rotate(e.rotation,e.cx,e.cy)):null!=e.scale||null!=e.scaleX||null!=e.scaleY?(m(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,i=new n.Scale(e.scaleX,e.scaleY,e.cx,e.cy)):null!=e.skewX||null!=e.skewY?(m(e,r),e.skewX=null!=e.skewX?e.skewX:0,e.skewY=null!=e.skewY?e.skewY:0,i=new n.Skew(e.skewX,e.skewY,e.cx,e.cy)):e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(o=r.bbox(),e.flip=o.cx,e.offset=o.cy):e.flip=e.offset,i=(new n.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(i=new n.Translate(e.x,e.y)),i?(i.relative=t,this.last().transforms.push(i),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map((function(e){var t=e.trim().split("(");return[t[0],t[1].split(n.regex.delimiter).map((function(e){return parseFloat(e)}))]})).reduce((function(e,t){return"matrix"==t[0]?e.multiply(f(t[1])):e[t[0]].apply(e,t[1])}),new n.Matrix)},toParent:function(e){if(this==e)return this;var t=this.screenCTM(),n=e.screenCTM().inverse();return this.addTo(e).untransform().transform(n.multiply(t)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(e,t){if(arguments.length>1&&"boolean"!=typeof t)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(e))for(var n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=e[n];else if("object"==typeof e)for(n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=e[this.arguments[n]];this.inversed=!1,!0===t&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(e){for(var t=[],i=0,o=this.arguments.length;i<o;++i)t.push(this[this.arguments[i]]);var r=this._undo||new n.Matrix;return r=(new n.Matrix).morph(n.Matrix.prototype[this.method].apply(r,t)).at(e),this.inversed?r.inverse():r},undo:function(e){for(var t=0,i=this.arguments.length;t<i;++t)e[this.arguments[t]]=void 0===this[this.arguments[t]]?0:e[this.arguments[t]];return e.cx=this.cx,e.cy=this.cy,this._undo=new(n[u(this.method)])(e,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),n.Rotate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(e){var t=(new n.Matrix).rotate((new n.Number).morph(this.rotation-(this._undo?this._undo.rotation:0)).at(e),this.cx,this.cy);return this.inversed?t.inverse():t},undo:function(e){return this._undo=e,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),n.Skew=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(e,t){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(e,t){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"==typeof e)for(t in e)this.style(t,e[t]);else{if(!n.regex.isCss.test(e))return this.node.style[c(e)];for(e=e.split(/\s*;\s*/).filter((function(e){return!!e})).map((function(e){return e.split(/\s*:\s*/)}));t=e.pop();)this.style(t[0],t[1])}else this.node.style[c(e)]=null===t||n.regex.isBlank.test(t)?"":t;return this}}),n.Parent=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Element,extend:{children:function(){return n.utils.map(n.utils.filterSVGElements(this.node.childNodes),(function(e){return n.adopt(e)}))},add:function(e,t){return null==t?this.node.appendChild(e.node):e.node!=this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this},put:function(e,t){return this.add(e,t),e},has:function(e){return this.index(e)>=0},index:function(e){return[].slice.call(this.node.childNodes).indexOf(e.node)},get:function(e){return n.adopt(this.node.childNodes[e])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(e,t){var i,o,r=this.children();for(i=0,o=r.length;i<o;i++)r[i]instanceof n.Element&&e.apply(r[i],[i,r]),t&&r[i]instanceof n.Container&&r[i].each(e,t);return this},removeElement:function(e){return this.node.removeChild(e.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(e,t){return 0===t||this instanceof n.Defs||this.node==n.parser.draw||(e=e||(this instanceof n.Doc?this:this.parent(n.Parent)),t=t||1/0,this.each((function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(e,t-1):this.toParent(e)})),this.node.firstChild||this.remove()),this},flatten:function(e,t){return this.ungroup(e,t)}}),n.Container=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(e){var t,i,o,r,a,s,l,c=[0,0,0,0],u=1,d=1,h=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(e instanceof n.Element){for(s=e,l=e,a=(e.attr("viewBox")||"").match(h),e.bbox,o=new n.Number(e.width()),r=new n.Number(e.height());"%"==o.unit;)u*=o.value,o=new n.Number(s instanceof n.Doc?s.parent().offsetWidth:s.parent().width()),s=s.parent();for(;"%"==r.unit;)d*=r.value,r=new n.Number(l instanceof n.Doc?l.parent().offsetHeight:l.parent().height()),l=l.parent();this.x=0,this.y=0,this.width=o*u,this.height=r*d,this.zoom=1,a&&(t=parseFloat(a[0]),i=parseFloat(a[1]),o=parseFloat(a[2]),r=parseFloat(a[3]),this.zoom=this.width/this.height>o/r?this.height/r:this.width/o,this.x=t,this.y=i,this.width=o,this.height=r)}else e="string"==typeof e?e.match(h).map((function(e){return parseFloat(e)})):Array.isArray(e)?e:"object"==typeof e?[e.x,e.y,e.width,e.height]:4==arguments.length?[].slice.call(arguments):c,this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(e,t,i,o){return this.destination=new n.ViewBox(e,t,i,o),this},at:function(e){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*e,this.y+(this.destination.y-this.y)*e,this.width+(this.destination.width-this.width)*e,this.height+(this.destination.height-this.height)*e]):this}},parent:n.Container,construct:{viewbox:function(e,t,i,o){return 0==arguments.length?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(e,t,i,o))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach((function(e){n.Element.prototype[e]=function(t){return null==t?n.off(this,e):n.on(this,e,t),this}})),n.listenerId=0,n.on=function(e,t,i,o,r){var a=i.bind(o||e),s=e instanceof n.Element?e.node:e;s.instance=s.instance||{_events:{}};var l=s.instance._events;i._svgjsListenerId||(i._svgjsListenerId=++n.listenerId),t.split(n.regex.delimiter).forEach((function(e){var t=e.split(".")[0],n=e.split(".")[1]||"*";l[t]=l[t]||{},l[t][n]=l[t][n]||{},l[t][n][i._svgjsListenerId]=a,s.addEventListener(t,a,r||!1)}))},n.off=function(e,t,i,o){var r=e instanceof n.Element?e.node:e;if(r.instance&&("function"!=typeof i||(i=i._svgjsListenerId))){var a=r.instance._events;(t||"").split(n.regex.delimiter).forEach((function(e){var t,s,l=e&&e.split(".")[0],c=e&&e.split(".")[1];if(i)a[l]&&a[l][c||"*"]&&(r.removeEventListener(l,a[l][c||"*"][i],o||!1),delete a[l][c||"*"][i]);else if(l&&c){if(a[l]&&a[l][c]){for(s in a[l][c])n.off(r,[l,c].join("."),s);delete a[l][c]}}else if(c)for(e in a)for(t in a[e])c===t&&n.off(r,[e,c].join("."));else if(l){if(a[l]){for(t in a[l])n.off(r,[l,t].join("."));delete a[l]}}else{for(e in a)n.off(r,e);r.instance._events={}}}))}},n.extend(n.Element,{on:function(e,t,i,o){return n.on(this,e,t,i,o),this},off:function(e,t){return n.off(this.node,e,t),this},fire:function(t,i){return t instanceof e.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new n.CustomEvent(t,{detail:i,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(e){return null==e?this.transform("x"):this.transform({x:e-this.x()},!0)},y:function(e){return null==e?this.transform("y"):this.transform({y:e-this.y()},!0)},cx:function(e){return null==e?this.gbox().cx:this.x(e-this.gbox().width/2)},cy:function(e){return null==e?this.gbox().cy:this.y(e-this.gbox().height/2)},gbox:function(){var e=this.bbox(),t=this.transform();return e.x+=t.x,e.x2+=t.x,e.cx+=t.x,e.y+=t.y,e.y2+=t.y,e.cy+=t.y,e}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(e){e&&("svg"==(e="string"==typeof e?t.getElementById(e):e).nodeName?this.constructor.call(this,e):(this.constructor.call(this,n.create("svg")),e.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var e;this._defs||((e=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(e):this._defs=new n.Defs,this.node.appendChild(this._defs.node));return this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName&&"#document-fragment"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var e=this.node.getScreenCTM();return e&&this.style("left",-e.e%1+"px").style("top",-e.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(e){this.writeDataToDom();var t=this.node,n=g(t.cloneNode(!0));return e?(e.node||e).appendChild(n.node):t.parentNode.insertBefore(n.node,t.nextSibling),n}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var e=this.position()+1,t=this.parent();return t.removeElement(this).add(this,e),t instanceof n.Doc&&t.node.appendChild(t.defs().node),this},backward:function(){var e=this.position();return e>0&&this.parent().removeElement(this).add(this,e-1),this},front:function(){var e=this.parent();return e.node.appendChild(this.node),e instanceof n.Doc&&e.node.appendChild(e.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(e){e.remove();var t=this.position();return this.parent().add(e,t),this},after:function(e){e.remove();var t=this.position();return this.parent().add(e,t+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(e){return this.masker=e instanceof n.Mask?e:this.parent().mask().add(e),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(e){return this.clipper=e instanceof n.ClipPath?e:this.parent().clip().add(e),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(e){this.constructor.call(this,n.create(e+"Gradient")),this.type=e},inherit:n.Container,extend:{at:function(e,t,i){return this.put(new n.Stop).update(e,t,i)},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(e,t,i){return"transform"==e&&(e="gradientTransform"),n.Container.prototype.attr.call(this,e,t,i)}},construct:{gradient:function(e,t){return this.defs().gradient(e,t)}}}),n.extend(n.Gradient,n.FX,{from:function(e,t){return"radial"==(this._target||this).type?this.attr({fx:new n.Number(e),fy:new n.Number(t)}):this.attr({x1:new n.Number(e),y1:new n.Number(t)})},to:function(e,t){return"radial"==(this._target||this).type?this.attr({cx:new n.Number(e),cy:new n.Number(t)}):this.attr({x2:new n.Number(e),y2:new n.Number(t)})}}),n.extend(n.Defs,{gradient:function(e,t){return this.put(new n.Gradient(e)).update(t)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(e){return("number"==typeof e||e instanceof n.Number)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",new n.Number(e.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},toString:function(){return this.fill()},attr:function(e,t,i){return"transform"==e&&(e="patternTransform"),n.Container.prototype.attr.call(this,e,t,i)}},construct:{pattern:function(e,t,n){return this.defs().pattern(e,t,n)}}}),n.extend(n.Defs,{pattern:function(e,t,i){return this.put(new n.Pattern).update(i).attr({x:0,y:0,width:e,height:t,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(e){this.constructor.call(this,e)},inherit:n.Element}),n.Bare=n.invent({create:function(e,t){if(this.constructor.call(this,n.create(e)),t)for(var i in t.prototype)"function"==typeof t.prototype[i]&&(this[i]=t.prototype[i])},inherit:n.Element,extend:{words:function(e){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(e)),this}}}),n.extend(n.Parent,{element:function(e,t){return this.put(new n.Bare(e,t))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(e,t){return this.attr("href",(t||"")+"#"+e,n.xlink)}},construct:{use:function(e,t){return this.put(new n.Use).element(e,t)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(e,t){return this.put(new n.Rect).size(e,t)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(e){return this.put(new n.Circle).rx(new n.Number(e).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(e){return this.attr("r",e)},ry:function(e){return this.rx(e)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(e,t){return this.put(new n.Ellipse).size(e,t).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(e){return this.attr("rx",e)},ry:function(e){return this.attr("ry",e)}}),n.extend(n.Circle,n.Ellipse,{x:function(e){return null==e?this.cx()-this.rx():this.cx(e+this.rx())},y:function(e){return null==e?this.cy()-this.ry():this.cy(e+this.ry())},cx:function(e){return null==e?this.attr("cx"):this.attr("cx",e)},cy:function(e){return null==e?this.attr("cy"):this.attr("cy",e)},width:function(e){return null==e?2*this.rx():this.rx(new n.Number(e).divide(2))},height:function(e){return null==e?2*this.ry():this.ry(new n.Number(e).divide(2))},size:function(e,t){var i=h(this,e,t);return this.rx(new n.Number(i.width).divide(2)).ry(new n.Number(i.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(e,t,i,o){return null==e?this.array():(e=void 0!==t?{x1:e,y1:t,x2:i,y2:o}:new n.PointArray(e).toLine(),this.attr(e))},move:function(e,t){return this.attr(this.array().move(e,t).toLine())},size:function(e,t){var n=h(this,e,t);return this.attr(this.array().size(n.width,n.height).toLine())}},construct:{line:function(e,t,i,o){return n.Line.prototype.plot.apply(this.put(new n.Line),null!=e?[e,t,i,o]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(e){return this.put(new n.Polyline).plot(e||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(e){return this.put(new n.Polygon).plot(e||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(e){return null==e?this.array():this.clear().attr("points","string"==typeof e?e:this._array=new n.PointArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("points",this.array().move(e,t))},size:function(e,t){var n=h(this,e,t);return this.attr("points",this.array().size(n.width,n.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},width:function(e){var t=this.bbox();return null==e?t.width:this.size(e,t.height)},height:function(e){var t=this.bbox();return null==e?t.height:this.size(t.width,e)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(e){return null==e?this.array():this.clear().attr("d","string"==typeof e?e:this._array=new n.PathArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("d",this.array().move(e,t))},x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},size:function(e,t){var n=h(this,e,t);return this.attr("d",this.array().size(n.width,n.height))},width:function(e){return null==e?this.bbox().width:this.size(e,this.bbox().height)},height:function(e){return null==e?this.bbox().height:this.size(this.bbox().width,e)}},construct:{path:function(e){return this.put(new n.Path).plot(e||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(t){if(!t)return this;var i=this,o=new e.Image;return n.on(o,"load",(function(){n.off(o);var e=i.parent(n.Pattern);null!==e&&(0==i.width()&&0==i.height()&&i.size(o.width,o.height),e&&0==e.width()&&0==e.height()&&e.size(i.width(),i.height()),"function"==typeof i._loaded&&i._loaded.call(i,{width:o.width,height:o.height,ratio:o.width/o.height,url:t}))})),n.on(o,"error",(function(e){n.off(o),"function"==typeof i._error&&i._error.call(i,e)})),this.attr("href",o.src=this.src=t,n.xlink)},loaded:function(e){return this._loaded=e,this},error:function(e){return this._error=e,this}},construct:{image:function(e,t,i){return this.put(new n.Image).load(e).size(t||0,i||t||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(e){return null==e?this.attr("x"):this.attr("x",e)},y:function(e){var t=this.attr("y"),n="number"==typeof t?t-this.bbox().y:0;return null==e?"number"==typeof t?t-n:t:this.attr("y","number"==typeof e.valueOf()?e+n:e)},cx:function(e){return null==e?this.bbox().cx:this.x(e-this.bbox().width/2)},cy:function(e){return null==e?this.bbox().cy:this.y(e-this.bbox().height/2)},text:function(e){if(void 0===e){e="";for(var t=this.node.childNodes,i=0,o=t.length;i<o;++i)0!=i&&3!=t[i].nodeType&&1==n.adopt(t[i]).dom.newLined&&(e+="\n"),e+=t[i].textContent;return e}if(this.clear().build(!0),"function"==typeof e)e.call(this,this);else{i=0;for(var r=(e=e.split("\n")).length;i<r;i++)this.tspan(e[i]).newLine()}return this.build(!1).rebuild()},size:function(e){return this.attr("font-size",e).rebuild()},leading:function(e){return null==e?this.dom.leading:(this.dom.leading=new n.Number(e),this.rebuild())},lines:function(){var e=(this.textPath&&this.textPath()||this).node,t=n.utils.map(n.utils.filterSVGElements(e.childNodes),(function(e){return n.adopt(e)}));return new n.Set(t)},rebuild:function(e){if("boolean"==typeof e&&(this._rebuild=e),this._rebuild){var t=this,i=0,o=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each((function(){this.dom.newLined&&(t.textPath()||this.attr("x",t.attr("x")),"\n"==this.text()?i+=o:(this.attr("dy",o+i),i=0))})),this.fire("rebuild")}return this},build:function(e){return this._build=!!e,this},setData:function(e){return this.dom=e,this.dom.leading=new n.Number(e.leading||1.3),this}},construct:{text:function(e){return this.put(new n.Text).text(e)},plain:function(e){return this.put(new n.Text).plain(e)}}}),n.Tspan=n.invent({create:"tspan",inherit:n.Shape,extend:{text:function(e){return null==e?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof e?e.call(this,this):this.plain(e),this)},dx:function(e){return this.attr("dx",e)},dy:function(e){return this.attr("dy",e)},newLine:function(){var e=this.parent(n.Text);return this.dom.newLined=!0,this.dy(e.dom.leading*e.attr("font-size")).attr("x",e.x())}}}),n.extend(n.Text,n.Tspan,{plain:function(e){return!1===this._build&&this.clear(),this.node.appendChild(t.createTextNode(e)),this},tspan:function(e){var t=(this.textPath&&this.textPath()||this).node,i=new n.Tspan;return!1===this._build&&this.clear(),t.appendChild(i.node),i.text(e)},clear:function(){for(var e=(this.textPath&&this.textPath()||this).node;e.hasChildNodes();)e.removeChild(e.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),n.TextPath=n.invent({create:"textPath",inherit:n.Parent,parent:n.Text,construct:{morphArray:n.PathArray,path:function(e){for(var t=new n.TextPath,i=this.doc().defs().path(e);this.node.hasChildNodes();)t.node.appendChild(this.node.firstChild);return this.node.appendChild(t.node),t.attr("href","#"+i,n.xlink),this},array:function(){var e=this.track();return e?e.array():null},plot:function(e){var t=this.track(),n=null;return t&&(n=t.plot(e)),null==e?n:this},track:function(){var e=this.textPath();if(e)return e.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return n.adopt(this.node.firstChild)}}}),n.Nested=n.invent({create:function(){this.constructor.call(this,n.create("svg")),this.style("overflow","visible")},inherit:n.Container,construct:{nested:function(){return this.put(new n.Nested)}}}),n.A=n.invent({create:"a",inherit:n.Container,extend:{to:function(e){return this.attr("href",e,n.xlink)},show:function(e){return this.attr("show",e,n.xlink)},target:function(e){return this.attr("target",e)}},construct:{link:function(e){return this.put(new n.A).to(e)}}}),n.extend(n.Element,{linkTo:function(e){var t=new n.A;return"function"==typeof e?e.call(t,t):t.to(e),this.parent().put(t).put(this)}}),n.Marker=n.invent({create:"marker",inherit:n.Container,extend:{width:function(e){return this.attr("markerWidth",e)},height:function(e){return this.attr("markerHeight",e)},ref:function(e,t){return this.attr("refX",e).attr("refY",t)},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(e,t,n){return this.defs().marker(e,t,n)}}}),n.extend(n.Defs,{marker:function(e,t,i){return this.put(new n.Marker).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr("orient","auto").update(i)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(e,t,i,o){var r=["marker"];return"all"!=e&&r.push(e),r=r.join("-"),e=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(t,i,o),this.attr(r,e)}});var s={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(e,t){return"color"==t?e:e+"-"+t}};function l(e,t,i,o){return i+o.replace(n.regex.dots," .")}function c(e){return e.toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e){var t=e.toString(16);return 1==t.length?"0"+t:t}function h(e,t,n){if(null==t||null==n){var i=e.bbox();null==t?t=i.width/i.height*n:null==n&&(n=i.height/i.width*t)}return{width:t,height:n}}function p(e,t,n){return{x:t*e.a+n*e.c+0,y:t*e.b+n*e.d+0}}function f(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}function m(e,t){e.cx=null==e.cx?t.bbox().cx:e.cx,e.cy=null==e.cy?t.bbox().cy:e.cy}function g(t){for(var i=t.childNodes.length-1;i>=0;i--)t.childNodes[i]instanceof e.SVGElement&&g(t.childNodes[i]);return n.adopt(t).id(n.eid(t.nodeName))}function v(e){return null==e.x&&(e.x=0,e.y=0,e.width=0,e.height=0),e.w=e.width,e.h=e.height,e.x2=e.x+e.width,e.y2=e.y+e.height,e.cx=e.x+e.width/2,e.cy=e.y+e.height/2,e}function b(e){return Math.abs(e)>1e-37?e:0}["fill","stroke"].forEach((function(e){var t,i={};i[e]=function(i){if(void 0===i)return this;if("string"==typeof i||n.Color.isRgb(i)||i&&"function"==typeof i.fill)this.attr(e,i);else for(t=s[e].length-1;t>=0;t--)null!=i[s[e][t]]&&this.attr(s.prefix(e,s[e][t]),i[s[e][t]]);return this},n.extend(n.Element,n.FX,i)})),n.extend(n.Element,n.FX,{rotate:function(e,t,n){return this.transform({rotation:e,cx:t,cy:n})},skew:function(e,t,n,i){return 1==arguments.length||3==arguments.length?this.transform({skew:e,cx:t,cy:n}):this.transform({skewX:e,skewY:t,cx:n,cy:i})},scale:function(e,t,n,i){return 1==arguments.length||3==arguments.length?this.transform({scale:e,cx:t,cy:n}):this.transform({scaleX:e,scaleY:t,cx:n,cy:i})},translate:function(e,t){return this.transform({x:e,y:t})},flip:function(e,t){return t="number"==typeof e?e:t,this.transform({flip:e||"both",offset:t})},matrix:function(e){return this.attr("transform",new n.Matrix(6==arguments.length?[].slice.call(arguments):e))},opacity:function(e){return this.attr("opacity",e)},dx:function(e){return this.x(new n.Number(e).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(e){return this.y(new n.Number(e).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(e,t){return this.dx(e).dy(t)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(e,t){var i=(this._target||this).type;return"radial"==i||"circle"==i?this.attr("r",new n.Number(e)):this.rx(e).ry(null==t?e:t)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(e){return this.node.getPointAtLength(e)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(e,t){if("object"==typeof e)for(t in e)this.font(t,e[t]);return"leading"==e?this.leading(t):"anchor"==e?this.attr("text-anchor",t):"size"==e||"family"==e||"weight"==e||"stretch"==e||"variant"==e||"style"==e?this.attr("font-"+e,t):this.attr(e,t)}}),n.Set=n.invent({create:function(e){e instanceof n.Set?this.members=e.members.slice():Array.isArray(e)?this.members=e:this.clear()},extend:{add:function(){var e,t,n=[].slice.call(arguments);for(e=0,t=n.length;e<t;e++)this.members.push(n[e]);return this},remove:function(e){var t=this.index(e);return t>-1&&this.members.splice(t,1),this},each:function(e){for(var t=0,n=this.members.length;t<n;t++)e.apply(this.members[t],[t,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(e){return this.index(e)>=0},index:function(e){return this.members.indexOf(e)},get:function(e){return this.members[e]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new n.RBox;var e=this.members[0].rbox(this.members[0].doc());return this.each((function(){e=e.merge(this.rbox(this.doc()))})),e}},construct:{set:function(e){return new n.Set(e)}}}),n.FX.Set=n.invent({create:function(e){this.set=e}}),n.Set.inherit=function(){var e=[];for(var t in n.Shape.prototype)"function"==typeof n.Shape.prototype[t]&&"function"!=typeof n.Set.prototype[t]&&e.push(t);for(var t in e.forEach((function(e){n.Set.prototype[e]=function(){for(var t=0,i=this.members.length;t<i;t++)this.members[t]&&"function"==typeof this.members[t][e]&&this.members[t][e].apply(this.members[t],arguments);return"animate"==e?this.fx||(this.fx=new n.FX.Set(this)):this}})),e=[],n.FX.prototype)"function"==typeof n.FX.prototype[t]&&"function"!=typeof n.FX.Set.prototype[t]&&e.push(t);e.forEach((function(e){n.FX.Set.prototype[e]=function(){for(var t=0,n=this.set.members.length;t<n;t++)this.set.members[t].fx[e].apply(this.set.members[t].fx,arguments);return this}}))},n.extend(n.Element,{data:function(e,t,n){if("object"==typeof e)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),n.extend(n.Element,{remember:function(e,t){if("object"==typeof arguments[0])for(var t in e)this.remember(t,e[t]);else{if(1==arguments.length)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(e){var i=t.getElementById(function(e){var t=(e||"").toString().match(n.regex.reference);if(t)return t[1]}(e)||e);return n.adopt(i)},n.select=function(e,i){return new n.Set(n.utils.map((i||t).querySelectorAll(e),(function(e){return n.adopt(e)})))},n.extend(n.Parent,{select:function(e){return n.select(e,this.node)}});var y="abcdef".split("");if("function"!=typeof e.CustomEvent){var w=function(e,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var i=t.createEvent("CustomEvent");return i.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),i};w.prototype=e.Event.prototype,n.CustomEvent=w}else n.CustomEvent=e.CustomEvent;for(var x=e,_=0,k=["moz","webkit"],E=0;E<k.length&&!e.requestAnimationFrame;++E)x.requestAnimationFrame=x[k[E]+"RequestAnimationFrame"],x.cancelAnimationFrame=x[k[E]+"CancelAnimationFrame"]||x[k[E]+"CancelRequestAnimationFrame"];return x.requestAnimationFrame=x.requestAnimationFrame||function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-_)),i=x.setTimeout((function(){e(t+n)}),n);return _=t+n,i},x.cancelAnimationFrame=x.cancelAnimationFrame||x.clearTimeout,n}(i,i.document)}.call(t,n,t,e))&&(e.exports=n)},function(e,t){function n(e,t){return t.querySelector(e)}(t=e.exports=function(e,t){return n(e,t=t||document)}).all=function(e,t){return(t=t||document).querySelectorAll(e)},t.engine=function(e){if(!e.one)throw new Error(".one callback required");if(e.all)return n=e.one,t.all=e.all,t;throw new Error(".all callback required")}},function(e,t){e.exports.getMid=function(e){return{x:(e=e.bbox()).x+e.width/2,y:e.y+e.height/2}},e.exports.distance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},function(e,t,n){e.exports=n(476)},function(e,t,n){"use strict";var i=n(10).isAncestor,o=n(8),r=o.TOGGLE_MODE_EVENT,a=o.RESET_SIMULATION_EVENT,s=o.TERMINATE_EVENT,l=o.UPDATE_ELEMENTS_EVENT,c=o.UPDATE_ELEMENT_EVENT,u=o.PROCESS_INSTANCE_SHOWN_EVENT,d=n(477),h=n(480),p=n(481),f=n(482),m=n(483);function g(e,t,n,i,o,g){var v=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=o,this._processInstances=g,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",h),this.registerHandler("bpmn:IntermediateCatchEvent",p),this.registerHandler("bpmn:SubProcess",f),this.registerHandler("bpmn:SubProcess",d),this.registerHandler("bpmn:StartEvent",m),e.on(r,500,(function(e){e.simulationModeActive?v.openContextPads():v.closeContextPads()})),e.on(a,500,(function(){v.closeContextPads(),v.openContextPads()})),e.on(s,500,(function(e){e=e.element.parent,v.closeContextPads(e)})),e.on(l,500,(function(e){e.elements.forEach((function(e){v.closeElementContextPads(e),v.openElementContextPads(e)}))})),e.on(c,500,(function(e){e=e.element,v.closeElementContextPads(e),v.openElementContextPads(e)})),e.on(u,(function(e){e=e.processInstanceId,e=g.getProcessInstance(e).parent,v.closeContextPads(e),v.openContextPads(e)}))}g.prototype.registerHandler=function(e,t){t=this._injector.instantiate(t),this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(t)},g.prototype.openContextPads=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){t.handlers[n.type]&&i(e,n)&&t.openElementContextPads(n)}))},g.prototype.openElementContextPads=function(e){var t,n;this.handlers[e.type]&&(t=[],this.handlers[e.type].forEach((function(n){(n=n.createContextPads(e))&&n.forEach((function(e){e&&t.push(e)}))})),n=this,t.forEach((function(e){var t=n._overlays.add(e.element,"context-menu",{position:{top:-15,left:-15},html:e.html,show:{minZoom:.5}});n.overlayIds[e.element.id]=t})))},g.prototype.closeContextPads=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){i(e,n)&&t.closeElementContextPads(n)}))},g.prototype.closeElementContextPads=function(e){var t=this,n=(e.attachers&&0<e.attachers.length&&e.attachers.forEach((function(e){t.closeElementContextPads(e)})),e.children&&0<e.children.length&&e.children.forEach((function(e){t.closeElementContextPads(e)})),this.overlayIds[e.id]);n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},g.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"],e.exports=g},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=(n=n(8)).GENERATE_TOKEN_EVENT,s=n.UPDATE_ELEMENT_EVENT;function l(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}l.prototype.createContextPads=function(e){var t,n,l;if(e.attachers.length&&this._processInstances.getProcessInstances(e).length)return t=e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})),n=this,l=[],e.attachers.forEach((function(c){var u=c.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")}));t.length&&u.length&&(u=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),l.push({element:c,html:u}),o.bind(u,"click",(function(){n._processInstances.getProcessInstances(e).forEach((function(t){var i=t.parentProcessInstanceId;c.businessObject.cancelActivity&&(e.children.forEach((function(e){e.tokenCount&&e.tokenCount[t.processInstanceId]&&e.tokenCount[t.processInstanceId]--})),n._processInstances.finish(t.processInstanceId),n._eventBus.fire(s,{element:e})),n._eventBus.fire(a,{element:c,processInstanceId:i})}))})))})),l},l.$inject=["eventBus","processInstances","processInstanceSettings"],e.exports=l},function(e,t){e=!(e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");if(t=t||document,!(a=/<([\w:]+)/.exec(e)))return t.createTextNode(e);if(e=e.replace(/^\s+|\s+$/g,""),"body"==(a=a[1]))return(n=t.createElement("html")).innerHTML=e,n.removeChild(n.lastChild);var n,o=(a=Object.prototype.hasOwnProperty.call(i,a)?i[a]:i._default)[0],r=a[1],a=a[2];for((n=t.createElement("div")).innerHTML=r+e+a;o--;)n=n.lastChild;if(n.firstChild==n.lastChild)return n.removeChild(n.firstChild);for(var s=t.createDocumentFragment();n.firstChild;)s.appendChild(n.removeChild(n.firstChild));return s});var n,i=("undefined"!=typeof document&&((n=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',e=!n.getElementsByTagName("link").length,n=void 0),{legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:e?[1,"X<div>","</div>"]:[0,"",""]});i.td=i.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],i.option=i.optgroup=[1,'<select multiple="multiple">',"</select>"],i.thead=i.tbody=i.colgroup=i.caption=i.tfoot=[1,"<table>","</table>"],i.polyline=i.ellipse=i.polygon=i.circle=i.text=i.line=i.path=i.rect=i.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},function(e,t){var n=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!=n?"on":"";t.bind=function(e,t,i,r){return e[n](o+t,i,r||!1),i},t.unbind=function(e,t,n,r){return e[i](o+t,n,r||!1),n}},function(e,t,n){"use strict";var i=n(10).is,o=n(13),r=n(18);function a(e){this._exclusiveGatewaySettings=e}a.prototype.createContextPads=function(e){var t=this,n=e.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")}));if(!(n.length<2))return n=o('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>'),r.bind(n,"click",(function(){t._exclusiveGatewaySettings.setSequenceFlow(e)})),[{element:e,html:n}]},a.$inject=["exclusiveGatewaySettings"],e.exports=a},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=n(8).GENERATE_TOKEN_EVENT;function s(e){this._eventBus=e}s.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})),s=[],l=(n.forEach((function(e){e=e.source,r(e,"bpmn:EventBasedGateway")&&e.tokenCount&&e.tokenCount[t]&&s.push(e)})),e.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")})));if(n.length&&l.length){var c,u=this;if(e.tokenCount&&e.tokenCount[t])c=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),o.bind(c,"click",(function(){e.tokenCount[t]--,u._eventBus.fire(a,{element:e,processInstanceId:t})}));else{if(!s.length)return;c=i('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),o.bind(c,"click",(function(){s.forEach((function(e){e.tokenCount[t]--})),u._eventBus.fire(a,{element:e,processInstanceId:t})}))}return[{element:e,html:c}]}},s.$inject=["eventBus"],e.exports=s},function(e,t,n){"use strict";var i=n(13),o=n(18);function r(e,t){this._processInstances=e,this._processInstanceSettings=t}r.prototype.createContextPads=function(e){var t=this,n=this._processInstances.getProcessInstances(e).filter((function(e){return!e.isFinished}));if(!(n.length<2))return n=i('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>'),o.bind(n,"click",(function(){t._processInstanceSettings.showNext(e)})),[{element:e,html:n}]},r.$inject=["processInstances","processInstanceSettings"],e.exports=r},function(e,t,n){"use strict";var i=n(13),o=n(18),r=n(10).is,a=n(8).GENERATE_TOKEN_EVENT;function s(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}s.prototype.createContextPads=function(e){var t,n,s=!1;if(this._elementRegistry.forEach((function(e){e.tokenCount&&Object.values(e.tokenCount).forEach((function(e){e&&(s=!0)}))})),!(r(e.parent,"bpmn:SubProcess")||s||this._animation.animations.length))return t=this,n=i('<div class="context-pad"><i class="fa fa-play"></i></div>'),o.bind(n,"click",(function(){t._eventBus.fire(a,{element:e})})),[{element:e,html:n}]},s.$inject=["eventBus","elementRegistry","animation"],e.exports=s},function(e,t,n){e.exports=n(485)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t,n,o,r,a,s,l){var c=this;function u(e,t,n){var i=e[t];e[t]=function(){return n.call(this,i,arguments)}}function d(e,t){u(e,t,(function(e,t){if(!c.modelingDisabled)return e.apply(this,t)}))}function h(e,t){u(e,t,(function(e,t){if(c.modelingDisabled)throw new Error("model is read-only");return e.apply(this,t)}))}this._eventBus=e,this.modelingDisabled=!1,e.on(i,10001,(function(e){e=e.simulationModeActive,c.modelingDisabled=e,c.modelingDisabled&&(o.cancel(),t.close(),n.cancel()),s._update()})),d(t,"open"),d(n,"init"),d(o,"activate"),d(n,"init"),d(o,"activate"),h(a,"moveShape"),h(a,"updateAttachment"),h(a,"moveElements"),h(a,"moveConnection"),h(a,"layoutConnection"),h(a,"createConnection"),h(a,"createShape"),h(a,"createLabel"),h(a,"appendShape"),h(a,"removeElements"),h(a,"distributeElements"),h(a,"removeShape"),h(a,"removeConnection"),h(a,"replaceShape"),h(a,"pasteElements"),h(a,"alignElements"),h(a,"resizeShape"),h(a,"createSpace"),h(a,"updateWaypoints"),h(a,"reconnectStart"),h(a,"reconnectEnd"),u(r,"trigger",(function(e,t){var n=t[0];if(!(c.modelingDisabled&&-1<["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"].indexOf(n)))return e.apply(this,t)}))}o.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"],e.exports=o},function(e,t,n){e.exports=n(487)},function(e,t,n){"use strict";var i=n(13),o=(n=n(8)).TOGGLE_MODE_EVENT,r=n.RESET_SIMULATION_EVENT,a=n.GENERATE_TOKEN_EVENT;function s(e,t){var n=this;this._overlays=e,t.on(o,(function(e){e.simulationModeActive||n.removeElementNotifications()})),t.on([r,a],(function(){n.removeElementNotifications()}))}s.prototype.addElementNotifications=function(e,t){var n=this;e.forEach((function(e){n.addElementNotification(e,t)}))},s.prototype.addElementNotification=function(e,t){t='<div class="element-notification '+(t.type||"")+'">'+(t.icon?'<i class="fa '+t.icon+'"></i>':"")+('<span class="text">'+t.text+"</span>"||!1)+"</div>",t=i(t);this._overlays.add(e,"element-notification",{position:{top:-15,right:15},html:t,show:{minZoom:.5}})},s.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach((function(e){t.removeElementNotification(e)})):this._overlays.remove({type:"element-notification"})},s.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},s.$inject=["overlays","eventBus"],e.exports=s},function(e,t,n){e.exports=n(489)},function(e,t,n){"use strict";var i,o=n(27),r=(i=n(10)).is,a=i.supportedElements,s=(i=n(8)).TOGGLE_MODE_EVENT,l=i.GENERATE_TOKEN_EVENT,c=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function u(e){return e.labelTarget}function d(e,t,n,i,a){var c=this;this._eventBus=e,this._elementRegistry=t,this._elementNotifications=a,this._notifications=i,this.canvasParent=n.getContainer().parentNode,e.on(l,2e4,(function(e){return e=e.element,!r(e,"bpmn:StartEvent")||c.allElementsSupported()?void 0:(c.showWarnings(),o(c.canvasParent).add("warning"),!0)})),e.on(s,(function(e){e.simulationModeActive||o(c.canvasParent).remove("warning")}))}d.prototype.allElementsSupported=function(){var e=!0;return this._elementRegistry.forEach((function(t){r(t,c)||r(t,a)||u(t)||(e=!1)})),e},d.prototype.showWarnings=function(e){var t=this,n=[];this._elementRegistry.forEach((function(e){r(e,c)||r(e,a)||u(e)||(t.showWarning(e),n.indexOf(e.type)&&(t._notifications.showNotification(e.type+" not supported","warning"),n.push(e.type)))}))},d.prototype.showWarning=function(e){this._elementNotifications.addElementNotification(e,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},d.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"],e.exports=d},function(e,t,n){try{var i=n(146)}catch(e){i=n(146)}var o=/\s+/,r=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}e.exports=function(e){return new a(e)},a.prototype.add=function(e){var t;return this.list?this.list.add(e):(t=this.array(),~i(t,e)||t.push(e),this.el.className=t.join(" ")),this},a.prototype.remove=function(e){var t;return"[object RegExp]"==r.call(e)?this.removeMatching(e):(this.list?this.list.remove(e):(t=this.array(),~(e=i(t,e))&&t.splice(e,1),this.el.className=t.join(" ")),this)},a.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},a.prototype.toggle=function(e,t){return this.list?void 0!==t&&t===this.list.toggle(e,t)||this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},a.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(o);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~i(this.array(),e)}},function(e,t,n){e.exports=n(492)},function(e,t,n){"use strict";var i=n(10).is,o=n(8).TOGGLE_MODE_EVENT,r=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),a=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function s(e){return i(e,"bpmn:SequenceFlow")}function l(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,e.on(o,(function(e){e.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()}))}l.prototype.setSequenceFlowsDefault=function(){var e=this;this._elementRegistry.filter((function(e){return i(e,"bpmn:ExclusiveGateway")})).forEach((function(t){t.outgoing.filter(s).length&&e.setSequenceFlow(t,t.outgoing.filter(s)[0])}))},l.prototype.resetSequenceFlows=function(){var e=this;this._elementRegistry.filter((function(e){return i(e,"bpmn:ExclusiveGateway")})).forEach((function(t){t.outgoing.filter(s).length&&e.resetSequenceFlow(t)}))},l.prototype.resetSequenceFlow=function(e){e.sequenceFlow&&delete e.sequenceFlow},l.prototype.setSequenceFlow=function(e){var t,n,i=this,o=e.outgoing.filter(s);o.length&&(t=e.sequenceFlow,e.sequenceFlow=t?(t=(n=(t=e).outgoing.filter(s)).indexOf(t.sequenceFlow),n[t+1]||n[0]):o[0],e.outgoing.forEach((function(t){t===e.sequenceFlow?i.setColor(t,a):i.setColor(t,r)})))},l.prototype.setColor=function(e,t){e.businessObject.di.set("stroke",t),t=this._elementRegistry.getGraphics(e),this._graphicsFactory.update("connection",e,t)},l.$inject=["eventBus","elementRegistry","graphicsFactory"],e.exports=l},function(e,t,n){e.exports=n(494)},function(e,t,n){"use strict";var i,o=n(13),r=n(27),a=n(18),s=n(48),l=(i=n(10)).getBusinessObject,c=i.is,u=i.isTypedEvent,d=(i=n(8)).GENERATE_TOKEN_EVENT,h=i.CONSUME_TOKEN_EVENT,p=i.TOGGLE_MODE_EVENT,f=i.RESET_SIMULATION_EVENT,m=i.PROCESS_INSTANCE_CREATED_EVENT;function g(e){return e&&e.businessObject.name}function v(e,t,n,i){var o=this;this._notifications=t,this._tokenSimulationPalette=n,this._canvas=i,this._init(),e.on(d,(function(e){var t=g(e=e.element);c(e,"bpmn:BusinessRuleTask")?o.log(t||"Business Rule Task","info","bpmn-icon-business-rule"):c(e,"bpmn:CallActivity")?o.log(t||"Call Activity","info","bpmn-icon-call-activity"):c(e,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"])?o.log(t||"Intermediate Event","info","bpmn-icon-intermediate-event-none"):c(e,"bpmn:ManualTask")?o.log(t||"Manual Task","info","bpmn-icon-manual"):c(e,"bpmn:ScriptTask")?o.log(t||"Script Task","info","bpmn-icon-script"):c(e,"bpmn:ServiceTask")?o.log(t||"Service Task","info","bpmn-icon-service"):c(e,"bpmn:StartEvent")?o.log(t||"Start Event","info","bpmn-icon-start-event-none"):c(e,"bpmn:Task")?o.log(t||"Task","info","bpmn-icon-task"):c(e,"bpmn:UserTask")?o.log(t||"User Task","info","bpmn-icon-user"):!c(e,"bpmn:ExclusiveGateway")||e.outgoing.length<2||(t=t||"Gateway",(e=g(e.sequenceFlow))&&(t=t.concat(' <i class="fa fa-angle-right" aria-hidden="true"></i> '+e)),o.log(t,"info","bpmn-icon-gateway-xor"))})),e.on(h,(function(e){var t=g(e=e.element);c(e,"bpmn:EndEvent")&&(u(l(e),"bpmn:TerminateEventDefinition")?o.log(t||"Terminate End Event","info","bpmn-icon-end-event-terminate"):o.log(t||"End Event","info","bpmn-icon-end-event-none"))})),e.on(m,(function(e){var t=e.processInstanceId;e=e.parent;c(e,"bpmn:Process")?o.log("Process "+t+" started","success","fa-check"):o.log("Subprocess "+t+" started","info","fa-check")})),e.on(p,(function(e){e.simulationModeActive||(o.emptyLog(),r(o.container).add("hidden"))})),e.on(f,(function(e){o.emptyLog(),r(o.container).add("hidden")}))}v.prototype._init=function(){var e=this;this.container=o('<div class="token-simulation-log hidden"><div class="header"><i class="fa fa-align-left"></i><button class="close"><i class="fa fa-times" aria-hidden="true"></i></button></div><div class="content"><p class="entry placeholder">No Entries</p></div></div>'),this.placeholder=s(".placeholder",this.container),this.content=s(".content",this.container),a.bind(this.content,"wheel",(function(e){e.stopPropagation()})),a.bind(this.content,"mousedown",(function(e){e.stopPropagation()})),this.close=s(".close",this.container),a.bind(this.close,"click",(function(){r(e.container).add("hidden")})),this.icon=s(".fa-align-left",this.container),a.bind(this.icon,"click",(function(){r(e.container).add("hidden")})),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=o('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),a.bind(this.paletteEntry,"click",(function(){r(e.container).remove("hidden")})),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},v.prototype.toggle=function(){var e=this.container;r(e).has("hidden")?r(e).remove("hidden"):r(e).add("hidden")},v.prototype.log=function(e,t,n){r(this.placeholder).add("hidden");var i=(i=new Date).toLocaleTimeString()+":"+i.getUTCMilliseconds();this._notifications.showNotification(e,t,n),n=(n=n||"fa-info").includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>',t=o('<p class="entry '+t+'"><span class="date">'+i+"</span>"+n+"</span>"+e+"</p>");this.content.appendChild(t),this.content.scrollTop=this.content.scrollHeight},v.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=o('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},v.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"],e.exports=v},function(e,t,n){e.exports=n(496)},function(e,t,n){"use strict";var i=n(13),o=n(8).TOGGLE_MODE_EVENT;function r(e,t){var n=this;this._eventBus=e,this._canvas=t,this._init(),e.on(o,(function(e){e.simulationModeActive||n.removeAll()}))}r.prototype._init=function(){this.container=i('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},r.prototype.showNotification=function(e,t,n){n=(n=n||"fa-info").includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var o=i('<div class="notification '+t+'"><span class="icon">'+n+"</span>"+e+"</div>");for(this.container.appendChild(o);5<this.container.children.length;)this.container.children[0].remove();setTimeout((function(){o.remove()}),2e3)},r.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},r.$inject=["eventBus","canvas"],e.exports=r},function(e,t,n){e.exports=n(498)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=(n=n(8)).TOGGLE_MODE_EVENT,s=n.PLAY_SIMULATION_EVENT,l=n.PAUSE_SIMULATION_EVENT,c=n.RESET_SIMULATION_EVENT,u=n.ANIMATION_CREATED_EVENT,d=n.PROCESS_INSTANCE_CREATED_EVENT,h='<i class="fa fa-play"></i>';function p(e,t,n,i){var o=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),e.on(d,(function(e){e.parent.parent||(o.activate(),o.unpause(),n.showNotification("Start Simulation","info"))})),e.on([c,a],(function(){o.deactivate(),o.unpause()})),e.on(u,(function(e){e=e.animation,o.isPaused&&e.pause()}))}p.prototype._init=function(){this.paletteEntry=i('<div class="entry disabled" title="Play/Pause Simulation">'+h+"</div>"),r.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},p.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},p.prototype.pause=function(){this.isActive&&(o(this.paletteEntry).remove("active"),o(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=h,this._eventBus.fire(l),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},p.prototype.unpause=function(){this.isActive&&(o(this.paletteEntry).add("active"),o(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(s),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},p.prototype.activate=function(){this.isActive=!0,o(this.paletteEntry).remove("disabled")},p.prototype.deactivate=function(){this.isActive=!1,o(this.paletteEntry).remove("active"),o(this.paletteEntry).add("disabled")},p.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"],e.exports=p},function(e,t,n){e.exports=n(500)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t,n){var o=this;this._elementRegistry=t,this._graphicsFactory=n,this.elementColors={},e.on(i,5e4,(function(e){e.simulationModeActive?o.preserveColors():o.resetColors()}))}o.prototype.preserveColors=function(){var e=this;this._elementRegistry.forEach((function(t){e.elementColors[t.id]={stroke:t.businessObject.di.get("stroke"),fill:t.businessObject.di.get("fill")},e.setColor(t,"#000","#fff")}))},o.prototype.resetColors=function(){var e=this;this._elementRegistry.forEach((function(t){e.elementColors[t.id]&&e.setColor(t,e.elementColors[t.id].stroke,e.elementColors[t.id].fill)})),this.elementColors={}},o.prototype.setColor=function(e,t,n){(i=e.businessObject).di.set("stroke",t),i.di.set("fill",n),t=this._elementRegistry.getGraphics(e);var i=e.waypoints?"connection":"shape";this._graphicsFactory.update(i,e,t)},o.$inject=["eventBus","elementRegistry","graphicsFactory"],e.exports=o},function(e,t,n){e.exports=n(502)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.RESET_SIMULATION_EVENT;function r(e){this.nextProcessInstanceId=1,e.on(i,this.reset.bind(this)),e.on(o,this.reset.bind(this))}r.prototype.getNext=function(){var e=this.nextProcessInstanceId;return this.nextProcessInstanceId++,e},r.prototype.reset=function(){this.nextProcessInstanceId=1},r.$inject=["eventBus"],e.exports=r},function(e,t,n){e.exports=n(504)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.PROCESS_INSTANCE_CREATED_EVENT,r=n.PROCESS_INSTANCE_FINISHED_EVENT,a=n.PROCESS_INSTANCE_SHOWN_EVENT,s=n.PROCESS_INSTANCE_HIDDEN_EVENT;function l(e,t,n,a){var s=this;this._animation=e,this._eventBus=t,this._processInstances=n,this._elementRegistry=a,this._eventBus.on(o,500,(function(e){var t=e.parent,i=(e=e.processInstanceId,n.getProcessInstances(t).filter((function(e){return!e.isFinished})));1===i.length?s.showProcessInstance(e,t):1<i.length&&s.hideProcessInstance(e)})),this._eventBus.on(r,500,(function(e){var t=e.parent,i=e.processInstanceId;(e=n.getProcessInstances(t).filter((function(e){return i!==e.processInstanceId&&!e.isFinished}))).length&&i===t.shownProcessInstance?s.showProcessInstance(e[0].processInstanceId,t):delete t.shownProcessInstance,t.parent||a.forEach((function(e){delete e.shownProcessInstance}))})),t.on(i,(function(){a.forEach((function(e){delete e.shownProcessInstance}))}))}l.prototype.showProcessInstance=function(e,t){this._animation.showProcessInstanceAnimations(e),t.shownProcessInstance=e,this._eventBus.fire(a,{processInstanceId:e})},l.prototype.hideProcessInstance=function(e){this._animation.hideProcessInstanceAnimations(e),this._eventBus.fire(s,{processInstanceId:e})},l.prototype.showNext=function(e){var t=this,n=this._processInstances.getProcessInstances(e),i=e.shownProcessInstance,o=0;for(let e=0;e<n.length&&n[e].processInstanceId!==i;e++)o++;n.forEach((function(e){t.hideProcessInstance(e.processInstanceId)})),o===n.length-1?this.showProcessInstance(n[0].processInstanceId,e):this.showProcessInstance(n[o+1].processInstanceId,e)},l.$inject=["animation","eventBus","processInstances","elementRegistry"],e.exports=l},function(e,t,n){e.exports=n(506)},function(e,t,n){"use strict";var i=(n=n(8)).TOGGLE_MODE_EVENT,o=n.RESET_SIMULATION_EVENT,r=n.PROCESS_INSTANCE_CREATED_EVENT,a=n.PROCESS_INSTANCE_FINISHED_EVENT;function s(e,t){var n=this;this._eventBus=e,this._processInstanceIds=t,this.processInstances=[],e.on([i,o],(function(){n.processInstances=[]}))}s.prototype.create=function(e,t){var n=this._processInstanceIds.getNext();e={parent:e,processInstanceId:n,parentProcessInstanceId:t};return this.processInstances.push(e),this._eventBus.fire(r,e),n},s.prototype.remove=function(e){this.processInstances=this.processInstances.filter((function(t){return t.processInstanceId!==e}))},s.prototype.finish=function(e){var t=this.processInstances.find((function(t){return t.processInstanceId===e}));this._eventBus.fire(a,t),t.isFinished=!0},s.prototype.getProcessInstances=function(e,t){var n;return e?(n=this.processInstances.filter((function(t){return t.parent===e})),t&&!0!==t.includeFinished?n.filter((function(e){return!e.isFinished})):n):this.processInstances},s.prototype.getProcessInstance=function(e){return this.processInstances.find((function(t){return t.processInstanceId===e}))},s.$inject=["eventBus","processInstanceIds"],e.exports=s},function(e,t,n){e.exports=n(508)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(10).is,s=(n=n(8)).TOGGLE_MODE_EVENT,l=n.GENERATE_TOKEN_EVENT,c=n.RESET_SIMULATION_EVENT;function u(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this._elementRegistry=i,this._init(),e.on(l,(function(e){a(e.element,"bpmn:StartEvent")&&o(r.paletteEntry).remove("disabled")})),e.on(s,(function(e){e.simulationModeActive||r.resetSimulation()}))}u.prototype._init=function(){var e=this;this.paletteEntry=i('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),r.bind(this.paletteEntry,"click",(function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")})),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},u.prototype.resetSimulation=function(){o(this.paletteEntry).add("disabled"),this._elementRegistry.forEach((function(e){void 0!==e.tokenCount&&delete e.tokenCount})),this._eventBus.fire(c)},u.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"],e.exports=u},function(e,t,n){e.exports=n(510)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(8).TOGGLE_MODE_EVENT;function l(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(s,(function(e){e.simulationModeActive?o(i.container).remove("hidden"):o(i.container).add("hidden")}))}l.prototype._init=function(){var e=this,t=(this.container=i('<div class="set-animation-speed hidden"><i title="Set Animation Speed" class="fa fa-tachometer" aria-hidden="true"></i><div class="animation-speed-buttons"><div title="Slow" id="animation-speed-1" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Normal" id="animation-speed-2" class="animation-speed-button active"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Fast" id="animation-speed-3" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div></div></div>'),a("#animation-speed-1",this.container)),n=a("#animation-speed-2",this.container),o=a("#animation-speed-3",this.container);r.bind(t,"click",(function(){e.setActive(t),e._animation.setAnimationSpeed(.5)})),r.bind(n,"click",(function(){e.setActive(n),e._animation.setAnimationSpeed(1)})),r.bind(o,"click",(function(){e.setActive(o),e._animation.setAnimationSpeed(1.5)})),this._canvas.getContainer().appendChild(this.container)},l.prototype.setActive=function(e){a.all(".animation-speed-button",this.container).forEach((function(e){o(e).remove("active")})),o(e).add("active")},l.$inject=["canvas","animation","eventBus"],e.exports=l},function(e,t,n){e.exports=n(512)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(513),l=(n=n(8)).TOGGLE_MODE_EVENT,c=n.PROCESS_INSTANCE_CREATED_EVENT,u=n.PROCESS_INSTANCE_FINISHED_EVENT,d=n.PROCESS_INSTANCE_SHOWN_EVENT,h=n.PROCESS_INSTANCE_HIDDEN_EVENT,p=n.RESET_SIMULATION_EVENT,f=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),m=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function g(e){return null===e}function v(e,t,n,i,r,a){var f=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=a,this.highlightedElement=null,this._init(),e.on(l,(function(e){e.simulationModeActive?o(f.container).remove("hidden"):(o(f.container).add("hidden"),s(f.container),g(f.highlightedElement)||(f.removeHighlightFromProcess(f.highlightedElement.element),f.highlightedElement=null))})),e.on(c,(function(e){f.addInstance(e)})),e.on(u,(function(e){f.removeInstance(e)})),e.on(d,(function(e){f.setInstanceShown(e.processInstanceId)})),e.on(h,(function(e){f.setInstanceHidden(e.processInstanceId)})),e.on(p,(function(){f.removeAllInstances()}))}v.prototype._init=function(){this.container=i('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},v.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,o=e.parent;e=i('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");r.bind(e,"click",(function(){t._processInstances.getProcessInstances(o).forEach((function(e){t._processInstanceSettings.hideProcessInstance(e.processInstanceId)})),t._processInstanceSettings.showProcessInstance(n,o)})),r.bind(e,"mouseenter",(function(){t.highlightedElement={element:o,stroke:o.businessObject.di.get("stroke"),fill:o.businessObject.di.get("fill")},t.addHighlightToProcess(o)})),r.bind(e,"mouseleave",(function(){t.removeHighlightFromProcess(o),t.highlightedElement=null})),this.container.appendChild(e)},v.prototype.removeInstance=function(e){e=e.processInstanceId,(e=a("#instance-"+e,this.container))&&e.remove()},v.prototype.removeAllInstances=function(){this.container.innerHTML=""},v.prototype.setInstanceShown=function(e){(e=a("#instance-"+e,this.container))&&o(e).add("active")},v.prototype.setInstanceHidden=function(e){(e=a("#instance-"+e,this.container))&&o(e).remove("active")},v.prototype.addHighlightToProcess=function(e){this.setColor(e,m,f),e.parent||o(this._canvas.getContainer()).add("highlight")},v.prototype.removeHighlightFromProcess=function(e){g(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent)||o(this._canvas.getContainer()).remove("highlight")},v.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n),t=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,t)},v.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"],e.exports=v},function(e,t){e.exports=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}},function(e,t,n){e.exports=n(515)},function(e,t,n){"use strict";var i=n(10),o=i.getBusinessObject,r=i.is,a=i.isAncestor,s=i.isTypedEvent,l=n(8).CONSUME_TOKEN_EVENT;function c(e,t,n,i,o,r,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=o,this._canvas=r,this._processInstances=a,e.on(l,250,(function(){}))}c.prototype.isDeadlock=function(){var e=this,t=[],n=(this._elementRegistry.forEach((function(e){e.tokenCount&&t.push(e)})),[]),i=[];t.forEach((function(e){e.outgoing.filter((function(e){return r(e,"bpmn:SequenceFlow")})).length||n.push(e),r(e,"bpmn:ParallelGateway")&&e.incoming.filter((function(e){return r(e,"bpmn:SequenceFlow")})).length>e.tokenCount&&n.push(e);var t=[];!function e(n){n.outgoing.forEach((function(r){-1===t.indexOf(r.target)&&(t.push(r.target),s(o(r.target),"bpmn:TerminateEventDefinition")&&i.push(n),e(r.target))}))}(e)})),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach((function(t){e._elementNotifications.addElementNotification(t,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})})))},c.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1,o=((n=n||this._canvas.getRootElement()).children.forEach((function(e){e.tokenCount&&e.tokenCount[t]&&e.tokenCount[t].length&&(i=!0)})),!1);if(this._animation.animations.forEach((function(e){a(n,e.element)&&e.processInstanceId===t&&(o=!0)})),!i&&!o)return r(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},c.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"],e.exports=c},function(e,t,n){e.exports=n(517)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(18),a=n(48),s=n(8).TOGGLE_MODE_EVENT;function l(e,t,n,i){var o=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",(function(){o.canvasParent=o._canvas.getContainer().parentNode,o.palette=a(".djs-palette",o._canvas.getContainer()),o._init()}))}l.prototype._init=function(){this.container=i('\n <div class="toggle-mode">\n Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>\n </div>\n '),r.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},l.prototype.toggleMode=function(){var e;this.simulationModeActive?(this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',o(this.canvasParent).remove("simulation"),o(this.palette).remove("hidden"),this._eventBus.fire(s,{simulationModeActive:!1}),1===(e=this._selection.get()).length&&this._contextPad.open(e[0])):(this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',o(this.canvasParent).add("simulation"),o(this.palette).add("hidden"),this._eventBus.fire(s,{simulationModeActive:!0})),this.simulationModeActive=!this.simulationModeActive},l.$inject=["eventBus","canvas","selection","contextPad"],e.exports=l},function(e,t,n){e.exports=n(519)},function(e,t,n){"use strict";var i=n(13),o=n(10).isAncestor,r=(n=n(8)).TOGGLE_MODE_EVENT,a=n.GENERATE_TOKEN_EVENT,s=n.CONSUME_TOKEN_EVENT,l=n.RESET_SIMULATION_EVENT,c=n.TERMINATE_EVENT,u=n.PROCESS_INSTANCE_SHOWN_EVENT;function d(e,t,n,i,o){var d=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=o,this.overlayIds={},e.on(r,(function(e){e.simulationModeActive||d.removeTokenCounts()})),e.on(l,(function(){d.removeTokenCounts()})),e.on(c,(function(e){e=e.element.parent,d.removeTokenCounts(e)})),e.on([a,s],500,(function(e){e=e.element.parent,d.removeTokenCounts(e),d.addTokenCounts(e)})),e.on(u,(function(e){e=e.processInstanceId,e=o.getProcessInstance(e).parent,d.removeTokenCounts(e),d.addTokenCounts(e)}))}d.prototype.addTokenCounts=function(e){var t=this,n=(e=e||this._canvas.getRootElement()).shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach((function(i){o(e,i)&&t.addTokenCount(i,n)}))},d.prototype.addTokenCount=function(e,t){(t=e.tokenCount&&e.tokenCount[t])&&(t=this.createTokenCount(t),t=this._overlays.add(e,"token-count",{position:{bottom:10,left:-15},html:t,show:{minZoom:.5}}),this.overlayIds[e.id]=t)},d.prototype.createTokenCount=function(e){return i('<div class="token-count waiting">'+e+"</div>")},d.prototype.removeTokenCounts=function(e){var t=this;e=e||this._canvas.getRootElement(),this._elementRegistry.forEach((function(n){o(e,n)&&t.removeTokenCount(n)}))},d.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},d.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"],e.exports=d},function(e,t,n){e.exports=n(521)},function(e,t,n){"use strict";var i=n(522),o=n(523),r=n(524),a=n(525),s=n(526),l=n(527),c=n(528),u=n(529),d=n(530),h=n(531),p=(n=n(8)).GENERATE_TOKEN_EVENT,f=n.CONSUME_TOKEN_EVENT;function m(e,t,n){var m=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",i),this.registerHandler("bpmn:EventBasedGateway",o),this.registerHandler("bpmn:ExclusiveGateway",r),this.registerHandler("bpmn:IntermediateCatchEvent",a),this.registerHandler("bpmn:IntermediateThrowEvent",s),this.registerHandler("bpmn:ParallelGateway",l),this.registerHandler("bpmn:StartEvent",c),this.registerHandler("bpmn:SubProcess",u),this.registerHandler("bpmn:BoundaryEvent",d),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],h),e.on(p,(function(e){var t=e.element;if(!m.handlers[t.type])throw new Error("no handler for type "+t.type);m.handlers[t.type].generate(e)})),e.on(f,(function(e){var t=e.element;if(!m.handlers[t.type])throw new Error("no handler for type "+t.type);m.handlers[t.type].consume(e)}))}m.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);(e=Array.isArray(e)?e:[e]).forEach((function(e){n.handlers[e]=i}))},m.$inject=["eventBus","animation","injector"],e.exports=m},function(e,t,n){"use strict";var i,o=(i=n(10)).getBusinessObject,r=i.is,a=i.isAncestor,s=i.getDescendants,l=i.isTypedEvent,c=(i=n(8)).GENERATE_TOKEN_EVENT,u=i.TERMINATE_EVENT,d=i.UPDATE_ELEMENTS_EVENT;function h(e,t,n,i,o,r){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=o,this._processInstances=r}h.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=l(o(t),"bpmn:TerminateEventDefinition"),h=r(t.parent,"bpmn:SubProcess");(e=(i&&(this._eventBus.fire(u,e),this._elementRegistry.forEach((function(e){a(t.parent,e)&&e.tokenCount&&e.tokenCount[n]&&delete e.tokenCount[n]})),this._processInstances.finish(n)),this._simulationState.isFinished(t,n)))&&this._processInstances.finish(n),(e||i)&&h&&(e=this._processInstances.getProcessInstance(n),this._eventBus.fire(c,{element:t.parent,processInstanceId:e.parentProcessInstanceId})),this._eventBus.fire(d,{elements:s(this._elementRegistry.getAll(),t.parent)})},h.prototype.generate=function(e){},h.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"],e.exports=h},function(e,t,n){"use strict";var i=n(10).is,o=n(8).UPDATE_ELEMENTS_EVENT;function r(e,t){this._eventBus=e,this._animation=t}r.prototype.consume=function(e){var t=e.element,n=(e=e.processInstanceId,e=(t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,t.outgoing),[]);e.forEach((function(e){e=e.target,i(e,"bpmn:IntermediateCatchEvent")&&n.push(e)})),this._eventBus.fire(o,{elements:n})},r.prototype.generate=function(){},r.$inject=["eventBus","animation"],e.exports=r},function(e,t,n){"use strict";var i=(n=n(8)).CONSUME_TOKEN_EVENT,o=n.GENERATE_TOKEN_EVENT;function r(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}r.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(o,e)},r.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var o=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,(function(){o._eventBus.fire(i,{element:r.target,processInstanceId:n})}))},r.$inject=["eventBus","animation","elementRegistry"],e.exports=r},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENT_EVENT,a=n.UPDATE_ELEMENTS_EVENT;function s(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}s.prototype.consume=function(e){var t=e.element;e=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,this._eventBus.fire(r,{element:t})},s.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId,s=(n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))})),n.parent);e=this._elementRegistry.filter((function(e){return i(e,"bpmn:IntermediateCatchEvent")&&e.parent===s}));this._eventBus.fire(a,{elements:e})},s.$inject=["animation","eventBus","elementRegistry"],e.exports=s},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){this._eventBus.fire(r,{element:e})},a.prototype.generate=function(e){var t=this;e.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,(function(){t._eventBus.fire(o,{element:e.target})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(r,e),t.tokenCount[n]=0)},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENTS_EVENT;function a(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}a.prototype.consume=function(){},a.prototype.generate=function(e){var t=this,n=e.element,a=(e=e.parentProcessInstanceId,n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")}))),s=n.parent,l=this._processInstances.create(s,e);a.forEach((function(e){t._animation.createAnimation(e,l,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:l})}))})),i(n.parent,"bpmn:SubProcess")||(s=this._elementRegistry.filter((function(e){return i(e,"bpmn:StartEvent")})),this._eventBus.fire(r,{elements:s}))},a.$inject=["animation","eventBus","elementRegistry","processInstances"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT,a=n.UPDATE_ELEMENT_EVENT;function s(e,t,n){this._animation=e,this._eventBus=t,this._log=n}s.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,o=t.children.filter((function(e){return i(e,"bpmn:StartEvent")}))[0];o?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(r,{element:o,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(r,e)),this._eventBus.fire(a,{element:t})},s.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))})),this._eventBus.fire(a,{element:n})},s.$inject=["animation","eventBus","log"],e.exports=s},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.UPDATE_ELEMENT_EVENT;function a(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}a.prototype.consume=function(e){var t=e.element;e=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[e]||(t.tokenCount[e]=0),t.tokenCount[e]++,this._eventBus.fire(r,{element:t})},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus","elementRegistry"],e.exports=a},function(e,t,n){"use strict";var i=n(10).is,o=(n=n(8)).CONSUME_TOKEN_EVENT,r=n.GENERATE_TOKEN_EVENT;function a(e,t){this._animation=e,this._eventBus=t}a.prototype.consume=function(e){this._eventBus.fire(r,e)},a.prototype.generate=function(e){var t=this,n=e.element,r=e.processInstanceId;n.outgoing.filter((function(e){return i(e,"bpmn:SequenceFlow")})).forEach((function(e){t._animation.createAnimation(e,r,(function(){t._eventBus.fire(o,{element:e.target,processInstanceId:r})}))}))},a.$inject=["animation","eventBus"],e.exports=a},function(e,t,n){e.exports=n(533)},function(e,t,n){"use strict";function i(e,t,n,i,o,r){r.register({toggleTokenSimulation:function(){t.toggleMode()}}),r.register({togglePauseTokenSimulation:function(){n.toggle()}}),r.register({resetTokenSimulation:function(){o.resetSimulation()}}),r.register({toggleTokenSimulationLog:function(){i.toggle()}})}i.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"],e.exports=i},function(e,t,n){e.exports=n(535)},function(e,t,n){"use strict";var i=n(8).TOGGLE_MODE_EVENT;function o(e,t){var n,o=t.get("editorActions",!1),a=t.get("keyboard",!1);a&&o&&(n=!1,e.on("keyboard.init",(function(){a.addListener(1e4,(function(e){r(["t","T"],e=e=e.keyEvent)?o.trigger("toggleTokenSimulation"):n&&(r(["l","L"],e)?o.trigger("toggleTokenSimulationLog"):r([" ","Spacebar"],e)?o.trigger("togglePauseTokenSimulation"):r(["r","R"],e)&&o.trigger("resetTokenSimulation"))}))})),e.on(i,(function(e){e=e.simulationModeActive,n=!!e})))}function r(e,t){return-1<e.indexOf(t.key)}o.$inject=["eventBus","injector"],e.exports=o},function(e,t,n){e.exports=n(537)},function(e,t,n){"use strict";var i=n(13),o=n(27),r=n(8).TOGGLE_MODE_EVENT;function a(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(r,(function(e){e.simulationModeActive?o(n.container).remove("hidden"):o(n.container).add("hidden")}))}a.prototype._init=function(){this.container=i('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},a.prototype.addEntry=function(e,t){var n=0;this.entries.forEach((function(e){t>=e.index&&n++})),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},a.$inject=["eventBus","canvas"],e.exports=a},function(e,t,n){"use strict";var i=n(0).isFunction,o=n(0).isObject,r=n(0).some;function a(e){var t=this;e.on("moddleCopy.canCopyProperty",(function(e){var n=e.property;e=e.parent;return t.canCopyProperty(n,e)}))}function s(e,t){return e&&i(e.$instanceOf)&&e.$instanceOf(t)}function l(e,t){return r(t,(function(t){return s(e,t)}))}function c(e,t){return t?s(e,t)?e:e.$parent?c(e.$parent,t):void 0:e.$parent}a.$inject=["eventBus"],a.prototype.canCopyProperty=function(e,t){return!(o(e)&&!function(e,t){return!(e=(e=e.$type&&e.$model.getTypeDescriptor(e.$type))&&e.meta&&e.meta.allowedIn)||function(e){return-1!==e.indexOf("*")}(e)||r(e,(function(e){return c(t,e)}))}(e,t)||s(e,"camunda:InputOutput")&&!this.canHostInputOutput(t)||l(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t)||s(e,"camunda:In")&&!this.canHostIn(t))&&void 0},a.prototype.canHostInputOutput=function(e){return!!c(e,"camunda:Connector")||!!(e=c(e,"bpmn:FlowNode"))&&!(l(e,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])||s(e,"bpmn:SubProcess")&&e.get("triggeredByEvent"))},a.prototype.canHostConnector=function(e){return!s(c(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||c(e,"bpmn:IntermediateThrowEvent")||c(e,"bpmn:EndEvent")},a.prototype.canHostIn=function(e){return!!c(e,"bpmn:CallActivity")||!c(e,"bpmn:SignalEventDefinition")||c(e,"bpmn:IntermediateThrowEvent")||c(e,"bpmn:EndEvent")},e.exports=a},function(e,t,n){"use strict";var i=n(0).some,o={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function r(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function a(e,t){return(n=e)&&n.length&&i(e,(function(e){return r(e,t)}));var n}function s(e,t,n){t=t.name;var a,s=o[t.replace(/activiti:/,"")];return t===e&&(a=n,i(s,(function(e){return r(a,e)})))}function l(e){e.on("property.clone",(function(e){var t=e.newElement;e=e.propertyDescriptor;this.canCloneProperty(t,e)}),this)}l.$inject=["eventBus"],l.prototype.canCloneProperty=function(e,t){return s("activiti:FailedJobRetryTimeCycle",t,e)?a(e.eventDefinitions,"bpmn:TimerEventDefinition")||a(e.eventDefinitions,"bpmn:SignalEventDefinition")||r(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):s("activiti:Connector",t,e)||s("activiti:Field",t,e)?a(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0},e.exports=l},function(e,t,n){"use strict";var i=n(0).some,o={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function r(e,t){return e&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function a(e,t){return(n=e)&&n.length&&i(e,(function(e){return r(e,t)}));var n}function s(e,t,n){t=t.name;var a,s=o[t.replace(/flowable:/,"")];return t===e&&(a=n,i(s,(function(e){return r(a,e)})))}function l(e){e.on("property.clone",(function(e){var t=e.newElement;e=e.propertyDescriptor;this.canCloneProperty(t,e)}),this)}l.$inject=["eventBus"],l.prototype.canCloneProperty=function(e,t){return s("flowable:FailedJobRetryTimeCycle",t,e)?a(e.eventDefinitions,"bpmn:TimerEventDefinition")||a(e.eventDefinitions,"bpmn:SignalEventDefinition")||r(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):s("flowable:Connector",t,e)||s("flowable:Field",t,e)?a(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0},e.exports=l},function(e,t,n){"use strict";var i=n(147);function o(e,t,n){var o=i.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:o}),o.length&&o.forEach((function(i){e.set(i,t.inverse,n)}))}function r(e,t){if(!(this instanceof r))return new r(e,t);(e.inverse=t).inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}r.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}var n,i,r,a;t.collection?o(this,t,e):(n=this,i=e,r=(e=t).inverse,a=i[e.name],Object.defineProperty(i,e.name,{configurable:e.configurable,enumerable:e.enumerable,get:function(){return a},set:function(e){var t;e!==a&&(t=a,a=null,t&&n.unset(t,r,i),a=e,n.set(a,r,i))}}))},r.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return i.isExtended(n)||o(this,t,e),n},r.prototype.ensureBound=function(e,t){var n;n=t,Object.prototype.hasOwnProperty.call(e,n.name||n)||this.bind(e,t)},r.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},r.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)},e.exports=r},function(e,t,n){"use strict";n.r(t);var i=n(7),o=(i=n.n(i),n(110));n=n.n(o),o={insert:"head",singleton:!1};i()(n.a,o),t.default=n.a.locals||{}},function(e,t,n){var i=n(544);(i="string"==typeof(i=i.__esModule?i.default:i)?[[e.i,i,""]]:i).locals&&(e.exports=i.locals),(0,n(5).default)("3ae8271d",i,!0,{})},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,".taskMenus-item[data-v-44afa99a]{display:flex;align-items:center;height:40px}.taskMenus/deep/.el-checkbox[data-v-44afa99a]{margin-right:20px}",""])},function(e){e.exports=JSON.parse('{"name":"tianheng-ui","description":"A Vue.js project","version":"0.0.91","author":"shu lang <403732931@qq.com>","license":"MIT","private":false,"main":"./lib/tianheng-ui.js","style":"lib/theme-chalk/index.css","scripts":{"dev":"cross-env NODE_ENV=development webpack-dev-server --open --hot --mode=development","build":"cross-env NODE_ENV=preview webpack --progress --hide-modules --mode=production","build:npm":"cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production"},"dependencies":{"ace-builds":"^1.4.13","axios":"^0.27.2","bpmn-js-sketchy":"^0.5.3","bpmn-js-task-resize":"^1.2.0","bpmn-js-token-simulation":"^0.10.0","clipboard":"^2.0.11","diagram-js-minimap":"^2.0.4","element-ui":"^2.15.6","highlight.js":"^10.5.0","min-dash":"^3.5.2","mini-css-extract-plugin":"^1.6.2","normalize.css":"^8.0.1","nprogress":"^0.2.0","viewerjs":"^1.10.5","vue":"^2.5.11","vue-i18n":"^5.0.3","vue-router":"^3.5.3","vue2-editor":"^2.10.3","vuedraggable":"^2.24.3","vuex":"^3.6.2","x2js":"^3.4.2","xlsx":"^0.18.5","xml-js":"^1.6.11"},"browserslist":["> 1%","last 2 versions","not ie <= 8"],"devDependencies":{"@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-json-strings":"^7.0.0","@babel/plugin-syntax-dynamic-import":"^7.0.0","@babel/plugin-syntax-import-meta":"^7.0.0","@babel/preset-env":"^7.0.0","@types/ace":"0.0.42","@vue/babel-helper-vue-jsx-merge-props":"^1.4.0","@vue/babel-preset-jsx":"^1.4.0","babel-loader":"^8.2.5","babel-plugin-component":"^1.1.1","babel-plugin-import":"^1.13.5","bpmn-js":"^8.8.3","bpmn-js-properties-panel":"^0.37.2","camunda-bpmn-moddle":"^4.4.1","cross-env":"^5.0.5","css-loader":"^0.28.7","file-loader":"^1.1.4","html-webpack-plugin":"^4.5.0","less":"^3.9.0","less-loader":"^4.1.0","sass":"^1.55.0","sass-loader":"^7.3.1","style-loader":"^2.0.0","uglifyjs-webpack-plugin":"^2.2.0","vue-loader":"^14.2.4","vue-template-compiler":"^2.4.4","webpack":"^4.46.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.3"},"files":["lib","packages"],"homepage":"https://tianhengui.demo.tianhengyun.com/","keywords":["tianheng","tianheng-ui"]}')},function(e,t,n){"use strict";n.r(t),n.d(t,"install",(function(){return rS})),n.d(t,"Cell",(function(){return o})),n.d(t,"Icons",(function(){return a})),n.d(t,"Table",(function(){return d})),n.d(t,"TableAction",(function(){return p})),n.d(t,"TableSearch",(function(){return m})),n.d(t,"TableTools",(function(){return v})),n.d(t,"Empty",(function(){return y})),n.d(t,"Dialog",(function(){return x})),n.d(t,"Card",(function(){return k})),n.d(t,"Grid",(function(){return C})),n.d(t,"GridItem",(function(){return T})),n.d(t,"CodeEditor",(function(){return O})),n.d(t,"VueEditor",(function(){return D})),n.d(t,"Button",(function(){return R})),n.d(t,"Image",(function(){return I})),n.d(t,"ImagePreview",(function(){return F})),n.d(t,"Row",(function(){return B})),n.d(t,"Col",(function(){return z})),n.d(t,"Upload",(function(){return Y})),n.d(t,"FormMaking",(function(){return Cl})),n.d(t,"FormGenerate",(function(){return Sl})),n.d(t,"TableMaking",(function(){return Ml})),n.d(t,"TableGenerate",(function(){return ql})),n.d(t,"Workflow",(function(){return iS}));var i=n(21),o=(i.a.install=function(e){e.component(i.a.name,i.a)},i.a),r=n(37),a=(r.a.install=function(e){e.component(r.a.name,r.a)},r.a),s={name:"TableColumn",props:{options:{type:Array,default:function(){return[]}}}},l=n(1);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}s={name:"ThTable",components:{TableColumn:Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._l(e.options,(function(t,i){return[t.hide?e._e():[t.type?n("el-table-column",{key:i,attrs:{type:t.type,label:t.label,width:"50"}}):t.children?n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align,fixed:t.fixed,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip}},[n("TableColumn",{key:i,attrs:{options:t.children}})],1):n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align,fixed:t.fixed,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip},scopedSlots:e._u([{key:"default",fn:function(i){return[t.slot?e._t("slot",null,{scope:i,option:t}):n("span",[e._v(e._s(i.row[t.prop]))])]}}],null,!0)})]]}))],2)}),[],!1,(function(e){n(221)}),null,null).exports},props:{data:{type:Array,default:function(){return[]}},options:{type:Array,default:function(){return[]}},dblclick:{type:Function,default:function(){return null}},stripe:{type:Boolean,default:function(){return!1}},treeProps:{type:Object,default:function(){return{}}},pageInfo:{type:Object,default:function(){return{}}},loading:{type:Boolean,default:function(){return!1}},height:String|Number,rowKey:String|Function,showPage:{type:Boolean,default:function(){return!0}},emptyText:{type:String,default:function(){return"暂无数据"}},loadingText:{type:String,default:function(){return"加载中"}},border:{type:Boolean,default:function(){return!1}},highlightCurrentRow:{type:Boolean,default:function(){return!1}}},data:function(){return{}},computed:{widgetList:function(){return this.options.filter((function(e){return!e.hide}))}},methods:{handleSelectionChange:function(e){e&&this.$emit("selection-change",e)},handleSingleSelect:function(e,t){e&&this.$emit("current-change",e)},handleSizeChange:function(e){this.pageInfo.pageSize=e,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize)},handleCurrentChange:function(e){this.pageInfo.currentPage=e,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize)},handlePrevClick:function(){1!==this.pageInfo.currentPage&&(--this.pageInfo.currentPage,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize))},handleNextClick:function(){this.pageInfo.currentPage!==this.pageInfo.pageCount&&(this.pageInfo.currentPage+=1,this.$emit("pagination-change",this.pageInfo.currentPage,this.pageInfo.pageSize))},getTable:function(){return this.$refs.th_table},handleFormatTime:function(e,t){var n;return 0===arguments.length?null:(t=t||"yyyy-MM-dd HH:mm:ss",null==e||"null"===e?"":(n={yyyy:(e="object"===c(e)?e:("number"==typeof(e="string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e):e)&&10===e.toString().length&&(e*=1e3),new Date(e))).getFullYear(),MM:e.getMonth()+1,dd:e.getDate(),HH:e.getHours(),mm:e.getMinutes(),ss:e.getSeconds(),a:e.getDay()},t.replace(/(yyyy|MM|dd|HH|mm|ss|a)/g,(function(e,t){var i=n[t];return"a"===t?["日","一","二","三","四","五","六"][i]:(i=0<e.length&&i<10?"0"+i:i)||0}))))},objectSpanMethod:function(e){this.$emit("span-method",e)}}};var u=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"th_table",attrs:{height:e.height,data:e.data,"row-key":e.rowKey,stripe:e.stripe,border:e.border,"highlight-current-row":e.highlightCurrentRow,"tree-props":e.treeProps,"span-method":e.objectSpanMethod},on:{"current-change":e.handleSingleSelect,"row-dblclick":e.dblclick,"selection-change":e.handleSelectionChange},scopedSlots:e._u([{key:"empty",fn:function(){return[n("div",[e._v("\n "+e._s(e.loading?e.loadingText||"加载中":e.emptyText||"暂无数据")+"\n ")])]},proxy:!0}])},[e._l(e.widgetList,(function(t,i){return[t.type?n("el-table-column",{key:i,attrs:{type:t.type,label:t.label,width:"50"}}):t.children?n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align||"left",fixed:t.fixed||null,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip}},[n("table-column",{attrs:{options:t.children}})],1):n("el-table-column",{key:i,attrs:{prop:t.prop,label:t.label,width:t.width,align:t.align||"left",fixed:t.fixed||null,sortable:t.sortable,"sort-method":t.sortMethod,"show-overflow-tooltip":t.showOverflowTooltip},scopedSlots:e._u([{key:"default",fn:function(i){return[t.slot?e._t(t.slot,null,{scope:i,option:t}):t.formatTime?n("span",[e._v("\n "+e._s(e.handleFormatTime(i.row[t.alias||t.prop],t.format))+"\n ")]):t.format?n("span",[e._v("\n "+e._s(t.format(i.row))+"\n ")]):t.alias?n("span",[e._v(e._s(i.row[t.alias]))]):n("span",[e._v(e._s(i.row[t.prop]))])]}}],null,!0)})]}))],2),e._v(" "),0<Object.keys(e.pageInfo).length&&e.showPage?n("div",{staticClass:"pagination"},[n("el-pagination",{attrs:{"current-page":e.pageInfo.currentPage,"page-sizes":e.pageInfo.sizes,"page-size":e.pageInfo.pageSize,layout:"total, prev, pager, next, sizes",total:e.pageInfo.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"prev-click":e.handlePrevClick,"next-click":e.handleNextClick}})],1):e._e()],1)}),[],!1,(function(e){n(219)}),"data-v-37f6d710",null).exports,d=(u.install=function(e){e.component(u.name,u)},u);s={name:"ThTableAction",props:{actions:{type:Array,default:function(){return[]}},scope:{type:Object|String},permission:{type:Object,required:!1},msg:{type:String,default:"确定删除本条数据吗?"}},data:function(){return{pop:!1,loadingDel:!1}},computed:{btnDisabled:function(){var e=this;return function(t){return"boolean"==typeof t.disabled?t.disabled:"function"==typeof t.disabled?t.disabled(e.scope):void 0}},btnHide:function(){var e=this;return function(t){return"boolean"==typeof t.hide?t.hide:"function"==typeof t.hide?t.hide(e.scope):void 0}}},methods:{handleCancel:function(){this.loadingDel=!1,this.pop=!1},handleClick:function(e,t){this.$emit("on-click",e,t)},handleDelete:function(e){var t=this;this.loadingDel=!0,this.handleClick(e,(function(e){e?t.handleCancel():t.loadingDel=!1}))},handleMore:function(e,t,n){for(var i=0;i<n.children.length;i++){var o=n.children[i];if(o.act===e){this.handleClick(o);break}}}}};var h=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-action",on:{click:function(e){e.stopPropagation()}}},[e._l(e.actions,(function(t,i){return["delete"!==t.act||e.btnHide(t)?"more"!==t.act||e.btnHide(t)?e.btnHide(t)?e._e():n("el-button",{key:i,style:t.style,attrs:{type:t.type,icon:t.icon,disabled:e.btnDisabled(t)},on:{click:function(n){return e.handleClick(t)}}},[e._v(e._s(t.name))]):n("el-dropdown",{key:i,attrs:{trigger:t.trigger||"click",placement:t.placement||"bottom-end",disabled:e.btnDisabled(t)},on:{command:function(n){e.handleMore(n,i,t)}}},[n("el-button",{style:t.style,attrs:{disabled:e.loadingDel||e.btnDisabled(t),type:t.type,icon:t.icon}},[e._v(e._s(t.name))]),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(t.children,(function(t,i){return n("el-dropdown-item",{key:i,style:t.style,attrs:{command:t.act,icon:t.icon,disabled:t.disabled}},[e._v(e._s(t.name))])})),1)],1):n("el-popover",{key:i,attrs:{placement:"top",width:"180",trigger:"manual"},model:{value:e.pop,callback:function(t){e.pop=t},expression:"pop"}},[n("p",[e._v(e._s(t.delmsg||e.msg))]),e._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0"}},[n("el-button",{attrs:{type:"text",disabled:e.loadingDel},on:{click:e.handleCancel}},[e._v("取消")]),e._v(" "),n("el-button",{attrs:{type:"text",loading:e.loadingDel},on:{click:function(n){return e.handleDelete(t)}}},[e._v("确定")])],1),e._v(" "),n("el-button",{style:t.style,attrs:{slot:"reference",disabled:e.loadingDel||e.btnDisabled(t),type:t.type,icon:t.icon},on:{click:function(t){e.pop=!0}},slot:"reference"},[e._v(e._s(t.name))])],1)]}))],2)}),[],!1,(function(e){n(223)}),null,null).exports,p=(h.install=function(e){e.component(h.name,h)},h);s={name:"ThTableSearch",props:{options:{type:Array,default:function(){return[]}},data:{type:Object,default:function(){return{}}}},data:function(){return{params:this.data,datePickerTypes:["year","month","date","dates","week","datetime","datetimerange","daterange","monthrange"]}},watch:{options:{handler:function(e,t){var n=this;e&&e.length&&e.map((function(e){n.$set(n.params,e.options.prop,e.options.defaultValue)}))},deep:!0,immediate:!0},data:function(e){this.params=e},params:{deep:!0,handler:function(e){this.$emit("update:data",e)}}},methods:{doSearch:function(){this.$emit("on-search",this.params)},doReset:function(){var e=this;this.options.map((function(t){e.$set(e.params,t.prop,t.defaultValue||"")})),this.$emit("on-reset",this.params)}}};var f=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-search"},[e._l(e.options,(function(t,i){return n("div",{key:i,staticClass:"th-table-search-item"},[n("span",{staticClass:"th-table-search-item-title"},[e._v(e._s(t.options.name)+":")]),e._v(" "),"input"===t.type?n("el-input",{style:{width:t.options.width+"px"},attrs:{placeholder:t.options.placeholder||"请输入",disabled:t.options.disabled,clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}}):e._e(),e._v(" "),"date"===t.type?n("el-date-picker",{style:{width:t.options.width+"px"},attrs:{type:t.options.dateType||"date",format:t.options.format,"value-format":t.options.valueFormat,"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}}):e._e(),e._v(" "),"select"===t.type?n("el-select",{style:{width:t.options.width+"px"},attrs:{placeholder:t.options.placeholder||"请选择",multiple:t.options.multiple,"multiple-limit":t.options.multipleLimit,filterable:t.options.filterable,disabled:t.options.disabled,clearable:""},model:{value:e.params[t.options.prop],callback:function(n){e.$set(e.params,t.options.prop,n)},expression:"params[item.options.prop]"}},[t.options.remote?e._l(t.options.options,(function(e){return n("el-option",{key:e[t.options.props.value],attrs:{label:e[t.options.props.label],value:e[t.options.props.value]}})})):e._l(t.options.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],2):e._e()],1)})),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-search",plain:""},on:{click:e.doSearch}},[e._v("查询")]),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-refresh-right",plain:""},on:{click:e.doReset}},[e._v("重置")])],2)}),[],!1,(function(e){n(225)}),"data-v-3195cc72",null).exports,m=(f.install=function(e){e.component(f.name,f)},f);s={name:"ThTableTools",props:{options:{type:Array,default:function(){return[]}},disabled:{type:Object,default:function(){return{}}}},data:function(){return{}},methods:{handleClick:function(e){this.$emit("on-click",e)}}};var g=Object(l.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-tools"},e._l(e.options,(function(t,i){return n("el-button",{key:i,style:t.style,attrs:{type:t.type,icon:t.icon,disabled:t.disabled||e.disabled[t.act],loading:t.loading},on:{click:function(n){return e.handleClick(t)}}},[e._v(e._s(t.name))])})),1)}),[],!1,(function(e){n(227)}),"data-v-4faa6b2f",null).exports,v=(g.install=function(e){e.component(g.name,g)},g),b=(s={name:"ThEmpty",props:{image:{type:String,default:""},imageSize:{type:Number,default:300},description:{type:String,default:"暂无数据"}},computed:{imageStyle:function(){return{width:this.imageSize?"".concat(this.imageSize,"px"):""}}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-empty"},[e.image?t("img",{staticClass:"th-empty-img",style:e.imageStyle,attrs:{src:e.image,alt:""}}):e._t("image"),e._v(" "),e.$slots.description?e._t("description"):t("p",{staticClass:"th-empty-description"},[e._v(e._s(e.description))]),e._v(" "),e.$slots.default?t("div",{staticClass:"th-empty-bottom"},[e._t("default")],2):e._e()],2)}),[],!1,null,null,null).exports),y=(b.install=function(e){e.component(b.name,b)},b),w=(s={name:"ThDialog",model:{prop:"visible",event:"input"},props:{visible:Boolean,title:{type:String,default:""},width:{type:String,default:"800px"},fullscreen:{type:Boolean,default:!1},top:{type:String,default:"15vh"},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},customClass:String,closeOnClickModal:{type:Boolean,default:!1},closeOnPressEscape:{type:Boolean,default:!1},beforeClose:Function,destroyOnClose:{type:Boolean,default:!1},showAffirm:{type:Boolean,default:!0},affirmLoading:Boolean,affirmText:{type:String,default:"确 认"},showCancel:{type:Boolean,default:!0},cancelText:{type:String,default:"取 消"},showClose:{type:Boolean,default:!0},closeIcon:{type:String,default:"el-icon-close"},showFullscreen:{type:Boolean,default:!0},fullscreenIcon:{type:String,default:"el-icon-full-screen"},showFooter:{type:Boolean,default:!0}},data:function(){return{formRules:{},dialogFullscreen:this.fullscreen}},watch:{fullscreen:function(e){this.dialogFullscreen=e}},methods:{handleClose:function(){this.$emit("input",!this.visible),this.$emit("on-close")},handleBeforeClose:function(e){var t=this;this.beforeClose?this.beforeClose((function(){t.handleClose()})):this.handleClose()},handleAffirm:function(){this.$emit("on-affirm")},handleFullscreenChange:function(){var e=this;this.dialogFullscreen=!this.dialogFullscreen,this.$nextTick((function(){e.$emit("on-fullscreen")}))}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("el-dialog",{staticClass:"th-dialog",class:[e.customClass],attrs:{visible:e.visible,width:e.width,top:e.top,fullscreen:e.dialogFullscreen,"close-on-click-modal":e.closeOnClickModal,"close-on-press-escape":e.closeOnPressEscape,"show-close":!1,modal:e.modal,"modal-append-to-body":e.modalAppendToBody,"append-to-body":e.appendToBody,"before-close":e.handleBeforeClose,"destroy-on-close":e.destroyOnClose},on:{"update:visible":function(t){e.visible=t}}},[t("div",{staticClass:"th-dialog__header",attrs:{slot:"title"},slot:"title"},[t("div",{staticClass:"th-dialog__title"},[e._v(e._s(e.title))]),e._v(" "),t("div",{staticClass:"th-dialog__action"},[e.showFullscreen?t("i",{staticClass:"th-dialog__action_item",class:e.fullscreenIcon,on:{click:e.handleFullscreenChange}}):e._e(),e._v(" "),e.showClose?t("i",{staticClass:"th-dialog__action_item",class:e.closeIcon,on:{click:e.handleBeforeClose}}):e._e()])]),e._v(" "),e._t("default"),e._v(" "),e.$slots.footer?t("template",{slot:"footer"},[e._t("footer")],2):e.showFooter?t("template",{slot:"footer"},[e.showAffirm?t("el-button",{attrs:{type:"primary",loading:e.affirmLoading},on:{click:e.handleAffirm}},[e._v(e._s(e.affirmText))]):e._e(),e._v(" "),e.showCancel?t("el-button",{on:{click:e.handleClose}},[e._v(e._s(e.cancelText))]):e._e()],1):e._e()],2)}),[],!1,null,null,null).exports),x=(w.install=function(e){e.component(w.name,w)},w),_=(s={name:"ThCard",props:{showHeader:{type:Boolean,default:!0},title:String,label:String,bodyStyle:String|Object,shadow:{type:String,default:"always"},border:Boolean},computed:{seflClass:function(){var e="".concat(this.shadow,"-shadow");return this.border?"".concat(e," th-is_border"):e}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-card",class:e.seflClass},[e.showHeader?[e.$slots.header?e._t("header"):t("div",{staticClass:"th-card-header"},[e.title?t("span",[e._v(e._s(e.title))]):e._t("title"),e._v(" "),e.label?t("span",[e._v(e._s(e.label))]):e._t("label")],2)]:e._e(),e._v(" "),t("div",{staticClass:"th-card-body",style:e.bodyStyle},[e._t("default")],2)],2)}),[],!1,null,null,null).exports),k=(_.install=function(e){e.component(_.name,_)},_),E=(s={name:"ThGrid",props:{column:Number|String,position:{type:String,default:"block"},border:Boolean},data:function(){return{}},mounted:function(){},methods:{}},Object(l.a)(s,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"th-grid",class:{"th-grid__border":this.border}},[this._t("default")],2)}),[],!1,null,null,null).exports),C=(E.install=function(e){e.component(E.name,E)},E),S=(s={name:"ThGridItem",props:{title:String,icon:String},data:function(){return{position:"",border:!1}},computed:{isIcon:function(){return!this.icon||"http"!==this.icon.substring(0,4)},selfStyle:function(){for(var e=this.$parent;e&&"ThGrid"!==e.$options.name;)e=e.$parent;var t=0,n=(e&&(t=e.column,this.position=e.position,this.border=e.border),{});return t&&(n.flex="none",n.flexBasis="".concat(100/t,"%")),n}},mounted:function(){},methods:{handleClick:function(){this.$emit("on-click")}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-grid-item",class:{"th-grid-item__border":e.border},style:e.selfStyle,on:{click:e.handleClick}},[e.$slots.default?e._t("default"):t("div",{staticClass:"th-grid-item-content",class:"th-grid-item-content_"+e.position},[e.isIcon?t("i",{class:["th-icon",e.icon]}):t("img",{staticClass:"th-grid-item-img",attrs:{src:"",alt:""}}),e._v(" "),e.$slots.title?e._t("title"):t("p",{staticClass:"th-grid-item-title"},[e._v(e._s(e.title))])],2)],2)}),[],!1,null,null,null).exports),T=(S.install=function(e){e.component(S.name,Grid)},S),A=n(11),O=(A.a.install=function(e){e.component(A.a.name,A.a)},A.a);s={name:"ThVueEditor",components:{VueEditor:n(43).a},model:{prop:"value",event:"upload:value"},props:{value:String,disabled:Boolean},data:function(){return{data:this.value}},watch:{data:{handler:function(e){this.$emit("upload:value",e)},deep:!0},value:function(e){this.data=e}},methods:{}};var M=Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("vue-editor",{attrs:{disabled:e.disabled},model:{value:e.data,callback:function(t){e.data=t},expression:"data"}})}),[],!1,(function(e){n(241)}),null,null).exports,D=(M.install=function(e){e.component(M.name,M)},M),P=(s={name:"ThButton",inject:{thForm:{default:""},thFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{selfClass:function(){return[this.type?"th-button-"+this.type:"",this.buttonSize?"th-button-size-"+this.buttonSize:"",{"is-disabled":this.buttonDisabled,"is-loading":this.loading,"is-plain":this.plain,"is-round":this.round,"is-circle":this.circle}]},_thFormItemSize:function(){return(this.thFormItem||{}).thFormItemSize},buttonSize:function(){return this.size||this._thFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return(this.$options.propsData.hasOwnProperty("disabled")?this:this.thForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("button",{staticClass:"th-button",class:e.selfClass,attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?t("i",{staticClass:"el-icon-loading"}):e._e(),e._v(" "),e.icon&&!e.loading?t("i",{class:e.icon}):e._e(),e._v(" "),e.$slots.default?t("span",[e._t("default")],2):e._e()])}),[],!1,null,null,null).exports),R=(P.install=function(e){e.component(P.name,P)},P),L=n(22),I=(L.a.install=function(e){e.component(L.a.name,L.a)},L.a),N=n(36),F=(N.a.install=function(e){e.component(N.a.name,N.a)},N.a),j=n(23),B=(j.a.install=function(e){e.component(j.a.name,j.a)},j.a),q=n(24),z=(q.a.install=function(e){e.component(q.a.name,q.a)},q.a),V=(s=n(206),n.n(s)),W=(s={name:"ElProgress",props:{type:{type:String,default:"line",validator:e=>-1<["line","circle","dashboard"].indexOf(e)},percentage:{type:Number,default:0,required:!0,validator:e=>0<=e&&e<=100},status:{type:String,validator:e=>-1<["success","exception","warning"].indexOf(e)},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth(){return(this.strokeWidth/this.width*100).toFixed(1)},radius(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath(){var e=this.radius,t="dashboard"===this.type;return`\n M 50 50\n m 0 ${t?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${t?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${t?"":"-"}${2*e}\n `},perimeter(){return 2*Math.PI*this.radius},rate(){return"dashboard"===this.type?.75:1},strokeDashoffset(){return-1*this.perimeter*(1-this.rate)/2+"px"},trailPathStyle(){return{strokeDasharray:`${this.perimeter*this.rate}px, ${this.perimeter}px`,strokeDashoffset:this.strokeDashoffset}},circlePathStyle(){return{strokeDasharray:`${this.perimeter*this.rate*(this.percentage/100)}px, ${this.perimeter}px`,strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke(){let e;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content(){return"function"==typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor(e){return"function"==typeof this.color?this.color(e):"string"==typeof this.color?this.color:this.getLevelColor(e)},getLevelColor(e){var t=this.getColorArray().sort((e,t)=>e.percentage-t.percentage);for(let n=0;n<t.length;n++)if(t[n].percentage>e)return t[n].color;return t[t.length-1].color},getColorArray(){var e=this.color;const t=100/e.length;return e.map((e,n)=>"string"==typeof e?{color:e,percentage:(n+1)*t}:e)}}},Object(l.a)(s,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"el-progress",class:["el-progress--"+e.type,e.status?"is-"+e.status:"",{"el-progress--without-text":!e.showText,"el-progress--text-inside":e.textInside}],attrs:{role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===e.type?t("div",{staticClass:"el-progress-bar"},[t("div",{staticClass:"el-progress-bar__outer",style:{height:e.strokeWidth+"px"}},[t("div",{staticClass:"el-progress-bar__inner",style:e.barStyle},[e.showText&&e.textInside?t("div",{staticClass:"el-progress-bar__innerText"},[e._v(e._s(e.content))]):e._e()])])]):t("div",{staticClass:"el-progress-circle",style:{height:e.width+"px",width:e.width+"px"}},[t("svg",{attrs:{viewBox:"0 0 100 100"}},[t("path",{staticClass:"el-progress-circle__track",style:e.trailPathStyle,attrs:{d:e.trackPath,stroke:"#e5e9f2","stroke-width":e.relativeStrokeWidth,fill:"none"}}),e._v(" "),t("path",{staticClass:"el-progress-circle__path",style:e.circlePathStyle,attrs:{d:e.trackPath,stroke:e.stroke,fill:"none","stroke-linecap":e.strokeLinecap,"stroke-width":e.percentage?e.relativeStrokeWidth:0}})])]),e._v(" "),e.showText&&!e.textInside?t("div",{staticClass:"el-progress__text",style:{fontSize:e.progressTextSize+"px"}},[e.status?t("i",{class:e.iconClass}):[e._v(e._s(e.content))]],2):e._e()])}),[],!1,null,null,null).exports),H={name:"ThUploadList",data:function(){return{focusing:!1}},components:{ElProgress:s=(W.install=function(e){e.component(W.name,W)},W)},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(e){return parseInt(e,10)},handleClick:function(e){this.handlePreview&&this.handlePreview(e)}}},U=Object(l.a)(H,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition-group",{class:["th-upload-list","th-upload-list--"+e.listType,{"is-disabled":e.disabled}],attrs:{tag:"ul",name:"th-list"}},e._l(e.files,(function(t){return n("li",{key:t.uid,class:["th-upload-list__item","is-"+t.status,e.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"delete",[8,46],n.key,["Backspace","Delete","Del"]))return null;e.disabled||e.$emit("remove",t)},focus:function(t){e.focusing=!0},blur:function(t){e.focusing=!1},click:function(t){e.focusing=!1}}},[e._t("default",(function(){return["uploading"!==t.status&&-1<["picture-card","picture"].indexOf(e.listType)?n("img",{staticClass:"th-upload-list__item-thumbnail",attrs:{src:t.url,alt:""}}):e._e(),e._v(" "),n("a",{staticClass:"th-upload-list__item-name",on:{click:function(n){return e.handleClick(t)}}},[n("i",{staticClass:"el-icon-document"}),e._v(e._s(t.name)+"\n ")]),e._v(" "),n("label",{staticClass:"th-upload-list__item-status-label"},[n("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===e.listType,"el-icon-check":-1<["picture-card","picture"].indexOf(e.listType)}})]),e._v(" "),e.disabled?e._e():n("i",{staticClass:"el-icon-close",on:{click:function(n){return e.$emit("remove",t)}}}),e._v(" "),"uploading"===t.status?n("el-progress",{attrs:{type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:e.parsePercentage(t.percentage)}}):e._e(),e._v(" "),"picture-card"===e.listType?n("span",{staticClass:"th-upload-list__item-actions"},[e.handlePreview&&"picture-card"===e.listType?n("span",{staticClass:"th-upload-list__item-preview",on:{click:function(n){return e.handlePreview(t)}}},[n("i",{staticClass:"el-icon-zoom-in"})]):e._e(),e._v(" "),e.disabled?e._e():n("span",{staticClass:"th-upload-list__item-delete",on:{click:function(n){return e.$emit("remove",t)}}},[n("i",{staticClass:"el-icon-delete"})])]):e._e()]}),{file:t})],2)})),0)}),[],!1,null,null,null).exports;function G(){}H={name:"ThUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(e){var t;!this.disabled&&this.uploader&&(t=this.uploader.accept,this.dragover=!1,t?this.$emit("file",[].slice.call(e.dataTransfer.files).filter((function(e){var n=e.type,i=-1<(e=e.name).indexOf(".")?".".concat(e.split(".").pop()):"",o=n.replace(/\/.*$/,"");return t.split(",").map((function(e){return e.trim()})).filter((function(e){return e})).some((function(e){return/\..+$/.test(e)?i===e:/\/\*$/.test(e)?o===e.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(e)&&n===e}))}))):this.$emit("file",e.dataTransfer.files))}}},H={inject:["uploader"],components:{UploadDragger:Object(l.a)(H,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"th-upload-dragger",class:{"is-dragover":e.dragover},on:{drop:function(t){return t.preventDefault(),e.onDrop.apply(null,arguments)},dragover:function(t){return t.preventDefault(),e.onDragover.apply(null,arguments)},dragleave:function(t){t.preventDefault(),e.dragover=!1}}},[e._t("default")],2)}),[],!1,null,null,null).exports},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:function(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,i=e.action,o=(n.upload&&(n.upload.onprogress=function(t){0<t.total&&(t.percent=t.loaded/t.total*100),e.onProgress(t)}),new FormData),r=(e.data&&Object.keys(e.data).forEach((function(t){o.append(t,e.data[t])})),o.append(e.filename,e.file,e.file.name),n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||300<=n.status)return e.onError((t=i,r=(o=n).response?"".concat(o.response.error||o.response):o.responseText?"".concat(o.responseText):"fail to post ".concat(t," ").concat(o.status),(r=new Error(r)).status=o.status,r.method="post",r.url=t,r));var t,o,r;e.onSuccess(function(e){if(!(e=e.responseText||e.response))return e;try{return JSON.parse(e)}catch(t){return e}}(n))},n.open("post",i,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0),e.headers||{});for(t in r)r.hasOwnProperty(t)&&null!==r[t]&&n.setRequestHeader(t,r[t]);return n.send(o),n}}},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},computed:{classMatch:function(){var e={"th-upload":!0};return e["th-upload--".concat(this.listType)]=!0,e}},methods:{isImage:function(e){return-1!==e.indexOf("image")},handleChange:function(e){(e=e.target.files)&&this.uploadFiles(e)},uploadFiles:function(e){var t=this;this.limit&&this.fileList.length+e.length>this.limit?this.onExceed&&this.onExceed(e,this.fileList):(e=Array.prototype.slice.call(e),0!==(e=this.multiple?e:e.slice(0,1)).length&&e.forEach((function(e){t.onStart(e),t.autoUpload&&t.upload(e)})))},upload:function(e){var t=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(e);var n=this.beforeUpload(e);n&&n.then?n.then((function(n){var i=Object.prototype.toString.call(n);if("[object File]"===i||"[object Blob]"===i){for(var o in"[object Blob]"===i&&(n=new File([n],e.name,{type:e.type})),e)e.hasOwnProperty(o)&&(n[o]=e[o]);t.post(n)}else t.post(e)}),(function(){t.onRemove(null,e)})):!1!==n?this.post(e):this.onRemove(null,e)},abort:function(e){var t,n=this.reqs;e?((t=e).uid&&(t=e.uid),n[t]&&n[t].abort()):Object.keys(n).forEach((function(e){n[e]&&n[e].abort(),delete n[e]}))},post:function(e){var t=this,n=e.uid,i={headers:this.headers,withCredentials:this.withCredentials,file:e,data:this.data,filename:this.name,action:this.action,onProgress:function(n){t.onProgress(n,e)},onSuccess:function(i){t.onSuccess(i,e),delete t.reqs[n]},onError:function(i){t.onError(i,e),delete t.reqs[n]}},o=this.httpRequest(i);(this.reqs[n]=o)&&o.then&&o.then(i.onSuccess,i.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(e){e.target!==e.currentTarget||13!==e.keyCode&&32!==e.keyCode||this.handleClick()}}},H=Object(l.a)(H,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{class:e.classMatch,attrs:{tabindex:"0"},on:{click:e.handleClick,keydown:e.handleKeydown}},[e.drag?t("upload-dragger",{attrs:{disabled:e.disabled},on:{file:e.uploadFiles}},[e._t("default")],2):e._t("default"),e._v(" "),t("input",{ref:"input",staticClass:"th-upload__input",attrs:{type:"file",name:e.name,multiple:e.multiple,accept:e.accept},on:{change:e.handleChange}})],2)}),[],!1,null,null,null).exports;s={name:"ThUpload",components:{ElProgress:s,UploadList:U,Upload:H},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:G},onChange:{type:Function,default:G},onPreview:{type:Function},onSuccess:{type:Function,default:G},onProgress:{type:Function,default:G},onError:{type:Function,default:G},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:G}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(e){"picture-card"!==e&&"picture"!==e||(this.uploadFiles=this.uploadFiles.map((function(e){if(!e.url&&e.raw)try{e.url=URL.createObjectURL(e.raw)}catch(e){console.error("[Element Error][Upload]",e)}return e})))},fileList:{immediate:!0,handler:function(e){var t=this;this.uploadFiles=e.map((function(e){return e.uid=e.uid||Date.now()+t.tempIndex++,e.status=e.status||"success",e}))}}},methods:{handleStart:function(e){e.uid=Date.now()+this.tempIndex++;var t={status:"ready",name:e.name,size:e.size,percentage:0,uid:e.uid,raw:e};if("picture-card"===this.listType||"picture"===this.listType)try{t.url=URL.createObjectURL(e)}catch(e){return void console.error("[Element Error][Upload]",e)}this.uploadFiles.push(t),this.onChange(t,this.uploadFiles)},handleProgress:function(e,t){t=this.getFile(t),this.onProgress(e,t,this.uploadFiles),t.status="uploading",t.percentage=e.percent||0},handleSuccess:function(e,t){(t=this.getFile(t))&&(t.status="success",t.response=e,this.onSuccess(e,t,this.uploadFiles),this.onChange(t,this.uploadFiles))},handleError:function(e,t){t=this.getFile(t);var n=this.uploadFiles;t.status="fail",n.splice(n.indexOf(t),1),this.onError(e,t,this.uploadFiles),this.onChange(t,this.uploadFiles)},handleRemove:function(e,t){function n(){i.abort(e);var t=i.uploadFiles;t.splice(t.indexOf(e),1),i.onRemove(e,t)}var i=this;t&&(e=this.getFile(t)),this.beforeRemove?"function"==typeof this.beforeRemove&&((t=this.beforeRemove(e,this.uploadFiles))&&t.then?t.then((function(){n()}),G):!1!==t&&n()):n()},getFile:function(e){var t;return this.uploadFiles.every((function(n){return!(t=e.uid===n.uid?n:null)})),t},abort:function(e){this.$refs["upload-inner"].abort(e)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var e=this;this.uploadFiles.filter((function(e){return"ready"===e.status})).forEach((function(t){e.$refs["upload-inner"].upload(t.raw)}))}},beforeDestroy:function(){this.uploadFiles.forEach((function(e){e.url&&0===e.url.indexOf("blob:")&&URL.revokeObjectURL(e.url)}))},render:function(e){var t,n=this,i=(this.showFileList&&(t=e(U,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}},[function(e){if(n.$scopedSlots.file)return n.$scopedSlots.file({file:e.file})}])),{props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"}),o=this.$slots.trigger||this.$slots.default;i=e("upload",V()([{},i]),[o]);return e("div",["picture-card"===this.listType?t:"",this.$slots.trigger?[i,this.$slots.default]:i,this.$slots.tip,"picture-card"!==this.listType?t:""])}};var K=Object(l.a)(s,void 0,void 0,!1,null,null,null).exports,Y=(K.install=function(e){e.component(K.name,K)},K),X=(H=n(7),s=n.n(H),H=n(93),H=n.n(H),{insert:"head",singleton:!1}),J=(X=(s()(H.a,X),H.a.locals,n(94)),H=n.n(X),X={insert:"head",singleton:!1},X=(s()(H.a,X),H.a.locals,n(95)),H=n.n(X),X={insert:"head",singleton:!1},X=(s()(H.a,X),H.a.locals,n(6)),H=n.n(X),X=n(207),n.n(X)),Z=n(62);X={components:{ThDialog:w,ThCodeEditor:A.a},props:{data:{type:Object,default:function(){return{}}},remoteApis:{type:Array,default:function(){return[]}},config:{type:Object,default:function(){return{}}}},data:function(){return{compsData:JSON.parse(JSON.stringify(Z.a)),validator:{type:null,required:null,pattern:null,range:null,length:null},eventsDialog:{visible:!1,eventScript:[],active:null},aceCompletions:[{meta:"设置数据",caption:"setData",value:"setData({ })",score:1},{meta:"获取数据",caption:"getData",value:"getData()",score:1},{meta:"显示组件",caption:"display",value:"display([ ])",score:1},{meta:"隐藏组件",caption:"hide",value:"hide([ ])",score:1}]}},computed:{show:function(){return!!(this.data&&0<Object.keys(this.data).length)}},created:function(){for(var e=0,t=Object.keys(this.compsData);e<t.length;e++){var i=t[e];this.compsData[i].content=n(259)("./".concat(i)).default}},methods:{generateRule:function(){var e=this;this.data.rules=[],Object.keys(this.validator).forEach((function(t){e.validator[t]&&e.data.rules.push(e.validator[t])}))},validateRequired:function(e){var t=this;this.validator.required=e?{required:!0,message:"".concat(this.data.name,"必须填写")}:null,this.$nextTick((function(){t.generateRule()}))},validateDataType:function(e){if(!this.show)return!1;this.validator.type=e?{type:e,message:this.data.name+"格式不正确"}:null,this.generateRule()},valiatePattern:function(e){if(!this.show)return!1;this.validator.pattern=e?{pattern:e,message:this.data.name+"格式不匹配"}:null,this.generateRule()},handleInputNumberChange:function(){this.data.options.minRows>this.data.options.maxRows&&(this.data.options.maxRows=this.data.options.minRows)},handleImguploadType:function(e){"picture-card"==e&&(this.data.options.drag=!1)},handleImguploadDrag:function(e){e&&(this.data.options.listType="default")},handleEventDialogShow:function(){this.eventsDialog={visible:!0,eventScript:JSON.parse(JSON.stringify(this.config.eventScript)),active:null}},handleAddEvent:function(){var e={key:e=(new Date).getTime(),name:e,func:""};this.eventsDialog.eventScript.push(e),this.eventsDialog.active=e},handleEventDialogAffirm:function(){this.config.eventScript=this.eventsDialog.eventScript,this.eventsDialog={visible:!1,eventScript:[],active:null}},handleEventDialogDelete:function(e,t){var n=this;this.$confirm("确定要删除该方法 ".concat(e.name," ?"),"",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.eventsDialog.active&&e.key===n.eventsDialog.active.key&&(n.eventsDialog.active=null),n.eventsDialog.eventScript.splice(t,1)})).catch()},handleEventsCollapseClick:function(e){for(var t=0;t<this.config.eventScript.length;t++)if(this.config.eventScript[t].key===e){var n=JSON.parse(JSON.stringify(this.config.eventScript));this.eventsDialog={visible:!0,eventScript:n,active:n[t]};break}}},watch:{"data.options.isRange":function(e){void 0!==e&&(e?this.data.options.defaultValue=null:0<=Object.keys(this.data.options).indexOf("defaultValue")&&(this.data.options.defaultValue=""))},"data.options.required":function(e){this.validateRequired(e)},"data.options.dataType":function(e){this.validateDataType(e)},"data.options.pattern":function(e){this.valiatePattern(e)},"data.name":function(e){this.data.options&&(this.validateRequired(this.data.options.required),this.validateDataType(this.data.options.dataType),this.valiatePattern(this.data.options.pattern))}}};X=Object(l.a)(X,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.show?n("div",{staticClass:"widgetConfig"},[n(e.compsData[e.data.type].content,{tag:"component",attrs:{widget:e.data,config:e.config,remoteApis:e.remoteApis},on:{"events-show":e.handleEventDialogShow,"events-edit":e.handleEventsCollapseClick}}),e._v(" "),n("th-dialog",{attrs:{title:"动作设置","modal-append-to-body":!1},on:{"on-fullscreen":function(t){e.$refs.codeEditor&&e.$refs.codeEditor.resize()}},model:{value:e.eventsDialog.visible,callback:function(t){e.$set(e.eventsDialog,"visible",t)},expression:"eventsDialog.visible"}},[n("div",{staticClass:"eventsSetting"},[n("div",{staticClass:"list"},[n("div",{staticClass:"list-header",on:{click:e.handleAddEvent}},[n("div",[e._v("动作库")]),e._v(" "),n("el-button",{attrs:{type:"text",icon:"el-icon-plus",size:"mini"}},[e._v("添加")])],1),e._v(" "),e._l(e.eventsDialog.eventScript,(function(t,i){return n("div",{key:t.key,staticClass:"list-item",on:{click:function(n){e.eventsDialog.active=t}}},[n("div",{staticClass:"list-item-title"},[e._v("Function")]),e._v(" "),n("div",{staticClass:"list-item-value"},[e._v(e._s(t.name))]),e._v(" "),n("i",{staticClass:"el-icon-delete",on:{click:function(n){return n.stopPropagation(),e.handleEventDialogDelete(t,i)}}})])}))],2),e._v(" "),e.eventsDialog.active?n("div",{staticClass:"detail"},[n("div",[n("span",[e._v("Function Name")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入动作名称",size:"small",disabled:"mounted"===e.eventsDialog.active.name||"refresh"===e.eventsDialog.active.name},model:{value:e.eventsDialog.active.name,callback:function(t){e.$set(e.eventsDialog.active,"name",t)},expression:"eventsDialog.active.name"}})],1),e._v(" "),n("div",[n("div",[e._v("\n function(\n "+e._s("mounted"!==e.eventsDialog.active.name&&"refresh"!==e.eventsDialog.active.name?"item,value":"")+"\n ) {\n\n "),n("el-popover",{attrs:{placement:"top-start",title:"可用Api",width:"200",trigger:"hover"}},[n("i",{staticClass:"el-icon-question",staticStyle:{float:"right"},attrs:{slot:"reference"},slot:"reference"}),e._v(" "),n("div",{staticClass:"functions"},[n("div",[e._v("setData")]),e._v(" "),n("div",[e._v("getData")]),e._v(" "),n("div",[e._v("display")]),e._v(" "),n("div",[e._v("hide")])])])],1),e._v(" "),n("th-code-editor",{ref:"codeEditor",staticStyle:{height:"calc(100% - 48px)"},attrs:{completions:e.aceCompletions},model:{value:e.eventsDialog.active.func,callback:function(t){e.$set(e.eventsDialog.active,"func",t)},expression:"eventsDialog.active.func"}}),e._v(" "),n("div",[e._v("}")])],1)]):e._e()]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:function(t){e.eventsDialog.visible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.handleEventDialogAffirm}},[e._v("保 存")])],1)])],1):e._e()}),[],!1,(function(e){n(257)}),"data-v-4d5ac79d",null).exports;var Q=Object(l.a)({props:["data"]},(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"form-config-container"},[t("el-form",{attrs:{"label-position":"top"}},[t("el-form-item",{attrs:{label:"UI"}},[t("el-radio-group",{model:{value:e.data.ui,callback:function(t){e.$set(e.data,"ui",t)},expression:"data.ui"}},[t("el-radio-button",{attrs:{label:"element"}},[e._v("Element")]),e._v(" "),t("el-radio-button",{attrs:{label:"vant",disabled:""}},[e._v("Vant")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"表单标题",required:""}},[t("el-input",{attrs:{placeholder:"请输入",clearable:""},model:{value:e.data.title,callback:function(t){e.$set(e.data,"title",t)},expression:"data.title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"表单宽度"}},[t("el-input",{model:{value:e.data.width,callback:function(t){e.$set(e.data,"width",t)},expression:"data.width"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"表单标签宽度"}},[t("el-input-number",{attrs:{min:0,max:200,step:10},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"标签对齐方式"}},[t("el-radio-group",{model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[t("el-radio-button",{attrs:{label:"left"}},[e._v("左对齐")]),e._v(" "),t("el-radio-button",{attrs:{label:"right"}},[e._v("右对齐")]),e._v(" "),t("el-radio-button",{attrs:{label:"top"}},[e._v("顶部对齐")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"组件尺寸"}},[t("el-radio-group",{model:{value:e.data.size,callback:function(t){e.$set(e.data,"size",t)},expression:"data.size"}},[t("el-radio-button",{attrs:{label:"medium"}},[e._v("medium")]),e._v(" "),t("el-radio-button",{attrs:{label:"small"}},[e._v("small")]),e._v(" "),t("el-radio-button",{attrs:{label:"mini"}},[e._v("mini")])],1)],1),e._v(" "),t("el-form-item",{attrs:{label:"操作属性"}},[t("el-checkbox",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}},[e._v("禁用 ")]),e._v(" "),t("el-checkbox",{model:{value:e.data.hideLabel,callback:function(t){e.$set(e.data,"hideLabel",t)},expression:"data.hideLabel"}},[e._v("隐藏标签 ")])],1)],1)],1)}),[],!1,null,null,null).exports,ee=n(15),te=(ee={components:{Draggable:H.a,WidgetFormItem:ee.a,ThEmpty:b},props:["data","select","client"],data:function(){return{selectWidget:this.select,config:{}}},watch:{select:function(e){this.selectWidget=e},selectWidget:{handler:function(e){this.$emit("update:select",e)},deep:!0}},computed:{widgetList:function(){return this.data.list.filter((function(e){return e.key}))},formWidth:function(){return this.data.config.width||("mobile"===this.client?"375px":"")}},mounted:function(){document.body.ondrop=function(e){var t=navigator.userAgent;("string"==typeof t?-1<t.toLowerCase().indexOf("firefox"):-1<t.indexOf("firefox"))&&(e.preventDefault(),e.stopPropagation())}},methods:{handleMoveEnd:function(e){e.newIndex,e.oldIndex},handleSelectWidget:function(e){this.selectWidget=this.data.list[e]},handleWidgetAdd:function(e){var t=e.newIndex,n=(e=(e.to,Date.parse(new Date)+"_"+Math.ceil(99999*Math.random())),JSON.parse(JSON.stringify(this.data.list[t])));n.key=e,n.model=n.type+"_"+e,n.rules=[],this.$set(this.data.list,t,n),this.selectWidget=this.data.list[t]}}},ee=Object(l.a)(ee,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"formContainer",staticClass:"widget-form-container"},[0==e.data.list.length?i("th-empty",{staticClass:"form-empty",attrs:{image:n(116),description:"从左侧拖拽来添加字段"}}):e._e(),e._v(" "),i("el-form",{class:{"form-hideLabel":e.data.config.hideLabel},staticStyle:{margin:"0 auto",padding:"5px",height:"100%"},style:{width:e.formWidth},attrs:{size:e.data.config.size,"label-suffix":e.data.config.labelSuffix,"label-position":e.data.config.labelPosition,"label-width":e.data.config.labelWidth+"px",disabled:e.data.config.disabled}},[i("draggable",e._b({staticStyle:{height:"100%"},on:{end:e.handleMoveEnd,add:e.handleWidgetAdd},model:{value:e.data.list,callback:function(t){e.$set(e.data,"list",t)},expression:"data.list"}},"draggable",{group:"people",ghostClass:"ghost",animation:200,handle:".drag-widget"},!1),[i("transition-group",{staticClass:"widget-form-list",attrs:{name:"fade",tag:"div"}},e._l(e.widgetList,(function(t,n){return i("widget-form-item",{key:t.key,attrs:{widget:t,widgetIndex:n,widgetArray:e.data,config:e.data.config,select:e.selectWidget},on:{"update:select":function(t){e.selectWidget=t}}})})),1)],1)],1)],1)}),[],!1,null,null,null).exports,n(60));function ne(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}te={name:"thFormGenerate",components:{GenetateFormItem:Object(l.a)(te.a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:!e.widget.options.hidden,expression:"!widget.options.hidden"}],ref:e.widget.model,class:((t={})[e.widget.model]=!0,t["widget-form-list-"+e.widget.type]=!0,t),attrs:{label:e.widget.options.hideLabel?"":e.widget.name,"label-width":e.labelWidth,prop:e.prop||e.widget.model,rules:e.widget.rules}},["input"==e.widget.type?["number"==e.widget.options.dataType||"integer"==e.widget.options.dataType||"float"==e.widget.options.dataType?n("el-input",{style:{width:e.widget.options.width},attrs:{type:"number",placeholder:e.widget.options.placeholder,disabled:e.widget.options.disabled,readonly:e.widget.options.readonly,clearable:e.widget.options.clearable,maxlength:e.widget.options.maxlength,"show-word-limit":e.widget.options.showWordLimit,"show-password":e.widget.options.showPassword},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=e._n(t)},expression:"dataModel"}}):n("el-input",{style:{width:e.widget.options.width},attrs:{type:"text",placeholder:e.widget.options.placeholder,disabled:e.widget.options.disabled,readonly:e.widget.options.readonly,clearable:e.widget.options.clearable,maxlength:e.widget.options.maxlength,"show-word-limit":e.widget.options.showWordLimit,"show-password":e.widget.options.showPassword,"suffix-icon":e.widget.options.suffixIcon,"prefix-icon":e.widget.options.prefixIcon},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.prepend?n("template",{slot:"prepend"},[e._v(e._s(e.widget.options.prepend))]):e._e(),e._v(" "),e.widget.options.append?n("template",{slot:"append"},[e._v(e._s(e.widget.options.append))]):e._e()],2)]:e._e(),e._v(" "),"textarea"==e.widget.type?[n("el-input",{style:{width:e.widget.options.width},attrs:{type:"textarea",disabled:e.widget.options.disabled,placeholder:e.widget.options.placeholder,maxlength:e.widget.options.maxlength,clearable:e.widget.options.clearable,"show-word-limit":e.widget.options.showWordLimit,autosize:{minRows:e.widget.options.minRows,maxRows:e.widget.options.maxRows}},on:{input:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"cell"==e.widget.type?[n("th-cell",{attrs:{title:e.widget.options.title,value:e.widget.options.value,label:e.widget.options.label}})]:e._e(),e._v(" "),"number"==e.widget.type?[n("el-input-number",{style:{width:e.widget.options.width},attrs:{step:e.widget.options.step,"controls-position":e.widget.options.controlsPosition?"right":"",disabled:e.widget.options.disabled,min:e.widget.options.min,max:e.widget.options.max,precision:e.widget.options.precision},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"text"==e.widget.type?[n("div",{style:{height:e.widget.options.height,textAlign:e.widget.options.textAlign},domProps:{innerHTML:e._s(e.dataModel)}})]:e._e(),e._v(" "),"radio"==e.widget.type?[n("el-radio-group",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.buttonType?e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-radio-button",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)})):e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-radio",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)}))],2)]:e._e(),e._v(" "),"checkbox"==e.widget.type?[n("el-checkbox-group",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled,min:e.widget.options.min,max:e.widget.options.max},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},[e.widget.options.buttonType?e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-checkbox-button",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)})):e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t,i){return n("el-checkbox",{key:i,style:{display:e.widget.options.inline?"inline-block":"block"},attrs:{label:t.value,border:e.widget.options.border}},[e.widget.options.remote?[e._v(e._s(t.label))]:[e._v(e._s(e.widget.options.showLabel?t.label:t.value))]],2)}))],2)]:e._e(),e._v(" "),"time"==e.widget.type?[n("el-time-picker",{style:{width:e.widget.options.width},attrs:{"is-range":e.widget.options.isRange,placeholder:e.widget.options.placeholder,"start-placeholder":e.widget.options.startPlaceholder,"end-placeholder":e.widget.options.endPlaceholder,readonly:e.widget.options.readonly,disabled:e.widget.options.disabled,editable:e.widget.options.editable,clearable:e.widget.options.clearable,arrowControl:e.widget.options.arrowControl,"value-format":e.widget.options.format,"picker-options":{selectableRange:e.widget.options.pickerOptions.selectableRange[0]+" - "+e.widget.options.pickerOptions.selectableRange[1]}},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"date"==e.widget.type?[n("el-date-picker",{style:{width:e.widget.options.width},attrs:{type:e.widget.options.type,"is-range":e.widget.options.isRange,placeholder:e.widget.options.placeholder,"start-placeholder":e.widget.options.startPlaceholder,"end-placeholder":e.widget.options.endPlaceholder,readonly:e.widget.options.readonly,disabled:e.widget.options.disabled,editable:e.widget.options.editable,clearable:e.widget.options.clearable,"value-format":e.widget.options.format},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"select"==e.widget.type?[n("el-select",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled,multiple:e.widget.options.multiple,clearable:e.widget.options.clearable,placeholder:e.widget.options.placeholder,collapseTags:e.widget.options.collapseTags,allowCreate:e.widget.options.allowCreate,filterable:!!e.widget.options.allowCreate||e.widget.options.filterable},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)},focus:function(t){return e.handleEventAction(e.widget.events.onFocus)},blur:function(t){return e.handleEventAction(e.widget.events.onBlur)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}},e._l(e.widget.options.remote?e.widget.options.remoteOptions:e.widget.options.options,(function(t){return n("el-option",{key:t.value,attrs:{value:t.value,label:e.widget.options.showLabel||e.widget.options.remote?t.label:t.value}})})),1)]:e._e(),e._v(" "),"color"==e.widget.type?[n("el-color-picker",{attrs:{disabled:e.widget.options.disabled,"show-alpha":e.widget.options.showAlpha},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"switch"==e.widget.type?[n("el-switch",{attrs:{width:e.widget.options.width-20,disabled:e.widget.options.disabled,"inactive-text":e.widget.options.switchInactiveText,"active-text":e.widget.options.switchActiveText,"inactive-color":e.widget.options.switchInactiveColor,"active-color":e.widget.options.switchActiveColor},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"button"==e.widget.type?[n("el-button",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{size:e.widget.options.buttonSize,type:e.widget.options.buttonType,plain:e.widget.options.buttonPlain,round:e.widget.options.buttonRound,circle:e.widget.options.buttonCircle,loading:e.widget.options.loading,disabled:e.widget.options.disabled,icon:e.widget.options.buttonIcon},on:{click:function(t){return e.handleEventAction(e.widget.events.onClick)}}},[e._v(e._s(e.widget.options.defaultValue))])]:e._e(),e._v(" "),"slider"==e.widget.type?[n("el-slider",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{min:e.widget.options.min,max:e.widget.options.max,disabled:e.widget.options.disabled,step:e.widget.options.step,"show-input":e.widget.options.showInput,range:e.widget.options.range,"show-tooltip":e.widget.options.showTooltip,"format-tooltip":function(t){return e.formatTooltip(t,e.widget.options.formatTooltip)},"show-stops":e.widget.options.showStops,vertical:e.widget.options.vertical},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"rate"==e.widget.type?[n("el-rate",{attrs:{max:e.widget.options.max,disabled:e.widget.options.disabled,"allow-half":e.widget.options.allowHalf,"show-text":e.widget.options.showText,texts:e.widget.options.auxiliaryValue},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"filler"==e.widget.type?[n("div",{style:{width:e.widget.options.width,height:e.widget.options.height}})]:e._e(),e._v(" "),"image"==e.widget.type?[n("th-image",{attrs:{src:e.widget.options.defaultValue,height:e.widget.options.height,width:e.widget.options.width,fit:e.widget.options.fit}})]:e._e(),e._v(" "),"upload"==e.widget.type?[n("el-upload",{staticClass:"upload-demo",attrs:{action:e.widget.options.remoteFunc,"on-preview":function(t){return e.handlePictureCardPreview(t,e.widget.options.listType)},"on-remove":e.handleRemove,multiple:e.widget.options.multiple,limit:e.widget.options.length,width:e.widget.options.size.width,height:e.widget.options.size.height,"list-type":e.widget.options.listType,"on-change":e.handleAvatar,"on-error":e.handleAvatarError,drag:e.widget.options.drag,disabled:e.widget.options.disabled,"auto-upload":!1}},[["default","picture"].includes(e.widget.options.listType)&&!e.widget.options.drag?n("el-button",{attrs:{size:"small",type:"primary",disabled:e.widget.options.disabled}},[e._v("点击上传")]):e._e(),e._v(" "),"picture-card"!==e.widget.options.listType||e.widget.options.drag?e._e():n("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"}),e._v(" "),e.widget.options.drag?n("i",{staticClass:"el-icon-upload"}):e._e(),e._v(" "),e.widget.options.drag?n("div",{staticClass:"el-upload__text"},[e._v("\n 将文件拖到此处,或"),n("em",[e._v("点击上传")])]):e._e(),e._v(" "),n("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},domProps:{innerHTML:e._s(e.widget.options.elUploadTip)},slot:"tip"})],1)]:e._e(),e._v(" "),"editor"==e.widget.type?[n("vue-editor",{style:{width:e.widget.options.width},attrs:{disabled:e.widget.options.disabled},model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"cascader"==e.widget.type?[n("el-cascader",{style:{width:e.widget.options.width,height:e.widget.options.height},attrs:{disabled:e.widget.options.disabled,clearable:e.widget.options.clearable,placeholder:e.widget.options.placeholder,options:e.widget.options.remoteOptions,props:e.widget.options.props,"show-all-levels":!e.widget.options.showAllLevels,"collapse-tags":e.widget.options.collapseTags,filterable:e.widget.options.filterable},on:{change:function(t){return e.handleEventAction(e.widget.events.onChange)}},scopedSlots:e._u([{key:"default",fn:function(t){return t=t.data,[n("span",{domProps:{innerHTML:e._s(e.widget.options.prepend)}}),e._v(" "),n("span",[e._v(e._s(t.label))]),e._v(" "),n("span",{domProps:{innerHTML:e._s(e.widget.options.append)}})]}}],null,!1,1426148692),model:{value:e.dataModel,callback:function(t){e.dataModel=t},expression:"dataModel"}})]:e._e(),e._v(" "),"blank"==e.widget.type?[e._t(e.widget.model)]:e._e(),e._v(" "),"table"==e.widget.type?[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataModel,stripe:e.widget.options.stripe,"show-header":e.widget.options.showHeader,"highlight-current-row":e.widget.options.highlightCurrentRow,border:e.widget.options.border}},[e.widget.options.isSerial?n("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center"}}):e._e(),e._v(" "),e._l(e.widget.list,(function(t){return n("el-table-column",{key:"table_"+t.key,attrs:{label:t.name,prop:t.model,width:t.options.width},scopedSlots:e._u([{key:"default",fn:function(i){return[n("genetate-form-item",{attrs:{models:e.dataModel[i.$index],widget:t,remote:e.remote,config:e.config,prop:e.prop+"."+i.$index+"."+t.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(t){return e.$set(e.dataModel,i.$index,t)}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)]}}],null,!0)})})),e._v(" "),e.widget.options.isDelete?n("el-table-column",{attrs:{fixed:"right",label:"操作",width:"60",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{staticStyle:{color:"#F56C6C"},attrs:{type:"text"},nativeOn:{click:function(n){return n.preventDefault(),e.handleTableDelete(t.$index)}}},[e._v("\n 移除\n ")])]}}],null,!1,4146503235)}):e._e(),e._v(" "),e.widget.options.isAdd?n("template",{slot:"append"},[n("div",{staticStyle:{"text-align":"center"},style:{borderTop:e.dataModel&&0!=e.dataModel.length?"":"1px solid #EBEEF5"}},[n("el-button",{attrs:{type:"text",disabled:e.widget.options.disabled},on:{click:e.handleTableAdd}},[e._v("新增")])],1)]):e._e()],2)]:e._e(),e._v(" "),"table_h5"==e.widget.type?[n("div",{staticClass:"tableH5"},[e._l(e.dataModel,(function(t,i){return n("div",{key:"table_h5_"+i,staticClass:"tableH5-item"},e._l(e.widget.list,(function(o,r){return n("div",{key:"table_h5_"+i+"_"+o.key},[n("genetate-form-item",{staticStyle:{flex:"1"},attrs:{models:t,widget:o,remote:e.remote,config:e.config,prop:"grid"===o.type?e.prop+"."+i:e.prop+"."+i+"."+o.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(e){t=e}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2),e._v(" "),e.widget.options.isDelete&&0===r&&i>=e.widget.options.deleteIndex?n("div",{staticClass:"actions"},[n("el-button",{attrs:{type:"danger"},nativeOn:{click:function(t){return t.preventDefault(),e.handleTableDelete(i)}}},[e._v(e._s(e.widget.options.deleteButtonText))])],1):e._e()],1)})),0)})),e._v(" "),e.widget.options.isAdd?n("div",{staticStyle:{"text-align":"center"}},[n("el-button",{attrs:{type:"text",disabled:e.widget.options.disabled},on:{click:e.handleTableAdd}},[e._v(e._s(e.widget.options.addButtonText))])],1):e._e()],2)]:e._e(),e._v(" "),"grid"==e.widget.type?[n("th-row",{attrs:{gutter:e.widget.options.gutter||0,justify:e.widget.options.justify,align:e.widget.options.align}},e._l(e.widget.columns,(function(t,i){return n("th-col",{key:i,attrs:{span:t.span}},e._l(t.list,(function(t){return n("genetate-form-item",{key:t.key,attrs:{widget:t,models:e.models,config:e.config,remote:e.remote,prop:e.prop?e.prop+"."+t.model:t.model,slotKeys:e.slotKeys,componentsData:e.componentsData}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)})),1)]:e._e(),e._v(" "),"tabs"==e.widget.type?[n("el-tabs",{model:{value:e.widget.options.defaultValue,callback:function(t){e.$set(e.widget.options,"defaultValue",t)},expression:"widget.options.defaultValue"}},e._l(e.widget.tabs,(function(t,i){return n("el-tab-pane",{key:"tabs_"+i,attrs:{label:t.label,name:t.value}},e._l(t.list,(function(o){return n("genetate-form-item",{key:"tabs_"+i+"_"+o.key,attrs:{widget:o,models:e.dataModel[t.value],config:e.config,remote:e.remote,prop:"grid"===o.type?e.prop+"."+t.value:e.prop+"."+t.value+"."+o.model,slotKeys:e.slotKeys,componentsData:e.componentsData},on:{"update:models":function(n){return e.$set(e.dataModel,t.value,n)}}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)})),1)]:e._e(),e._v(" "),"divider"==e.widget.type?[n("el-divider",{attrs:{"content-position":e.widget.options.contentPosition}},[e._v("\n "+e._s(e.widget.options.defaultValue)+"\n ")])]:e._e(),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],2)}),[],!1,null,null,null).exports},props:{data:{type:Object,default:function(){return{}}},remoteData:{type:Object,default:function(){return{}}},value:{type:Object,default:function(){return{}}},slotKeys:{type:Array,default:function(){return[]}},client:String},data:function(){return{formJson:this.data,models:{},componentsData:[]}},computed:{formWidth:function(){return this.formJson.config.width||("mobile"===this.client?"375px":"")}},watch:{data:function(e){this.formJson=e},formJson:{handler:function(e){this.$emit("update:data",e)},deep:!0},value:{deep:!0,handler:function(e){this.models=ie(ie({},this.models),e)}}},created:function(){this.generateModle(this.formJson.list)},mounted:function(){},methods:{generateModle:function(e,t){var n=this;e&&e.map((function(e){"grid"===e.type?e.columns.forEach((function(e){n.generateModle(e.list,t)})):"tabs"===e.type?t?(n.$set(t,e.model,{}),e.tabs.forEach((function(i){n.$set(t[e.model],i.value,{}),n.generateModle(i.list,t[e.model][i.value])}))):(n.$set(n.models,e.model,{}),e.tabs.forEach((function(t){n.$set(n.models[e.model],t.value,{}),n.generateModle(t.list,n.models[e.model][t.value])}))):"table"===e.type||"table_h5"===e.type?t?(n.$set(t,e.model,JSON.parse(e.options.defaultValue||"[]")),n.generateModle(e.list,t[e.model])):(n.$set(n.models,e.model,JSON.parse(e.options.defaultValue||"[]")),n.generateModle(e.list,n.models[e.model])):(t?t[e.model]||n.$set(t,e.model,e.options.defaultValue):n.value&&0<=Object.keys(n.value).indexOf(e.model)?n.$set(n.models,e.model,n.value[e.model]):"blank"===e.type?n.$set(n.models,e.model,"String"===e.options.defaultType?"":"Object"===e.options.defaultType?{}:[]):n.$set(n.models,e.model,JSON.parse(JSON.stringify(e.options.defaultValue))),n.generateRules(e))}))},generateRules:function(e){e.rules||(e.rules=[]),e.rules.forEach((function(e){e.pattern&&(e.pattern=new RegExp(e.pattern))}))},getData:function(){var e=this;return new Promise((function(t,n){e.$refs.generateForm.validate((function(i){i?t(e.models):n(new Error("表单数据校验失败").message)}))}))},reset:function(){this.$refs.generateForm.resetFields()},onInputChange:function(e,t){this.$emit("on-change",t,e,this.models)},setJSON:function(e){this.formJson=e,this.generateModle(this.formJson.list)}}};var oe=Object(l.a)(te,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.formJson.config?n("div",[n("el-form",{ref:"generateForm",staticClass:"generateForm",class:{"form-hideLabel":e.formJson.config.hideLabel},style:{width:e.formWidth},attrs:{"label-suffix":e.formJson.config.labelSuffix,size:e.formJson.config.size,model:e.models,"label-position":e.formJson.config.labelPosition,"label-width":e.formJson.config.labelWidth+"px"}},e._l(e.formJson.list,(function(t){return n("genetate-form-item",{key:t.key,attrs:{models:e.models,widget:t,slotKeys:e.slotKeys,remote:e.remoteData,config:e.formJson.config,prop:"grid"===t.type?"":t.model,componentsData:e.componentsData},on:{"update:models":function(t){e.models=t},"input-change":e.onInputChange}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)})),1)],1):e._e()}),[],!1,(function(e){n(370)}),"data-v-0dadcd32",null).exports;function re(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}var ae=[{name:"单行文本",type:"input",icon:"icon-input",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"string",pattern:"",placeholder:"",maxlength:-1,required:!1,disabled:!1,readonly:!1,clearable:!1,showWordLimit:!1,showPassword:!1,prefixIcon:"",suffixIcon:"",prepend:"",append:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""},rules:[]},{name:"多行文本",type:"textarea",icon:"icon-diy-com-textarea",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"string",pattern:"",placeholder:"",maxlength:-1,rows:2,showWordLimit:!1,minRows:2,maxRows:5,required:!1,disabled:!1,readonly:!1,clearable:!1,hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"单元格",type:"cell",icon:"icon-ic",options:{width:"100%",height:"40px",labelWidth:100,isLabelWidth:!1,title:"标题",value:"内容",label:"副标题",defaultValue:"",customClass:"",textAlign:"right",hidden:!1,hideLabel:!1}},{name:"文字",type:"text",icon:"icon-wenzishezhi-",options:{width:"100%",height:"",labelWidth:100,isLabelWidth:!1,defaultValue:"",customClass:"",textAlign:"left",hidden:!1,hideLabel:!1}},{name:"单选框组",type:"radio",icon:"icon-radio-active",options:{width:"",labelWidth:100,isLabelWidth:!1,inline:!1,defaultValue:"",showLabel:!1,options:[{value:"Option 1",label:"Option 1"},{value:"Option 2",label:"Option 2"},{value:"Option 3",label:"Option 3"}],required:!1,remote:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",disabled:!1,border:!1,buttonType:!1},events:{onChange:""}},{name:"多选框组",type:"checkbox",icon:"icon-check-box",options:{width:"",labelWidth:100,isLabelWidth:!1,inline:!1,defaultValue:[],showLabel:!1,options:[{value:"Option 1"},{value:"Option 2"},{value:"Option 3"}],required:!1,remote:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",disabled:!1,border:!1,buttonType:!1,min:0,max:0,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"时间选择器",type:"time",icon:"icon-time",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"00:00:00",placeholder:"",startPlaceholder:"",endPlaceholder:"",isRange:!1,arrowControl:!0,format:"HH:mm:ss",pickerOptions:{selectableRange:["00:00:00","23:59:59"]},readonly:!1,disabled:!1,editable:!0,clearable:!0,required:!1,hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"日期选择器",type:"date",icon:"icon-date",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",readonly:!1,disabled:!1,editable:!0,clearable:!0,placeholder:"",startPlaceholder:"",endPlaceholder:"",type:"date",format:"yyyy-MM-dd",timestamp:!1,required:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"下拉选择框",type:"select",icon:"icon-select",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",multiple:!1,disabled:!1,clearable:!1,placeholder:"",required:!1,showLabel:!1,collapseTags:!1,allowCreate:!1,options:[{value:"Option 1"},{value:"Option 2"},{value:"Option 3"}],remote:!1,filterable:!1,remoteOptions:[],props:{value:"value",label:"label"},remoteFunc:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""}},{name:"颜色选择器",type:"color",icon:"icon-color",options:{labelWidth:100,isLabelWidth:!1,defaultValue:"",predefine:["#1989FA","#67C23A","#FF976A","#EE0A24","#000000","#333333","#666666","#999999","#FFFFFF"],disabled:!1,showAlpha:!1,required:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"开关",type:"switch",icon:"icon-switch",options:{width:70,labelWidth:100,isLabelWidth:!1,defaultValue:!1,switchInactiveText:"",switchActiveText:"",switchInactiveColor:"#C0CCDA",switchActiveColor:"#409EFF",required:!1,disabled:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"按钮",type:"button",icon:"icon-ic",options:{customClass:"",defaultValue:"Button",width:"",height:"",labelWidth:100,isLabelWidth:!1,dataBind:!1,buttonSize:"small",buttonType:"",buttonPlain:!1,buttonRound:!1,buttonCircle:!1,buttonIcon:"",textAlign:"center",remoteFunc:"",remoteOption:"",tableColumn:!1,disabled:!1,loading:!1,hidden:!1,hideLabel:!1},events:{onClick:""},rules:[]},{name:"计数器",type:"number",icon:"icon-number",options:(re(te={width:"",labelWidth:100,isLabelWidth:!1,required:!1,defaultValue:0,min:1,max:2,step:1,disabled:!1,controlsPosition:!1},"step",1),re(te,"precision",1),re(te,"hidden",!1),re(te,"hideLabel",!1),te),events:{onChange:"",onFocus:"",onBlur:""}},{name:"滑块",type:"slider",icon:"icon-slider",options:{width:"100%",height:"40px",labelWidth:100,isLabelWidth:!1,defaultValue:0,disabled:!1,required:!1,min:0,max:100,step:1,showInput:!1,range:!1,vertical:!1,showTooltip:!0,formatTooltip:1,showStops:!1,hidden:!1,hideLabel:!1},events:{onChange:""}},{name:"评分",type:"rate",icon:"icon-pingfen1",options:{labelWidth:100,isLabelWidth:!1,defaultValue:0,max:5,disabled:!1,allowHalf:!1,required:!1,showText:!1,hidden:!1,hideLabel:!1,auxiliaryValue:["极差","失望","一般","满意","惊喜"]},events:{onChange:""}},{name:"填充物",type:"filler",icon:"icon-ic",options:{defaultValue:"",width:"100%",height:"20px"}},{name:"图片",type:"image",icon:"icon-ic",options:{defaultValue:"https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",defaultValueArr:[{url:"https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"},{url:"https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg"},{url:"https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg"}],remote:!1,width:"",height:"200px",fit:"fill",borderRadius:"",displayStyle:"inline-block",errorSrc:"",isLoding:!1,hidden:!1,hideLabel:!1}},{name:"文件",type:"upload",icon:"icon-tupian",options:(re(te={width:"",labelWidth:100,isLabelWidth:!1,defaultValue:[],size:{width:100,height:100},tokenFunc:"funcGetToken",token:"",domain:"https://tcdn.form.making.link/",disabled:!1,length:8,autoUpload:!1,isQiniu:!1,min:0,remoteFunc:"https://jsonplaceholder.typicode.com/posts/",action:"https://jsonplaceholder.typicode.com/posts/",remoteApi:{}},"disabled",!1),re(te,"required",!1),re(te,"multiple",!1),re(te,"elUploadTip",""),re(te,"listType","default"),re(te,"drag",!1),te)},{name:"编辑器",type:"editor",icon:"icon-fuwenbenkuang",options:{width:"100%",height:"",labelWidth:100,isLabelWidth:!1,defaultValue:"",disabled:!1,required:!1,hidden:!1,hideLabel:!1}},{name:"级联选择器",type:"cascader",icon:"icon-jilianxuanze",options:{width:"",labelWidth:100,isLabelWidth:!1,defaultValue:[],placeholder:"",disabled:!1,clearable:!1,required:!1,remote:!0,showAllLevels:!1,collapseTags:!1,filterable:!1,prepend:"",append:"",remoteOptions:[],props:{value:"value",label:"label",children:"children",multiple:!1,expandTrigger:"hover",checkStrictly:!1},remoteFunc:"",hidden:!1,hideLabel:!1},events:{onChange:""}}],se=[{name:"子表单",type:"table",icon:"icon-table",options:{height:"",defaultValue:"",customClass:"",labelWidth:100,isLabelWidth:!1,dataBind:!0,validatorCheck:!1,validator:"",paging:!1,pageSize:5,remoteFunc:"",remoteOption:"",tableColumn:!1,hidden:!1,hideLabel:!1,disabled:!1,required:!1,isAdd:!0,isDelete:!0,isSerial:!0,border:!1,stripe:!1,showHeader:!0,highlightCurrentRow:!1},list:[]},{name:"子表单H5",type:"table_h5",icon:"icon-table",options:{defaultValue:"",customClass:"",labelWidth:100,isLabelWidth:!1,dataBind:!0,validatorCheck:!1,validator:"",paging:!1,pageSize:5,remoteFunc:"",remoteOption:"",tableColumn:!1,hidden:!1,hideLabel:!1,disabled:!1,required:!1,isAdd:!0,addButtonText:"新增",isDelete:!0,deleteButtonText:"删除",deleteIndex:0},list:[]},{name:"标签页",type:"tabs",icon:"icon-tabs",tabs:[{label:"选项1",value:"tab1",list:[]},{label:"选项2",value:"tab2",list:[]}],options:{defaultValue:"tab1",type:"",tabPosition:"top",customClass:"",hidden:!1,labelWidth:100,isLabelWidth:!1,hideLabel:!0,remote:!1,remoteFunc:"",remoteOption:"",tableColumn:!1},rules:[]},{name:"自定义区域",type:"blank",icon:"icon-zidingyishuju",options:{defaultType:"String",required:!1}}],le=[{name:"栅格布局",type:"grid",icon:"icon-grid-",columns:[{span:12,list:[]},{span:12,list:[]}],options:{gutter:0,justify:"start",align:"top",hideLabel:!0}},{name:"浮动布局",type:"alliance",icon:"icon-grid-",columns:[{span:12,list:[]},{span:12,list:[]}],options:{gutter:0,justify:"start",align:"top",hideLabel:!0}},{name:"分割线",type:"divider",icon:"icon-fengexian",options:{width:"100%",defaultValue:"",hidden:!1,labelWidth:100,isLabelWidth:!1,hideLabel:!0,contentPosition:"left",remoteFunc:"",remoteOption:"",tableColumn:!1},rules:[]}],ce={ui:"element",title:"",width:"",labelWidth:100,labelPosition:"right",labelSuffix:":",size:"small",disabled:!1,hideLabel:!1,eventScript:[{key:"mounted",name:"mounted",func:""},{key:"refresh",name:"refresh",func:""}]},ue=(te=n(63),n.n(te)),de=((te=ue.a.create({withCredentials:!1})).interceptors.request.use((function(e){return e}),(function(e){return console.log("error",e),Promise.reject(new Error(e).message)})),te.interceptors.response.use((function(e){return console.log(".....",e),e.data}),(function(e){return console.log("error",e),Promise.reject(new Error(e).message)})),te);function he(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"vue",n=[],i=[],o=[],r=(function e(t,n,i,o){for(var r=0;r<t.length;r++)"grid"==t[r].type?t[r].columns.forEach((function(t){e(t.list,n,i,o)})):"tabs"==t[r].type?t[r].tabs.forEach((function(t){e(t.list,n,i,o)})):"table"==t[r].type?e(t[r].list,n,i,o):"blank"==t[r].type?t[r].model&&o.push({name:t[r].model,label:t[r].name}):"upload"==t[r].type?t[r].options.tokenFunc&&i.push({func:t[r].options.tokenFunc,label:t[r].name,model:t[r].model}):t[r].options.remote&&t[r].options.remoteFunc&&n.push({func:t[r].options.remoteFunc,label:t[r].name,model:t[r].model})}(JSON.parse(e).list,n,i,o),""),a="",s=0;s<n.length;s++)r+="\n ".concat(n[s].func," (resolve) {\n // ").concat(n[s].label," ").concat(n[s].model,"\n // Call callback function once get the data from remote server\n // resolve(data)\n },\n ");for(var l=0;l<i.length;l++)r+="\n ".concat(i[l].func," (resolve) {\n // ").concat(i[l].label," ").concat(i[l].model,"\n // Call callback function once get the token\n // resolve(token)\n },\n ");for(var c=0;c<o.length;c++)a+='\n <template slot="'.concat(o[c].name,'" slot-scope="scope">\n \x3c!-- ').concat(o[c].label,' --\x3e\n \x3c!-- use v-model="scope.model.').concat(o[c].name,'" to bind data --\x3e\n </template>\n ');return"vue"==t?'\n<template>\n <div>\n <th-generate-form :data="jsonData" :remote="remoteFuncs" :value="editData" ref="generateForm">\n '.concat(a,'\n </th-generate-form>\n <el-button type="primary" @click="handleSubmit">提交</el-button>\n </div>\n</template>\n\n<script>\n export default {\n data () {\n return {\n jsonData: ').concat(e,",\n editData: {},\n remoteFuncs: {\n ").concat(r,"\n }\n }\n },\n methods: {\n handleSubmit () {\n this.$refs.generateForm.getData().then(data => {\n // data check success\n // data - form data\n }).catch(e => {\n // data check failed\n })\n }\n }\n }\n<\/script>"):'<!DOCTYPE html>\n <html>\n <head>\n <meta charset="UTF-8">\n <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">\n <link rel="stylesheet" href="https://unpkg.com/form-making/dist/FormMaking.css">\n </head>\n <body>\n <div id="app">\n <th-generate-form :data="jsonData" :remote="remoteFuncs" :value="editData" ref="generateForm">\n '.concat(a,'\n </th-generate-form>\n <el-button type="primary" @click="handleSubmit">提交</el-button>\n </div>\n <script src="https://unpkg.com/vue/dist/vue.js"><\/script>\n <script src="https://unpkg.com/element-ui/lib/index.js"><\/script>\n <script src="https://unpkg.com/form-making/dist/FormMaking.umd.js"><\/script>\n <script>\n new Vue({\n el: \'#app\',\n data: {\n jsonData: ').concat(e,",\n editData: {},\n remoteFuncs: {\n ").concat(r,"\n }\n },\n methods: {\n handleSubmit () {\n this.$refs.generateForm.getData().then(data => {\n // data check success\n // data - form data\n }).catch(e => {\n // data check failed\n })\n }\n }\n })\n <\/script>\n </body>\n </html>")}var pe=1200,fe=1252,me=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],ge={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},ve=function(e){-1!=me.indexOf(e)&&(fe=ge[0]=e)},be=function(e){ve(pe=e)};
|
115
115
|
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */function ye(){be(1200),ve(1252)}function we(e){for(var t=[],n=0,i=e.length;n<i;++n)t[n]=e.charCodeAt(n);return t}function xe(e){for(var t=[],n=0;n<e.length>>1;++n)t[n]=String.fromCharCode(e.charCodeAt(2*n+1)+(e.charCodeAt(2*n)<<8));return t.join("")}var _e,ke=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);if(255!=t||254!=n)return 254==t&&255==n?xe(e.slice(2)):65279==t?e.slice(1):e;for(var i=e.slice(2),o=[],r=0;r<i.length>>1;++r)o[r]=String.fromCharCode(i.charCodeAt(2*r)+(i.charCodeAt(2*r+1)<<8));return o.join("")},Ee=function(e){return String.fromCharCode(e)},Ce=function(e){return String.fromCharCode(e)},Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Te(e){for(var t,n,i,o,r="",a=0,s=0,l=0;l<e.length;)i=(t=e.charCodeAt(l++))>>2,o=(3&t)<<4|(t=e.charCodeAt(l++))>>4,a=(15&t)<<2|(n=e.charCodeAt(l++))>>6,s=63&n,isNaN(t)?a=s=64:isNaN(n)&&(s=64),r+=Se.charAt(i)+Se.charAt(o)+Se.charAt(a)+Se.charAt(s);return r}function Ae(e){var t,n,i="";e=e.replace(/[^\w\+\/\=]/g,"");for(var o=0;o<e.length;)t=Se.indexOf(e.charAt(o++)),n=Se.indexOf(e.charAt(o++)),i+=String.fromCharCode(t<<2|n>>4),64!==(t=Se.indexOf(e.charAt(o++)))&&(i+=String.fromCharCode((15&n)<<4|t>>2)),64!==(n=Se.indexOf(e.charAt(o++)))&&(i+=String.fromCharCode((3&t)<<6|n));return i}var Oe="undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node,Me=function(){if("undefined"==typeof Buffer)return function(){};var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(t){e=!0}return e?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}();function De(e){return Oe?Buffer.alloc?Buffer.alloc(e):new Buffer(e):new("undefined"!=typeof Uint8Array?Uint8Array:Array)(e)}function $e(e){return Oe?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):new("undefined"!=typeof Uint8Array?Uint8Array:Array)(e)}var Pe=function(e){return Oe?Me(e,"binary"):e.split("").map((function(e){return 255&e.charCodeAt(0)}))};function Re(e){if(Array.isArray(e))return e.map((function(e){return String.fromCharCode(e)})).join("");for(var t=[],n=0;n<e.length;++n)t[n]=String.fromCharCode(e[n]);return t.join("")}function Le(e){if("undefined"==typeof ArrayBuffer)throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Le(new Uint8Array(e));for(var t=new Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t}var Ie=Oe?function(e){return Buffer.concat(e.map((function(e){return Buffer.isBuffer(e)?e:Me(e)})))}:function(e){if("undefined"==typeof Uint8Array)return[].concat.apply([],e.map((function(e){return Array.isArray(e)?e:[].slice.call(e)})));var t=0,n=0;for(t=0;t<e.length;++t)n+=e[t].length;var i,o=new Uint8Array(n);for(n=t=0;t<e.length;n+=i,++t)if(i=e[t].length,e[t]instanceof Uint8Array)o.set(e[t],n);else{if("string"==typeof e[t])throw"wtf";o.set(new Uint8Array(e[t]),n)}return o},Ne=/\u0000/g,Fe=/[\u0001-\u0006]/g;function je(e){for(var t="",n=e.length-1;0<=n;)t+=e.charAt(n--);return t}function Be(e,t){return t<=(e=""+e).length?e:qt("0",t-e.length)+e}function qe(e,t){return t<=(e=""+e).length?e:qt(" ",t-e.length)+e}function ze(e,t){return t<=(e=""+e).length?e:e+qt(" ",t-e.length)}var Ve=Math.pow(2,32);function We(e,t){var n,i;return Ve<e||e<-Ve?(i=e,(n=t)<=(i=""+Math.round(i)).length?i:qt("0",n-i.length)+i):(i=t)<=(e=""+(e=n=Math.round(e))).length?e:qt("0",i-e.length)+e}function He(e,t){return e.length>=7+(t=t||0)&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var Ue=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Ge=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]],Ke={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},Ye={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Xe={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Je(e,t,n){var i,o=e<0?-1:1,r=e*o,a=0,s=1,l=0,c=1,u=0,d=0;for(Math.floor(r);u<t&&(l=(i=Math.floor(r))*s+a,d=i*u+c,!(r-i<5e-8));)r=1/(r-i),a=s,s=l,c=u,u=d;return t<d&&(l=t<u?(d=c,a):(d=u,s)),n?[e=Math.floor(o*l/d),o*l-e*d,d]:[0,o*l,d]}function Ze(e,t,n){var i,o,r,a;return 2958465<e||e<0?null:(r=[],a={D:i=0|e,T:o=Math.floor(86400*(e-i)),u:86400*(e-i)-o,y:e=0,m:0,d:0,H:0,M:0,S:0,q:0},Math.abs(a.u)<1e-6&&(a.u=0),t&&t.date1904&&(i+=1462),.9999<a.u&&(a.u=0,86400==++o)&&(a.T=o=0,++i,++a.D),60===i?(r=n?[1317,10,29]:[1900,2,29],e=3):0===i?(r=n?[1317,8,29]:[1900,1,0],e=6):(60<i&&--i,(t=new Date(1900,0,1)).setDate(t.getDate()+i-1),r=[t.getFullYear(),t.getMonth()+1,t.getDate()],e=t.getDay(),i<60&&(e=(e+6)%7),n&&(e=function(e,t){return t[0]-=581,t=e.getDay(),e<60&&(t=(t+6)%7),t}(t,r))),a.y=r[0],a.m=r[1],a.d=r[2],a.S=o%60,o=Math.floor(o/60),a.M=o%60,o=Math.floor(o/60),a.H=o,a.q=e,a)}var Qe=new Date(1899,11,31,0,0,0),et=Qe.getTime(),tt=new Date(1900,2,1,0,0,0);function nt(e,t){var n=e.getTime();return t?n-=1262304e5:tt<=e&&(n+=864e5),(n-(et+6e4*(e.getTimezoneOffset()-Qe.getTimezoneOffset())))/864e5}function it(e){return-1==e.indexOf(".")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function ot(e){var t,n,i=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),o=-4<=i&&i<=-1?e.toPrecision(10+i):Math.abs(i)<=9?(t=(o=e)<0?12:11,(n=it(o.toFixed(12))).length<=t||(n=o.toPrecision(10)).length<=t?n:o.toExponential(5)):10===i?e.toFixed(10).substr(0,12):(n=it((t=e).toFixed(11))).length>(t<0?12:11)||"0"===n||"-0"===n?t.toPrecision(6):n;return it(-1==(i=o.toUpperCase()).indexOf("E")?i:i.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2"))}function rt(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):ot(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return _t(14,nt(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function at(e){if(e.length<=3)return e;for(var t=e.length%3,n=e.substr(0,t);t!=e.length;t+=3)n+=(0<n.length?",":"")+e.substr(t,3);return n}var st=/%/g,lt=/# (\?+)( ?)\/( ?)(\d+)/,ct=/^#*0*\.([0#]+)/,ut=/\).*[0#]/,dt=/\(###\) ###\\?-####/;function ht(e){for(var t,n="",i=0;i!=e.length;++i)switch(t=e.charCodeAt(i)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(t)}return n}function pt(e,t){return t=Math.pow(10,t),""+Math.round(e*t)/t}function ft(e,t){e-=Math.floor(e);var n=Math.pow(10,t);return t<(""+Math.round(e*n)).length?0:Math.round(e*n)}function mt(e,t,n){if(40===e.charCodeAt(0)&&!t.match(ut))return i=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""),0<=n?mt("n",i,n):"("+mt("n",i,-n)+")";if(44===t.charCodeAt(t.length-1)){for(var i=e,o=t,r=n,a=o.length-1;44===o.charCodeAt(a-1);)--a;return vt(i,o.substr(0,a),r/Math.pow(10,3*(o.length-a)))}if(-1!==t.indexOf("%"))return r=e,c=n,l=(u=t).replace(st,""),u=u.length-l.length,vt(r,l,c*Math.pow(10,2*u))+qt("%",u);if(-1!==t.indexOf("E"))return function e(t,n){var i,o=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+e(t,-n);var r=t.indexOf("."),a=(-1===r&&(r=t.indexOf("E")),Math.floor(Math.log(n)*Math.LOG10E)%r);if(a<0&&(a+=r),-1===(i=(n/Math.pow(10,a)).toPrecision(1+o+(r+a)%r)).indexOf("e")){var s=Math.floor(Math.log(n)*Math.LOG10E);for(-1===i.indexOf(".")?i=i.charAt(0)+"."+i.substr(1)+"E+"+(s-i.length+a):i+="E+"+(s-a);"0."===i.substr(0,2);)i=(i=i.charAt(0)+i.substr(2,r)+"."+i.substr(2+r)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");i=i.replace(/\+-/,"-")}i=i.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,n,i){return t+n+i.substr(0,(r+a)%r)+"."+i.substr(a)+"E"}))}else i=n.toExponential(o);return t.match(/E\+00$/)&&i.match(/e[+-]\d$/)&&(i=i.substr(0,i.length-1)+"0"+i.charAt(i.length-1)),(i=t.match(/E\-/)&&i.match(/e\+/)?i.replace(/e\+/,"e"):i).replace("e","E")}(t,n);if(36===t.charCodeAt(0))return"$"+mt(e,t.substr(" "==t.charAt(1)?2:1),n);var s,l,c,u,d,h=Math.abs(n),p=n<0?"-":"";if(t.match(/^00+$/))return p+We(h,t.length);if(t.match(/^[#?]+$/))return(f="0"===(f=We(n,0))?"":f).length>t.length?f:ht(t.substr(0,t.length-f.length))+f;if(s=t.match(lt))return l=s,c=h,u=p,b=parseInt(l[4],10),c=Math.round(c*b),u+(0===(d=Math.floor(c/b))?"":""+d)+" "+(0==(c-=d*b)?qt(" ",l[1].length+1+l[4].length):qe(c,l[1].length)+l[2]+"/"+l[3]+Be(b,l[4].length));if(t.match(/^#+0+$/))return p+We(h,t.length-t.indexOf("0"));if(s=t.match(ct))return f=pt(n,s[1].length).replace(/^([^\.]+)$/,"$1."+ht(s[1])).replace(/\.$/,"."+ht(s[1])).replace(/\.(\d*)$/,(function(e,t){return"."+t+qt("0",ht(s[1]).length-t.length)})),-1!==t.indexOf("0.")?f:f.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return p+pt(h,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return p+at(We(h,0));if(s=t.match(/^#,##0\.([#0]*0)$/))return n<0?"-"+mt(e,t,-n):at(""+(Math.floor(n)+((d=s[1].length)<(""+Math.round((n-Math.floor(n))*Math.pow(10,d))).length?1:0)))+"."+Be(ft(n,s[1].length),s[1].length);if(s=t.match(/^#,#*,#0/))return mt(e,t.replace(/^#,#*,/,""),n);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return f=je(mt(e,t.replace(/[\\-]/g,""),n)),m=0,je(je(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return m<f.length?f.charAt(m++):"0"===e?"0":""})));if(t.match(dt))return"("+(f=mt(e,"##########",n)).substr(0,3)+") "+f.substr(3,3)+"-"+f.substr(6);var f,m,g,v,b="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return m=Math.min(s[4].length,7),v=Je(h,Math.pow(10,m)-1,!1),f=p," "==(b=vt("n",s[1],v[1])).charAt(b.length-1)&&(b=b.substr(0,b.length-1)+"0"),f+=b+s[2]+"/"+s[3],(b=ze(v[2],m)).length<s[4].length&&(b=ht(s[4].substr(s[4].length-b.length))+b),f+=b;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return m=Math.min(Math.max(s[1].length,s[4].length),7),p+((v=Je(h,Math.pow(10,m)-1,!0))[0]||(v[1]?"":"0"))+" "+(v[1]?qe(v[1],m)+s[2]+"/"+s[3]+ze(v[2],m):qt(" ",2*m+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return f=We(n,0),t.length<=f.length?f:ht(t.substr(0,t.length-f.length))+f;if(s=t.match(/^([#0?]+)\.([#0]+)$/))return m=(f=""+n.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1")).indexOf("."),v=t.indexOf(".")-m,g=t.length-f.length-v,ht(t.substr(0,v)+f+t.substr(t.length-g));if(s=t.match(/^00,000\.([#0]*0)$/))return m=ft(n,s[1].length),n<0?"-"+mt(e,t,-n):at((v=n)<2147483647&&-2147483648<v?""+(0<=v?0|v:v-1|0):""+Math.floor(v)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?Be(0,3-e.length):"")+e}))+"."+Be(m,s[1].length);switch(t){case"###,##0.00":return mt(e,"#,##0.00",n);case"###,###":case"##,###":case"#,###":var y=at(We(h,0));return"0"!==y?p+y:"";case"###,###.00":return mt(e,"###,##0.00",n).replace(/^0\./,".");case"#,###.00":return mt(e,"#,##0.00",n).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function gt(e,t,n){if(40===e.charCodeAt(0)&&!t.match(ut))return i=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""),0<=n?gt("n",i,n):"("+gt("n",i,-n)+")";if(44===t.charCodeAt(t.length-1)){for(var i=e,o=t,r=n,a=o.length-1;44===o.charCodeAt(a-1);)--a;return vt(i,o.substr(0,a),r/Math.pow(10,3*(o.length-a)))}if(-1!==t.indexOf("%"))return r=e,l=n,c=(g=t).replace(st,""),g=g.length-c.length,vt(r,c,l*Math.pow(10,2*g))+qt("%",g);if(-1!==t.indexOf("E"))return function e(t,n){var i,o=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+e(t,-n);var r,a=t.indexOf("."),s=(-1===a&&(a=t.indexOf("E")),Math.floor(Math.log(n)*Math.LOG10E)%a);s<0&&(s+=a),(i=(n/Math.pow(10,s)).toPrecision(1+o+(a+s)%a)).match(/[Ee]/)||(r=Math.floor(Math.log(n)*Math.LOG10E),-1===i.indexOf(".")?i=i.charAt(0)+"."+i.substr(1)+"E+"+(r-i.length+s):i+="E+"+(r-s),i=i.replace(/\+-/,"-")),i=i.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(e,t,n,i){return t+n+i.substr(0,(a+s)%a)+"."+i.substr(s)+"E"}))}else i=n.toExponential(o);return t.match(/E\+00$/)&&i.match(/e[+-]\d$/)&&(i=i.substr(0,i.length-1)+"0"+i.charAt(i.length-1)),(i=t.match(/E\-/)&&i.match(/e\+/)?i.replace(/e\+/,"e"):i).replace("e","E")}(t,n);if(36===t.charCodeAt(0))return"$"+gt(e,t.substr(" "==t.charAt(1)?2:1),n);var s,l,c,u=Math.abs(n),d=n<0?"-":"";if(t.match(/^00+$/))return d+Be(u,t.length);if(t.match(/^[#?]+$/))return(h=0===n?"":""+n).length>t.length?h:ht(t.substr(0,t.length-h.length))+h;if(s=t.match(lt))return d+(0===(c=u)?"":""+c)+qt(" ",(l=s)[1].length+2+l[4].length);if(t.match(/^#+0+$/))return d+Be(u,t.length-t.indexOf("0"));if(s=t.match(ct))return h=(h=(""+n).replace(/^([^\.]+)$/,"$1."+ht(s[1])).replace(/\.$/,"."+ht(s[1]))).replace(/\.(\d*)$/,(function(e,t){return"."+t+qt("0",ht(s[1]).length-t.length)})),-1!==t.indexOf("0.")?h:h.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return d+(""+u).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return d+at(""+u);if(s=t.match(/^#,##0\.([#0]*0)$/))return n<0?"-"+gt(e,t,-n):at(""+n)+"."+qt("0",s[1].length);if(s=t.match(/^#,#*,#0/))return gt(e,t.replace(/^#,#*,/,""),n);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return h=je(gt(e,t.replace(/[\\-]/g,""),n)),p=0,je(je(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return p<h.length?h.charAt(p++):"0"===e?"0":""})));if(t.match(dt))return"("+(h=gt(e,"##########",n)).substr(0,3)+") "+h.substr(3,3)+"-"+h.substr(6);var h,p,f,m,g="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return p=Math.min(s[4].length,7),f=Je(u,Math.pow(10,p)-1,!1),h=d," "==(g=vt("n",s[1],f[1])).charAt(g.length-1)&&(g=g.substr(0,g.length-1)+"0"),h+=g+s[2]+"/"+s[3],(g=ze(f[2],p)).length<s[4].length&&(g=ht(s[4].substr(s[4].length-g.length))+g),h+=g;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return p=Math.min(Math.max(s[1].length,s[4].length),7),d+((f=Je(u,Math.pow(10,p)-1,!0))[0]||(f[1]?"":"0"))+" "+(f[1]?qe(f[1],p)+s[2]+"/"+s[3]+ze(f[2],p):qt(" ",2*p+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return h=""+n,t.length<=h.length?h:ht(t.substr(0,t.length-h.length))+h;if(s=t.match(/^([#0]+)\.([#0]+)$/))return p=(h=""+n.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1")).indexOf("."),f=t.indexOf(".")-p,m=t.length-h.length-f,ht(t.substr(0,f)+h+t.substr(t.length-m));if(s=t.match(/^00,000\.([#0]*0)$/))return n<0?"-"+gt(e,t,-n):at(""+n).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?Be(0,3-e.length):"")+e}))+"."+Be(0,s[1].length);switch(t){case"###,###":case"##,###":case"#,###":var v=at(""+u);return"0"!==v?d+v:"";default:if(t.match(/\.[0#?]*$/))return gt(e,t.slice(0,t.lastIndexOf(".")),n)+ht(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function vt(e,t,n){return((0|n)===n?gt:mt)(e,t,n)}var bt=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function yt(e){for(var t=0,n="",i="";t<e.length;)switch(n=e.charAt(t)){case"G":He(e,t)&&(t+=6),t++;break;case'"':for(;34!==e.charCodeAt(++t)&&t<e.length;);++t;break;case"\\":case"_":t+=2;break;case"@":++t;break;case"B":case"b":if("1"===e.charAt(t+1)||"2"===e.charAt(t+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===e.substr(t,3).toUpperCase())return!0;if("AM/PM"===e.substr(t,5).toUpperCase())return!0;if("上午/下午"===e.substr(t,5).toUpperCase())return!0;++t;break;case"[":for(i=n;"]"!==e.charAt(t++)&&t<e.length;)i+=e.charAt(t);if(i.match(bt))return!0;break;case".":case"0":case"#":for(;t<e.length&&(-1<"0#?.,E+-%".indexOf(n=e.charAt(++t))||"\\"==n&&"-"==e.charAt(t+1)&&-1<"0#".indexOf(e.charAt(t+2))););break;case"?":for(;e.charAt(++t)===n;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&-1<"0123456789".indexOf(e.charAt(++t)););break;default:++t}return!1}var wt=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function xt(e,t){if(null!=t){var n=parseFloat(t[2]);switch(t[1]){case"=":if(e==n)return 1;break;case">":if(n<e)return 1;break;case"<":if(e<n)return 1;break;case"<>":if(e!=n)return 1;break;case">=":if(n<=e)return 1;break;case"<=":if(e<=n)return 1}}}function _t(e,t,n){null==n&&(n={});var i="";switch(typeof e){case"string":i="m/d/yy"==e&&n.dateNF?n.dateNF:e;break;case"number":null==(i=null==(i=14==e&&n.dateNF?n.dateNF:(null!=n.table?n.table:Ke)[e])?n.table&&n.table[Ye[e]]||Ke[Ye[e]]:i)&&(i=Xe[e]||"General")}if(He(i,0))return rt(t,n);var o=function(e,t){var n=function(e){for(var t=[],n=!1,i=0,o=0;i<e.length;++i)switch(e.charCodeAt(i)){case 34:n=!n;break;case 95:case 42:case 92:++i;break;case 59:t[t.length]=e.substr(o,i-o),o=i+1}if(t[t.length]=e.substr(o),!0===n)throw new Error("Format |"+e+"| unterminated string ");return t}(e),i=n[(e=n.length)-1].indexOf("@");if(e<4&&-1<i&&--e,4<n.length)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof t)return[4,4===n.length||-1<i?n[n.length-1]:"@"];switch(n.length){case 1:n=-1<i?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=-1<i?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=-1<i?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var o,r,a=0<t?n[0]:t<0?n[1]:n[2];return-1===n[0].indexOf("[")&&-1===n[1].indexOf("[")||null==n[0].match(/\[[=<>]/)&&null==n[1].match(/\[[=<>]/)?[e,a]:(o=n[0].match(wt),r=n[1].match(wt),xt(t,o)?[e,n[0]]:xt(t,r)?[e,n[1]]:[e,n[null!=o&&null!=r?2:1]])}(i,t=t instanceof Date?nt(t,n.date1904):t);if(He(o[1]))return rt(t,n);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else if(""===t||null==t)return"";return function(e,t,n,i){for(var o,r,a,s=[],l="",c=0,u="",d="t",h="H";c<e.length;)switch(u=e.charAt(c)){case"G":if(!He(e,c))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(a=e.charCodeAt(++c))&&c<e.length;)l+=String.fromCharCode(a);s[s.length]={t:"t",v:l},++c;break;case"\\":var p=e.charAt(++c);s[s.length]={t:"("===p||")"===p?p:"t",v:p},++c;break;case"_":s[s.length]={t:"t",v:" "},c+=2;break;case"@":s[s.length]={t:"T",v:t},++c;break;case"B":case"b":if("1"===e.charAt(c+1)||"2"===e.charAt(c+1)){if(null==o&&null==(o=Ze(t,n,"2"===e.charAt(c+1))))return"";s[s.length]={t:"X",v:e.substr(c,2)},d=u,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":u=u.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0)return"";if(null==o&&null==(o=Ze(t,n)))return"";for(l=u;++c<e.length&&e.charAt(c).toLowerCase()===u;)l+=u;"h"===(u="m"===u&&"h"===d.toLowerCase()?"M":u)&&(u=h),s[s.length]={t:u,v:l},d=u;break;case"A":case"a":case"上":if(p={t:u,v:u},null==o&&(o=Ze(t,n)),"A/P"===e.substr(c,3).toUpperCase()?(null!=o&&(p.v=12<=o.H?"P":"A"),p.t="T",h="h",c+=3):"AM/PM"===e.substr(c,5).toUpperCase()?(null!=o&&(p.v=12<=o.H?"PM":"AM"),p.t="T",c+=5,h="h"):"上午/下午"===e.substr(c,5).toUpperCase()?(null!=o&&(p.v=12<=o.H?"下午":"上午"),p.t="T",c+=5,h="h"):(p.t="t",++c),null==o&&"T"===p.t)return"";s[s.length]=p,d=u;break;case"[":for(l=u;"]"!==e.charAt(c++)&&c<e.length;)l+=e.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(bt)){if(null==o&&null==(o=Ze(t,n)))return"";s[s.length]={t:"Z",v:l.toLowerCase()},d=l.charAt(1)}else-1<l.indexOf("$")&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",yt(e)||(s[s.length]={t:"t",v:l}));break;case".":if(null!=o){for(l=u;++c<e.length&&"0"===(u=e.charAt(c));)l+=u;s[s.length]={t:"s",v:l};break}case"0":case"#":for(l=u;++c<e.length&&-1<"0#?.,E+-%".indexOf(u=e.charAt(c));)l+=u;s[s.length]={t:"n",v:l};break;case"?":for(l=u;e.charAt(++c)===u;)l+=u;s[s.length]={t:u,v:l},d=u;break;case"*":++c," "!=e.charAt(c)&&"*"!=e.charAt(c)||++c;break;case"(":case")":s[s.length]={t:1===i?"t":u,v:u},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=u;c<e.length&&-1<"0123456789".indexOf(e.charAt(++c));)l+=e.charAt(c);s[s.length]={t:"D",v:l};break;case" ":s[s.length]={t:u,v:u},++c;break;case"$":s[s.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(u))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"t",v:u},++c}var f,m=0,g=0;for(c=s.length-1,d="t";0<=c;--c)switch(s[c].t){case"h":case"H":s[c].t=h,d="h",m<1&&(m=1);break;case"s":(f=s[c].v.match(/\.0+$/))&&(g=Math.max(g,f[0].length-1)),m<3&&(m=3);case"d":case"y":case"M":case"e":d=s[c].t;break;case"m":"s"===d&&(s[c].t="M",m<2)&&(m=2);break;case"X":break;case"Z":(m=(m=m<1&&s[c].v.match(/[Hh]/)?1:m)<2&&s[c].v.match(/[Mm]/)?2:m)<3&&s[c].v.match(/[Ss]/)&&(m=3)}switch(m){case 0:break;case 1:.5<=o.u&&(o.u=0,++o.S),60<=o.S&&(o.S=0,++o.M),60<=o.M&&(o.M=0,++o.H);break;case 2:.5<=o.u&&(o.u=0,++o.S),60<=o.S&&(o.S=0,++o.M)}var v="";for(c=0;c<s.length;++c)switch(s[c].t){case"t":case"T":case" ":case"D":break;case"X":s[c].v="",s[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[c].v=function(e,t,n,i){var o,r="",a=0,s=0,l=n.y,c=0;switch(e){case 98:l=n.y+543;case 121:switch(t.length){case 1:case 2:o=l%100,c=2;break;default:o=l%1e4,c=4}break;case 109:switch(t.length){case 1:case 2:o=n.m,c=t.length;break;case 3:return Ge[n.m-1][1];case 5:return Ge[n.m-1][0];default:return Ge[n.m-1][2]}break;case 100:switch(t.length){case 1:case 2:o=n.d,c=t.length;break;case 3:return Ue[n.q][0];default:return Ue[n.q][1]}break;case 104:switch(t.length){case 1:case 2:o=1+(n.H+11)%12,c=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:o=n.H,c=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:o=n.M,c=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==n.u||"s"!=t&&"ss"!=t?(60*(s=2<=i?3===i?1e3:100:1===i?10:1)<=(a=Math.round(s*(n.S+n.u)))&&(a=0),"s"===t?0===a?"0":""+a/s:(r=Be(a,2+i),"ss"===t?r.substr(0,2):"."+r.substr(2,t.length-1))):Be(n.S,t.length);case 90:switch(t){case"[h]":case"[hh]":o=24*n.D+n.H;break;case"[m]":case"[mm]":o=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":o=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+t}c=3===t.length?1:2;break;case 101:o=l,c=1}return 0<c?Be(o,c):""}(s[c].t.charCodeAt(0),s[c].v,o,g),s[c].t="t";break;case"n":case"?":for(x=c+1;null!=s[x]&&("?"===(u=s[x].t)||"D"===u||(" "===u||"t"===u)&&null!=s[x+1]&&("?"===s[x+1].t||"t"===s[x+1].t&&"/"===s[x+1].v)||"("===s[c].t&&(" "===u||"n"===u||")"===u)||"t"===u&&("/"===s[x].v||" "===s[x].v&&null!=s[x+1]&&"?"==s[x+1].t));)s[c].v+=s[x].v,s[x]={v:"",t:";"},++x;v+=s[c].v,c=x-1;break;case"G":s[c].t="t",s[c].v=rt(t,n)}var b,y,w="";if(0<v.length){40==v.charCodeAt(0)?(b=t<0&&45===v.charCodeAt(0)?-t:t,y=vt("n",v,b)):(y=vt("n",v,b=t<0&&1<i?-t:t),b<0&&s[0]&&"t"==s[0].t&&(y=y.substr(1),s[0].v="-"+s[0].v));var x=y.length-1,_=s.length;for(c=0;c<s.length;++c)if(null!=s[c]&&"t"!=s[c].t&&-1<s[c].v.indexOf(".")){_=c;break}var k=s.length;if(_===s.length&&-1===y.indexOf("E")){for(c=s.length-1;0<=c;--c)null!=s[c]&&-1!=="n?".indexOf(s[c].t)&&(x>=s[c].v.length-1?(x-=s[c].v.length,s[c].v=y.substr(x+1,s[c].v.length)):x<0?s[c].v="":(s[c].v=y.substr(0,x+1),x=-1),s[c].t="t",k=c);0<=x&&k<s.length&&(s[k].v=y.substr(0,x+1)+s[k].v)}else if(_!==s.length&&-1===y.indexOf("E")){for(x=y.indexOf(".")-1,c=_;0<=c;--c)if(null!=s[c]&&-1!=="n?".indexOf(s[c].t)){for(r=-1<s[c].v.indexOf(".")&&c===_?s[c].v.indexOf(".")-1:s[c].v.length-1,w=s[c].v.substr(r+1);0<=r;--r)0<=x&&("0"===s[c].v.charAt(r)||"#"===s[c].v.charAt(r))&&(w=y.charAt(x--)+w);s[c].v=w,s[c].t="t",k=c}for(0<=x&&k<s.length&&(s[k].v=y.substr(0,x+1)+s[k].v),x=y.indexOf(".")+1,c=_;c<s.length;++c)if(null!=s[c]&&(-1!=="n?(".indexOf(s[c].t)||c===_)){for(r=-1<s[c].v.indexOf(".")&&c===_?s[c].v.indexOf(".")+1:0,w=s[c].v.substr(0,r);r<s[c].v.length;++r)x<y.length&&(w+=y.charAt(x++));s[c].v=w,s[c].t="t",k=c}}}for(c=0;c<s.length;++c)null!=s[c]&&-1<"n?".indexOf(s[c].t)&&(b=1<i&&t<0&&0<c&&"-"===s[c-1].v?-t:t,s[c].v=vt(s[c].t,s[c].v,b),s[c].t="t");var E="";for(c=0;c!==s.length;++c)null!=s[c]&&(E+=s[c].v);return E}(o[1],t,n,o[0])}function kt(e,t){if("number"!=typeof t){t=+t||-1;for(var n=0;n<392;++n)if(null==Ke[n])t<0&&(t=n);else if(Ke[n]==e){t=n;break}t<0&&(t=391)}return Ke[t]=e,t}function Et(){var e;(e=e||{})[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',Ke=e}var Ct={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},St=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g,Tt=function(){var e={version:"1.2.0"},t=function(){for(var e,t=new Array(256),n=0;256!=n;++n)t[e=n]=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&e?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),n=function(e){var t=0,n=0,i=0,o=new("undefined"!=typeof Int32Array?Int32Array:Array)(4096);for(i=0;256!=i;++i)o[i]=e[i];for(i=0;256!=i;++i)for(n=e[i],t=256+i;t<4096;t+=256)n=o[t]=n>>>8^e[255&n];var r=[];for(i=1;16!=i;++i)r[i-1]="undefined"!=typeof Int32Array?o.subarray(256*i,256*i+256):o.slice(256*i,256*i+256);return r}(t),i=n[0],o=n[1],r=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],h=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14];return e.table=t,e.bstr=function(e,n){for(var i=-1^n,o=0,r=e.length;o<r;)i=i>>>8^t[255&(i^e.charCodeAt(o++))];return~i},e.buf=function(e,n){for(var b=-1^n,y=e.length-15,w=0;w<y;)b=v[e[w++]^255&b]^g[e[w++]^b>>8&255]^m[e[w++]^b>>16&255]^f[e[w++]^b>>>24]^p[e[w++]]^h[e[w++]]^d[e[w++]]^u[e[w++]]^c[e[w++]]^l[e[w++]]^s[e[w++]]^a[e[w++]]^r[e[w++]]^o[e[w++]]^i[e[w++]]^t[e[w++]];for(y+=15;w<y;)b=b>>>8^t[255&(b^e[w++])];return~b},e.str=function(e,n){for(var i,o=-1^n,r=0,a=e.length,s=0;r<a;)o=(s=e.charCodeAt(r++))<128?o>>>8^t[255&(o^s)]:s<2048?(o=o>>>8^t[255&(o^(192|s>>6&31))])>>>8^t[255&(o^(128|63&s))]:55296<=s&&s<57344?(s=64+(1023&s),i=1023&e.charCodeAt(r++),(o=(o=(o=o>>>8^t[255&(o^(240|s>>8&7))])>>>8^t[255&(o^(128|s>>2&63))])>>>8^t[255&(o^(128|i>>6&15|(3&s)<<4))])>>>8^t[255&(o^(128|63&i))]):(o=(o=o>>>8^t[255&(o^(224|s>>12&15))])>>>8^t[255&(o^(128|s>>6&63))])>>>8^t[255&(o^(128|63&s))];return~o},e}(),At=function(){var e,t={};function n(e){var t;return"/"==e.charAt(e.length-1)?-1===e.slice(0,-1).indexOf("/")?e:n(e.slice(0,-1)):-1===(t=e.lastIndexOf("/"))?e:e.slice(0,t+1)}function i(e){var t;return"/"==e.charAt(e.length-1)?i(e.slice(0,-1)):-1===(t=e.lastIndexOf("/"))?e:e.slice(t+1)}function o(e){di(e,0);for(var t,n={};e.l<=e.length-4;){var i=e.read_shift(2),o=e.read_shift(2),r=e.l+o,a={};21589===i&&(1&(t=e.read_shift(1))&&(a.mtime=e.read_shift(4)),5<o&&(2&t&&(a.atime=e.read_shift(4)),4&t)&&(a.ctime=e.read_shift(4)),a.mtime)&&(a.mt=new Date(1e3*a.mtime)),e.l=r,n[i]=a}return n}function r(){e=e||{}}function a(e,t){if(80==e[0]&&75==e[1])return X(e,t);if(109==(32|e[0])&&105==(32|e[1])){var n=t;if("mime-version:"!=v((k=e).slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var i=n&&n.root||"",o=(Oe&&Buffer.isBuffer(k)?k.toString("binary"):v(k)).split("\r\n"),r=0,a="";for(r=0;r<o.length;++r)if(a=o[r],/^Content-Location:/i.test(a)&&(a=a.slice(a.indexOf("file")),i=i||a.slice(0,a.lastIndexOf("/")+1),a.slice(0,i.length)!=i))for(;0<i.length&&(i=(i=i.slice(0,i.length-1)).slice(0,i.lastIndexOf("/")+1),a.slice(0,i.length)!=i););if(!(n=(o[1]||"").match(/boundary="(.*?)"/)))throw new Error("MAD cannot find boundary");var c="--"+(n[1]||""),u={FileIndex:[],FullPaths:[]};l(u);var d,f=0;for(r=0;r<o.length;++r){var m=o[r];m!==c&&m!==c+"--"||(f++&&function(e,t,n){for(var i,o="",r="",a="",s=0;s<10;++s){var l=t[s];if(!l||l.match(/^\s*$/))break;var c=l.match(/^(.*?):\s*([^\s].*)$/);if(c)switch(c[1].toLowerCase()){case"content-location":o=c[2].trim();break;case"content-type":a=c[2].trim();break;case"content-transfer-encoding":r=c[2].trim()}}switch(++s,r.toLowerCase()){case"base64":i=Pe(Ae(t.slice(s).join("")));break;case"quoted-printable":i=function(e){for(var t=[],n=0;n<e.length;++n){for(var i=e[n];n<=e.length&&"="==i.charAt(i.length-1);)i=i.slice(0,i.length-1)+e[++n];t.push(i)}for(var o=0;o<t.length;++o)t[o]=t[o].replace(/[=][0-9A-Fa-f]{2}/g,(function(e){return String.fromCharCode(parseInt(e.slice(1),16))}));return Pe(t.join("\r\n"))}(t.slice(s));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+r)}e=Z(e,o.slice(n.length),i,{unsafe:!0}),a&&(e.ctype=a)}(u,o.slice(d,r),i),d=r)}return u}if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var g,b=512,y=[],w=e.slice(0,512),x=(di(w,0),function(e){if(80==e[e.l]&&75==e[e.l+1])return[0,0];e.chk(p,"Header Signature: "),e.l+=16;var t=e.read_shift(2,"u");return[e.read_shift(2,"u"),t]}(w));switch(g=x[0]){case 3:b=512;break;case 4:b=4096;break;case 0:if(0==x[1])return X(e,t);default:throw new Error("Major Version: Expected 3 or 4 saw "+g)}512!==b&&di(w=e.slice(0,b),28);var _,k=e.slice(0,b),E=g;switch((n=w).l+=2,_=n.read_shift(2)){case 9:if(3!=E)throw new Error("Sector Shift: Expected 9 saw "+_);break;case 12:if(4!=E)throw new Error("Sector Shift: Expected 12 saw "+_);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+_)}n.chk("0600","Mini Sector Shift: "),n.chk("000000000000","Reserved: ");var C=w.read_shift(4,"i");if(3===g&&0!==C)throw new Error("# Directory Sectors: Expected 0 saw "+C);w.l+=4,C=w.read_shift(4,"i"),w.l+=4,w.chk("00100000","Mini Stream Cutoff Size: ");for(var S,T=w.read_shift(4,"i"),A=w.read_shift(4,"i"),O=w.read_shift(4,"i"),M=w.read_shift(4,"i"),D=0;D<109&&!((S=w.read_shift(4,"i"))<0);++D)y[D]=S;for(var $,P=function(e,t){for(var n=Math.ceil(e.length/t)-1,i=[],o=1;o<n;++o)i[o-1]=e.slice(o*t,(o+1)*t);return i[n-1]=e.slice(n*t),i}(e,b),R=(M=((O=(function e(t,n,i,o,r){var a=h;if(t===h){if(0!==n)throw new Error("DIFAT chain shorter than expected")}else if(-1!==t){var s=i[t],l=(o>>>2)-1;if(s){for(var c=0;c<l&&(a=ri(s,4*c))!==h;++c)r.push(a);e(ri(s,o-4),n-1,i,o,r)}}}(O,M,P,b,y),function(e,t,n,i){var o=e.length,r=[],a=[],s=[],l=[],c=i-1,u=0,d=0,h=0,p=0;for(u=0;u<o;++u)if(s=[],o<=(h=u+t)&&(h-=o),!a[h]){l=[];var f=[];for(d=h;0<=d;){a[d]=f[d]=!0,s[s.length]=d,l.push(e[d]);var m=n[Math.floor(4*d/i)];if(i<4+(p=4*d&c))throw new Error("FAT boundary crossed: "+d+" 4 "+i);if(!e[m])break;if(f[d=ri(e[m],p)])break}r[h]={nodes:s,data:Wn([l])}}return r}(P,C,y,b)))[C].name="!Directory",0<A&&T!==h&&(O[T].name="!MiniFAT"),O[y[0]].name="!FAT",O.fat_addrs=y,O.ssz=b,[]),[]),L=[],I=O,N=P,F=M,j=A,B={},q=R,z=T,V=0,W=F.length?2:0,H=I[C].data,U=0,G=0;U<H.length;U+=128){var K=H.slice(U,U+128),Y=(di(K,64),G=K.read_shift(2),$=Hn(K,0,G-W),F.push($),{name:$,type:K.read_shift(1),color:K.read_shift(1),L:K.read_shift(4,"i"),R:K.read_shift(4,"i"),C:K.read_shift(4,"i"),clsid:K.read_shift(16),state:K.read_shift(4,"i"),start:0,size:0});0!==K.read_shift(2)+K.read_shift(2)+K.read_shift(2)+K.read_shift(2)&&(Y.ct=s(K,K.l-8)),0!==K.read_shift(2)+K.read_shift(2)+K.read_shift(2)+K.read_shift(2)&&(Y.mt=s(K,K.l-8)),Y.start=K.read_shift(4,"i"),Y.size=K.read_shift(4,"i"),Y.size<0&&Y.start<0&&(Y.size=Y.type=0,Y.start=h,Y.name=""),5===Y.type?(V=Y.start,0<j&&V!==h&&(I[V].name="!StreamData")):4096<=Y.size?(Y.storage="fat",void 0===I[Y.start]&&(I[Y.start]=function(e,t,n,i,o){var r=[],a=[];o=o||[];var s=i-1,l=0,c=0;for(l=t;0<=l;){o[l]=!0,r[r.length]=l,a.push(e[l]);var u=n[Math.floor(4*l/i)];if(i<4+(c=4*l&s))throw new Error("FAT boundary crossed: "+l+" 4 "+i);if(!e[u])break;l=ri(e[u],c)}return{nodes:r,data:Wn([a])}}(N,Y.start,I.fat_addrs,I.ssz)),I[Y.start].name=Y.name,Y.content=I[Y.start].data.slice(0,Y.size)):(Y.storage="minifat",Y.size<0?Y.size=0:V!==h&&Y.start!==h&&I[V]&&(Y.content=function(e,t,n){for(var i=e.start,o=e.size,r=[],a=i;n&&0<o&&0<=a;)r.push(t.slice(64*a,64*a+64)),o-=64,a=ri(n,4*a);return 0===r.length?pi(0):Ie(r).slice(0,e.size)}(Y,I[V].data,(I[z]||{}).data))),Y.content&&di(Y.content,0),B[$]=Y,q.push(Y)}for(var J=R,Q=L,ee=M,te=0,ne=0,ie=0,oe=0,re=0,ae=ee.length,se=[],le=[];te<ae;++te)se[te]=le[te]=te,Q[te]=ee[te];for(;re<le.length;++re)ne=J[te=le[re]].L,ie=J[te].R,oe=J[te].C,se[te]===te&&(-1!==ne&&se[ne]!==ne&&(se[te]=se[ne]),-1!==ie)&&se[ie]!==ie&&(se[te]=se[ie]),-1!==oe&&(se[oe]=te),-1!==ne&&te!=se[te]&&(se[ne]=se[te],le.lastIndexOf(ne)<re)&&le.push(ne),-1!==ie&&te!=se[te]&&(se[ie]=se[te],le.lastIndexOf(ie)<re)&&le.push(ie);for(te=1;te<ae;++te)se[te]===te&&(-1!==ie&&se[ie]!==ie?se[te]=se[ie]:-1!==ne&&se[ne]!==ne&&(se[te]=se[ne]));for(te=1;te<ae;++te)if(0!==J[te].type){if((re=te)!=se[re])for(;re=se[re],Q[te]=Q[re]+"/"+Q[te],0!==re&&-1!==se[re]&&re!=se[re];);se[te]=-1}for(Q[0]+="/",te=1;te<ae;++te)2!==J[te].type&&(Q[te]+="/");return M.shift(),O={FileIndex:R,FullPaths:L},t&&t.raw&&(O.raw={header:k,sectors:P}),O}function s(e,t){return new Date(1e3*(oi(e,t+4)/1e7*Math.pow(2,32)+oi(e,t)/1e7-11644473600))}function l(e,t){var n=(t=t||{}).root||"Root Entry";if(e.FullPaths||(e.FullPaths=[]),e.FileIndex||(e.FileIndex=[]),e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");0===e.FullPaths.length&&(e.FullPaths[0]=n+"/",e.FileIndex[0]={name:n,type:5}),t.CLSID&&(e.FileIndex[0].clsid=t.CLSID),n=e,t="Sh33tJ5",At.find(n,"/"+t)||((e=pi(4))[0]=55,e[1]=e[3]=50,e[2]=54,n.FileIndex.push({name:t,type:2,content:e,size:4,L:69,R:69,C:69}),n.FullPaths.push(n.FullPaths[0]+t),c(n))}function c(e,t){l(e);for(var o=!1,r=!1,a=e.FullPaths.length-1;0<=a;--a){var s=e.FileIndex[a];switch(s.type){case 0:r?o=!0:(e.FileIndex.pop(),e.FullPaths.pop());break;case 1:case 2:case 5:r=!0,isNaN(s.R*s.L*s.C)&&(o=!0),-1<s.R&&-1<s.L&&s.R==s.L&&(o=!0);break;default:o=!0}}if(o||t){var c=new Date(1987,1,19),u=0,d=Object.create?Object.create(null):{},h=[];for(a=0;a<e.FullPaths.length;++a)d[e.FullPaths[a]]=!0,0!==e.FileIndex[a].type&&h.push([e.FullPaths[a],e.FileIndex[a]]);for(a=0;a<h.length;++a){var p=n(h[a][0]);(r=d[p])||(h.push([p,{name:i(p).replace("/",""),type:1,clsid:m,ct:c,mt:c,content:null}]),d[p]=!0)}for(h.sort((function(e,t){e=e[0],t=t[0];for(var n,i=e.split("/"),o=t.split("/"),r=0,a=Math.min(i.length,o.length);r<a;++r){if(n=i[r].length-o[r].length)return n;if(i[r]!=o[r])return i[r]<o[r]?-1:1}return i.length-o.length})),e.FullPaths=[],e.FileIndex=[],a=0;a<h.length;++a)e.FullPaths[a]=h[a][0],e.FileIndex[a]=h[a][1];for(a=0;a<h.length;++a){var f=e.FileIndex[a],g=e.FullPaths[a];if(f.name=i(g).replace("/",""),f.L=f.R=f.C=-(f.color=1),f.size=f.content?f.content.length:0,f.start=0,f.clsid=f.clsid||m,0===a)f.C=1<h.length?1:-1,f.size=0,f.type=5;else if("/"==g.slice(-1)){for(u=a+1;u<h.length&&n(e.FullPaths[u])!=g;++u);for(f.C=h.length<=u?-1:u,u=a+1;u<h.length&&n(e.FullPaths[u])!=n(g);++u);f.R=h.length<=u?-1:u,f.type=1}else n(e.FullPaths[a+1]||"")==n(g)&&(f.R=a+1),f.type=2}}}function u(e,t){var n=t||{};if("mad"==n.fileType){for(var i=e,o=n||{},r=o.boundary||"SheetJS",a=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(r="------="+r).slice(2)+'"',"","",""],s=i.FullPaths[0],l=s,u=i.FileIndex[0],p=1;p<i.FullPaths.length;++p)if(l=i.FullPaths[p].slice(s.length),(u=i.FileIndex[p]).size&&u.content&&"Sh33tJ5"!=l){l=l.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,(function(e){return"_x"+e.charCodeAt(0).toString(16)+"_"})).replace(/[\u0080-\uFFFF]/g,(function(e){return"_u"+e.charCodeAt(0).toString(16)+"_"}));for(var m=u.content,b=Oe&&Buffer.isBuffer(m)?m.toString("binary"):v(m),y=0,w=Math.min(1024,b.length),x=0,_=0;_<=w;++_)32<=(x=b.charCodeAt(_))&&x<128&&++y;m=4*w/5<=y,a.push(r),a.push("Content-Location: "+(o.root||"file:///C:/SheetJS/")+l),a.push("Content-Transfer-Encoding: "+(m?"quoted-printable":"base64")),a.push("Content-Type: "+function(e,t){if(e.ctype)return e.ctype;var n=(e=e.name||"").match(/\.([^\.]+)$/);return n&&J[n[1]]||t&&(n=(e=t).match(/[\.\\]([^\.\\])+$/))&&J[n[1]]?J[n[1]]:"application/octet-stream"}(u,l)),a.push(""),a.push((m?function(e){"\n"==(e=(e=e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,(function(e){return"="+(1==(e=e.charCodeAt(0).toString(16).toUpperCase()).length?"0"+e:e)}))).replace(/ $/gm,"=20").replace(/\t$/gm,"=09")).charAt(0)&&(e="=0D"+e.slice(1));for(var t=[],n=(e=e.replace(/\r(?!\n)/gm,"=0D").replace(/\n\n/gm,"\n=0A").replace(/([^\r\n])\n/gm,"$1=0A")).split("\r\n"),i=0;i<n.length;++i){var o=n[i];if(0==o.length)t.push("");else for(var r=0;r<o.length;){var a=76,s=o.slice(r,r+a);"="==s.charAt(a-1)?a--:"="==s.charAt(a-2)?a-=2:"="==s.charAt(a-3)&&(a-=3),s=o.slice(r,r+a),(r+=a)<o.length&&(s+="="),t.push(s)}}return t.join("\r\n")}:function(e){for(var t=Te(e),n=[],i=0;i<t.length;i+=76)n.push(t.slice(i,i+76));return n.join("\r\n")+"\r\n"})(b))}return a.push(r+"--\r\n"),a.join("\r\n")}if(c(e),"zip"===n.fileType){var k=e,E=(t=(t=n)||{},[]),C=[],S=pi(1),T=t.compression?8:0,A=0,O=0,M=0,D=0,$=k.FullPaths[0],P=$,R=k.FileIndex[0],L=[],I=0;for(A=1;A<k.FullPaths.length;++A)if(P=k.FullPaths[A].slice($.length),(R=k.FileIndex[A]).size&&R.content&&"Sh33tJ5"!=P){var N=M,F=pi(P.length);for(O=0;O<P.length;++O)F.write_shift(1,127&P.charCodeAt(O));F=F.slice(0,F.l),L[D]=Tt.buf(R.content,0);var j=R.content;8==T&&(j=function(e){return d?d.deflateRawSync(e):z(e)}(j)),(S=pi(30)).write_shift(4,67324752),S.write_shift(2,20),S.write_shift(2,0),S.write_shift(2,T),R.mt?function(e,t){var n;n=((t="string"==typeof t?new Date(t):t).getHours()<<6|t.getMinutes())<<5|t.getSeconds()>>>1,e.write_shift(2,n),n=(t.getFullYear()-1980<<4|t.getMonth()+1)<<5|t.getDate(),e.write_shift(2,n)}(S,R.mt):S.write_shift(4,0),S.write_shift(-4,L[D]),S.write_shift(4,j.length),S.write_shift(4,R.content.length),S.write_shift(2,F.length),S.write_shift(2,0),M+=S.length,E.push(S),M+=F.length,E.push(F),M+=j.length,E.push(j),(S=pi(46)).write_shift(4,33639248),S.write_shift(2,0),S.write_shift(2,20),S.write_shift(2,0),S.write_shift(2,T),S.write_shift(4,0),S.write_shift(-4,L[D]),S.write_shift(4,j.length),S.write_shift(4,R.content.length),S.write_shift(2,F.length),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(4,0),S.write_shift(4,N),I+=S.l,C.push(S),I+=F.length,C.push(F),++D}return(S=pi(22)).write_shift(4,101010256),S.write_shift(2,0),S.write_shift(2,0),S.write_shift(2,D),S.write_shift(2,D),S.write_shift(4,I),S.write_shift(4,M),S.write_shift(2,0),Ie([Ie(E),Ie(C),S])}var B=function(e){for(var t=0,n=0,i=0;i<e.FileIndex.length;++i){var o=e.FileIndex[i];o.content&&0<(o=o.content.length)&&(o<4096?t+=o+63>>6:n+=o+511>>9)}for(var r=e.FullPaths.length+3>>2,a=t+127>>7,s=(t+7>>3)+n+r+a,l=s+127>>7,c=l<=109?0:Math.ceil((l-109)/127);l<s+l+c+127>>7;)c=++l<=109?0:Math.ceil((l-109)/127);return a=[1,c,l,a,r,n,t,0],e.FileIndex[0].size=t<<6,a[7]=(e.FileIndex[0].start=a[0]+a[1]+a[2]+a[3]+a[4]+a[5])+(a[6]+7>>3),a}(e),q=pi(B[7]<<9),V=0,W=0;for(V=0;V<8;++V)q.write_shift(1,f[V]);for(V=0;V<8;++V)q.write_shift(2,0);for(q.write_shift(2,62),q.write_shift(2,3),q.write_shift(2,65534),q.write_shift(2,9),q.write_shift(2,6),V=0;V<3;++V)q.write_shift(2,0);for(q.write_shift(4,0),q.write_shift(4,B[2]),q.write_shift(4,B[0]+B[1]+B[2]+B[3]-1),q.write_shift(4,0),q.write_shift(4,4096),q.write_shift(4,B[3]?B[0]+B[1]+B[2]-1:h),q.write_shift(4,B[3]),q.write_shift(-4,B[1]?B[0]-1:h),q.write_shift(4,B[1]),V=0;V<109;++V)q.write_shift(-4,V<B[2]?B[1]+V:-1);if(B[1])for(W=0;W<B[1];++W){for(;V<236+127*W;++V)q.write_shift(-4,V<B[2]?B[1]+V:-1);q.write_shift(-4,W===B[1]-1?h:W+1)}function H(e){for(W+=e;V<W-1;++V)q.write_shift(-4,V+1);e&&(++V,q.write_shift(-4,h))}for(W=V=0,W+=B[1];V<W;++V)q.write_shift(-4,g.DIFSECT);for(W+=B[2];V<W;++V)q.write_shift(-4,g.FATSECT);H(B[3]),H(B[4]);for(var U=0,G=0,K=e.FileIndex[0];U<e.FileIndex.length;++U)!(K=e.FileIndex[U]).content||(G=K.content.length)<4096||(K.start=W,H(G+511>>9));for(H(B[6]+7>>3);511&q.l;)q.write_shift(-4,g.ENDOFCHAIN);for(U=W=V=0;U<e.FileIndex.length;++U)!(K=e.FileIndex[U]).content||!(G=K.content.length)||4096<=G||(K.start=W,H(G+63>>6));for(;511&q.l;)q.write_shift(-4,g.ENDOFCHAIN);for(V=0;V<B[4]<<2;++V){var Y=e.FullPaths[V];if(Y&&0!==Y.length){if(K=e.FileIndex[V],0===V&&(K.start=K.size?K.start-1:h),G=2*((Y=0===V&&n.root||K.name).length+1),q.write_shift(64,Y,"utf16le"),q.write_shift(2,G),q.write_shift(1,K.type),q.write_shift(1,K.color),q.write_shift(-4,K.L),q.write_shift(-4,K.R),q.write_shift(-4,K.C),K.clsid)q.write_shift(16,K.clsid,"hex");else for(U=0;U<4;++U)q.write_shift(4,0);q.write_shift(4,K.state||0),q.write_shift(4,0),q.write_shift(4,0),q.write_shift(4,0),q.write_shift(4,0),q.write_shift(4,K.start),q.write_shift(4,K.size),q.write_shift(4,0)}else{for(U=0;U<17;++U)q.write_shift(4,0);for(U=0;U<3;++U)q.write_shift(4,-1);for(U=0;U<12;++U)q.write_shift(4,0)}}for(V=1;V<e.FileIndex.length;++V)if(4096<=(K=e.FileIndex[V]).size)if(q.l=K.start+1<<9,Oe&&Buffer.isBuffer(K.content))K.content.copy(q,q.l,0,K.size),q.l+=K.size+511&-512;else{for(U=0;U<K.size;++U)q.write_shift(1,K.content[U]);for(;511&U;++U)q.write_shift(1,0)}for(V=1;V<e.FileIndex.length;++V)if(0<(K=e.FileIndex[V]).size&&K.size<4096)if(Oe&&Buffer.isBuffer(K.content))K.content.copy(q,q.l,0,K.size),q.l+=K.size+63&-64;else{for(U=0;U<K.size;++U)q.write_shift(1,K.content[U]);for(;63&U;++U)q.write_shift(1,0)}if(Oe)q.l=q.length;else for(;q.l<q.length;)q.write_shift(1,0);return q}t.version="1.2.1";var d,h=-2,p="d0cf11e0a1b11ae1",f=[208,207,17,224,161,177,26,225],m="00000000000000000000000000000000",g={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:h,FREESECT:-1,HEADER_SIGNATURE:p,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:m,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function v(e){for(var t=new Array(e.length),n=0;n<e.length;++n)t[n]=String.fromCharCode(e[n]);return t.join("")}for(var b,y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],w=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],x=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],_="undefined"!=typeof Uint8Array,k=_?new Uint8Array(256):[],E=0;E<256;++E)k[E]=255&((b=139536&((b=E)<<1|b<<11)|558144&(b<<5|b<<15))>>16|b>>8|b);function C(e,t){var n=7&t;return(e[t=t>>>3]|(n<=5?0:e[1+t]<<8))>>>n&7}function S(e,t){var n=7&t;return(e[t=t>>>3]|(n<=3?0:e[1+t]<<8))>>>n&31}function T(e,t){var n=7&t;return(e[t=t>>>3]|(n<=1?0:e[1+t]<<8))>>>n&127}function A(e,t,n){var i=7&t,o=(1<<n)-1,r=e[t=t>>>3]>>>i;return n<8-i||(r|=e[1+t]<<8-i,n<16-i)||(r|=e[2+t]<<16-i,n<24-i)||(r|=e[3+t]<<24-i),r&o}function O(e,t,n){var i=7&t,o=t>>>3;return i<=5?e[o]|=(7&n)<<i:(e[o]|=n<<i&255,e[1+o]=(7&n)>>8-i),t+3}function M(e,t,n){var i=t>>>3;return e[i]|=255&(n<<=7&t),e[1+i]=n>>>=8,t+8}function D(e,t,n){var i=t>>>3;e[i]|=255&(n<<=7&t),e[1+i]=255&(n>>>=8),e[2+i]=n>>>8}function $(e,t){var n=e.length,i=t<2*n?2*n:t+5,o=0;if(!(t<=n)){if(Oe){var r=$e(i);if(e.copy)e.copy(r);else for(;o<e.length;++o)r[o]=e[o];return r}if(_){var a=new Uint8Array(i);if(a.set)a.set(e);else for(;o<n;++o)a[o]=e[o];return a}e.length=i}return e}function P(e){for(var t=new Array(e),n=0;n<e;++n)t[n]=0;return t}function R(e,t,n){var i,o=1,r=0,a=0,s=0,l=e.length,c=_?new Uint16Array(32):P(32);for(r=0;r<32;++r)c[r]=0;for(r=l;r<n;++r)e[r]=0;l=e.length;var u,d,h,p,f=_?new Uint16Array(l):P(l);for(r=0;r<l;++r)c[i=e[r]]++,o<i&&(o=i),f[r]=0;for(c[0]=0,r=1;r<=o;++r)c[r+16]=s=s+c[r-1]<<1;for(r=0;r<l;++r)0!=(s=e[r])&&(f[r]=c[s+16]++);for(r=0;r<l;++r)if(0!=(u=e[r]))for(d=f[r],h=o,p=void 0,p=k[255&d],s=(h<=8?p>>>8-h:(p=p<<8|k[d>>8&255],h<=16?p>>>16-h:(p<<8|k[d>>16&255])>>>24-h))>>o-u,a=(1<<o+4-u)-1;0<=a;--a)t[s|a<<u]=15&u|r<<4;return o}var L=_?new Uint16Array(512):P(512),I=_?new Uint16Array(32):P(32);if(!_){for(var N=0;N<512;++N)L[N]=0;for(N=0;N<32;++N)I[N]=0}for(var F=[],j=0;j<32;j++)F.push(5);R(F,I,32);var B=[];for(j=0;j<=143;j++)B.push(8);for(;j<=255;j++)B.push(9);for(;j<=279;j++)B.push(7);for(;j<=287;j++)B.push(8);R(B,L,288);var q=function(){for(var e=_?new Uint8Array(32768):[],t=0,n=0;t<x.length-1;++t)for(;n<x[t+1];++n)e[n]=t;for(;n<32768;++n)e[n]=29;var i=_?new Uint8Array(259):[];for(t=0,n=0;t<w.length-1;++t)for(;n<w[t+1];++n)i[n]=t;return function(t,n){if(t.length<8){for(var o=t,r=n,a=0;a<o.length;){var s=Math.min(65535,o.length-a),l=a+s==o.length;for(r.write_shift(1,+l),r.write_shift(2,s),r.write_shift(2,65535&~s);0<s--;)r[r.l++]=o[a++]}return r.l}for(var c,u=t,d=n,h=0,p=0,f=_?new Uint16Array(32768):[];p<u.length;){var m=Math.min(65535,u.length-p);if(m<10){for(7&(h=O(d,h,+!(p+m!=u.length)))&&(h+=8-(7&h)),d.l=h/8|0,d.write_shift(2,m),d.write_shift(2,65535&~m);0<m--;)d[d.l++]=u[p++];h=8*d.l}else{h=O(d,h,+!(p+m!=u.length)+2);for(var g=0;0<m--;){var v=u[p],b=-1,y=0;if((b=f[g=32767&(g<<5^v)])&&(p<(b|=-32768&p)&&(b-=32768),b<p))for(;u[b+y]==u[p+y]&&y<250;)++y;if(2<y){var E;(v=i[y])<=22?h=M(d,h,k[v+1]>>1)-1:(M(d,h,3),M(d,h+=5,k[v-23]>>5),h+=3),0<(E=(0<(E=v<8?0:v-4>>2)&&(D(d,h,y-w[v]),h+=E),v=e[p-b],h=M(d,h,k[v]>>3),h-=3,v<4?0:v-2>>1))&&(D(d,h,p-b-x[v]),h+=E);for(var C=0;C<y;++C)f[g]=32767&p,g=32767&(g<<5^u[p]),++p;m-=y-1}else v<=143?v+=48:(E=1,d[(c=h)>>>3]|=E=(1&E)<<(7&c),h=c+1),h=M(d,h,k[v]),f[g]=32767&p,++p}h=M(d,h,0)-1}}return d.l=(h+7)/8|0,d.l}}();function z(e){var t=pi(50+Math.floor(1.1*e.length));e=q(e,t);return t.slice(0,e)}var V=_?new Uint16Array(32768):P(32768),W=_?new Uint16Array(32768):P(32768),H=_?new Uint16Array(128):P(128),U=1,G=1;function K(e,t){return t=function(e,t){if(3==e[0]&&!(3&e[1]))return[De(t),2];for(var n=0,i=0,o=$e(t||1<<18),r=0,a=o.length>>>0,s=0,l=0;0==(1&i);)if(i=C(e,n),n+=3,i>>>1==0){7&n&&(n+=8-(7&n));var c=e[n>>>3]|e[1+(n>>>3)]<<8;if(n+=32,0<c)for(!t&&a<r+c&&(a=(o=$(o,r+c)).length);0<c--;)o[r++]=e[n>>>3],n+=8}else for(l=i>>1==1?(s=9,5):(n=function(e,t){for(var n,i,o,r=S(e,t)+257,a=S(e,t+=5)+1,s=(t+=5,o=7&t,4+(((n=e)[i=t>>>3]|(o<=4?0:n[1+i]<<8))>>>o&15)),l=(t+=4,0),c=_?new Uint8Array(19):P(19),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=1,h=_?new Uint8Array(8):P(8),p=_?new Uint8Array(8):P(8),f=c.length,m=0;m<s;++m)c[y[m]]=l=C(e,t),d<l&&(d=l),h[l]++,t+=3;var g=0;for(h[0]=0,m=1;m<=d;++m)p[m]=g=g+h[m-1]<<1;for(m=0;m<f;++m)0!=(g=c[m])&&(u[m]=p[g]++);var v;for(m=0;m<f;++m)if(0!=(v=c[m])){g=k[u[m]]>>8-v;for(var b=(1<<7-v)-1;0<=b;--b)H[g|b<<v]=7&v|m<<3}var w,x,E,A=[];for(d=1;A.length<r+a;)switch(g=H[T(e,t)],t+=7&g,g>>>=3){case 16:for(l=3+(void 0,E=7&t,((w=e)[x=t>>>3]|(E<=6?0:w[1+x]<<8))>>>E&3),t+=2,g=A[A.length-1];0<l--;)A.push(g);break;case 17:for(l=3+C(e,t),t+=3;0<l--;)A.push(0);break;case 18:for(l=11+T(e,t),t+=7;0<l--;)A.push(0);break;default:A.push(g),d<g&&(d=g)}var O=A.slice(0,r),M=A.slice(r);for(m=r;m<286;++m)O[m]=0;for(m=a;m<30;++m)M[m]=0;return U=R(O,V,286),G=R(M,W,30),t}(e,n),s=U,G);;){!t&&a<r+32767&&(a=(o=$(o,r+32767)).length);var u=A(e,n,s),d=(i>>>1==1?L:V)[u];if(n+=15&d,0==((d>>>=4)>>>8&255))o[r++]=d;else{if(256==d)break;var h=(5<(p=(d-=257)<8?0:d-4>>2)&&(p=0),r+w[d]),p=(0<p&&(h+=A(e,n,p),n+=p),u=A(e,n,l),n+=15&(d=(i>>>1==1?I:W)[u]),(d>>>=4)<4?0:d-2>>1),f=x[d];for(0<p&&(f+=A(e,n,p),n+=p),!t&&a<h&&(a=(o=$(o,h+100)).length);r<h;)o[r]=o[r-f],++r}}return t?[o,n+7>>>3]:[o.slice(0,r),n+7>>>3]}(e.slice(e.l||0),t),e.l+=t[1],t[0]}function Y(e,t){if(!e)throw new Error(t);"undefined"!=typeof console&&console.error(t)}function X(e,t){for(var n=e,i=(di(n,0),{FileIndex:[],FullPaths:[]}),r=(l(i,{root:t.root}),n.length-4);(80!=n[r]||75!=n[r+1]||5!=n[r+2]||6!=n[r+3])&&0<=r;)--r;n.l=r+4,n.l+=4;var a=n.read_shift(2);n.l+=6,e=n.read_shift(4);for(n.l=e,r=0;r<a;++r){n.l+=20;var s=n.read_shift(4),c=n.read_shift(4),u=n.read_shift(2),h=n.read_shift(2),p=n.read_shift(2),f=(n.l+=8,n.read_shift(4)),m=o(n.slice(n.l+u,n.l+u+h)),g=(u=(n.l+=u+h+p,n.l),n.l=f+4,T=A=S=C=_=x=w=f=p=h=g=void 0,n),v=(h=s,p=c,f=i,m),b=(g.l+=2,g.read_shift(2)),y=g.read_shift(2),w=function(e){var t=65535&e.read_shift(2),n=(e=65535&e.read_shift(2),new Date),i=31&e,o=15&(e>>>=5);e>>>=4,n.setMilliseconds(0),n.setFullYear(1980+e),n.setMonth(o-1),n.setDate(i),e=31&t,o=63&(t>>>=5);return n.setHours(t>>>=6),n.setMinutes(o),n.setSeconds(e<<1),n}(g);if(8257&b)throw new Error("Unsupported ZIP encryption");g.read_shift(4);for(var x=g.read_shift(4),_=g.read_shift(4),k=g.read_shift(2),E=g.read_shift(2),C="",S=0;S<k;++S)C+=String.fromCharCode(g[g.l++]);E&&(((A=o(g.slice(g.l,g.l+E)))[21589]||{}).mt&&(w=A[21589].mt),((v||{})[21589]||{}).mt)&&(w=v[21589].mt),g.l+=E;var T=g.slice(g.l,g.l+x);switch(y){case 8:T=function(e,t){var n,i;return d?(i=(n=new d.InflateRaw)._processChunk(e.slice(e.l),n._finishFlushFlag),e.l+=n.bytesRead,i):K(e,t)}(g,_);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+y)}var A=!1;8&b&&(134695760==g.read_shift(4)&&(g.read_shift(4),A=!0),x=g.read_shift(4),_=g.read_shift(4)),x!=h&&Y(A,"Bad compressed size: "+h+" != "+x),_!=p&&Y(A,"Bad uncompressed size: "+p+" != "+_),Z(f,C,T,{unsafe:!0,mt:w}),n.l=u}return i}var J={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function Z(e,t,n,o){var r,a=o&&o.unsafe,s=(a||l(e),!a&&At.find(e,t));return s||(r=e.FullPaths[0],r=t.slice(0,r.length)==r?t:("/"!=r.slice(-1)&&(r+="/"),(r+t).replace("//","/")),s={name:i(t),type:2},e.FileIndex.push(s),e.FullPaths.push(r),a)||At.utils.cfb_gc(e),s.content=n,s.size=n?n.length:0,o&&(o.CLSID&&(s.clsid=o.CLSID),o.mt&&(s.mt=o.mt),o.ct)&&(s.ct=o.ct),s}return t.find=function(e,t){var n=e.FullPaths.map((function(e){return e.toUpperCase()})),i=n.map((function(e){var t=e.split("/");return t[t.length-("/"==e.slice(-1)?2:1)]})),o=!1,r=(47===t.charCodeAt(0)?(o=!0,t=n[0].slice(0,-1)+t):o=-1!==t.indexOf("/"),t.toUpperCase()),a=(!0===o?n:i).indexOf(r);if(-1!==a)return e.FileIndex[a];var s=!r.match(Fe);r=r.replace(Ne,"");for(s&&(r=r.replace(Fe,"!")),a=0;a<n.length;++a){if((s?n[a].replace(Fe,"!"):n[a]).replace(Ne,"")==r)return e.FileIndex[a];if((s?i[a].replace(Fe,"!"):i[a]).replace(Ne,"")==r)return e.FileIndex[a]}return null},t.read=function(t,n){var i,o=n&&n.type;switch(o||Oe&&Buffer.isBuffer(t)&&(o="buffer"),o||"base64"){case"file":return i=n,r(),a(e.readFileSync(t),i);case"base64":return a(Pe(Ae(t)),n);case"binary":return a(Pe(t),n)}return a(t,n)},t.parse=a,t.write=function(t,n){var i=u(t,n);switch(n&&n.type||"buffer"){case"file":return r(),e.writeFileSync(n.filename,i),i;case"binary":return"string"==typeof i?i:v(i);case"base64":return Te("string"==typeof i?i:v(i));case"buffer":if(Oe)return Buffer.isBuffer(i)?i:Me(i);case"array":return"string"==typeof i?Pe(i):i}return i},t.writeFile=function(t,n,i){r(),t=u(t,i),e.writeFileSync(n,t)},t.utils={cfb_new:function(e){var t={};return l(t,e),t},cfb_add:Z,cfb_del:function(e,t){l(e);var n=At.find(e,t);if(n)for(var i=0;i<e.FileIndex.length;++i)if(e.FileIndex[i]==n)return e.FileIndex.splice(i,1),e.FullPaths.splice(i,1),!0;return!1},cfb_mov:function(e,t,n){l(e);var o=At.find(e,t);if(o)for(var r=0;r<e.FileIndex.length;++r)if(e.FileIndex[r]==o)return e.FileIndex[r].name=i(n),e.FullPaths[r]=n,!0;return!1},cfb_gc:function(e){c(e,!0)},ReadShift:si,CheckField:ui,prep_blob:di,bconcat:Ie,use_zlib:function(e){try{var t=new e.InflateRaw;if(t._processChunk(new Uint8Array([3,0]),t._finishFlushFlag),!t.bytesRead)throw new Error("zlib does not expose bytesRead");d=e}catch(e){console.error("cannot use native zlib: "+(e.message||e))}},_deflateRaw:z,_inflateRaw:K,consts:g},t}();function Ot(e){for(var t=Object.keys(e),n=[],i=0;i<t.length;++i)Object.prototype.hasOwnProperty.call(e,t[i])&&n.push(t[i]);return n}function Mt(e){for(var t=[],n=Ot(e),i=0;i!==n.length;++i)t[e[n[i]]]=n[i];return t}var Dt=new Date(1899,11,30,0,0,0);function $t(e,t){var n=e.getTime();t&&(n-=1263168e5),t=Dt.getTime()+6e4*(e.getTimezoneOffset()-Dt.getTimezoneOffset());return(n-t)/864e5}te=new Date;var Pt=Dt.getTime()+6e4*(te.getTimezoneOffset()-Dt.getTimezoneOffset()),Rt=te.getTimezoneOffset();function Lt(e){var t=new Date;return t.setTime(24*e*60*60*1e3+Pt),t.getTimezoneOffset()!==Rt&&t.setTime(t.getTime()+6e4*(t.getTimezoneOffset()-Rt)),t}te=new Date("2017-02-19T19:06:09.000Z");var It=isNaN(te.getFullYear())?new Date("2/19/17"):te,Nt=2017==It.getFullYear();function Ft(e,t){var n=new Date(e);return Nt?(0<t?n.setTime(n.getTime()+60*n.getTimezoneOffset()*1e3):t<0&&n.setTime(n.getTime()-60*n.getTimezoneOffset()*1e3),n):e instanceof Date?e:1917!=It.getFullYear()||isNaN(n.getFullYear())?(t=e.match(/\d+/g)||["2017","2","19","0","0","0"],t=new Date(+t[0],+t[1]-1,+t[2],+t[3]||0,+t[4]||0,+t[5]||0),-1<e.indexOf("Z")?new Date(t.getTime()-60*t.getTimezoneOffset()*1e3):t):(t=n.getFullYear(),-1<e.indexOf(""+t)||n.setFullYear(n.getFullYear()+100),n)}function jt(e,t){if(Oe&&Buffer.isBuffer(e)){if(t){if(255==e[0]&&254==e[1])return xn(e.slice(2).toString("utf16le"));if(254==e[1]&&255==e[2])return xn(xe(e.slice(2).toString("binary")))}return e.toString("binary")}if("undefined"!=typeof TextDecoder)try{if(t){if(255==e[0]&&254==e[1])return xn(new TextDecoder("utf-16le").decode(e.slice(2)));if(254==e[0]&&255==e[1])return xn(new TextDecoder("utf-16be").decode(e.slice(2)))}var n={"€":"","‚":"","ƒ":"","„":"","…":"
","†":"","‡":"","ˆ":"","‰":"","Š":"","‹":"","Œ":"","Ž":"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"","š":"","›":"","œ":"","ž":"","Ÿ":""};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,(function(e){return n[e]||e}))}catch(e){}for(var i=[],o=0;o!=e.length;++o)i.push(String.fromCharCode(e[o]));return i.join("")}function Bt(e){if("undefined"!=typeof JSON&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if("object"!=typeof e||null==e)return e;if(e instanceof Date)return new Date(e.getTime());var t,n={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Bt(e[t]));return n}function qt(e,t){for(var n="";n.length<t;)n+=e;return n}function zt(e){var t,n=Number(e);return isNaN(n)?!/\d/.test(e)||(t=1,e=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,(function(){return t*=100,""})),isNaN(n=Number(e))&&(e=e.replace(/[(](.*)[)]/,(function(e,n){return t=-t,n})),isNaN(n=Number(e))))?n:n/t:isFinite(n)?n:NaN}var Vt=["january","february","march","april","may","june","july","august","september","october","november","december"];function Wt(e){var t=new Date(e),n=new Date(NaN),i=t.getYear(),o=t.getMonth(),r=t.getDate();if(isNaN(r))return n;var a=e.toLowerCase();if(a.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(3<(a=a.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"")).length&&-1==Vt.indexOf(a))return n}else if(a.match(/[a-z]/))return n;return i<0||8099<i||(!(0<o||1<r)||101==i)&&e.match(/[^-0-9:,\/\\]/)?n:t}var Ht=function(){var e=5=="abacaba".split(/(:?b)/i).length;return function(t,n,i){if(e||"string"==typeof n)return t.split(n);for(var o=t.split(n),r=[o[0]],a=1;a<o.length;++a)r.push(i),r.push(o[a]);return r}}();function Ut(e){return e?e.content&&e.type?jt(e.content,!0):e.data?ke(e.data):e.asNodeBuffer&&Oe?ke(e.asNodeBuffer().toString("binary")):e.asBinary?ke(e.asBinary()):e._data&&e._data.getContent?ke(jt(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function Gt(e){var t;return e?e.data?we(e.data):e.asNodeBuffer&&Oe?e.asNodeBuffer():e._data&&e._data.getContent?"string"==typeof(t=e._data.getContent())?we(t):Array.prototype.slice.call(t):e.content&&e.type?e.content:null:null}function Kt(e,t){for(var n=e.FullPaths||Ot(e.files),i=t.toLowerCase().replace(/[\/]/g,"\\"),o=i.replace(/\\/g,"/"),r=0;r<n.length;++r){var a=n[r].replace(/^Root Entry[\/]/,"").toLowerCase();if(i==a||o==a)return e.files?e.files[n[r]]:e.FileIndex[r]}return null}function Yt(e,t){if(null==(e=Kt(e,t)))throw new Error("Cannot find file "+t+" in zip");return e}function Xt(e,t,n){if(!n)return((n=Yt(e,t))&&".bin"===n.name.slice(-4)?Gt:Ut)(n);if(!t)return null;try{return Xt(e,t)}catch(e){return null}}function Jt(e,t,n){if(!n)return Ut(Yt(e,t));if(!t)return null;try{return Jt(e,t)}catch(e){return null}}function Zt(e){for(var t=e.FullPaths||Ot(e.files),n=[],i=0;i<t.length;++i)"/"!=t[i].slice(-1)&&n.push(t[i].replace(/^Root Entry[\/]/,""));return n.sort()}function Qt(e,t){switch(t.type){case"base64":return At.read(e,{type:"base64"});case"binary":return At.read(e,{type:"binary"});case"buffer":case"array":return At.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function en(e,t){if("/"==e.charAt(0))return e.slice(1);for(var n=t.split("/"),i=("/"!=t.slice(-1)&&n.pop(),e.split("/"));0!==i.length;){var o=i.shift();".."===o?n.pop():"."!==o&&n.push(o)}return n.join("/")}var tn='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n',nn=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,on=tn.match(te=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm)?te:/<[^>]*>/g,rn=/<\w*:/,an=/<(\/?)\w+:/;function sn(e,t,n){for(var i={},o=0,r=0;o!==e.length&&32!==(r=e.charCodeAt(o))&&10!==r&&13!==r;++o);if(t||(i[0]=e.slice(0,o)),o!==e.length){var a,s,l=e.match(nn),c=0,u=0,d="",h="";if(l)for(u=0;u!=l.length;++u){for(h=l[u],r=0;r!=h.length&&61!==h.charCodeAt(r);++r);for(d=h.slice(0,r).trim();32==h.charCodeAt(r+1);)++r;for(a=34==(o=h.charCodeAt(r+1))||39==o?1:0,a=h.slice(r+1+a,h.length-a),c=0;c!=d.length&&58!==d.charCodeAt(c);++c);c===d.length?(i[d=0<d.indexOf("_")?d.slice(0,d.indexOf("_")):d]=a,n||(i[d.toLowerCase()]=a)):i[s=(5===c&&"xmlns"===d.slice(0,5)?"xmlns":"")+d.slice(c+1)]&&"ext"==d.slice(c-3,c)||(i[s]=a,n)||(i[s.toLowerCase()]=a)}}return i}function ln(e){return e.replace(an,"<$1")}var cn={""":'"',"'":"'",">":">","<":"<","&":"&"},un=Mt(cn),dn=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,t=/_x([\da-fA-F]{4})_/gi;return function n(i){var o,r=(i=i+"").indexOf("<![CDATA[");return-1==r?i.replace(e,(function(e,t){return cn[e]||String.fromCharCode(parseInt(t,-1<e.indexOf("x")?16:10))||e})).replace(t,(function(e,t){return String.fromCharCode(parseInt(t,16))})):(o=i.indexOf("]]>"),n(i.slice(0,r))+i.slice(r+9,o)+n(i.slice(o+3)))}}(),hn=/[&<>'"]/g,pn=/[\u0000-\u001f]/g;function fn(e){return(e+"").replace(hn,(function(e){return un[e]})).replace(/\n/g,"<br/>").replace(pn,(function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"}))}var mn=function(){var e=/&#(\d+);/g;function t(e,t){return String.fromCharCode(parseInt(t,10))}return function(n){return n.replace(e,t)}}();function gn(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function vn(e){for(var t,n,i,o="",r=0,a=0;r<e.length;)(i=e.charCodeAt(r++))<128?o+=String.fromCharCode(i):(t=e.charCodeAt(r++),191<i&&i<224?(a=(31&i)<<6,a|=63&t,o+=String.fromCharCode(a)):(n=e.charCodeAt(r++),i<240?o+=String.fromCharCode((15&i)<<12|(63&t)<<6|63&n):(i=((7&i)<<18|(63&t)<<12|(63&n)<<6|63&(a=e.charCodeAt(r++)))-65536,o=(o+=String.fromCharCode(55296+(i>>>10&1023)))+String.fromCharCode(56320+(1023&i)))));return o}function bn(e){for(var t,n,i=De(2*e.length),o=1,r=0,a=0,s=0;s<e.length;s+=o)o=1,(n=e.charCodeAt(s))<128?t=n:n<224?(t=64*(31&n)+(63&e.charCodeAt(s+1)),o=2):n<240?(t=4096*(15&n)+64*(63&e.charCodeAt(s+1))+(63&e.charCodeAt(s+2)),o=3):(o=4,t=262144*(7&n)+4096*(63&e.charCodeAt(s+1))+64*(63&e.charCodeAt(s+2))+(63&e.charCodeAt(s+3)),a=55296+((t-=65536)>>>10&1023),t=56320+(1023&t)),0!==a&&(i[r++]=255&a,i[r++]=a>>>8,a=0),i[r++]=t%256,i[r++]=t>>>8;return i.slice(0,r).toString("ucs2")}function yn(e){return Me(e,"binary").toString("utf8")}te="foo bar bazâð£";var wn=Oe&&(yn(te)==vn(te)?yn:bn(te)==vn(te)&&bn)||vn,xn=Oe?function(e){return Me(e,"utf8").toString("binary")}:function(e){for(var t,n=[],i=0,o=0;i<e.length;)switch(!0){case(o=e.charCodeAt(i++))<128:n.push(String.fromCharCode(o));break;case o<2048:n.push(String.fromCharCode(192+(o>>6))),n.push(String.fromCharCode(128+(63&o)));break;case 55296<=o&&o<57344:o-=55296,t=e.charCodeAt(i++)-56320+(o<<10),n.push(String.fromCharCode(240+(t>>18&7))),n.push(String.fromCharCode(144+(t>>12&63))),n.push(String.fromCharCode(128+(t>>6&63))),n.push(String.fromCharCode(128+(63&t)));break;default:n.push(String.fromCharCode(224+(o>>12))),n.push(String.fromCharCode(128+(o>>6&63))),n.push(String.fromCharCode(128+(63&o)))}return n.join("")},_n=function(){var e={};return function(t,n){var i=t+"|"+(n||"");return e[i]||(e[i]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",n||""))}}(),kn=function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map((function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]}));return function(t){for(var n=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i<e.length;++i)n=n.replace(e[i][0],e[i][1]);return n}}(),En=function(){var e={};return function(t){return void 0!==e[t]?e[t]:e[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),Cn=/<\/?(?:vt:)?variant>/g,Sn=/<(?:vt:)([^>]*)>([\s\S]*)</;function Tn(e,t){var n=sn(e),i=(e=e.match(En(n.baseType))||[],[]);if(e.length!=n.size){if(t.WTF)throw new Error("unexpected vector length "+e.length+" != "+n.size)}else e.forEach((function(e){(e=e.replace(Cn,"").match(Sn))&&i.push({v:wn(e[2]),t:e[1]})}));return i}var An=/(^\s|\s$|\n)/;function On(e,t,n){return"<"+e+(null!=n?function(e){return Ot(e).map((function(t){return" "+t+'="'+e[t]+'"'})).join("")}(n):"")+(null!=t?(t.match(An)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function Mn(e){if(Oe&&Buffer.isBuffer(e))return e.toString("utf8");if("string"==typeof e)return e;if("undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return wn(Re(Le(e)));throw new Error("Bad input format: expected Buffer or string")}var Dn=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/gm,$n="http://schemas.openxmlformats.org/package/2006/content-types",Pn=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function Rn(e){for(var t=[],n=0;n<e[0].length;++n)if(e[0][n])for(var i=0,o=e[0][n].length;i<o;i+=10240)t.push.apply(t,e[0][n].slice(i,i+10240));return t}function Ln(e,t,n){for(var i=[],o=t;o<n;o+=2)i.push(String.fromCharCode(ni(e,o)));return i.join("").replace(Ne,"")}function In(e,t,n){for(var i=[],o=t;o<t+n;++o)i.push(("0"+e[o].toString(16)).slice(-2));return i.join("")}function Nn(e,t,n){for(var i=[],o=t;o<n;o++)i.push(String.fromCharCode(ti(e,o)));return i.join("")}function Fn(e,t){var n=oi(e,t);return 0<n?Gn(e,t+4,t+4+n-1):""}function jn(e,t){var n=oi(e,t);return 0<n?Gn(e,t+4,t+4+n-1):""}function Bn(e,t){var n=2*oi(e,t);return 0<n?Gn(e,t+4,t+4+n-1):""}function qn(e,t){var n=oi(e,t);return 0<n?Hn(e,t+4,t+4+n):""}function zn(e,t){var n=oi(e,t);return 0<n?Gn(e,t+4,t+4+n):""}function Vn(e,t){for(var n=e,i=t,o=(e=1-2*(n[i+7]>>>7),t=((127&n[i+7])<<4)+(n[i+6]>>>4&15),15&n[i+6]),r=5;0<=r;--r)o=256*o+n[i+r];return 2047==t?0==o?1/0*e:NaN:(0==t?t=-1022:(t-=1023,o+=Math.pow(2,52)),e*Math.pow(2,t-52)*o)}var Wn=Oe?function(e){return 0<e[0].length&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map((function(e){return Buffer.isBuffer(e)?e:Me(e)}))):Rn(e)}:Rn,Hn=Oe?function(e,t,n){return Buffer.isBuffer(e)?e.toString("utf16le",t,n).replace(Ne,""):Ln(e,t,n)}:Ln,Un=Oe?function(e,t,n){return Buffer.isBuffer(e)?e.toString("hex",t,t+n):In(e,t,n)}:In,Gn=Oe?function(e,t,n){return Buffer.isBuffer(e)?e.toString("utf8",t,n):Nn(e,t,n)}:Nn,Kn=Fn,Yn=jn,Xn=Bn,Jn=qn,Zn=zn,Qn=Vn,ei=function(e){return Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array};Oe&&(Kn=function(e,t){var n;return Buffer.isBuffer(e)?0<(n=e.readUInt32LE(t))?e.toString("utf8",t+4,t+4+n-1):"":Fn(e,t)},Yn=function(e,t){var n;return Buffer.isBuffer(e)?0<(n=e.readUInt32LE(t))?e.toString("utf8",t+4,t+4+n-1):"":jn(e,t)},Xn=function(e,t){var n;return Buffer.isBuffer(e)?(n=2*e.readUInt32LE(t),e.toString("utf16le",t+4,t+4+n-1)):Bn(e,t)},Jn=function(e,t){var n;return Buffer.isBuffer(e)?(n=e.readUInt32LE(t),e.toString("utf16le",t+4,t+4+n)):qn(e,t)},Zn=function(e,t){var n;return Buffer.isBuffer(e)?(n=e.readUInt32LE(t),e.toString("utf8",t+4,t+4+n)):zn(e,t)},Qn=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):Vn(e,t)},ei=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array});var ti=function(e,t){return e[t]},ni=function(e,t){return 256*e[t+1]+e[t]},ii=function(e,t){return(e=256*e[t+1]+e[t])<32768?e:-1*(65535-e+1)},oi=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},ri=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},ai=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function si(e,t){var n,i,o,r,a,s,l="",c=[];switch(t){case"dbcs":if(s=this.l,Oe&&Buffer.isBuffer(this))l=this.slice(this.l,this.l+2*e).toString("utf16le");else for(a=0;a<e;++a)l+=String.fromCharCode(ni(this,s)),s+=2;e*=2;break;case"utf8":l=Gn(this,this.l,this.l+e);break;case"utf16le":l=Hn(this,this.l,this.l+(e*=2));break;case"wstr":return si.call(this,e,"dbcs");case"lpstr-ansi":l=Kn(this,this.l),e=4+oi(this,this.l);break;case"lpstr-cp":l=Yn(this,this.l),e=4+oi(this,this.l);break;case"lpwstr":l=Xn(this,this.l),e=4+2*oi(this,this.l);break;case"lpp4":e=4+oi(this,this.l),l=Jn(this,this.l),2&e&&(e+=2);break;case"8lpp4":e=4+oi(this,this.l),l=Zn(this,this.l),3&e&&(e+=4-(3&e));break;case"cstr":for(e=0,l="";0!==(o=ti(this,this.l+e++));)c.push(Ee(o));l=c.join("");break;case"_wstr":for(e=0,l="";0!==(o=ni(this,this.l+e));)c.push(Ee(o)),e+=2;e+=2,l=c.join("");break;case"dbcs-cont":for(l="",s=this.l,a=0;a<e;++a){if(this.lens&&-1!==this.lens.indexOf(s))return o=ti(this,s),this.l=s+1,r=si.call(this,e-a,o?"dbcs-cont":"sbcs-cont"),c.join("")+r;c.push(Ee(ni(this,s))),s+=2}l=c.join(""),e*=2;break;case"cpstr":0;case"sbcs-cont":for(l="",s=this.l,a=0;a!=e;++a){if(this.lens&&-1!==this.lens.indexOf(s))return o=ti(this,s),this.l=s+1,r=si.call(this,e-a,o?"dbcs-cont":"sbcs-cont"),c.join("")+r;c.push(Ee(ti(this,s))),s+=1}l=c.join("");break;default:switch(e){case 1:return n=ti(this,this.l),this.l++,n;case 2:return n=("i"===t?ii:ni)(this,this.l),this.l+=2,n;case 4:case-4:return"i"===t||0==(128&this[this.l+3])?(n=(0<e?ri:ai)(this,this.l),this.l+=4,n):(i=oi(this,this.l),this.l+=4,i);case 8:case-8:if("f"===t)return i=8==e?Qn(this,this.l):Qn([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;e=8;case 16:l=Un(this,this.l,e)}}return this.l+=e,l}var li=function(e,t,n){e[n]=255&t,e[n+1]=t>>>8&255};function ci(e,t,n){var i=0,o=0;if("dbcs"===n){for(o=0;o!=t.length;++o)li(this,t.charCodeAt(o),this.l+2*o);i=2*t.length}else if("sbcs"===n){for(t=t.replace(/[^\x00-\x7F]/g,"_"),o=0;o!=t.length;++o)this[this.l+o]=255&t.charCodeAt(o);i=t.length}else{if("hex"===n){for(;o<e;++o)this[this.l++]=parseInt(t.slice(2*o,2*o+2),16)||0;return this}if("utf16le"===n){var r=Math.min(this.l+e,this.length);for(o=0;o<Math.min(t.length,e);++o){var a=t.charCodeAt(o);this[this.l++]=255&a,this[this.l++]=a>>8}for(;this.l<r;)this[this.l++]=0;return this}switch(e){case 1:i=1,this[this.l]=255&t;break;case 2:i=2,this[this.l]=255&t,this[this.l+1]=255&(t>>>=8);break;case 3:i=3,this[this.l]=255&t,this[this.l+1]=255&(t>>>=8),this[this.l+2]=255&(t>>>=8);break;case 4:i=4,function(e,t,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24&255}(this,t,this.l);break;case 8:if(i=8,"f"===n){var s=this,l=t,c=this.l,u=(l<0||1/l==-1/0?1:0)<<7,d=0,h=0,p=u?-l:l;isFinite(p)?0==p?d=h=0:(d=Math.floor(Math.log(p)/Math.LN2),h=p*Math.pow(2,52-d),d<=-1023&&(!isFinite(h)||h<Math.pow(2,52))?d=-1022:(h-=Math.pow(2,52),d+=1023)):(d=2047,h=isNaN(l)?26985:0);for(var f=0;f<=5;++f,h/=256)s[c+f]=255&h;s[c+6]=(15&d)<<4|15&h,s[c+7]=d>>4|u;break}case 16:break;case-4:i=4,function(e,t,n){e[n]=255&t,e[n+1]=t>>8&255,e[n+2]=t>>16&255,e[n+3]=t>>24&255}(this,t,this.l)}}return this.l+=i,this}function ui(e,t){var n=Un(this,this.l,e.length>>1);if(n!==e)throw new Error(t+"Expected "+e+" saw "+n);this.l+=e.length>>1}function di(e,t){e.l=t,e.read_shift=si,e.chk=ui,e.write_shift=ci}function hi(e,t){e.l+=t}function pi(e){return di(e=De(e),0),e}function fi(e,t,n){if(e){di(e,e.l||0);for(var i=e.length,o=0;e.l<i;){128&(o=e.read_shift(1))&&(o=(127&o)+((127&e.read_shift(1))<<7));for(var r,a=As[o]||As[65535],s=127&(r=e.read_shift(1)),l=1;l<4&&128&r;++l)s+=(127&(r=e.read_shift(1)))<<7*l;var c=e.l+s,u=a.f&&a.f(e,s,n);if(e.l=c,t(u,a,o))return}}}function mi(){function e(e){return di(e=pi(e),0),e}function t(){r&&(r.length>r.l&&((r=r.slice(0,r.l)).l=r.length),0<r.length&&i.push(r),r=null)}function n(n){return r&&n<r.length-r.l?r:(t(),r=e(Math.max(n+1,o)))}var i=[],o=Oe?256:2048,r=e(o);return{next:n,push:function(e){t(),null==(r=e).l&&(r.l=r.length),n(o)},end:function(){return t(),Ie(i)},_bufs:i}}function gi(e,t,n){var i=Bt(e);if(t.s?(i.cRel&&(i.c+=t.s.c),i.rRel&&(i.r+=t.s.r)):(i.cRel&&(i.c+=t.c),i.rRel&&(i.r+=t.r)),!n||n.biff<12){for(;256<=i.c;)i.c-=256;for(;65536<=i.r;)i.r-=65536}return i}function vi(e,t,n){return(e=Bt(e)).s=gi(e.s,t.s,n),e.e=gi(e.e,t.s,n),e}function bi(e,t){if(e.cRel&&e.c<0)for(e=Bt(e);e.c<0;)e.c+=8<t?16384:256;if(e.rRel&&e.r<0)for(e=Bt(e);e.r<0;)e.r+=8<t?1048576:5<t?65536:16384;var n=Ci(e);return e.cRel||null==e.cRel||(n=n.replace(/^([A-Z])/,"$$$1")),e.rRel||null==e.rRel?n:n.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function yi(e,t){return 0!=e.s.r||e.s.rRel||e.e.r!=(12<=t.biff?1048575:8<=t.biff?65536:16384)||e.e.rRel?0!=e.s.c||e.s.cRel||e.e.c!=(12<=t.biff?16383:255)||e.e.cRel?bi(e.s,t.biff)+":"+bi(e.e,t.biff):(e.s.rRel?"":"$")+xi(e.s.r)+":"+(e.e.rRel?"":"$")+xi(e.e.r):(e.s.cRel?"":"$")+ki(e.s.c)+":"+(e.e.cRel?"":"$")+ki(e.e.c)}function wi(e){return parseInt(e.replace(/\$(\d+)$/,"$1"),10)-1}function xi(e){return""+(e+1)}function _i(e){for(var t=e.replace(/^\$([A-Z])/,"$1"),n=0,i=0;i!==t.length;++i)n=26*n+t.charCodeAt(i)-64;return n-1}function ki(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function Ei(e){for(var t=0,n=0,i=0;i<e.length;++i){var o=e.charCodeAt(i);48<=o&&o<=57?t=10*t+(o-48):65<=o&&o<=90&&(n=26*n+(o-64))}return{c:n-1,r:t-1}}function Ci(e){for(var t=e.c+1,n="";t;t=(t-1)/26|0)n=String.fromCharCode((t-1)%26+65)+n;return n+(e.r+1)}function Si(e){var t=e.indexOf(":");return-1==t?{s:Ei(e),e:Ei(e)}:{s:Ei(e.slice(0,t)),e:Ei(e.slice(t+1))}}function Ti(e,t){return void 0===t||"number"==typeof t?Ti(e.s,e.e):(e="string"!=typeof e?Ci(e):e)==(t="string"!=typeof t?Ci(t):t)?e:e+":"+t}function Ai(e){var t={s:{c:0,r:0},e:{c:0,r:0}},n=0,i=0,o=0,r=e.length;for(n=0;i<r&&!((o=e.charCodeAt(i)-64)<1||26<o);++i)n=26*n+o;for(t.s.c=--n,n=0;i<r&&!((o=e.charCodeAt(i)-48)<0||9<o);++i)n=10*n+o;if(t.s.r=--n,i===r||10!=o)t.e.c=t.s.c,t.e.r=t.s.r;else{for(++i,n=0;i!=r&&!((o=e.charCodeAt(i)-64)<1||26<o);++i)n=26*n+o;for(t.e.c=--n,n=0;i!=r&&!((o=e.charCodeAt(i)-48)<0||9<o);++i)n=10*n+o;t.e.r=--n}return t}function Oi(e,t,n){return null==e||null==e.t||"z"==e.t?"":void 0!==e.w?e.w:("d"==e.t&&!e.z&&n&&n.dateNF&&(e.z=n.dateNF),"e"==e.t?Zi[e.v]||e.v:function(e,t){var n="d"==e.t&&t instanceof Date;if(null!=e.z)try{return e.w=_t(e.z,n?$t(t):t)}catch(e){}try{return e.w=_t((e.XF||{}).numFmtId||(n?14:0),n?$t(t):t)}catch(e){return""+t}}(e,null==t?e.v:t))}function Mi(e,t){var n={};return n[t=t&&t.sheet?t.sheet:"Sheet1"]=e,{SheetNames:[t],Sheets:n}}function Di(e,t,n){var i=n||{},o=e?Array.isArray(e):i.dense,r=e||(o?[]:{}),a=0,s=0,l=(r&&null!=i.origin&&("number"==typeof i.origin?a=i.origin:(a=(n="string"==typeof i.origin?Ei(i.origin):i.origin).r,s=n.c),r["!ref"]||(r["!ref"]="A1:A1")),{s:{c:1e7,r:1e7},e:{c:0,r:0}});r["!ref"]&&(e=Ai(r["!ref"]),l.s.c=e.s.c,l.s.r=e.s.r,l.e.c=Math.max(l.e.c,e.e.c),l.e.r=Math.max(l.e.r,e.e.r),-1==a)&&(l.e.r=a=e.e.r+1);for(var c=0;c!=t.length;++c)if(t[c]){if(!Array.isArray(t[c]))throw new Error("aoa_to_sheet expects an array of arrays");for(var u=0;u!=t[c].length;++u)if(void 0!==t[c][u]){var d={v:t[c][u]},h=a+c,p=s+u;if(l.s.r>h&&(l.s.r=h),l.s.c>p&&(l.s.c=p),l.e.r<h&&(l.e.r=h),l.e.c<p&&(l.e.c=p),!t[c][u]||"object"!=typeof t[c][u]||Array.isArray(t[c][u])||t[c][u]instanceof Date)if(Array.isArray(d.v)&&(d.f=t[c][u][1],d.v=d.v[0]),null===d.v)if(d.f)d.t="n";else if(i.nullError)d.t="e",d.v=0;else{if(!i.sheetStubs)continue;d.t="z"}else"number"==typeof d.v?d.t="n":"boolean"==typeof d.v?d.t="b":d.v instanceof Date?(d.z=i.dateNF||Ke[14],i.cellDates?(d.t="d",d.w=_t(d.z,$t(d.v))):(d.t="n",d.v=$t(d.v),d.w=_t(d.z,d.v))):d.t="s";else d=t[c][u];o?(r[h]||(r[h]=[]),r[h][p]&&r[h][p].z&&(d.z=r[h][p].z),r[h][p]=d):(r[p=Ci({c:p,r:h})]&&r[p].z&&(d.z=r[p].z),r[p]=d)}}return l.s.c<1e7&&(r["!ref"]=Ti(l)),r}function $i(e,t){return Di(null,e,t)}function Pi(e){var t=e.read_shift(4);return 0===t?"":e.read_shift(t,"dbcs")}function Ri(e,t){var n,i=e.l,o=e.read_shift(1),r=[],a={t:a=Pi(e),h:a};if(0!=(1&o)){for(var s=e.read_shift(4),l=0;l!=s;++l)r.push({ich:(n=e).read_shift(2),ifnt:n.read_shift(2)});a.r=r}else a.r=[{ich:0,ifnt:0}];return e.l=i+t,a}function Li(e){var t=e.read_shift(4),n=e.read_shift(2);return n+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:n}}function Ii(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}te=Ri;var Ni=Pi;function Fi(e){var t=e.read_shift(4);return 0===t||4294967295===t?"":e.read_shift(t,"dbcs")}var ji=Pi,Bi=Fi;function qi(e){var t=e.slice(e.l,e.l+4),n=1&t[0],i=2&t[0];e.l+=4,e=0==i?Qn([0,0,0,0,252&t[0],t[1],t[2],t[3]],0):ri(t,0)>>2;return n?e/100:e}function zi(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}var Vi=zi;function Wi(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function Hi(e,t){var n=e.read_shift(4);switch(n){case 0:return"";case 4294967295:case 4294967294:return{2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"}[e.read_shift(4)]||""}if(400<n)throw new Error("Unsupported Clipboard: "+n.toString(16));return e.l-=4,e.read_shift(0,1==t?"lpstr":"lpwstr")}var Ui=[80,81],Gi={1:{n:"CodePage",t:2},2:{n:"Category",t:80},3:{n:"PresentationFormat",t:80},4:{n:"ByteCount",t:3},5:{n:"LineCount",t:3},6:{n:"ParagraphCount",t:3},7:{n:"SlideCount",t:3},8:{n:"NoteCount",t:3},9:{n:"HiddenCount",t:3},10:{n:"MultimediaClipCount",t:3},11:{n:"ScaleCrop",t:11},12:{n:"HeadingPairs",t:4108},13:{n:"TitlesOfParts",t:4126},14:{n:"Manager",t:80},15:{n:"Company",t:80},16:{n:"LinksUpToDate",t:11},17:{n:"CharacterCount",t:3},19:{n:"SharedDoc",t:11},22:{n:"HyperlinksChanged",t:11},23:{n:"AppVersion",t:3,p:"version"},24:{n:"DigSig",t:65},26:{n:"ContentType",t:80},27:{n:"ContentStatus",t:80},28:{n:"Language",t:80},29:{n:"Version",t:80},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Ki={1:{n:"CodePage",t:2},2:{n:"Title",t:80},3:{n:"Subject",t:80},4:{n:"Author",t:80},5:{n:"Keywords",t:80},6:{n:"Comments",t:80},7:{n:"Template",t:80},8:{n:"LastAuthor",t:80},9:{n:"RevNumber",t:80},10:{n:"EditTime",t:64},11:{n:"LastPrinted",t:64},12:{n:"CreatedDate",t:64},13:{n:"ModifiedDate",t:64},14:{n:"PageCount",t:3},15:{n:"WordCount",t:3},16:{n:"CharCount",t:3},17:{n:"Thumbnail",t:71},18:{n:"Application",t:80},19:{n:"DocSecurity",t:3},255:{},2147483648:{n:"Locale",t:19},2147483651:{n:"Behavior",t:19},1919054434:{}},Yi={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},Xi=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];var Ji=Bt(function(e){return e.map((function(e){return[e>>16&255,e>>8&255,255&e]}))}([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),Zi={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},Qi={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},eo={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};var to={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function no(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function io(e,t){var n,i={"!id":{}};return e&&("/"!==t.charAt(0)&&(t="/"+t),n={},(e.match(on)||[]).forEach((function(e){var o,r;"<Relationship"===(e=sn(e))[0]&&((o={}).Type=e.Type,o.Target=e.Target,o.Id=e.Id,e.TargetMode&&(o.TargetMode=e.TargetMode),r="External"===e.TargetMode?e.Target:en(e.Target,t),i[r]=o,n[e.Id]=o)})),i["!id"]=n),i}var oo=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],ro=function(){for(var e=new Array(oo.length),t=0;t<oo.length;++t){var n="(?:"+(n=oo[t])[0].slice(0,n[0].indexOf(":"))+":)"+n[0].slice(n[0].indexOf(":")+1);e[t]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return e}();function ao(e){var t={};e=wn(e);for(var n=0;n<oo.length;++n){var i=oo[n],o=e.match(ro[n]);null!=o&&0<o.length&&(t[i[1]]=dn(o[1])),"date"===i[2]&&t[i[1]]&&(t[i[1]]=Ft(t[i[1]]))}return t}var so=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function lo(e,t,n,i){var o=[];if("string"==typeof e)o=Tn(e,i);else for(var r=0;r<e.length;++r)o=o.concat(e[r].map((function(e){return{v:e}})));var a,s="string"==typeof t?Tn(t,i).map((function(e){return e.v})):t,l=0;if(0<s.length)for(var c=0;c!==o.length;c+=2){switch(a=+o[c+1].v,o[c].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":n.Worksheets=a,n.SheetNames=s.slice(l,l+a);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":n.NamedRanges=a,n.DefinedNames=s.slice(l,l+a);break;case"Charts":case"Diagramme":n.Chartsheets=a,n.ChartNames=s.slice(l,l+a)}l+=a}}var co,uo=/<[^>]+>[^<]*/g,ho={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function po(e){var t=e.read_shift(4);e=e.read_shift(4);return new Date(1e3*(e/1e7*Math.pow(2,32)+t/1e7-11644473600)).toISOString().replace(/\.000/,"")}function fo(e,t,n){var i=e.l,o=e.read_shift(0,"lpstr-cp");if(n)for(;e.l-i&3;)++e.l;return o}function mo(e,t,n){var i=e.read_shift(0,"lpwstr");return n&&(e.l+=4-(i.length+1&3)&3),i}function go(e,t,n){return 31===t?mo(e):fo(e,0,n)}function vo(e,t,n){return go(e,t,!1===n?0:4)}function bo(e,t){for(var n=e.read_shift(4),i={},o=0;o!=n;++o){var r=e.read_shift(4),a=e.read_shift(4);i[r]=e.read_shift(a,1200===t?"utf16le":"utf8").replace(Ne,"").replace(Fe,"!"),1200===t&&a%2&&(e.l+=2)}return 3&e.l&&(e.l=e.l>>3<<2),i}function yo(e){var t=e.read_shift(4),n=e.slice(e.l,e.l+t);return e.l+=t,0<(3&t)&&(e.l+=4-(3&t)&3),n}function wo(e,t,n){var i,o,r=e.read_shift(2),a=n||{};if(e.l+=2,12!==t&&r!==t&&-1===Ui.indexOf(t)&&(4126!=(65534&t)||4126!=(65534&r)))throw new Error("Expected type "+t+" saw "+r);switch(12===t?r:t){case 2:return o=e.read_shift(2,"i"),a.raw||(e.l+=2),o;case 3:return e.read_shift(4,"i");case 11:return 0!==e.read_shift(4);case 19:return e.read_shift(4);case 30:return fo(e,0,4).replace(Ne,"");case 31:return mo(e);case 64:return po(e);case 65:return yo(e);case 71:return(o={}).Size=(i=e).read_shift(4),i.l+=o.Size+3-(o.Size-1)%4,o;case 80:return vo(e,r,!a.raw).replace(Ne,"");case 81:return function(e,t){if(t)return go(e,t,0);throw new Error("VtUnalignedString must have positive length")}(e,r).replace(Ne,"");case 4108:return function(e){for(var t,n,i,o=e.read_shift(4),r=[],a=0;a<o/2;++a)r.push((void 0,n=(t=e).l,i=wo(t,81),0==t[t.l]&&0==t[t.l+1]&&t.l-n&2&&(t.l+=2),[i,wo(t,3)]));return r}(e);case 4126:case 4127:return(4127==r?function(e){for(var t=e.read_shift(4),n=[],i=0;i!=t;++i){var o=e.l;n[i]=e.read_shift(0,"lpwstr").replace(Ne,""),e.l-o&2&&(e.l+=2)}return n}:function(e){for(var t=e.read_shift(4),n=[],i=0;i!=t;++i)n[i]=e.read_shift(0,"lpstr-cp").replace(Ne,"");return n})(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+r)}}function xo(e,t){var n=e.l,i=e.read_shift(4),o=e.read_shift(4),r=[],a=0,s=0,l=-1,c={};for(a=0;a!=o;++a){var u=e.read_shift(4),d=e.read_shift(4);r[a]=[u,d+n]}r.sort((function(e,t){return e[1]-t[1]}));var h={};for(a=0;a!=o;++a){if(e.l!==r[a][1]){var p=!0;if(0<a&&t)switch(t[r[a-1][0]].t){case 2:e.l+2===r[a][1]&&(e.l+=2,p=!1);break;case 80:case 4108:e.l<=r[a][1]&&(e.l=r[a][1],p=!1)}if((!t||0==a)&&e.l<=r[a][1]&&(p=!1,e.l=r[a][1]),p)throw new Error("Read Error: Expected address "+r[a][1]+" at "+e.l+" :"+a)}if(t){var f=t[r[a][0]];if(h[f.n]=wo(e,f.t,{raw:!0}),"version"===f.p&&(h[f.n]=String(h[f.n]>>16)+"."+("0000"+String(65535&h[f.n])).slice(-4)),"CodePage"==f.n)switch(h[f.n]){case 0:h[f.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:be(s=h[f.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[f.n])}}else if(1===r[a][0])s=h.CodePage=wo(e,2),be(s),-1!==l&&(g=e.l,e.l=r[l][1],c=bo(e,s),e.l=g);else if(0===r[a][0])0===s?(l=a,e.l=r[a+1][1]):c=bo(e,s);else{var m,g=c[r[a][0]];switch(e[e.l]){case 65:e.l+=4,m=yo(e);break;case 30:case 31:e.l+=4,m=vo(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,m=e.read_shift(4,"i");break;case 19:e.l+=4,m=e.read_shift(4);break;case 5:e.l+=4,m=e.read_shift(8,"f");break;case 11:e.l+=4,m=Eo(e,4);break;case 64:e.l+=4,m=Ft(po(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[g]=m}}return e.l=n+i,h}function _o(e,t,n){if(!(e=e.content))return{};di(e,0);var i,o,r=0,a=(e.chk("feff","Byte Order: "),e.read_shift(2),e.read_shift(4)),s=e.read_shift(16);if(s!==At.utils.consts.HEADER_CLSID&&s!==n)throw new Error("Bad PropertySet CLSID "+s);if(1!==(n=e.read_shift(4))&&2!==n)throw new Error("Unrecognized #Sets: "+n);if(s=e.read_shift(16),o=e.read_shift(4),1===n&&o!==e.l)throw new Error("Length mismatch: "+o+" !== "+e.l);2===n&&(i=e.read_shift(16),r=e.read_shift(4));var l,c,u=xo(e,t),d={SystemIdentifier:a};for(l in u)d[l]=u[l];if(d.FMTID=s,1!==n){if(r-e.l==2&&(e.l+=2),e.l!==r)throw new Error("Length mismatch 2: "+e.l+" !== "+r);try{c=xo(e,null)}catch(e){}for(l in c)d[l]=c[l];d.FMTID=[s,i]}return d}function ko(e,t){return e.read_shift(t),null}function Eo(e,t){return 1===e.read_shift(t)}function Co(e){return e.read_shift(2,"u")}function So(e,t){for(var n=e,i=(e=t,Co),o=[],r=n.l+e;n.l<r;)o.push(i(n,r-n.l));if(r!==n.l)throw new Error("Slurp error");return o}function To(e,t,n){var i=e.read_shift(n&&12<=n.biff?2:1),o="sbcs-cont",r=pe;n&&8<=n.biff&&(pe=1200),n&&8!=n.biff?12==n.biff&&(o="wstr"):e.read_shift(1)&&(o="dbcs-cont"),2<=n.biff&&n.biff<=5&&(o="cpstr"),n=i?e.read_shift(i,o):"";return pe=r,n}function Ao(e,t,n){if(n){if(2<=n.biff&&n.biff<=5)return e.read_shift(t,"cpstr");if(12<=n.biff)return e.read_shift(t,"dbcs-cont")}return 0===e.read_shift(1)?e.read_shift(t,"sbcs-cont"):e.read_shift(t,"dbcs-cont")}function Oo(e,t,n){var i=e.read_shift(n&&2==n.biff?1:2);return 0===i?(e.l++,""):Ao(e,i,n)}function Mo(e,t,n){var i;return 5<n.biff?Oo(e,0,n):0===(i=e.read_shift(1))?(e.l++,""):e.read_shift(i,n.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function Do(e){var t=e.read_shift(4);return 0<t?e.read_shift(t,"utf16le").replace(Ne,""):""}function $o(e){return[e.read_shift(1),e.read_shift(1),e.read_shift(1),e.read_shift(1)]}function Po(e){return(e=$o(e))[3]=0,e}function Ro(e){return{r:e.read_shift(2),c:e.read_shift(2),ixfe:e.read_shift(2)}}function Lo(e){return[e.read_shift(2),qi(e)]}function Io(e){var t=e.read_shift(2),n=e.read_shift(2);return{s:{c:e.read_shift(2),r:t},e:{c:e.read_shift(2),r:n}}}function No(e){var t=e.read_shift(2),n=e.read_shift(2);return{s:{c:e.read_shift(1),r:t},e:{c:e.read_shift(1),r:n}}}var Fo=No;function jo(e){e.l+=4;var t=e.read_shift(2),n=e.read_shift(2),i=e.read_shift(2);return e.l+=12,[n,t,i]}function Bo(e){e.l+=2,e.l+=e.read_shift(2)}var qo={0:Bo,4:Bo,5:Bo,6:Bo,7:function(e){return e.l+=4,e.cf=e.read_shift(2),{}},8:Bo,9:Bo,10:Bo,11:Bo,12:Bo,13:function(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t},14:Bo,15:Bo,16:Bo,17:Bo,18:Bo,19:Bo,20:Bo,21:jo};function zo(e,t){var n={BIFFVer:0,dt:0};switch(n.BIFFVer=e.read_shift(2),2<=(t-=2)&&(n.dt=e.read_shift(2),e.l-=2),n.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(6<t)throw new Error("Unexpected BIFF Ver "+n.BIFFVer)}return e.read_shift(t),n}function Vo(e,t,n){var i=0;n&&2==n.biff||(i=e.read_shift(2)),e=e.read_shift(2);return n&&2==n.biff&&(i=1-(e>>15),e&=32767),[{Unsynced:1&i,DyZero:(2&i)>>1,ExAsc:(4&i)>>2,ExDsc:(8&i)>>3},e]}var Wo=Mo;function Ho(e,t,n){t=e.l+t,n=8!=n.biff&&n.biff?2:4;var i=e.read_shift(n),o=(n=e.read_shift(n),e.read_shift(2)),r=e.read_shift(2);return e.l=t,{s:{r:i,c:o},e:{r:n,c:r}}}function Uo(e,t,n){var i=Ro(e);2!=n.biff&&9!=t||++e.l,t=(n=e).read_shift(1),e=1===n.read_shift(1)?t:1===t;return i.val=e,i.t=!0===e||!1===e?"b":"e",i}function Go(e,t,n){return 0===t?"":Mo(e,0,n)}function Ko(e,t,n){var i,o={fBuiltIn:1&(o=e.read_shift(2)),fWantAdvise:o>>>1&1,fWantPict:o>>>2&1,fOle:o>>>3&1,fOleLink:o>>>4&1,cf:o>>>5&1023,fIcon:o>>>15&1};return 14849===n.sbcch&&(i=function(e,t,n){e.l+=4;t=e.l+(t-=4),n=To(e,0,n);var i=e.read_shift(2);if(i!==(t-=e.l))throw new Error("Malformed AddinUdf: padding = "+t+" != "+i);return e.l+=i,n}(e,t-2,n)),o.body=i||e.read_shift(t-2),"string"==typeof i&&(o.Name=i),o}var Yo=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function Xo(e,t,n){t=e.l+t;var i=e.read_shift(2),o=e.read_shift(1),r=e.read_shift(1),a=e.read_shift(n&&2==n.biff?1:2),s=0;(!n||5<=n.biff)&&(5!=n.biff&&(e.l+=2),s=e.read_shift(2),5==n.biff&&(e.l+=2),e.l+=4),r=Ao(e,r,n),32&i&&(r=Yo[r.charCodeAt(0)]),i=t-e.l;return n&&2==n.biff&&--i,{chKey:o,Name:r,itab:s,rgce:t!=e.l&&0!==a&&0<i?function(e,t,n,i){var o;t=e.l+t,i=ka(e,i,n);return t!==e.l&&(o=_a(e,t-e.l,i,n)),[i,o]}(e,i,n,a):[]}}function Jo(e,t,n){var i;if(n.biff<8)return s=n,3==(i=e)[i.l+1]&&i[i.l]++,3==(i=To(i,0,s)).charCodeAt(0)?i.slice(1):i;for(var o,r,a=[],s=e.l+t,l=e.read_shift(8<n.biff?4:2);0!=l--;)a.push((o=e,n.biff,r=8<(r=n).biff?4:2,[o.read_shift(r),o.read_shift(r,"i"),o.read_shift(r,"i")]));if(e.l!=s)throw new Error("Bad ExternSheet: "+e.l+" != "+s);return a}function Zo(e,t,n){var i=Fo(e,6);switch(n.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[i,function(e,t,n){var i,o=e.l+t,r=2==n.biff?1:2,a=e.read_shift(r);if(65535==a)return[[],hi(e,t-2)];var s=ka(e,a,n);return t!==a+r&&(i=_a(e,t-a-r,s,n)),e.l=o,[s,i]}(e,t,n)]}var Qo={8:function(e,t){t=e.l+t;var n=(e.l+=10,e.read_shift(2)),i=(e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4,e.read_shift(1));return e.l+=i,e.l=t,{fmt:n}}};function er(e,t,n){var i,o,r,a,s,l;return n.cellStyles?(l=n&&12<=n.biff?4:2,i=e.read_shift(l),o=e.read_shift(l),r=e.read_shift(l),a=e.read_shift(l),s=e.read_shift(2),2==l&&(e.l+=2),l={s:i,e:o,w:r,ixfe:a,flags:s},(5<=n.biff||!n.biff)&&(l.level=s>>8&7),l):hi(e,t)}var tr=Ro,nr=So,ir=Oo,or=[2,3,48,49,131,139,140,245],rr=function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=Mt({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function n(t,n){return(n=n||{}).dateNF||(n.dateNF="yyyymmdd"),(t=$i(function(t,n){var i=[],o=De(1);switch(n.type){case"base64":o=Pe(Ae(t));break;case"binary":o=Pe(t);break;case"buffer":case"array":o=t}di(o,0);var r=o.read_shift(1),a=!!(136&r),s=!1,l=!1;switch(r){case 2:case 3:break;case 48:case 49:a=s=!0;break;case 131:case 139:break;case 140:l=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+r.toString(16))}for(var c=0,u=521,d=(2==r&&(c=o.read_shift(2)),o.l+=3,1048576<(c=2!=r?o.read_shift(4):c)&&(c=1e6),2!=r&&(u=o.read_shift(2)),o.read_shift(2)),h=n.codepage||1252,p=(2!=r&&(o.l+=16,o.read_shift(1),0!==o[o.l]&&(h=e[o[o.l]]),o.l+=1,o.l+=2),l&&(o.l+=36),[]),f={},m=Math.min(o.length,2==r?521:u-10-(s?264:0)),g=l?32:11;o.l<m&&13!=o[o.l];)switch((f={}).name=_e.utils.decode(h,o.slice(o.l,o.l+g)).replace(/[\u0000\r\n].*$/g,""),o.l+=g,f.type=String.fromCharCode(o.read_shift(1)),2==r||l||(f.offset=o.read_shift(4)),f.len=o.read_shift(1),2==r&&(f.offset=o.read_shift(2)),f.dec=o.read_shift(1),f.name.length&&p.push(f),2!=r&&(o.l+=l?13:14),f.type){case"B":s&&8==f.len||!n.WTF||console.log("Skipping "+f.name+":"+f.type);break;case"G":case"P":n.WTF&&console.log("Skipping "+f.name+":"+f.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+f.type)}if(13!==o[o.l]&&(o.l=u-1),13!==o.read_shift(1))throw new Error("DBF Terminator not found "+o.l+" "+o[o.l]);o.l=u;var v=0,b=0;for(i[0]=[],b=0;b!=p.length;++b)i[0][b]=p[b].name;for(;0<c--;)if(42===o[o.l])o.l+=d;else for(++o.l,i[++v]=[],b=b=0;b!=p.length;++b){var y=o.slice(o.l,o.l+p[b].len),w=(o.l+=p[b].len,di(y,0),_e.utils.decode(h,y));switch(p[b].type){case"C":w.trim().length&&(i[v][b]=w.replace(/\s+$/,""));break;case"D":8===w.length?i[v][b]=new Date(+w.slice(0,4),+w.slice(4,6)-1,+w.slice(6,8)):i[v][b]=w;break;case"F":i[v][b]=parseFloat(w.trim());break;case"+":case"I":i[v][b]=l?2147483648^y.read_shift(-4,"i"):y.read_shift(4,"i");break;case"L":switch(w.trim().toUpperCase()){case"Y":case"T":i[v][b]=!0;break;case"N":case"F":i[v][b]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+w+"|")}break;case"M":if(!a)throw new Error("DBF Unexpected MEMO for type "+r.toString(16));i[v][b]="##MEMO##"+(l?parseInt(w.trim(),10):y.read_shift(4));break;case"N":(w=w.replace(/\u0000/g,"").trim())&&"."!=w&&(i[v][b]=+w||0);break;case"@":i[v][b]=new Date(y.read_shift(-8,"f")-621356832e5);break;case"T":i[v][b]=new Date(864e5*(y.read_shift(4)-2440588)+y.read_shift(4));break;case"Y":i[v][b]=y.read_shift(4,"i")/1e4+y.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":i[v][b]=-y.read_shift(-8,"f");break;case"B":if(s&&8==p[b].len){i[v][b]=y.read_shift(8,"f");break}case"G":case"P":y.l+=p[b].len;break;case"0":if("_NullFlags"===p[b].name)break;default:throw new Error("DBF Unsupported data type "+p[b].type)}}if(2!=r&&o.l<o.length&&26!=o[o.l++])throw new Error("DBF EOF Marker missing "+(o.l-1)+" of "+o.length+" "+o[o.l-1].toString(16));return n&&n.sheetRows&&(i=i.slice(0,n.sheetRows)),n.DBF=p,i}(t,n),n))["!cols"]=n.DBF.map((function(e){return{wch:e.len,DBF:e}})),delete n.DBF,t}var i={B:8,C:250,L:1,D:8,"?":0,"":0};return{to_workbook:function(e,t){try{return Mi(n(e,t),t)}catch(e){if(t&&t.WTF)throw e}return{SheetNames:[],Sheets:{}}},to_sheet:n,from_sheet:function(e,n){if(0<=+(n=n||{}).codepage&&be(+n.codepage),"string"==n.type)throw new Error("Cannot write DBF to JS string");var o=mi(),r=(n=cl(e,{header:1,raw:!0,cellDates:!0}))[0],a=n.slice(1),s=e["!cols"]||[],l=0,c=0,u=0,d=1;for(l=0;l<r.length;++l)if(((s[l]||{}).DBF||{}).name)r[l]=s[l].DBF.name,++u;else if(null!=r[l]){if(++u,"number"==typeof r[l]&&(r[l]=r[l].toString(10)),"string"!=typeof r[l])throw new Error("DBF Invalid column name "+r[l]+" |"+typeof r[l]+"|");if(r.indexOf(r[l])!==l)for(c=0;c<1024;++c)if(-1==r.indexOf(r[l]+"_"+c)){r[l]+="_"+c;break}}var h=Ai(e["!ref"]),p=[],f=[],m=[];for(l=0;l<=h.e.c-h.s.c;++l){var g="",v="",b=0,y=[];for(c=0;c<a.length;++c)null!=a[c][l]&&y.push(a[c][l]);if(0==y.length||null==r[l])p[l]="?";else{for(c=0;c<y.length;++c){switch(typeof y[c]){case"number":v="B";break;case"string":v="C";break;case"boolean":v="L";break;case"object":v=y[c]instanceof Date?"D":"C";break;default:v="C"}b=Math.max(b,String(y[c]).length),g=g&&g!=v?"C":v}250<b&&(b=250),"C"==(v=((s[l]||{}).DBF||{}).type)&&s[l].DBF.len>b&&(b=s[l].DBF.len),"B"==g&&"N"==v&&(g="N",m[l]=s[l].DBF.dec,b=s[l].DBF.len),f[l]="C"==g||"N"==v?b:i[g]||0,d+=f[l],p[l]=g}}var w,x,_=o.next(32);for(_.write_shift(4,318902576),_.write_shift(4,a.length),_.write_shift(2,296+32*u),_.write_shift(2,d),l=0;l<4;++l)_.write_shift(4,0);for(_.write_shift(4,0|(+t[fe]||3)<<8),c=l=0;l<r.length;++l)null!=r[l]&&(w=o.next(32),x=(r[l].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11),w.write_shift(1,x,"sbcs"),w.write_shift(1,"?"==p[l]?"C":p[l],"sbcs"),w.write_shift(4,c),w.write_shift(1,f[l]||i[p[l]]||0),w.write_shift(1,m[l]||0),w.write_shift(1,2),w.write_shift(4,0),w.write_shift(1,0),w.write_shift(4,0),w.write_shift(4,0),c+=f[l]||i[p[l]]||0);var k=o.next(264);for(k.write_shift(4,13),l=0;l<65;++l)k.write_shift(4,0);for(l=0;l<a.length;++l){var E=o.next(d);for(E.write_shift(1,0),c=0;c<r.length;++c)if(null!=r[c])switch(p[c]){case"L":E.write_shift(1,null==a[l][c]?63:a[l][c]?84:70);break;case"B":E.write_shift(8,a[l][c]||0,"f");break;case"N":var C="0";for("number"==typeof a[l][c]&&(C=a[l][c].toFixed(m[c]||0)),u=0;u<f[c]-C.length;++u)E.write_shift(1,32);E.write_shift(1,C,"sbcs");break;case"D":a[l][c]?(E.write_shift(4,("0000"+a[l][c].getFullYear()).slice(-4),"sbcs"),E.write_shift(2,("00"+(a[l][c].getMonth()+1)).slice(-2),"sbcs"),E.write_shift(2,("00"+a[l][c].getDate()).slice(-2),"sbcs")):E.write_shift(8,"00000000","sbcs");break;case"C":var S=String(null!=a[l][c]?a[l][c]:"").slice(0,f[c]);for(E.write_shift(1,S,"sbcs"),u=0;u<f[c]-S.length;++u)E.write_shift(1,32)}}return o.next(1).write_shift(1,26),o.end()}}}(),ar=function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("N("+Ot(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),n=function(t,n){return"number"==typeof(n=e[n])?Ce(n):n},i=function(e,t,n){return 59==(t=t.charCodeAt(0)-32<<4|n.charCodeAt(0)-48)?e:Ce(t)};function o(e,o){var r,a,s=e.split(/[\n\r]+/),l=-1,c=-1,u=0,d=0,h=[],p=[],f=null,m=(e={},[]),g=[],v=0;for(0<=+o.codepage&&be(+o.codepage);u!==s.length;++u){v=0;var b,y=s[u].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,i).replace(t,n),w=y.replace(/;;/g,"\0").split(";").map((function(e){return e.replace(/\u0000/g,";")})),x=w[0];if(0<y.length)switch(x){case"ID":case"E":case"B":case"O":case"W":break;case"P":"P"==w[1].charAt(0)&&p.push(y.slice(3).replace(/;;/g,";"));break;case"C":var _=!1,k=!1,E=!1,C=!1,S=-1,T=-1;for(d=1;d<w.length;++d)switch(w[d].charAt(0)){case"A":break;case"X":c=parseInt(w[d].slice(1))-1,k=!0;break;case"Y":for(l=parseInt(w[d].slice(1))-1,k||(c=0),a=h.length;a<=l;++a)h[a]=[];break;case"K":'"'===(b=w[d].slice(1)).charAt(0)?b=b.slice(1,b.length-1):"TRUE"===b?b=!0:"FALSE"===b?b=!1:isNaN(zt(b))?isNaN(Wt(b).getDate())||(b=Ft(b)):(b=zt(b),null!==f&&yt(f)&&(b=Lt(b))),_=!0;break;case"E":C=!0;var A=ta(w[d].slice(1),{r:l,c:c});h[l][c]=[h[l][c],A];break;case"S":E=!0,h[l][c]=[h[l][c],"S5S"];break;case"G":break;case"R":S=parseInt(w[d].slice(1))-1;break;case"C":T=parseInt(w[d].slice(1))-1;break;default:if(o&&o.WTF)throw new Error("SYLK bad record "+y)}if(_&&(h[l][c]&&2==h[l][c].length?h[l][c][0]=b:h[l][c]=b,f=null),E){if(C)throw new Error("SYLK shared formula cannot have own formula");var O=-1<S&&h[S][T];if(!O||!O[1])throw new Error("SYLK shared formula cannot find base");h[l][c][1]=oa(O[1],{r:l-S,c:c-T})}break;case"F":var M=0;for(d=1;d<w.length;++d)switch(w[d].charAt(0)){case"X":c=parseInt(w[d].slice(1))-1,++M;break;case"Y":for(l=parseInt(w[d].slice(1))-1,a=h.length;a<=l;++a)h[a]=[];break;case"M":v=parseInt(w[d].slice(1))/20;break;case"F":case"G":break;case"P":f=p[parseInt(w[d].slice(1))];break;case"S":case"D":case"N":break;case"W":for(r=w[d].slice(1).split(" "),a=parseInt(r[0],10);a<=parseInt(r[1],10);++a)v=parseInt(r[2],10),g[a-1]=0===v?{hidden:!0}:{wch:v},Rr(g[a-1]);break;case"C":g[c=parseInt(w[d].slice(1))-1]||(g[c]={});break;case"R":m[l=parseInt(w[d].slice(1))-1]||(m[l]={}),0<v?(m[l].hpt=v,m[l].hpx=Ir(v)):0===v&&(m[l].hidden=!0);break;default:if(o&&o.WTF)throw new Error("SYLK bad record "+y)}M<1&&(f=null);break;default:if(o&&o.WTF)throw new Error("SYLK bad record "+y)}}return 0<m.length&&(e["!rows"]=m),0<g.length&&(e["!cols"]=g),[h=o&&o.sheetRows?h.slice(0,o.sheetRows):h,e]}function r(e,t){var n=(e=function(e,t){switch(t.type){case"base64":return o(Ae(e),t);case"binary":return o(e,t);case"buffer":return o(Oe&&Buffer.isBuffer(e)?e.toString("binary"):Re(e),t);case"array":return o(jt(e),t)}throw new Error("Unrecognized type "+t.type)}(e,t))[0],i=e[1],r=$i(n,t);return Ot(i).forEach((function(e){r[e]=i[e]})),r}return e["|"]=254,{to_workbook:function(e,t){return Mi(r(e,t),t)},to_sheet:r,from_sheet:function(e,t){var n,i,o=["ID;PWXL;N;E"],r=[],a=Ai(e["!ref"]),s=Array.isArray(e),l="\r\n";o.push("P;PGeneral"),o.push("F;P0;DG0G8;M255"),e["!cols"]&&(n=o,e["!cols"].forEach((function(e,t){t="F;W"+(t+1)+" "+(t+1)+" ",e.hidden?t+="0":("number"!=typeof e.width||e.wpx||(e.wpx=Or(e.width)),"number"!=typeof e.wpx||e.wch||(e.wch=Mr(e.wpx)),"number"==typeof e.wch&&(t+=Math.round(e.wch)))," "!=t.charAt(t.length-1)&&n.push(t)}))),e["!rows"]&&(i=o,e["!rows"].forEach((function(e,t){var n="F;";e.hidden?n+="M0;":e.hpt?n+="M"+20*e.hpt+";":e.hpx&&(n+="M"+20*Lr(e.hpx)+";"),2<n.length&&i.push(n+"R"+(t+1))}))),o.push("B;Y"+(a.e.r-a.s.r+1)+";X"+(a.e.c-a.s.c+1)+";D"+[a.s.c,a.s.r,a.e.c,a.e.r].join(" "));for(var c=a.s.r;c<=a.e.r;++c)for(var u=a.s.c;u<=a.e.c;++u){var d=Ci({r:c,c:u});(d=s?(e[c]||[])[u]:e[d])&&(null!=d.v||d.f&&!d.F)&&r.push(function(e,t,n){var i="C;Y"+(t+1)+";X"+(n+1)+";K";switch(e.t){case"n":i+=e.v||0,e.f&&!e.F&&(i+=";E"+ia(e.f,{r:t,c:n}));break;case"b":i+=e.v?"TRUE":"FALSE";break;case"e":i+=e.w||e.v;break;case"d":i+='"'+(e.w||e.v)+'"';break;case"s":i+='"'+e.v.replace(/"/g,"").replace(/;/g,";;")+'"'}return i}(d,c,u))}return o.join(l)+l+r.join(l)+l+"E"+l}}}(),sr=function(){function e(e,t){for(var n=e.split("\n"),i=-1,o=-1,r=0,a=[];r!==n.length;++r)if("BOT"===n[r].trim())a[++i]=[],o=0;else if(!(i<0)){for(var s=n[r].trim().split(","),l=s[0],c=s[1],u=n[++r]||"";1&(u.match(/["]/g)||[]).length&&r<n.length-1;)u+="\n"+n[++r];switch(u=u.trim(),+l){case-1:if("BOT"===u){a[++i]=[],o=0;continue}if("EOD"!==u)throw new Error("Unrecognized DIF special command "+u);break;case 0:"TRUE"===u?a[i][o]=!0:"FALSE"===u?a[i][o]=!1:isNaN(zt(c))?isNaN(Wt(c).getDate())?a[i][o]=c:a[i][o]=Ft(c):a[i][o]=zt(c),++o;break;case 1:(u=(u=u.slice(1,u.length-1)).replace(/""/g,'"'))&&u.match(/^=".*"$/)&&(u=u.slice(2,-1)),a[i][o++]=""!==u?u:null}if("EOD"===u)break}return t&&t.sheetRows?a.slice(0,t.sheetRows):a}function t(t,n){return $i(function(t,n){switch(n.type){case"base64":return e(Ae(t),n);case"binary":return e(t,n);case"buffer":return e(Oe&&Buffer.isBuffer(t)?t.toString("binary"):Re(t),n);case"array":return e(jt(t),n)}throw new Error("Unrecognized type "+n.type)}(t,n),n)}return{to_workbook:function(e,n){return Mi(t(e,n),n)},to_sheet:t,from_sheet:function(){function e(e,t,n,i,o){e.push(t),e.push(n+","+i),e.push('"'+o.replace(/"/g,'""')+'"')}function t(e,t,n,i){e.push(t+","+n),e.push(1==t?'"'+i.replace(/"/g,'""')+'"':i)}return function(n){var i=[],o=Ai(n["!ref"]),r=Array.isArray(n);e(i,"TABLE",0,1,"sheetjs"),e(i,"VECTORS",0,o.e.r-o.s.r+1,""),e(i,"TUPLES",0,o.e.c-o.s.c+1,""),e(i,"DATA",0,0,"");for(var a=o.s.r;a<=o.e.r;++a){t(i,-1,0,"BOT");for(var s=o.s.c;s<=o.e.c;++s){var l,c=Ci({r:a,c:s});if(l=r?(n[a]||[])[s]:n[c])switch(l.t){case"n":var u=l.w;null==(u=u||null==l.v?u:l.v)?l.f&&!l.F?t(i,1,0,"="+l.f):t(i,1,0,""):t(i,0,u,"V");break;case"b":t(i,0,l.v?1:0,l.v?"TRUE":"FALSE");break;case"s":t(i,1,0,isNaN(l.v)?l.v:'="'+l.v+'"');break;case"d":l.w||(l.w=_t(l.z||Ke[14],$t(Ft(l.v)))),t(i,0,l.w,"V");break;default:t(i,1,0,"")}else t(i,1,0,"")}}return t(i,-1,0,"EOD"),i.join("\r\n")}}()}}(),lr=function(){function e(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(e,t){return $i(function(e,t){for(var n,i=e.split("\n"),o=-1,r=0,a=[];r!==i.length;++r){var s=i[r].trim().split(":");if("cell"===s[0]){var l=Ei(s[1]);if(a.length<=l.r)for(o=a.length;o<=l.r;++o)a[o]||(a[o]=[]);switch(o=l.r,n=l.c,s[2]){case"t":a[o][n]=s[3].replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n");break;case"v":a[o][n]=+s[3];break;case"vtf":var c=s[s.length-1];case"vtc":"nl"===s[3]?a[o][n]=!!+s[4]:a[o][n]=+s[4],"vtf"==s[2]&&(a[o][n]=[a[o][n],c])}}}return t&&t.sheetRows?a.slice(0,t.sheetRows):a}(e,t),t)}var n=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n"),i=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n",o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n");return{to_workbook:function(e,n){return Mi(t(e,n),n)},to_sheet:t,from_sheet:function(t){return[n,i,o,i,function(t){if(!t||!t["!ref"])return"";for(var n,i,o=[],r=[],a=Si(t["!ref"]),s=Array.isArray(t),l=a.s.r;l<=a.e.r;++l)for(var c=a.s.c;c<=a.e.c;++c)if(i=Ci({r:l,c:c}),(n=s?(t[l]||[])[c]:t[i])&&null!=n.v&&"z"!==n.t){switch(r=["cell",i,"t"],n.t){case"s":case"str":r.push(e(n.v));break;case"n":n.f?(r[2]="vtf",r[3]="n",r[4]=n.v,r[5]=e(n.f)):(r[2]="v",r[3]=n.v);break;case"b":r[2]="vt"+(n.f?"f":"c"),r[3]="nl",r[4]=n.v?"1":"0",r[5]=e(n.f||(n.v?"TRUE":"FALSE"));break;case"d":var u=$t(Ft(n.v));r[2]="vtc",r[3]="nd",r[4]=""+u,r[5]=n.w||_t(n.z||Ke[14],u);break;case"e":continue}o.push(r.join(":"))}return o.push("sheet:c:"+(a.e.c-a.s.c+1)+":r:"+(a.e.r-a.s.r+1)+":tvf:1"),o.push("valueformat:1:text-wiki"),o.join("\n")}(t),"--SocialCalcSpreadsheetControlSave--"].join("\n")}}}(),cr=function(){function e(e,t,n,i,o){o.raw?t[n][i]=e:""!==e&&("TRUE"===e?t[n][i]=!0:"FALSE"===e?t[n][i]=!1:isNaN(zt(e))?isNaN(Wt(e).getDate())?t[n][i]=e:t[n][i]=Ft(e):t[n][i]=zt(e))}var t={44:",",9:"\t",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function i(e){for(var i={},o=!1,r=0,a=0;r<e.length;++r)34==(a=e.charCodeAt(r))?o=!o:!o&&a in t&&(i[a]=(i[a]||0)+1);for(r in a=[],i)Object.prototype.hasOwnProperty.call(i,r)&&a.push([i[r],r]);if(!a.length)for(r in i=n)Object.prototype.hasOwnProperty.call(i,r)&&a.push([i[r],r]);return a.sort((function(e,t){return e[0]-t[0]||n[e[1]]-n[t[1]]})),t[a.pop()[1]]||44}function o(t,n){return!n||!n.PRN||n.FS||"sep="==t.slice(0,4)||0<=t.indexOf("\t")||0<=t.indexOf(",")||0<=t.indexOf(";")?function(e,t){var n=t||{},o=(t="",n.dense?[]:{}),r={s:{c:0,r:0},e:{c:0,r:0}},a=("sep="==e.slice(0,4)?13==e.charCodeAt(5)&&10==e.charCodeAt(6)?(t=e.charAt(4),e=e.slice(7)):13==e.charCodeAt(5)||10==e.charCodeAt(5)?(t=e.charAt(4),e=e.slice(6)):t=i(e.slice(0,1024)):t=n&&n.FS?n.FS:i(e.slice(0,1024)),0),s=0,l=0,c=0,u=0,d=t.charCodeAt(0),h=!1,p=0,f=e.charCodeAt(0),m=(e=e.replace(/\r\n/gm,"\n"),null!=n.dateNF?(t=(t="number"==typeof(t=n.dateNF)?Ke[t]:t).replace(St,"(\\d+)"),new RegExp("^"+t+"$")):null);function g(){var t,i=e.slice(c,u),h={};if(0===(i='"'==i.charAt(0)&&'"'==i.charAt(i.length-1)?i.slice(1,-1).replace(/""/g,'"'):i).length?h.t="z":n.raw||0===i.trim().length?(h.t="s",h.v=i):61==i.charCodeAt(0)?34==i.charCodeAt(1)&&34==i.charCodeAt(i.length-1)?(h.t="s",h.v=i.slice(2,-1).replace(/""/g,'"')):1!=i.length?(h.t="n",h.f=i.slice(1)):(h.t="s",h.v=i):"TRUE"==i?(h.t="b",h.v=!0):"FALSE"==i?(h.t="b",h.v=!1):isNaN(l=zt(i))?!isNaN(Wt(i).getDate())||m&&i.match(m)?(h.z=n.dateNF||Ke[14],t=0,m&&i.match(m)&&(i=function(e,t){var n=-1,i=-1,o=-1,r=-1,a=-1,s=-1;(e.match(St)||[]).forEach((function(e,l){var c=parseInt(t[l+1],10);switch(e.toLowerCase().charAt(0)){case"y":n=c;break;case"d":o=c;break;case"h":r=c;break;case"s":s=c;break;case"m":0<=r?a=c:i=c}})),0<=s&&-1==a&&0<=i&&(a=i,i=-1),8==(e=7==(e=(""+(0<=n?n:(new Date).getFullYear())).slice(-4)+"-"+("00"+(1<=i?i:1)).slice(-2)+"-"+("00"+(1<=o?o:1)).slice(-2)).length?"0"+e:e).length&&(e="20"+e);var l=("00"+(0<=r?r:0)).slice(-2)+":"+("00"+(0<=a?a:0)).slice(-2)+":"+("00"+(0<=s?s:0)).slice(-2);return-1==r&&-1==a&&-1==s?e:-1==n&&-1==i&&-1==o?l:e+"T"+l}(n.dateNF,i.match(m)||[]),t=1),n.cellDates?(h.t="d",h.v=Ft(i,t)):(h.t="n",h.v=$t(Ft(i,t))),!1!==n.cellText&&(h.w=_t(h.z,h.v instanceof Date?$t(h.v):h.v)),n.cellNF||delete h.z):(h.t="s",h.v=i):(!(h.t="n")!==n.cellText&&(h.w=i),h.v=l),"z"!=h.t&&(n.dense?(o[a]||(o[a]=[]),o[a][s]=h):o[Ci({c:s,r:a})]=h),c=u+1,f=e.charCodeAt(c),r.e.c<s&&(r.e.c=s),r.e.r<a&&(r.e.r=a),p!=d)return s=0,++a,!!(n.sheetRows&&n.sheetRows<=a);++s}e:for(;u<e.length;++u)switch(p=e.charCodeAt(u)){case 34:34===f&&(h=!h);break;case d:case 10:case 13:if(!h&&g())break e}return 0<u-c&&g(),o["!ref"]=Ti(r),o}(t,n):$i(function(t,n){var i=n||{},o=[];if(t&&0!==t.length){for(var r=t.split(/[\r\n]/),a=r.length-1;0<=a&&0===r[a].length;)--a;for(var s=10,l=0,c=0;c<=a;++c)-1==(l=r[c].indexOf(" "))?l=r[c].length:l++,s=Math.max(s,l);for(c=0;c<=a;++c){o[c]=[];var u=0;for(e(r[c].slice(0,s).trim(),o,c,u,i),u=1;u<=(r[c].length-s)/10+1;++u)e(r[c].slice(s+10*(u-1),s+10*u).trim(),o,c,u,i)}i.sheetRows&&(o=o.slice(0,i.sheetRows))}return o}(t,n),n)}function r(e,t){var n="",i="string"==t.type?[0,0,0,0]:ol(e,t);switch(t.type){case"base64":n=Ae(e);break;case"binary":n=e;break;case"buffer":n=65001==t.codepage?e.toString("utf8"):(t.codepage,Oe&&Buffer.isBuffer(e)?e.toString("binary"):Re(e));break;case"array":n=jt(e);break;case"string":n=e;break;default:throw new Error("Unrecognized type "+t.type)}return 239==i[0]&&187==i[1]&&191==i[2]?n=wn(n.slice(3)):"string"!=t.type&&"buffer"!=t.type&&65001==t.codepage?n=wn(n):t.type,"socialcalc:version:"==n.slice(0,19)?lr.to_sheet("string"==t.type?n:wn(n),t):o(n,t)}return{to_workbook:function(e,t){return Mi(r(e,t),t)},to_sheet:r,from_sheet:function(e){for(var t=[],n=Ai(e["!ref"]),i=Array.isArray(e),o=n.s.r;o<=n.e.r;++o){for(var r=[],a=n.s.c;a<=n.e.c;++a){var s=Ci({r:o,c:a});if((s=i?(e[o]||[])[a]:e[s])&&null!=s.v){for(var l=(s.w||(Oi(s),s.w)||"").slice(0,10);l.length<10;)l+=" ";r.push(l+(0===a?" ":""))}else r.push(" ")}t.push(r.join(""))}return t.join("\n")}}}(),ur=function(){function e(e,t,n){if(e){di(e,e.l||0);for(var i=n.Enum||d;e.l<e.length;){var o=e.read_shift(2),r=i[o]||i[65535],a=e.read_shift(2),s=e.l+a;a=r.f&&r.f(e,a,n);if(e.l=s,t(a,r,o))return}}}function t(t,n){if(!t)return t;var i=n||{},o=i.dense?[]:{},r="Sheet1",a="",s=0,l={},c=[],u=[],p={s:{r:0,c:0},e:{r:0,c:0}},f=i.sheetRows||0;if(0==t[2]&&(8==t[3]||9==t[3])&&16<=t.length&&5==t[14]&&108===t[15])throw new Error("Unsupported Works 3 for Mac file");if(2==t[2])i.Enum=d,e(t,(function(e,t,n){switch(n){case 0:4096<=(i.vers=e)&&(i.qpro=!0);break;case 6:p=e;break;case 204:e&&(a=e);break;case 222:a=e;break;case 15:case 51:i.qpro||(e[1].v=e[1].v.slice(1));case 13:case 14:case 16:14==n&&112==(112&e[2])&&1<(15&e[2])&&(15&e[2])<15&&(e[1].z=i.dateNF||Ke[14],i.cellDates)&&(e[1].t="d",e[1].v=Lt(e[1].v)),i.qpro&&e[3]>s&&(o["!ref"]=Ti(p),l[r]=o,c.push(r),o=i.dense?[]:{},p={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],r=a||"Sheet"+(s+1),a="");var u=i.dense?(o[e[0].r]||[])[e[0].c]:o[Ci(e[0])];u?(u.t=e[1].t,u.v=e[1].v,null!=e[1].z&&(u.z=e[1].z),null!=e[1].f&&(u.f=e[1].f)):i.dense?(o[e[0].r]||(o[e[0].r]=[]),o[e[0].r][e[0].c]=e[1]):o[Ci(e[0])]=e[1]}}),i);else{if(26!=t[2]&&14!=t[2])throw new Error("Unrecognized LOTUS BOF "+t[2]);i.Enum=h,14==t[2]&&(i.qpro=!0,t.l=0),e(t,(function(e,t,n){switch(n){case 204:r=e;break;case 22:e[1].v=e[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:e[3]>s&&(o["!ref"]=Ti(p),l[r]=o,c.push(r),o=i.dense?[]:{},p={s:{r:0,c:0},e:{r:0,c:0}},s=e[3],r="Sheet"+(s+1)),0<f&&e[0].r>=f||(i.dense?(o[e[0].r]||(o[e[0].r]=[]),o[e[0].r][e[0].c]=e[1]):o[Ci(e[0])]=e[1],p.e.c<e[0].c&&(p.e.c=e[0].c),p.e.r<e[0].r&&(p.e.r=e[0].r));break;case 27:e[14e3]&&(u[e[14e3][0]]=e[14e3][1]);break;case 1537:u[e[0]]=e[1],e[0]==s&&(r=e[1])}}),i)}if(o["!ref"]=Ti(p),l[a||r]=o,c.push(a||r),!u.length)return{SheetNames:c,Sheets:l};for(var m={},g=[],v=0;v<u.length;++v)l[c[v]]?(g.push(u[v]||c[v]),m[u[v]]=l[u[v]]||l[c[v]]):(g.push(u[v]),m[u[v]]={"!ref":"A1"});return{SheetNames:g,Sheets:m}}function n(e,t,n){var i=[{c:0,r:0},{t:"n",v:0},0,0];return n.qpro&&20768!=n.vers?(i[0].c=e.read_shift(1),i[3]=e.read_shift(1),i[0].r=e.read_shift(2),e.l+=2):(i[2]=e.read_shift(1),i[0].c=e.read_shift(2),i[0].r=e.read_shift(2)),i}function i(e,t,i){t=e.l+t;var o,r=n(e,0,i);return r[1].t="s",20768==i.vers?(e.l++,o=e.read_shift(1),r[1].v=e.read_shift(o,"utf8")):(i.qpro&&e.l++,r[1].v=e.read_shift(t-e.l,"cstr")),r}function o(e,t,n){var i=32768&t;return(i?"":"$")+(n?ki:xi)(t=(i?e:0)+(8192<=(t&=-32769)?t-16384:t))}var r={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},a=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function s(e){var t=[{c:0,r:0},{t:"n",v:0},0];return t[0].r=e.read_shift(2),t[3]=e[e.l++],t[0].c=e[e.l++],t}function l(e,t){var n,i=s(e),o=e.read_shift(4),r=e.read_shift(4);return 65535==(e=e.read_shift(2))?0===o&&3221225472===r?(i[1].t="e",i[1].v=15):0===o&&3489660928===r?(i[1].t="e",i[1].v=42):i[1].v=0:(n=32768&e,e=(32767&e)-16446,i[1].v=(1-2*n)*(r*Math.pow(2,32+e)+o*Math.pow(2,e))),i}function c(e,t){var n=s(e);e=e.read_shift(8,"f");return n[1].v=e,n}function u(e,t){return 0==e[e.l+t-1]?e.read_shift(t,"cstr"):""}var d={0:{n:"BOF",f:Co},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:function(e,t,n){var i={s:{c:0,r:0},e:{c:0,r:0}};return 8==t&&n.qpro?(i.s.c=e.read_shift(1),e.l++,i.s.r=e.read_shift(2),i.e.c=e.read_shift(1),e.l++,i.e.r=e.read_shift(2)):(i.s.c=e.read_shift(2),i.s.r=e.read_shift(2),12==t&&n.qpro&&(e.l+=2),i.e.c=e.read_shift(2),i.e.r=e.read_shift(2),12==t&&n.qpro&&(e.l+=2),65535==i.s.c&&(i.s.c=i.e.c=i.s.r=i.e.r=0)),i}},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:function(e,t,i){return(i=n(e,0,i))[1].v=e.read_shift(2,"i"),i}},14:{n:"NUMBER",f:function(e,t,i){return(i=n(e,0,i))[1].v=e.read_shift(8,"f"),i}},15:{n:"LABEL",f:i},16:{n:"FORMULA",f:function(e,t,i){t=e.l+t;var s=n(e,0,i);return s[1].v=e.read_shift(8,"f"),i.qpro?e.l=t:(i=e.read_shift(2),function(e,t){di(e,0);for(var n=[],i=0,s="",l="",c="",u="";e.l<e.length;){var d=e[e.l++];switch(d){case 0:n.push(e.read_shift(8,"f"));break;case 1:l=o(t[0].c,e.read_shift(2),!0),s=o(t[0].r,e.read_shift(2),!1),n.push(l+s);break;case 2:var h=o(t[0].c,e.read_shift(2),!0),p=o(t[0].r,e.read_shift(2),!1);l=o(t[0].c,e.read_shift(2),!0),s=o(t[0].r,e.read_shift(2),!1),n.push(h+p+":"+l+s);break;case 3:if(e.l<e.length)return console.error("WK1 premature formula end");break;case 4:n.push("("+n.pop()+")");break;case 5:n.push(e.read_shift(2));break;case 6:for(var f="";d=e[e.l++];)f+=String.fromCharCode(d);n.push('"'+f.replace(/"/g,'""')+'"');break;case 8:n.push("-"+n.pop());break;case 23:n.push("+"+n.pop());break;case 22:n.push("NOT("+n.pop()+")");break;case 20:case 21:u=n.pop(),c=n.pop(),n.push(["AND","OR"][d-20]+"("+c+","+u+")");break;default:if(d<32&&a[d])u=n.pop(),c=n.pop(),n.push(c+a[d]+u);else{if(!r[d])return d<=7?console.error("WK1 invalid opcode "+d.toString(16)):d<=24?console.error("WK1 unsupported op "+d.toString(16)):d<=30?console.error("WK1 invalid opcode "+d.toString(16)):d<=115?console.error("WK1 unsupported function opcode "+d.toString(16)):console.error("WK1 unrecognized opcode "+d.toString(16));if(69==(i=r[d][1])&&(i=e[e.l++]),n.length<i)return console.error("WK1 bad formula parse 0x"+d.toString(16)+":|"+n.join("|")+"|");h=n.slice(-i),n.length-=i,n.push(r[d][0]+"("+h.join(",")+")")}}}1==n.length?t[1].f=""+n[0]:console.error("WK1 bad formula parse |"+n.join("|")+"|")}(e.slice(e.l,e.l+i),s),e.l+=i),s}},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:i},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:u},222:{n:"SHEETNAMELP",f:function(e,t){for(var n=e[e.l++],i=(t-1<n&&(n=t-1),"");i.length<n;)i+=String.fromCharCode(e[e.l++]);return i}},65535:{n:""}},h={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:function(e,t){var n=s(e);return n[1].t="s",n[1].v=e.read_shift(t-4,"cstr"),n}},23:{n:"NUMBER17",f:l},24:{n:"NUMBER18",f:function(e,t){var n=s(e),i=(n[1].v=e.read_shift(2),n[1].v>>1);if(1&n[1].v)switch(7&i){case 0:i=5e3*(i>>3);break;case 1:i=500*(i>>3);break;case 2:i=(i>>3)/20;break;case 3:i=(i>>3)/200;break;case 4:i=(i>>3)/2e3;break;case 5:i=(i>>3)/2e4;break;case 6:i=(i>>3)/16;break;case 7:i=(i>>3)/64}return n[1].v=i,n}},25:{n:"FORMULA19",f:function(e,t){var n=l(e);return e.l+=t-14,n}},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:function(e,t){for(var n={},i=e.l+t;e.l<i;){var o=e.read_shift(2);if(14e3==o){for(n[o]=[0,""],n[o][0]=e.read_shift(2);e[e.l];)n[o][1]+=String.fromCharCode(e[e.l]),e.l++;e.l++}}return n}},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:function(e,t){var n=s(e);e=e.read_shift(4);return n[1].v=e>>6,n}},38:{n:"??"},39:{n:"NUMBER27",f:c},40:{n:"FORMULA28",f:function(e,t){var n=c(e);return e.l+=t-10,n}},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:u},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:function(e,t,n){if(n.qpro&&!(t<21))return n=e.read_shift(1),e.l+=17,e.l+=1,e.l+=2,[n,e.read_shift(t-21,"cstr")]}},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:function(e,t){if(0<=+(t=t||{}).codepage&&be(+t.codepage),"string"==t.type)throw new Error("Cannot write WK1 to JS string");for(var n,i,o,r,a,s=mi(),l=Ai(e["!ref"]),c=Array.isArray(e),u=[],d=(Ms(s,0,(t=1030,(n=pi(2)).write_shift(2,t),n)),Ms(s,6,(t=l,(n=pi(8)).write_shift(2,t.s.c),n.write_shift(2,t.s.r),n.write_shift(2,t.e.c),n.write_shift(2,t.e.r),n)),Math.min(l.e.r,8191)),h=l.s.r;h<=d;++h)for(var p=xi(h),f=l.s.c;f<=l.e.c;++f){h===l.s.r&&(u[f]=ki(f));var m=c?(e[h]||[])[f]:e[u[f]+p];m&&"z"!=m.t&&("n"==m.t?(0|m.v)==m.v&&-32768<=m.v&&m.v<=32767?Ms(s,13,(i=h,o=f,r=m.v,a=void 0,(a=pi(7)).write_shift(1,255),a.write_shift(2,o),a.write_shift(2,i),a.write_shift(2,r,"i"),a)):Ms(s,14,(o=h,i=f,r=m.v,a=void 0,(a=pi(13)).write_shift(1,255),a.write_shift(2,i),a.write_shift(2,o),a.write_shift(8,r,"f"),a)):Ms(s,15,function(e,t,n){var i=pi(7+n.length);i.write_shift(1,255),i.write_shift(2,t),i.write_shift(2,e),i.write_shift(1,39);for(var o=0;o<i.length;++o){var r=n.charCodeAt(o);i.write_shift(1,128<=r?95:r)}return i.write_shift(1,0),i}(h,f,Oi(m).slice(0,239))))}return Ms(s,1),s.end()},book_to_wk3:function(e,t){if(0<=+(t=t||{}).codepage&&be(+t.codepage),"string"==t.type)throw new Error("Cannot write WK3 to JS string");var n=mi();Ms(n,0,function(e){for(var t=pi(26),n=(t.write_shift(2,4096),t.write_shift(2,4),t.write_shift(4,0),0),i=0,o=0,r=0;r<e.SheetNames.length;++r){var a=e.SheetNames[r];(a=e.Sheets[a])&&a["!ref"]&&(++o,n<(a=Si(a["!ref"])).e.r&&(n=a.e.r),i<a.e.c)&&(i=a.e.c)}return 8191<n&&(n=8191),t.write_shift(2,n),t.write_shift(1,o),t.write_shift(1,i),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,1),t.write_shift(1,2),t.write_shift(4,0),t.write_shift(4,0),t}(e));for(var i=0,o=0;i<e.SheetNames.length;++i)(e.Sheets[e.SheetNames[i]]||{})["!ref"]&&Ms(n,27,function(e,t){var n=pi(5+e.length);n.write_shift(2,14e3),n.write_shift(2,t);for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);n[n.l++]=127<o?95:o}return n[n.l++]=0,n}(e.SheetNames[i],o++));var r,a,s,l,c,u,d=0;for(i=0;i<e.SheetNames.length;++i){var h=e.Sheets[e.SheetNames[i]];if(h&&h["!ref"]){for(var p=Ai(h["!ref"]),f=Array.isArray(h),m=[],g=Math.min(p.e.r,8191),v=p.s.r;v<=g;++v)for(var b=xi(v),y=p.s.c;y<=p.e.c;++y){v===p.s.r&&(m[y]=ki(y));var w=f?(h[v]||[])[y]:h[m[y]+b];w&&"z"!=w.t&&("n"==w.t?Ms(n,23,(r=v,a=y,s=d,l=w.v,u=c=void 0,(u=pi(14)).write_shift(2,r),u.write_shift(1,s),u.write_shift(1,a),0==l?(u.write_shift(4,0),u.write_shift(4,0),u.write_shift(2,65535)):(l<(c=a=s=r=0)&&(r=1,l=-l),s=0|Math.log2(l),0==(2147483648&(c=(l/=Math.pow(2,s-31))>>>0))&&(++s,c=(l/=2)>>>0),l-=c,c=(2147483648|c)>>>0,a=(l*=Math.pow(2,32))>>>0,u.write_shift(4,a),u.write_shift(4,c),s+=16383+(r?32768:0),u.write_shift(2,s)),u)):Ms(n,22,function(e,t,n,i){var o=pi(6+i.length);o.write_shift(2,e),o.write_shift(1,n),o.write_shift(1,t),o.write_shift(1,39);for(var r=0;r<i.length;++r){var a=i.charCodeAt(r);o.write_shift(1,128<=a?95:a)}return o.write_shift(1,0),o}(v,y,d,Oi(w).slice(0,239))))}++d}}return Ms(n,1),n.end()},to_workbook:function(e,n){switch(n.type){case"base64":return t(Pe(Ae(e)),n);case"binary":return t(Pe(e),n);case"buffer":case"array":return t(e,n)}throw"Unsupported type "+n.type}}}(),dr=function(){var e=_n("t"),t=_n("rPr");function n(n){var i=n.match(e);return i?(i={t:"s",v:dn(i[1])},(n=n.match(t))&&(i.s=function(e){var t={},n=e.match(on),i=0,o=!1;if(n)for(;i!=n.length;++i){var r=sn(n[i]);switch(r[0].replace(/\w*:/g,"")){case"<condense":case"<extend":break;case"<shadow":if(!r.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":"1"!=r.val&&(t.cp=ge[parseInt(r.val,10)]);break;case"<outline":if(!r.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=r.val;break;case"<sz":t.sz=r.val;break;case"<strike":if(!r.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!r.val)break;switch(r.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting"}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if("0"==r.val)break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if("0"==r.val)break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":r.rgb&&(t.color=r.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=r.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=r.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":o=!0;break;case"</ext>":o=!1;break;default:if(47!==r[0].charCodeAt(1)&&!o)throw new Error("Unrecognized rich format "+r[0])}}return t}(n[1])),i):{t:"s",v:""}}var i=/<(?:\w+:)?r>/g,o=/<\/(?:\w+:)?r>/;return function(e){return e.replace(i,"").split(o).map(n).filter((function(e){return e.v}))}}(),hr=function(){var e=/(\r\n|\n)/g;function t(t){var n,i,o,r=[[],t.v,[]];return t.v?(t.s&&(t=t.s,n=r[0],i=r[2],o=[],t.u&&o.push("text-decoration: underline;"),t.uval&&o.push("text-underline-style:"+t.uval+";"),t.sz&&o.push("font-size:"+t.sz+"pt;"),t.outline&&o.push("text-effect: outline;"),t.shadow&&o.push("text-shadow: auto;"),n.push('<span style="'+o.join("")+'">'),t.b&&(n.push("<b>"),i.push("</b>")),t.i&&(n.push("<i>"),i.push("</i>")),t.strike&&(n.push("<s>"),i.push("</s>")),"superscript"==(o=t.valign||"")||"super"==o?o="sup":"subscript"==o&&(o="sub"),""!=o&&(n.push("<"+o+">"),i.push("</"+o+">")),i.push("</span>")),r[0].join("")+r[1].replace(e,"<br/>")+r[2].join("")):""}return function(e){return e.map(t).join("")}}(),pr=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,fr=/<(?:\w+:)?r>/,mr=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function gr(e,t){t=!t||t.cellHTML;var n={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=dn(wn(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=wn(e),t&&(n.h=fn(n.t))):e.match(fr)&&(n.r=wn(e),n.t=dn(wn((e.replace(mr,"").match(pr)||[]).join("").replace(on,""))),t)&&(n.h=hr(dr(n.r))),n):{t:""}}var vr=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,br=/<(?:\w+:)?(?:si|sstItem)>/g,yr=/<\/(?:\w+:)?(?:si|sstItem)>/;function wr(e){for(var t=[],n=e.split(""),i=0;i<n.length;++i)t[i]=n[i].charCodeAt(0);return t}function xr(e,t){var n={};return n.Major=e.read_shift(2),n.Minor=e.read_shift(2),4<=t&&(e.l+=t-4),n}function _r(e,t){t=e.l+t;var n={},i=(n.Flags=63&e.read_shift(4),e.l+=4,n.AlgID=e.read_shift(4),!1);switch(n.AlgID){case 26126:case 26127:case 26128:i=36==n.Flags;break;case 26625:i=4==n.Flags;break;case 0:i=16==n.Flags||4==n.Flags||36==n.Flags;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(i)return n.AlgIDHash=e.read_shift(4),n.KeySize=e.read_shift(4),n.ProviderType=e.read_shift(4),e.l+=8,n.CSPName=e.read_shift(t-e.l>>1,"utf16le"),e.l=t,n;throw new Error("Encryption Flags/AlgID mismatch")}function kr(e,t){var n={};t=e.l+t;return e.l+=4,n.Salt=e.slice(e.l,e.l+16),e.l+=16,n.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),n.VerifierHash=e.slice(e.l,t),e.l=t,n}var Er=function(){function e(e,t){return 255&((e^=t)/2|128*e)}var t=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],n=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],i=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628];return function(o){for(var r,a=wr(o),s=function(e){for(var t=n[e.length-1],o=104,r=e.length-1;0<=r;--r)for(var a=e[r],s=0;7!=s;++s)64&a&&(t^=i[o]),a*=2,--o;return t}(a),l=a.length,c=De(16),u=0;16!=u;++u)c[u]=0;for(1==(1&l)&&(c[l]=e(t[0],s>>8),o=a[a.length-1],c[--l]=e(o,255&s));0<l;)c[--l]=e(a[l],s>>8),c[--l]=e(a[l],255&s);for(r=(l=15)-a.length;0<r;)c[l]=e(t[r],s>>8),--r,c[--l]=e(a[l],255&s),--l,--r;return c}}();var Cr=function(){function e(e,n){switch(n.type){case"base64":return t(Ae(e),n);case"binary":return t(e,n);case"buffer":return t(Oe&&Buffer.isBuffer(e)?e.toString("binary"):Re(e),n);case"array":return t(jt(e),n)}throw new Error("Unrecognized type "+n.type)}function t(e,t){var n,i=(t||{}).dense?[]:{};if((t=e.match(/\\trowd.*?\\row\b/g)).length)return n={s:{c:0,r:0},e:{c:0,r:t.length-1}},t.forEach((function(e,t){Array.isArray(i)&&(i[t]=[]);for(var o,r=/\\\w+\b/g,a=0,s=-1;o=r.exec(e);)"\\cell"===o[0]&&(++s,(o=" "==(o=e.slice(a,r.lastIndex-o[0].length))[0]?o.slice(1):o).length)&&(o={v:o,t:"s"},Array.isArray(i)?i[t][s]=o:i[Ci({r:t,c:s})]=o),a=r.lastIndex;s>n.e.c&&(n.e.c=s)})),i["!ref"]=Ti(n),i;throw new Error("RTF missing table")}return{to_workbook:function(t,n){return Mi(e(t,n),n)},to_sheet:e,from_sheet:function(e){for(var t=["{\\rtf1\\ansi"],n=Ai(e["!ref"]),i=Array.isArray(e),o=n.s.r;o<=n.e.r;++o){t.push("\\trowd\\trautofit1");for(var r=n.s.c;r<=n.e.c;++r)t.push("\\cellx"+(r+1));for(t.push("\\pard\\intbl"),r=n.s.c;r<=n.e.c;++r){var a=Ci({r:o,c:r});(a=i?(e[o]||[])[r]:e[a])&&(null!=a.v||a.f&&!a.F)&&(t.push(" "+(a.w||(Oi(a),a.w))),t.push("\\cell"))}t.push("\\pard\\intbl\\row")}return t.join("")+"}"}}}();function Sr(e){for(var t=0,n=1;3!=t;++t)n=256*n+(255<e[t]?255:e[t]<0?0:e[t]);return n.toString(16).toUpperCase().slice(1)}function Tr(e,t){return 0===t?e:((e=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255,o=(e=Math.max(t,n,i),Math.min(t,n,i)),r=e-o;if(0==r)return[0,0,t];var a=0,s=r/(1<(o=e+o)?2-o:o);switch(e){case t:a=((n-i)/r+6)%6;break;case n:a=(i-t)/r+2;break;case i:a=(t-n)/r+4}return[a/6,s,o/2]}((e=(e=e).slice("#"===e[0]?1:0).slice(0,6),[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)])))[2]=t<0?e[2]*(1+t):1-(1-e[2])*(1-t),Sr(function(e){var t,n=e[0],i=e[1],o=2*i*((e=e[2])<.5?e:1-e),r=[e-=o/2,e,e],a=6*n;if(0!==i)switch(0|a){case 0:case 6:t=o*a,r[0]+=o,r[1]+=t;break;case 1:r[0]+=t=o*(2-a),r[1]+=o;break;case 2:t=o*(a-2),r[1]+=o,r[2]+=t;break;case 3:r[1]+=t=o*(4-a),r[2]+=o;break;case 4:t=o*(a-4),r[2]+=o,r[0]+=t;break;case 5:r[2]+=t=o*(6-a),r[0]+=o}for(var s=0;3!=s;++s)r[s]=Math.round(255*r[s]);return r}(e)))}var Ar=6;function Or(e){return Math.floor((e+Math.round(128/Ar)/256)*Ar)}function Mr(e){return Math.floor((e-5)/Ar*100+.5)/100}function Dr(e){return Math.round((e*Ar+5)/Ar*256)/256}function $r(e){return Dr(Mr(Or(e)))}function Pr(e){var t=Math.abs(e-$r(e)),n=Ar;if(.005<t)for(Ar=1;Ar<15;++Ar)Math.abs(e-$r(e))<=t&&(t=Math.abs(e-$r(e)),n=Ar);Ar=n}function Rr(e){e.width?(e.wpx=Or(e.width),e.wch=Mr(e.wpx),e.MDW=Ar):e.wpx?(e.wch=Mr(e.wpx),e.width=Dr(e.wch),e.MDW=Ar):"number"==typeof e.wch&&(e.width=Dr(e.wch),e.wpx=Or(e.width),e.MDW=Ar),e.customWidth&&delete e.customWidth}function Lr(e){return 96*e/96}function Ir(e){return 96*e/96}var Nr={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"},Fr=["numFmtId","fillId","fontId","borderId","xfId"],jr=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"],Br=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,n=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,o=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(r,a,s){var l,c,u,d,h,p,f,m,g,v,b,y,w,x,_,k,E,C,S={};if(r){if(l=(r=r.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"")).match(e)){var T=l,A=S,O=s;A.NumberFmt=[];for(var M=Ot(Ke),D=0;D<M.length;++D)A.NumberFmt[M[D]]=Ke[M[D]];var $=T[0].match(on);if($)for(D=0;D<$.length;++D){var P=sn($[D]);switch(ln(P[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":var R=dn(wn(P.formatCode)),L=parseInt(P.numFmtId,10);if(A.NumberFmt[L]=R,0<L){if(392<L){for(L=392;60<L&&null!=A.NumberFmt[L];--L);A.NumberFmt[L]=R}kt(R,L)}break;case"</numFmt>":break;default:if(O.WTF)throw new Error("unrecognized "+P[0]+" in numFmts")}}}(l=r.match(i))&&(T=l,u=a,d=s,(c=S).Fonts=[],p=!(h={}),(T[0].match(on)||[]).forEach((function(e){var t,n=sn(e);switch(ln(n[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":c.Fonts.push(h),h={};break;case"<name":n.val&&(h.name=wn(n.val));break;case"<name/>":case"</name>":break;case"<b":h.bold=n.val?gn(n.val):1;break;case"<b/>":h.bold=1;break;case"<i":h.italic=n.val?gn(n.val):1;break;case"<i/>":h.italic=1;break;case"<u":switch(n.val){case"none":h.underline=0;break;case"single":h.underline=1;break;case"double":h.underline=2;break;case"singleAccounting":h.underline=33;break;case"doubleAccounting":h.underline=34}break;case"<u/>":h.underline=1;break;case"<strike":h.strike=n.val?gn(n.val):1;break;case"<strike/>":h.strike=1;break;case"<outline":h.outline=n.val?gn(n.val):1;break;case"<outline/>":h.outline=1;break;case"<shadow":h.shadow=n.val?gn(n.val):1;break;case"<shadow/>":h.shadow=1;break;case"<condense":h.condense=n.val?gn(n.val):1;break;case"<condense/>":h.condense=1;break;case"<extend":h.extend=n.val?gn(n.val):1;break;case"<extend/>":h.extend=1;break;case"<sz":n.val&&(h.sz=+n.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":n.val&&(h.vertAlign=n.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":n.val&&(h.family=parseInt(n.val,10));break;case"<family/>":case"</family>":break;case"<scheme":n.val&&(h.scheme=n.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":"1"!=n.val&&(n.codepage=ge[parseInt(n.val,10)]);break;case"<color":h.color||(h.color={}),n.auto&&(h.color.auto=gn(n.auto)),n.rgb?h.color.rgb=n.rgb.slice(-6):n.indexed?(h.color.index=parseInt(n.indexed,10),t=Ji[h.color.index],t=(t=81==h.color.index?Ji[1]:t)||Ji[1],h.color.rgb=t[0].toString(16)+t[1].toString(16)+t[2].toString(16)):n.theme&&(h.color.theme=parseInt(n.theme,10),n.tint&&(h.color.tint=parseFloat(n.tint)),n.theme)&&u.themeElements&&u.themeElements.clrScheme&&(h.color.rgb=Tr(u.themeElements.clrScheme[h.color.theme].rgb,h.color.tint||0));break;case"<color/>":case"</color>":break;case"<AlternateContent":p=!0;break;case"</AlternateContent>":p=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":p=!0;break;case"</ext>":p=!1;break;default:if(d&&d.WTF&&!p)throw new Error("unrecognized "+n[0]+" in fonts")}}))),(l=r.match(n))&&(a=l,m=s,(f=S).Fills=[],v=!(g={}),(a[0].match(on)||[]).forEach((function(e){var t=sn(e);switch(ln(t[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":g={},f.Fills.push(g);break;case"</fill>":case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":f.Fills.push(g),g={};break;case"<patternFill":case"<patternFill>":t.patternType&&(g.patternType=t.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":g.bgColor||(g.bgColor={}),t.indexed&&(g.bgColor.indexed=parseInt(t.indexed,10)),t.theme&&(g.bgColor.theme=parseInt(t.theme,10)),t.tint&&(g.bgColor.tint=parseFloat(t.tint)),t.rgb&&(g.bgColor.rgb=t.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":g.fgColor||(g.fgColor={}),t.theme&&(g.fgColor.theme=parseInt(t.theme,10)),t.tint&&(g.fgColor.tint=parseFloat(t.tint)),null!=t.rgb&&(g.fgColor.rgb=t.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":case"</stop>":break;case"<color":case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":v=!0;break;case"</ext>":v=!1;break;default:if(m&&m.WTF&&!v)throw new Error("unrecognized "+t[0]+" in fills")}}))),(l=r.match(o))&&(a=l,y=s,(b=S).Borders=[],x=!(w={}),(a[0].match(on)||[]).forEach((function(e){var t=sn(e);switch(ln(t[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":w={},t.diagonalUp&&(w.diagonalUp=gn(t.diagonalUp)),t.diagonalDown&&(w.diagonalDown=gn(t.diagonalDown)),b.Borders.push(w);break;case"</border>":case"<left/>":break;case"<left":case"<left>":case"</left>":case"<right/>":break;case"<right":case"<right>":case"</right>":case"<top/>":break;case"<top":case"<top>":case"</top>":case"<bottom/>":break;case"<bottom":case"<bottom>":case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":case"</vertical>":break;case"<start":case"<start>":case"<start/>":case"</start>":break;case"<end":case"<end>":case"<end/>":case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":x=!0;break;case"</ext>":x=!1;break;default:if(y&&y.WTF&&!x)throw new Error("unrecognized "+t[0]+" in borders")}}))),(l=r.match(t))&&(a=l,k=s,C=!((_=S).CellXf=[]),(a[0].match(on)||[]).forEach((function(e){var t=sn(e),n=0;switch(ln(t[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(delete(E=t)[0],n=0;n<Fr.length;++n)E[Fr[n]]&&(E[Fr[n]]=parseInt(E[Fr[n]],10));for(n=0;n<jr.length;++n)E[jr[n]]&&(E[jr[n]]=gn(E[jr[n]]));if(_.NumberFmt&&392<E.numFmtId)for(n=392;60<n;--n)if(_.NumberFmt[E.numFmtId]==_.NumberFmt[n]){E.numFmtId=n;break}_.CellXf.push(E);break;case"</xf>":break;case"<alignment":case"<alignment/>":var i={};t.vertical&&(i.vertical=t.vertical),t.horizontal&&(i.horizontal=t.horizontal),null!=t.textRotation&&(i.textRotation=t.textRotation),t.indent&&(i.indent=t.indent),t.wrapText&&(i.wrapText=gn(t.wrapText)),E.alignment=i;break;case"</alignment>":case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":C=!0;break;case"</AlternateContent>":C=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":C=!0;break;case"</ext>":C=!1;break;default:if(k&&k.WTF&&!C)throw new Error("unrecognized "+t[0]+" in cellXfs")}})))}return S}}(),qr=hi,zr=hi,Vr=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function Wr(e,t,n){t.themeElements.clrScheme=[];var i={};(e[0].match(on)||[]).forEach((function(e){var o=sn(e);switch(o[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":i.rgb=o.val;break;case"<a:sysClr":i.rgb=o.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":"/"===o[0].charAt(1)?(t.themeElements.clrScheme[Vr.indexOf(o[0])]=i,i={}):i.name=o[0].slice(3,o[0].length-1);break;default:if(n&&n.WTF)throw new Error("Unrecognized "+o[0]+" in clrScheme")}}))}function Hr(){}function Ur(){}var Gr=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,Kr=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,Yr=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/,Xr=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function Jr(e,t){e&&0!==e.length||(e=function(e,t){return t&&t.themeXLSX?t.themeXLSX:e&&"string"==typeof e.raw?e.raw:((t=[tn])[t.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',t[t.length]="<a:themeElements>",t[t.length]='<a:clrScheme name="Office">',t[t.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',t[t.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',t[t.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',t[t.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',t[t.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',t[t.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',t[t.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',t[t.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',t[t.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',t[t.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',t[t.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',t[t.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',t[t.length]="</a:clrScheme>",t[t.length]='<a:fontScheme name="Office">',t[t.length]="<a:majorFont>",t[t.length]='<a:latin typeface="Cambria"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',t[t.length]='<a:font script="Hang" typeface="맑은 고딕"/>',t[t.length]='<a:font script="Hans" typeface="宋体"/>',t[t.length]='<a:font script="Hant" typeface="新細明體"/>',t[t.length]='<a:font script="Arab" typeface="Times New Roman"/>',t[t.length]='<a:font script="Hebr" typeface="Times New Roman"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="MoolBoran"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:majorFont>",t[t.length]="<a:minorFont>",t[t.length]='<a:latin typeface="Calibri"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',t[t.length]='<a:font script="Hang" typeface="맑은 고딕"/>',t[t.length]='<a:font script="Hans" typeface="宋体"/>',t[t.length]='<a:font script="Hant" typeface="新細明體"/>',t[t.length]='<a:font script="Arab" typeface="Arial"/>',t[t.length]='<a:font script="Hebr" typeface="Arial"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Arial"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:minorFont>",t[t.length]="</a:fontScheme>",t[t.length]='<a:fmtScheme name="Office">',t[t.length]="<a:fillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="1"/>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="0"/>',t[t.length]="</a:gradFill>",t[t.length]="</a:fillStyleLst>",t[t.length]="<a:lnStyleLst>",t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]="</a:lnStyleLst>",t[t.length]="<a:effectStyleLst>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',t[t.length]="</a:effectStyle>",t[t.length]="</a:effectStyleLst>",t[t.length]="<a:bgFillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]="</a:bgFillStyleLst>",t[t.length]="</a:fmtScheme>",t[t.length]="</a:themeElements>",t[t.length]="<a:objectDefaults>",t[t.length]="<a:spDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',t[t.length]="</a:spDef>",t[t.length]="<a:lnDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',t[t.length]="</a:lnDef>",t[t.length]="</a:objectDefaults>",t[t.length]="<a:extraClrSchemeLst/>",t[t.length]="</a:theme>",t.join(""))}());var n,i,o,r,a,s={};if(n=e.match(Xr))return i=n[0],r=t,(o=s).themeElements={},[["clrScheme",Gr,Wr],["fontScheme",Kr,Hr],["fmtScheme",Yr,Ur]].forEach((function(e){if(!(a=i.match(e[1])))throw new Error(e[0]+" not found in themeElements");e[2](a,o,r)})),s.raw=e,s;throw new Error("themeElements not found in theme")}function Zr(e){var t=e.read_shift(2),n=e.read_shift(2)-4,i=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:i[1]=function(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:e.l+=4;break;case 1:t.xclrValue=hi(e,4);break;case 2:t.xclrValue=$o(e);break;case 3:t.xclrValue=e.read_shift(4);break;case 4:e.l+=4}return e.l+=8,t}(e);break;case 6:i[1]=hi(e,n);break;case 14:case 15:i[1]=e.read_shift(1==n?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+n)}return i}function Qr(e,t,n,i){var o,r=Array.isArray(e);t.forEach((function(t){var a,s=Ei(t.ref),l=((o=r?(e[s.r]||(e[s.r]=[]),e[s.r][s.c]):e[t.ref])||(o={t:"z"},r?e[s.r][s.c]=o:e[t.ref]=o,(a=Ai(e["!ref"]||"BDWGO1000001:A1")).s.r>s.r&&(a.s.r=s.r),a.e.r<s.r&&(a.e.r=s.r),a.s.c>s.c&&(a.s.c=s.c),a.e.c<s.c&&(a.e.c=s.c),(s=Ti(a))!==e["!ref"]&&(e["!ref"]=s)),o.c||(o.c=[]),{a:t.author,t:t.t,r:t.r,T:n});t.h&&(l.h=t.h);for(var c=o.c.length-1;0<=c;--c){if(!n&&o.c[c].T)return;n&&!o.c[c].T&&o.c.splice(c,1)}if(n&&i)for(c=0;c<i.length;++c)if(l.a==i[c].id){l.a=i[c].name||l.a;break}o.c.push(l)}))}var ea=Pi,ta=function(){var e,t=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;function n(t,n,i,o){var r=!1,a=!1;0==i.length?a=!0:"["==i.charAt(0)&&(a=!0,i=i.slice(1,-1)),0==o.length?r=!0:"["==o.charAt(0)&&(r=!0,o=o.slice(1,-1)),i=0<i.length?0|parseInt(i,10):0,o=0<o.length?0|parseInt(o,10):0;return r?o+=e.c:--o,a?i+=e.r:--i,n+(r?"":"$")+ki(o)+(a?"":"$")+xi(i)}return function(i,o){return e=o,i.replace(t,n)}}(),na=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,ia=function(e,t){return e.replace(na,(function(e,n,i,o,r,a){return o=_i(o)-(i?0:t.c),n+"R"+(0==(a=wi(a)-(r?0:t.r))?"":r?1+a:"["+a+"]")+"C"+(0==o?"":i?1+o:"["+o+"]")}))};function oa(e,t){return e.replace(na,(function(e,n,i,o,r,a){return n+("$"==i?i+o:ki(_i(o)+t.c))+("$"==r?r+a:xi(wi(a)+t.r))}))}function ra(e){return e.replace(/_xlfn\./g,"")}function aa(e){e.l+=1}function sa(e,t){return[16383&(e=e.read_shift(1==t?1:2)),e>>14&1,e>>15&1]}function la(e,t,n){var i=2;if(n){if(2<=n.biff&&n.biff<=5)return ca(e);12==n.biff&&(i=4)}n=e.read_shift(i),i=e.read_shift(i);var o=sa(e,2);e=sa(e,2);return{s:{r:n,c:o[0],cRel:o[1],rRel:o[2]},e:{r:i,c:e[0],cRel:e[1],rRel:e[2]}}}function ca(e){var t=sa(e,2),n=sa(e,2),i=e.read_shift(1);e=e.read_shift(1);return{s:{r:t[0],c:i,cRel:t[1],rRel:t[2]},e:{r:n[0],c:e,cRel:n[1],rRel:n[2]}}}function ua(e,t,n){var i,o;return n&&2<=n.biff&&n.biff<=5?(i=sa(o=e,2),o=o.read_shift(1),{r:i[0],c:o,cRel:i[1],rRel:i[2]}):{r:e.read_shift(n&&12==n.biff?4:2),c:(o=sa(e,2))[0],cRel:o[1],rRel:o[2]}}function da(e){var t=1&e[e.l+1];return e.l+=4,[t,1]}function ha(e){return[e.read_shift(1),e.read_shift(1)]}function pa(e,t,n){var i=0,o=0;12==n.biff?(i=e.read_shift(4),o=e.read_shift(4)):(o=1+e.read_shift(1),i=1+e.read_shift(2)),2<=n.biff&&n.biff<8&&(--i,0==--o)&&(o=256);for(var r=0,a=[];r!=i&&(a[r]=[]);++r)for(var s=0;s!=o;++s)a[r][s]=function(e,t){var n=[e.read_shift(1)];if(12==t)switch(n[0]){case 2:n[0]=4;break;case 4:n[0]=16;break;case 0:n[0]=1;break;case 1:n[0]=2}switch(n[0]){case 4:n[1]=Eo(e,1)?"TRUE":"FALSE",12!=t&&(e.l+=7);break;case 37:case 16:n[1]=Zi[e[e.l]],e.l+=12==t?4:8;break;case 0:e.l+=8;break;case 1:n[1]=Wi(e);break;case 2:n[1]=Mo(e,0,{biff:0<t&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+n[0])}return n}(e,n.biff);return a}function fa(e,t,n){return e.l+=2,[(i=(e=e).read_shift(2),e=e.read_shift(2),{r:i,c:255&e,fQuoted:!!(16384&e),cRel:e>>15,rRel:e>>15})];var i}function ma(e){return e.l+=6,[]}function ga(e){return e.l+=2,[Co(e),1&e.read_shift(2)]}var va=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"],ba={1:{n:"PtgExp",f:function(e,t,n){return e.l++,n&&12==n.biff?[e.read_shift(4,"i"),0]:[e.read_shift(2),e.read_shift(n&&2==n.biff?1:2)]}},2:{n:"PtgTbl",f:hi},3:{n:"PtgAdd",f:aa},4:{n:"PtgSub",f:aa},5:{n:"PtgMul",f:aa},6:{n:"PtgDiv",f:aa},7:{n:"PtgPower",f:aa},8:{n:"PtgConcat",f:aa},9:{n:"PtgLt",f:aa},10:{n:"PtgLe",f:aa},11:{n:"PtgEq",f:aa},12:{n:"PtgGe",f:aa},13:{n:"PtgGt",f:aa},14:{n:"PtgNe",f:aa},15:{n:"PtgIsect",f:aa},16:{n:"PtgUnion",f:aa},17:{n:"PtgRange",f:aa},18:{n:"PtgUplus",f:aa},19:{n:"PtgUminus",f:aa},20:{n:"PtgPercent",f:aa},21:{n:"PtgParen",f:aa},22:{n:"PtgMissArg",f:aa},23:{n:"PtgStr",f:function(e,t,n){return e.l++,To(e,0,n)}},26:{n:"PtgSheet",f:function(e,t,n){return e.l+=5,e.l+=2,e.l+=2==n.biff?1:4,["PTGSHEET"]}},27:{n:"PtgEndSheet",f:function(e,t,n){return e.l+=2==n.biff?4:5,["PTGENDSHEET"]}},28:{n:"PtgErr",f:function(e){return e.l++,Zi[e.read_shift(1)]}},29:{n:"PtgBool",f:function(e){return e.l++,0!==e.read_shift(1)}},30:{n:"PtgInt",f:function(e){return e.l++,e.read_shift(2)}},31:{n:"PtgNum",f:function(e){return e.l++,Wi(e)}},32:{n:"PtgArray",f:function(e,t,n){var i=(96&e[e.l++])>>5;return e.l+=2==n.biff?6:12==n.biff?14:7,[i]}},33:{n:"PtgFunc",f:function(e,t,n){var i=(96&e[e.l])>>5;e.l+=1,e=e.read_shift(n&&n.biff<=3?1:2);return[Ia[e],La[e],i]}},34:{n:"PtgFuncVar",f:function(e,t,n){var i=e[e.l++];return[e.read_shift(1),(0===(n=n&&n.biff<=3?[88==i?-1:0,e.read_shift(1)]:[e[e.l+1]>>7,32767&e.read_shift(2)])[0]?La:Ra)[n[1]]]}},35:{n:"PtgName",f:function(e,t,n){var i=e.read_shift(1)>>>5&3,o=!n||8<=n.biff?4:2;o=e.read_shift(o);switch(n.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12}return[i,0,o]}},36:{n:"PtgRef",f:function(e,t,n){var i=(96&e[e.l])>>5;return e.l+=1,[i,ua(e,0,n)]}},37:{n:"PtgArea",f:function(e,t,n){return[(96&e[e.l++])>>5,la(e,2<=n.biff&&n.biff,n)]}},38:{n:"PtgMemArea",f:function(e,t,n){var i=e.read_shift(1)>>>5&3;return e.l+=n&&2==n.biff?3:4,[i,e.read_shift(n&&2==n.biff?1:2)]}},39:{n:"PtgMemErr",f:hi},40:{n:"PtgMemNoMem",f:hi},41:{n:"PtgMemFunc",f:function(e,t,n){return[e.read_shift(1)>>>5&3,e.read_shift(n&&2==n.biff?1:2)]}},42:{n:"PtgRefErr",f:function(e,t,n){var i=e.read_shift(1)>>>5&3;return e.l+=4,n.biff<8&&e.l--,12==n.biff&&(e.l+=2),[i]}},43:{n:"PtgAreaErr",f:function(e,t,n){var i=(96&e[e.l++])>>5;return e.l+=n&&8<n.biff?12:n.biff<8?6:8,[i]}},44:{n:"PtgRefN",f:function(e,t,n){var i=(96&e[e.l])>>5;return e.l+=1,[i,function(e,t){var n,i;if(2<=(t=t&&t.biff?t.biff:8)&&t<=5)return a=(s=e).read_shift(2),s=s.read_shift(1),n=(32768&a)>>15,i=(16384&a)>>14,a&=16383,1==n&&8192<=a&&(a-=16384),1==i&&128<=s&&(s-=256),{r:a,c:s,cRel:i,rRel:n};var o=e.read_shift(12<=t?4:2),r=e.read_shift(2),a=(16384&r)>>14,s=(32768&r)>>15;if(r&=16383,1==s)for(;524287<o;)o-=1048576;if(1==a)for(;8191<r;)r-=16384;return{r:o,c:r,cRel:a,rRel:s}}(e,n)]}},45:{n:"PtgAreaN",f:function(e,t,n){var i,o=(96&e[e.l++])>>5;return e=e,[o,(o=n).biff<8?ca(e):(n=e.read_shift(12==o.biff?4:2),o=e.read_shift(12==o.biff?4:2),i=sa(e,2),e=sa(e,2),{s:{r:n,c:i[0],cRel:i[1],rRel:i[2]},e:{r:o,c:e[0],cRel:e[1],rRel:e[2]}})]}},46:{n:"PtgMemAreaN",f:function(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}},47:{n:"PtgMemNoMemN",f:function(e){return[e.read_shift(1)>>>5&3,e.read_shift(2)]}},57:{n:"PtgNameX",f:function(e,t,n){var i,o,r;return 5==n.biff?(i=(n=e).read_shift(1)>>>5&3,o=n.read_shift(2,"i"),n.l+=8,r=n.read_shift(2),n.l+=12,[i,o,r]):[e.read_shift(1)>>>5&3,e.read_shift(2),e.read_shift(4)]}},58:{n:"PtgRef3d",f:function(e,t,n){var i=(96&e[e.l])>>5,o=(e.l+=1,e.read_shift(2));return n&&5==n.biff&&(e.l+=12),[i,o,ua(e,0,n)]}},59:{n:"PtgArea3d",f:function(e,t,n){var i=(96&e[e.l++])>>5,o=e.read_shift(2,"i");if(n)switch(n.biff){case 5:e.l+=12}return[i,o,la(e,0,n)]}},60:{n:"PtgRefErr3d",f:function(e,t,n){var i=(96&e[e.l++])>>5,o=e.read_shift(2),r=4;if(n)switch(n.biff){case 5:r=15;break;case 12:r=6}return e.l+=r,[i,o]}},61:{n:"PtgAreaErr3d",f:function(e,t,n){var i=(96&e[e.l++])>>5,o=e.read_shift(2),r=8;if(n)switch(n.biff){case 5:e.l+=12,r=6;break;case 12:r=12}return e.l+=r,[i,o]}},255:{}},ya={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},wa={1:{n:"PtgElfLel",f:ga},2:{n:"PtgElfRw",f:fa},3:{n:"PtgElfCol",f:fa},6:{n:"PtgElfRwV",f:fa},7:{n:"PtgElfColV",f:fa},10:{n:"PtgElfRadical",f:fa},11:{n:"PtgElfRadicalS",f:ma},13:{n:"PtgElfColS",f:ma},15:{n:"PtgElfColSV",f:ma},16:{n:"PtgElfRadicalLel",f:ga},25:{n:"PtgList",f:function(e){e.l+=2;var t=e.read_shift(2),n=e.read_shift(2),i=e.read_shift(4),o=e.read_shift(2);e=e.read_shift(2);return{ixti:t,coltype:3&n,rt:va[n>>2&31],idx:i,c:o,C:e}}},29:{n:"PtgSxName",f:function(e){return e.l+=2,[e.read_shift(4)]}},255:{}},xa={0:{n:"PtgAttrNoop",f:function(e){return e.l+=4,[0,0]}},1:{n:"PtgAttrSemi",f:function(e,t,n){var i=255&e[e.l+1]?1:0;return e.l+=n&&2==n.biff?3:4,[i]}},2:{n:"PtgAttrIf",f:function(e,t,n){var i=255&e[e.l+1]?1:0;return e.l+=2,[i,e.read_shift(n&&2==n.biff?1:2)]}},4:{n:"PtgAttrChoose",f:function(e,t,n){e.l+=2;for(var i=e.read_shift(n&&2==n.biff?1:2),o=[],r=0;r<=i;++r)o.push(e.read_shift(n&&2==n.biff?1:2));return o}},8:{n:"PtgAttrGoto",f:function(e,t,n){var i=255&e[e.l+1]?1:0;return e.l+=2,[i,e.read_shift(n&&2==n.biff?1:2)]}},16:{n:"PtgAttrSum",f:function(e,t,n){e.l+=n&&2==n.biff?3:4}},32:{n:"PtgAttrBaxcel",f:da},33:{n:"PtgAttrBaxcel",f:da},64:{n:"PtgAttrSpace",f:function(e){return e.read_shift(2),ha(e)}},65:{n:"PtgAttrSpaceSemi",f:function(e){return e.read_shift(2),ha(e)}},128:{n:"PtgAttrIfError",f:function(e){var t=255&e[e.l+1]?1:0;return e.l+=2,[t,e.read_shift(2)]}},255:{}};function _a(e,t,n,i){if(i.biff<8)return hi(e,t);for(var o=e.l+t,r=[],a=0;a!==n.length;++a)switch(n[a][0]){case"PtgArray":n[a][1]=pa(e,0,i),r.push(n[a][1]);break;case"PtgMemArea":n[a][2]=function(e,t){for(var n=e.read_shift(12==t.biff?4:2),i=[],o=0;o!=n;++o)i.push((12==t.biff?Vi:Io)(e,8));return i}(e,(n[a][1],i)),r.push(n[a][2]);break;case"PtgExp":i&&12==i.biff&&(n[a][1][1]=e.read_shift(4),r.push(n[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+n[a][0]}return 0!=(t=o-e.l)&&r.push(hi(e,t)),r}function ka(e,t,n){for(var i,o,r=e.l+t,a=[];r!=e.l;)t=r-e.l,o=e[e.l],i=ba[o]||ba[ya[o]],(i=24!==o&&25!==o?i:(24===o?wa:xa)[e[e.l+1]])&&i.f?a.push([i.n,i.f(e,t,n)]):hi(e,t);return a}var Ea={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function Ca(e,t,n){if(!e)return"SH33TJSERR0";if(8<n.biff&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var i=e.XTI[t];if(n.biff<8)return 1e4<t&&(t-=65536),0==(t=t<0?-t:t)?"":e.XTI[t-1];if(!i)return"SH33TJSERR1";var o="";if(8<n.biff)switch(e[i[0]][0]){case 357:return o=-1==i[1]?"#REF":e.SheetNames[i[1]],i[1]==i[2]?o:o+":"+e.SheetNames[i[2]];case 358:return null!=n.SID?e.SheetNames[n.SID]:"SH33TJSSAME"+e[i[0]][0];default:return"SH33TJSSRC"+e[i[0]][0]}switch(e[i[0]][0][0]){case 1025:return o=-1==i[1]?"#REF":e.SheetNames[i[1]]||"SH33TJSERR3",i[1]==i[2]?o:o+":"+e.SheetNames[i[2]];case 14849:return e[i[0]].slice(1).map((function(e){return e.Name})).join(";;");default:return e[i[0]][0][3]?(o=-1==i[1]?"#REF":e[i[0]][0][3][i[1]]||"SH33TJSERR4",i[1]==i[2]?o:o+":"+e[i[0]][0][3][i[2]]):"SH33TJSERR2"}}function Sa(e,t,n){if("#REF"==(e=Ca(e,t,n)))return e;if(t=e,e=n,t||e&&e.biff<=5&&2<=e.biff)return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(t)?"'"+t+"'":t;throw new Error("empty sheet name")}function Ta(e,t,n,i,o){var r,a,s=o&&o.biff||8,l={s:{c:0,r:0},e:{c:0,r:0}},c=[],u=0,d=0,h="";if(!e[0]||!e[0][0])return"";for(var p=-1,f="",m=0,g=e[0].length;m<g;++m){switch((O=e[0][m])[0]){case"PtgUminus":c.push("-"+c.pop());break;case"PtgUplus":c.push("+"+c.pop());break;case"PtgPercent":c.push(c.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(A=c.pop(),r=c.pop(),0<=p){switch(e[0][p][1][0]){case 0:f=qt(" ",e[0][p][1][1]);break;case 1:f=qt("\r",e[0][p][1][1]);break;default:if(f="",o.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}r+=f,p=-1}c.push(r+Ea[O[0]]+A);break;case"PtgIsect":A=c.pop(),r=c.pop(),c.push(r+" "+A);break;case"PtgUnion":A=c.pop(),r=c.pop(),c.push(r+","+A);break;case"PtgRange":A=c.pop(),r=c.pop(),c.push(r+":"+A);break;case"PtgAttrChoose":case"PtgAttrGoto":case"PtgAttrIf":case"PtgAttrIfError":break;case"PtgRef":v=gi(O[1][1],l,o),c.push(bi(v,s));break;case"PtgRefN":v=n?gi(O[1][1],n,o):O[1][1],c.push(bi(v,s));break;case"PtgRef3d":u=O[1][1];var v=gi(O[1][2],l,o);h=Sa(i,u,o),c.push(h+"!"+bi(v,s));break;case"PtgFunc":case"PtgFuncVar":var b=O[1][0],y=O[1][1],w=(b=b||0,0==(b&=127)?[]:c.slice(-b));c.length-=b,"User"===y&&(y=w.shift()),c.push(y+"("+w.join(",")+")");break;case"PtgBool":c.push(O[1]?"TRUE":"FALSE");break;case"PtgInt":c.push(O[1]);break;case"PtgNum":c.push(String(O[1]));break;case"PtgStr":c.push('"'+O[1].replace(/"/g,'""')+'"');break;case"PtgErr":c.push(O[1]);break;case"PtgAreaN":a=vi(O[1][1],n?{s:n}:l,o),c.push(yi(a,o));break;case"PtgArea":a=vi(O[1][1],l,o),c.push(yi(a,o));break;case"PtgArea3d":u=O[1][1],a=O[1][2],h=Sa(i,u,o),c.push(h+"!"+yi(a,o));break;case"PtgAttrSum":c.push("SUM("+c.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":d=O[1][2],(y=(b=(i.names||[])[d-1]||(i[0]||[])[d])?b.Name:"SH33TJSNAME"+String(d))&&"_xlfn."==y.slice(0,6)&&!o.xlfn&&(y=y.slice(6)),c.push(y);break;case"PtgNameX":var x,_;w=O[1][1];d=O[1][2],o.biff<=5?(i[w=w<0?-w:w]&&(x=i[w][d]),c.push((x=x||{Name:"SH33TJSERRY"}).Name)):(_="",14849!=((i[w]||[])[0]||[])[0]&&(1025==((i[w]||[])[0]||[])[0]?i[w][d]&&0<i[w][d].itab&&(_=i.SheetNames[i[w][d].itab-1]+"!"):_=i.SheetNames[d-1]+"!"),i[w]&&i[w][d]?_+=i[w][d].Name:i[0]&&i[0][d]?_+=i[0][d].Name:(S=(Ca(i,w,o)||"").split(";;"))[d-1]?_=S[d-1]:_+="SH33TJSERRX",c.push(_));break;case"PtgParen":var k="(",E=")";if(0<=p){switch(f="",e[0][p][1][0]){case 2:k=qt(" ",e[0][p][1][1])+k;break;case 3:k=qt("\r",e[0][p][1][1])+k;break;case 4:E=qt(" ",e[0][p][1][1])+E;break;case 5:E=qt("\r",e[0][p][1][1])+E;break;default:if(o.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}p=-1}c.push(k+c.pop()+E);break;case"PtgRefErr":case"PtgRefErr3d":c.push("#REF!");break;case"PtgExp":v={c:O[1][1],r:O[1][0]};var C={c:n.c,r:n.r};if(i.sharedf[Ci(v)]){var S=i.sharedf[Ci(v)];c.push(Ta(S,0,C,i,o))}else{for(var T=!1,A=0;A!=i.arrayf.length;++A)if(r=i.arrayf[A],!(v.c<r[0].s.c||v.c>r[0].e.c||v.r<r[0].s.r||v.r>r[0].e.r)){c.push(Ta(r[1],0,C,i,o)),T=!0;break}T||c.push(O[1])}break;case"PtgArray":c.push("{"+function(e){for(var t=[],n=0;n<e.length;++n){for(var i=e[n],o=[],r=0;r<i.length;++r){var a=i[r];a?2===a[0]?o.push('"'+a[1].replace(/"/g,'""')+'"'):o.push(a[1]):o.push("")}t.push(o.join(","))}return t.join(";")}(O[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":p=m;break;case"PtgTbl":case"PtgMemErr":break;case"PtgMissArg":c.push("");break;case"PtgAreaErr":case"PtgAreaErr3d":c.push("#REF!");break;case"PtgList":c.push("Table"+O[1].idx+"[#"+O[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":case"PtgMemFunc":case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");default:throw new Error("Unrecognized Formula Token: "+String(O))}if(3!=o.biff&&0<=p&&-1==["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"].indexOf(e[0][m][0])){var O,M=!0;switch((O=e[0][p])[1][0]){case 4:M=!1;case 0:f=qt(" ",O[1][1]);break;case 5:M=!1;case 1:f=qt("\r",O[1][1]);break;default:if(f="",o.WTF)throw new Error("Unexpected PtgAttrSpaceType "+O[1][0])}c.push((M?f:"")+c.pop()+(M?"":f)),p=-1}}if(1<c.length&&o.WTF)throw new Error("bad formula stack");return c[0]}function Aa(e,t,n){t=e.l+t;var i,o,r,a,s,l=Ro(e),c=(2==n.biff&&++e.l,function(e){var t;if(65535!==ni(e,e.l+6))return[Wi(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=1===e[e.l+2],e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}(e)),u=e.read_shift(1);2!=n.biff&&(e.read_shift(1),5<=n.biff)&&e.read_shift(4),e=t-(t=e).l,n=n,r=t.l+e,a=2==n.biff?1:2,e=65535==(s=t.read_shift(a))?[[],hi(t,e-2)]:(o=ka(t,s,n),e!==s+a&&(i=_a(t,e-s-a,o,n)),t.l=r,[o,i]);return{cell:l,val:c[0],formula:e,shared:u>>3&1,tt:c[1]}}function Oa(e,t,n){var i=e.read_shift(4),o=(i=ka(e,i,n),e.read_shift(4));return[i,0<o?_a(e,o,i,n):null]}var Ma=Oa,Da=Oa,$a=Oa,Pa=Oa,Ra={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},La={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},Ia={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function Na(e){return(e=(e=(e=(e=61==(e="of:"==e.slice(0,3)?e.slice(3):e).charCodeAt(0)&&61==(e=e.slice(1)).charCodeAt(0)?e.slice(1):e).replace(/COM\.MICROSOFT\./g,"")).replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,(function(e,t){return t.replace(/\./g,"")}))).replace(/\[.(#[A-Z]*[?!])\]/g,"$1")).replace(/[;~]/g,",").replace(/\|/g,";")}function Fa(e){return[(e=e.split(":"))[0].split(".")[0],e[0].split(".")[1]+(1<e.length?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}var ja={},Ba={};function qa(e,t){e&&(t="xlml"==t?[1,1,1,1,.5,.5]:[.7,.7,.75,.75,.3,.3],null==e.left&&(e.left=t[0]),null==e.right&&(e.right=t[1]),null==e.top&&(e.top=t[2]),null==e.bottom&&(e.bottom=t[3]),null==e.header&&(e.header=t[4]),null==e.footer)&&(e.footer=t[5])}function za(e,t,n,i,o,r){try{i.cellNF&&(e.z=Ke[t])}catch(e){if(i.WTF)throw e}if("z"!==e.t||i.cellStyles){if("d"===e.t&&"string"==typeof e.v&&(e.v=Ft(e.v)),(!i||!1!==i.cellText)&&"z"!==e.t)try{if(null==Ke[t]&&kt(Ct[t]||"General",t),"e"===e.t)e.w=e.w||Zi[e.v];else if(0===t)if("n"===e.t)(0|e.v)===e.v?e.w=e.v.toString(10):e.w=ot(e.v);else if("d"===e.t){var a=$t(e.v);e.w=(0|a)===a?a.toString(10):ot(a)}else{if(void 0===e.v)return;e.w=rt(e.v,Ba)}else"d"===e.t?e.w=_t(t,$t(e.v),Ba):e.w=_t(t,e.v,Ba)}catch(e){if(i.WTF)throw e}if(i.cellStyles&&null!=n)try{e.s=r.Fills[n],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=Tr(o.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),i.WTF)&&(e.s.fgColor.raw_rgb=o.themeElements.clrScheme[e.s.fgColor.theme].rgb),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=Tr(o.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),i.WTF)&&(e.s.bgColor.raw_rgb=o.themeElements.clrScheme[e.s.bgColor.theme].rgb)}catch(e){if(i.WTF&&r.Fills)throw e}}}var Va=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,Wa=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,Ha=/<(?:\w:)?hyperlink [^>]*>/gm,Ua=/"(\w*:\w*)"/,Ga=/<(?:\w:)?col\b[^>]*[\/]?>/g,Ka=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,Ya=/<(?:\w:)?pageMargins[^>]*\/>/g,Xa=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,Ja=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,Za=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function Qa(e,t,n,i){e=sn(e),n.Sheets[i]||(n.Sheets[i]={}),e.codeName&&(n.Sheets[i].CodeName=dn(wn(e.codeName)))}var es=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/,ts=function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,n=/r=["']([^"']*)["']/,i=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,o=/ref=["']([^"']*)["']/,r=_n("v"),a=_n("f");return function(s,l,c,u,d,h){for(var p,f,m,g,v=0,b="",y=[],w=[],x=0,_=0,k="",E=0,C=0,S=0,T=0,A=Array.isArray(h.CellXf),O=[],M=[],D=Array.isArray(l),$=[],P={},R=!1,L=!!c.sheetStubs,I=s.split(t),N=0,F=I.length;N!=F;++N){var j=(b=I[N].trim()).length;if(0!==j){var B=0;e:for(v=0;v<j;++v)switch(b[v]){case">":if("/"!=b[v-1]){++v;break e}if(c&&c.cellStyles){if(E=null!=(m=sn(b.slice(B,v),!0)).r?parseInt(m.r,10):E+1,C=-1,c.sheetRows&&c.sheetRows<E)continue;R=!(P={}),m.ht&&(R=!0,P.hpt=parseFloat(m.ht),P.hpx=Ir(P.hpt)),"1"==m.hidden&&(P.hidden=R=!0),null!=m.outlineLevel&&(R=!0,P.level=+m.outlineLevel),R&&($[E-1]=P)}break;case"<":B=v}if(v<=B)break;if(E=null!=(m=sn(b.slice(B,v),!0)).r?parseInt(m.r,10):E+1,C=-1,!(c.sheetRows&&c.sheetRows<E)){u.s.r>E-1&&(u.s.r=E-1),u.e.r<E-1&&(u.e.r=E-1),c&&c.cellStyles&&(R=!(P={}),m.ht&&(R=!0,P.hpt=parseFloat(m.ht),P.hpx=Ir(P.hpt)),"1"==m.hidden&&(P.hidden=R=!0),null!=m.outlineLevel&&(R=!0,P.level=+m.outlineLevel),R)&&($[E-1]=P);y=b.slice(v).split(e);for(var q=0;q!=y.length&&"<"==y[q].trim().charAt(0);++q);for(y=y.slice(q),v=0;v!=y.length;++v)if(0!==(b=y[v].trim()).length){if(w=b.match(n),x=v,b="<c "+("<"==b.slice(_=0,1)?">":"")+b,null!=w&&2===w.length){for(k=w[1],_=x=0;_!=k.length&&!((p=k.charCodeAt(_)-64)<1||26<p);++_)x=26*x+p;C=--x}else++C;for(_=0;_!=b.length&&62!==b.charCodeAt(_);++_);if(++_,(m=sn(b.slice(0,_),!0)).r||(m.r=Ci({r:E-1,c:C})),f={t:""},null!=(w=(k=b.slice(_)).match(r))&&""!==w[1]&&(f.v=dn(w[1])),c.cellFormula){null!=(w=k.match(a))&&""!==w[1]?(f.f=dn(wn(w[1])).replace(/\r\n/g,"\n"),c.xlfn||(f.f=ra(f.f)),-1<w[0].indexOf('t="array"')?(f.F=(k.match(o)||[])[1],-1<f.F.indexOf(":")&&O.push([Ai(f.F),f.F])):-1<w[0].indexOf('t="shared"')&&(z=sn(w[0]),V=dn(wn(w[1])),c.xlfn||(V=ra(V)),M[parseInt(z.si,10)]=[z,V,m.r])):(w=k.match(/<f[^>]*\/>/))&&M[(z=sn(w[0])).si]&&(f.f=(V=M[z.si][1],H=M[z.si][2],G=m.r,H=Si(H).s,oa(V,{r:(G=Ei(G)).r-H.r,c:G.c-H.c})));var z,V,W=Ei(m.r);for(_=0;_<O.length;++_)W.r>=O[_][0].s.r&&W.r<=O[_][0].e.r&&W.c>=O[_][0].s.c&&W.c<=O[_][0].e.c&&(f.F=O[_][1])}if(null==m.t&&void 0===f.v)if(f.f||f.F)f.v=0,f.t="n";else{if(!L)continue;f.t="z"}else f.t=m.t||"n";switch(u.s.c>C&&(u.s.c=C),u.e.c<C&&(u.e.c=C),f.t){case"n":if(""==f.v||null==f.v){if(!L)continue;f.t="z"}else f.v=parseFloat(f.v);break;case"s":if(void 0===f.v){if(!L)continue;f.t="z"}else g=ja[parseInt(f.v,10)],f.v=g.t,f.r=g.r,c.cellHTML&&(f.h=g.h);break;case"str":f.t="s",f.v=null!=f.v?wn(f.v):"",c.cellHTML&&(f.h=fn(f.v));break;case"inlineStr":w=k.match(i),f.t="s",null!=w&&(g=gr(w[1]))?(f.v=g.t,c.cellHTML&&(f.h=g.h)):f.v="";break;case"b":f.v=gn(f.v);break;case"d":c.cellDates?f.v=Ft(f.v,1):(f.v=$t(Ft(f.v,1)),f.t="n");break;case"e":c&&!1===c.cellText||(f.w=f.v),f.v=Qi[f.v]}var H,U,G;S=T=0;A&&void 0!==m.s&&null!=(G=h.CellXf[m.s])&&(null!=G.numFmtId&&(S=G.numFmtId),c.cellStyles)&&null!=G.fillId&&(T=G.fillId),za(f,S,T,c,d,h),c.cellDates&&A&&"n"==f.t&&yt(Ke[S])&&(f.t="d",f.v=Lt(f.v)),m.cm&&c.xlmeta&&(H=(c.xlmeta.Cell||[])[+m.cm-1])&&"XLDAPR"==H.type&&(f.D=!0),D?(l[(U=Ei(m.r)).r]||(l[U.r]=[]),l[U.r][U.c]=f):l[m.r]=f}}}}0<$.length&&(l["!rows"]=$)}}();function ns(e){return[Ii(e),Wi(e),"n"]}var is=["left","right","top","bottom","header","footer"];var os=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],rs=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],as=[],ss=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function ls(e,t){for(var n=0;n!=e.length;++n)for(var i=e[n],o=0;o!=t.length;++o){var r=t[o];if(null==i[r[0]])i[r[0]]=r[1];else switch(r[2]){case"bool":"string"==typeof i[r[0]]&&(i[r[0]]=gn(i[r[0]]));break;case"int":"string"==typeof i[r[0]]&&(i[r[0]]=parseInt(i[r[0]],10))}}}function cs(e,t){for(var n=0;n!=t.length;++n){var i=t[n];if(null==e[i[0]])e[i[0]]=i[1];else switch(i[2]){case"bool":"string"==typeof e[i[0]]&&(e[i[0]]=gn(e[i[0]]));break;case"int":"string"==typeof e[i[0]]&&(e[i[0]]=parseInt(e[i[0]],10))}}}function us(e){cs(e.WBProps,os),cs(e.CalcPr,ss),ls(e.WBView,rs),ls(e.Sheets,as),Ba.date1904=gn(e.WBProps.date1904)}var ds="][*?/\\".split("");var hs=/<\w+:workbook/;function ps(e,t){var n={};return e.read_shift(4),n.ArchID=e.read_shift(4),e.l+=t-8,n}function fs(e,t,n,i,o,r,a,s){if(".bin"!==t.slice(-4))return function(e,t,n,i,o,r,a){if(!e)return e;i=i||{"!id":{}};var s,l,c=t.dense?[]:{},u={s:{r:2e6,c:2e6},e:{r:0,c:0}},d="",h="",p=e.match(Wa),f=((e=(p?(d=e.slice(0,p.index),h=e.slice(p.index+p[0].length)):d=h=e,d.match(Xa)))?Qa(e[0],0,o,n):(e=d.match(Ja))&&(s=e[0],e[1],e=c,l=o,n=n,Qa(s.slice(0,s.indexOf(">")),0,l,n)),(d.match(/<(?:\w*:)?dimension/)||{index:-1}).index);if((n=(0<f&&(s=d.slice(f,f+50).match(Ua))&&(e=c,(l=Ai(l=s[1])).s.r<=l.e.r)&&l.s.c<=l.e.c&&0<=l.s.r&&0<=l.s.c&&(e["!ref"]=Ti(l)),d.match(Za)))&&n[1]){e=n[1];var m=o;m.Views||(m.Views=[{}]),(e.match(es)||[]).forEach((function(e,t){e=sn(e),m.Views[t]||(m.Views[t]={}),+e.zoomScale&&(m.Views[t].zoom=+e.zoomScale),gn(e.rightToLeft)&&(m.Views[t].RTL=!0)}))}if(n=[],t.cellStyles&&(o=d.match(Ga)))for(var g=n,v=o,b=!1,y=0;y!=v.length;++y){var w=sn(v[y],!0),x=(w.hidden&&(w.hidden=gn(w.hidden)),parseInt(w.min,10)-1),_=parseInt(w.max,10)-1;for(w.outlineLevel&&(w.level=+w.outlineLevel||0),delete w.min,delete w.max,w.width=+w.width,!b&&w.width&&(b=!0,Pr(w.width)),Rr(w);x<=_;)g[x++]=Bt(w)}p&&ts(p[1],c,t,u,r,a);var k,E,C=((e=h.match(Ka))&&(c["!autofilter"]={ref:(e[0].match(/ref="([^"]*)"/)||[])[1]}),[]),S=h.match(Va);if(S)for(f=0;f!=S.length;++f)C[f]=Ai(S[f].slice(S[f].indexOf('"')+1));return(o=((d=h.match(Ha))&&function(e,t,n){for(var i=Array.isArray(e),o=0;o!=t.length;++o){var r=sn(wn(t[o]),!0);if(!r.ref)return;for(var a=((n||{})["!id"]||[])[r.id],s=(a?(r.Target=a.Target,r.location&&(r.Target+="#"+dn(r.location))):(r.Target="#"+dn(r.location),a={Target:r.Target,TargetMode:"Internal"}),r.Rel=a,r.tooltip&&(r.Tooltip=r.tooltip,delete r.tooltip),Ai(r.ref)),l=s.s.r;l<=s.e.r;++l)for(var c=s.s.c;c<=s.e.c;++c){var u=Ci({c:c,r:l});i?(e[l]||(e[l]=[]),e[l][c]||(e[l][c]={t:"z",v:void 0}),e[l][c].l=r):(e[u]||(e[u]={t:"z",v:void 0}),e[u].l=r)}}}(c,d,i),h.match(Ya)))&&(c["!margins"]=(k=sn(o[0]),E={},["left","right","top","bottom","header","footer"].forEach((function(e){k[e]&&(E[e]=parseFloat(k[e]))})),E)),!c["!ref"]&&u.e.c>=u.s.c&&u.e.r>=u.s.r&&(c["!ref"]=Ti(u)),0<t.sheetRows&&c["!ref"]&&(p=Ai(c["!ref"]),t.sheetRows<=+p.e.r)&&(p.e.r=t.sheetRows-1,p.e.r>u.e.r&&(p.e.r=u.e.r),p.e.r<p.s.r&&(p.s.r=p.e.r),p.e.c>u.e.c&&(p.e.c=u.e.c),p.e.c<p.s.c&&(p.s.c=p.e.c),c["!fullref"]=c["!ref"],c["!ref"]=Ti(p)),0<n.length&&(c["!cols"]=n),0<C.length&&(c["!merges"]=C),c}(e,i,n,o,r,a,s);var l=n,c=o,u=r,d=a,h=s;if(!(t=e))return t;var p,f,m,g,v,b,y,w,x,_,k=(e=i)||{},E=(c=c||{"!id":{}},k.dense?[]:{}),C={s:{r:2e6,c:2e6},e:{r:0,c:0}},S=[],T=!1,A=!1,O=[],M=(k.biff=12,k["!row"]=0),D=!1,$=[],P={},R=k.supbooks||u.supbooks||[[]];if(R.sharedf=P,R.arrayf=$,R.SheetNames=u.SheetNames||u.Sheets.map((function(e){return e.name})),!k.supbooks&&(k.supbooks=R,u.Names))for(var L=0;L<u.Names.length;++L)R[0][L+1]=u.Names[L];var I,N=[],F=[],j=!1;return As[16]={n:"BrtShortReal",f:ns},fi(t,(function(e,t,n){if(!A)switch(n){case 148:p=e;break;case 0:f=e,k.sheetRows&&k.sheetRows<=f.r&&(A=!0),x=xi(v=f.r),k["!row"]=f.r,(e.hidden||e.hpt||null!=e.level)&&(e.hpt&&(e.hpx=Ir(e.hpt)),F[e.r]=e);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(m={t:e[2]},e[2]){case"n":m.v=e[1];break;case"s":w=ja[e[1]],m.v=w.t,m.r=w.r;break;case"b":m.v=!!e[1];break;case"e":m.v=e[1],!1!==k.cellText&&(m.w=Zi[m.v]);break;case"str":m.t="s",m.v=e[1];break;case"is":m.t="s",m.v=e[1].t}if((g=h.CellXf[e[0].iStyleRef])&&za(m,g.numFmtId,null,k,d,h),b=-1==e[0].c?b+1:e[0].c,k.dense?(E[v]||(E[v]=[]),E[v][b]=m):E[ki(b)+x]=m,k.cellFormula){for(D=!1,M=0;M<$.length;++M){var i=$[M];f.r>=i[0].s.r&&f.r<=i[0].e.r&&b>=i[0].s.c&&b<=i[0].e.c&&(m.F=Ti(i[0]),D=!0)}!D&&3<e.length&&(m.f=e[3])}C.s.r>f.r&&(C.s.r=f.r),C.s.c>b&&(C.s.c=b),C.e.r<f.r&&(C.e.r=f.r),C.e.c<b&&(C.e.c=b),k.cellDates&&g&&"n"==m.t&&yt(Ke[g.numFmtId])&&(o=Ze(m.v))&&(m.t="d",m.v=new Date(o.y,o.m-1,o.d,o.H,o.M,o.S,o.u)),I&&("XLDAPR"==I.type&&(m.D=!0),I=void 0);break;case 1:case 12:k.sheetStubs&&!T&&(m={t:"z",v:void 0},b=-1==e[0].c?b+1:e[0].c,k.dense?(E[v]||(E[v]=[]),E[v][b]=m):E[ki(b)+x]=m,C.s.r>f.r&&(C.s.r=f.r),C.s.c>b&&(C.s.c=b),C.e.r<f.r&&(C.e.r=f.r),C.e.c<b&&(C.e.c=b),I&&("XLDAPR"==I.type&&(m.D=!0),I=void 0));break;case 176:O.push(e);break;case 49:I=((k.xlmeta||{}).Cell||[])[e-1];break;case 494:var o=c["!id"][e.relId];for(o?(e.Target=o.Target,e.loc&&(e.Target+="#"+e.loc),e.Rel=o):""==e.relId&&(e.Target="#"+e.loc),v=e.rfx.s.r;v<=e.rfx.e.r;++v)for(b=e.rfx.s.c;b<=e.rfx.e.c;++b)k.dense?(E[v]||(E[v]=[]),E[v][b]||(E[v][b]={t:"z",v:void 0}),E[v][b].l=e):(y=Ci({c:b,r:v}),E[y]||(E[y]={t:"z",v:void 0}),E[y].l=e);break;case 426:k.cellFormula&&($.push(e),(_=k.dense?E[v][b]:E[ki(b)+x]).f=Ta(e[1],0,{r:f.r,c:b},R,k),_.F=Ti(e[0]));break;case 427:k.cellFormula&&(P[Ci(e[0].s)]=e[1],(_=k.dense?E[v][b]:E[ki(b)+x]).f=Ta(e[1],0,{r:f.r,c:b},R,k));break;case 60:if(k.cellStyles)for(;e.e>=e.s;)N[e.e--]={width:e.w/256,hidden:!!(1&e.flags),level:e.level},j||(j=!0,Pr(e.w/256)),Rr(N[e.e+1]);break;case 161:E["!autofilter"]={ref:Ti(e)};break;case 476:E["!margins"]=e;break;case 147:u.Sheets[l]||(u.Sheets[l]={}),e.name&&(u.Sheets[l].CodeName=e.name),(e.above||e.left)&&(E["!outline"]={above:e.above,left:e.left});break;case 137:u.Views||(u.Views=[{}]),u.Views[0]||(u.Views[0]={}),e.RTL&&(u.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:T=!0;break;case 36:T=!1;break;case 37:S.push(n),T=!0;break;case 38:S.pop(),T=!1;break;default:if(!t.T&&(!T||k.WTF))throw new Error("Unexpected record 0x"+n.toString(16))}}),k),delete k.supbooks,delete k["!row"],!E["!ref"]&&(C.s.r<2e6||p&&(0<p.e.r||0<p.e.c||0<p.s.r||0<p.s.c))&&(E["!ref"]=Ti(p||C)),k.sheetRows&&E["!ref"]&&(e=Ai(E["!ref"]),k.sheetRows<=+e.e.r)&&(e.e.r=k.sheetRows-1,e.e.r>C.e.r&&(e.e.r=C.e.r),e.e.r<e.s.r&&(e.s.r=e.e.r),e.e.c>C.e.c&&(e.e.c=C.e.c),e.e.c<e.s.c&&(e.s.c=e.e.c),E["!fullref"]=E["!ref"],E["!ref"]=Ti(e)),0<O.length&&(E["!merges"]=O),0<N.length&&(E["!cols"]=N),0<F.length&&(E["!rows"]=F),E}var ms,gs=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,vs=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function bs(e,t){var n=e.split(/\s+/),i=[];if(t||(i[0]=n[0]),1!==n.length){var o,r,a,s=e.match(gs);if(s)for(a=0;a!=s.length;++a)-1===(r=(o=s[a].match(vs))[1].indexOf(":"))?i[o[1]]=o[2].slice(1,o[2].length-1):i["xmlns:"===o[1].slice(0,6)?"xmlns"+o[1].slice(6):o[1].slice(r+1)]=o[2].slice(1,o[2].length-1)}return i}function ys(e,t,n){if("z"!==e.t){if(!n||!1!==n.cellText)try{"e"===e.t?e.w=e.w||Zi[e.v]:"General"===t?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=ot(e.v):e.w=rt(e.v):e.w=(i=t||"General",o=e.v,"General"===(i=ms[i]||dn(i))?rt(o):_t(i,o))}catch(e){if(n.WTF)throw e}var i,o;try{var r,a=ms[t]||t||"General";n.cellNF&&(e.z=a),n.cellDates&&"n"==e.t&&yt(a)&&(r=Ze(e.v))&&(e.t="d",e.v=new Date(r.y,r.m-1,r.d,r.H,r.M,r.S,r.u))}catch(e){if(n.WTF)throw e}}}function ws(e,t){var n,i=t||{},o=(Et(),ke(Mn(e))),r=(o="binary"!=i.type&&"array"!=i.type&&"base64"!=i.type?o:wn(o)).slice(0,1024).toLowerCase(),a=!1;if((1023&(r=r.replace(/".*?"/g,"")).indexOf(">"))>Math.min(1023&r.indexOf(","),1023&r.indexOf(";")))return(t=Bt(i)).type="string",cr.to_workbook(o,t);if(-1==r.indexOf("<?xml")&&["html","table","head","meta","script","style","div"].forEach((function(e){0<=r.indexOf("<"+e)&&(a=!0)})),a){var s,l=i;if((e=(e=o).match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi))&&0!=e.length)return 1==e.length?Mi(Ds(e[0],l),l):(s={SheetNames:[],Sheets:{}},e.forEach((function(e,t){gl(s,Ds(e,l),"Sheet"+(t+1))})),s);throw new Error("Invalid HTML: could not find <table>")}ms={"General Number":"General","General Date":Ke[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":Ke[15],"Short Date":Ke[14],"Long Time":Ke[19],"Medium Time":Ke[18],"Short Time":Ke[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:Ke[2],Standard:Ke[4],Percent:Ke[10],Scientific:Ke[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};for(var c,u,d,h,p,f,m,g=[],v={},b=[],y=i.dense?[]:{},w="",x={},_={},k=bs('<Data ss:Type="String">'),E=0,C=0,S=0,T={s:{r:2e6,c:2e6},e:{r:0,c:0}},A={},O={},M="",D=0,$=[],P={},R={},L=0,I=[],N=[],F={},j=[],B=!1,q=[],z=[],V={},W=0,H=0,U={Sheets:[],WBProps:{date1904:!1}},G={},K=(Dn.lastIndex=0,o=o.replace(/<!--([\s\S]*?)-->/gm,""),"");n=Dn.exec(o);)switch(n[3]=(K=n[3]).toLowerCase()){case"data":if("data"==K)if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else"/"!==n[0].charAt(n[0].length-2)&&g.push([n[3],!0]);else g[g.length-1][1]||("/"===n[1]?function(e,t,n,i,o,r,a,s,l,c){var u="General",d=i.StyleID,h={},p=(c=c||{},[]),f=0;for(void 0===(d=void 0===d&&s?s.StyleID:d)&&a&&(d=a.StyleID);void 0!==r[d]&&(r[d].nf&&(u=r[d].nf),r[d].Interior&&p.push(r[d].Interior),r[d].Parent);)d=r[d].Parent;switch(n.Type){case"Boolean":i.t="b",i.v=gn(e);break;case"String":i.t="s",i.r=mn(dn(e)),i.v=-1<e.indexOf("<")?dn(t||e).replace(/<.*?>/g,""):i.r;break;case"DateTime":"Z"!=e.slice(-1)&&(e+="Z"),i.v=(Ft(e)-new Date(Date.UTC(1899,11,30)))/864e5,i.v!=i.v?i.v=dn(e):i.v<60&&(i.v=i.v-1),u&&"General"!=u||(u="yyyy-mm-dd");case"Number":void 0===i.v&&(i.v=+e),i.t||(i.t="n");break;case"Error":i.t="e",i.v=Qi[e],!1!==c.cellText&&(i.w=e);break;default:""==e&&""==t?i.t="z":(i.t="s",i.v=mn(t||e))}if(ys(i,u,c),!1!==c.cellFormula)if(i.Formula)61==(s=dn(i.Formula)).charCodeAt(0)&&(s=s.slice(1)),i.f=ta(s,o),delete i.Formula,"RC"==i.ArrayRange?i.F=ta("RC:RC",o):i.ArrayRange&&(i.F=ta(i.ArrayRange,o),l.push([Ai(i.F),i.F]));else for(f=0;f<l.length;++f)o.r>=l[f][0].s.r&&o.r<=l[f][0].e.r&&o.c>=l[f][0].s.c&&o.c<=l[f][0].e.c&&(i.F=l[f][1]);c.cellStyles&&(p.forEach((function(e){!h.patternType&&e.patternType&&(h.patternType=e.patternType)})),i.s=h),void 0!==i.StyleID&&(i.ixfe=i.StyleID)}(o.slice(E,n.index),M,k,"comment"==g[g.length-1][0]?F:x,{c:C,r:S},A,j[C],_,q,i):(M="",k=bs(n[0]),E=n.index+n[0].length));break;case"cell":if("/"===n[1])if(0<N.length&&(x.c=N),(!i.sheetRows||i.sheetRows>S)&&void 0!==x.v&&(i.dense?(y[S]||(y[S]=[]),y[S][C]=x):y[ki(C)+xi(S)]=x),x.HRef&&(x.l={Target:dn(x.HRef)},x.HRefScreenTip&&(x.l.Tooltip=x.HRefScreenTip),delete x.HRef,delete x.HRefScreenTip),(x.MergeAcross||x.MergeDown)&&(W=C+(0|parseInt(x.MergeAcross,10)),H=S+(0|parseInt(x.MergeDown,10)),$.push({s:{c:C,r:S},e:{c:W,r:H}})),i.sheetStubs)if(x.MergeAcross||x.MergeDown){for(var Y=C;Y<=W;++Y)for(var X=S;X<=H;++X)(C<Y||S<X)&&(i.dense?(y[X]||(y[X]=[]),y[X][Y]={t:"z"}):y[ki(Y)+xi(X)]={t:"z"});C=W+1}else++C;else x.MergeAcross?C=W+1:++C;else(C=(x=function(e){var t={};if(1!==e.split(/\s+/).length){var n,i,o,r=e.match(gs);if(r)for(o=0;o!=r.length;++o)-1===(i=(n=r[o].match(vs))[1].indexOf(":"))?t[n[1]]=n[2].slice(1,n[2].length-1):t["xmlns:"===n[1].slice(0,6)?"xmlns"+n[1].slice(6):n[1].slice(i+1)]=n[2].slice(1,n[2].length-1)}return t}(n[0])).Index?+x.Index-1:C)<T.s.c&&(T.s.c=C),C>T.e.c&&(T.e.c=C),"/>"===n[0].slice(-2)&&++C,N=[];break;case"row":"/"===n[1]||"/>"===n[0].slice(-2)?(S<T.s.r&&(T.s.r=S),S>T.e.r&&(T.e.r=S),"/>"===n[0].slice(-2)&&(_=bs(n[0])).Index&&(S=+_.Index-1),C=0,++S):((_=bs(n[0])).Index&&(S=+_.Index-1),V={},"0"!=_.AutoFitHeight&&!_.Height||(V.hpx=parseInt(_.Height,10),V.hpt=Lr(V.hpx),z[S]=V),"1"==_.Hidden&&(V.hidden=!0,z[S]=V));break;case"worksheet":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"));b.push(w),T.s.r<=T.e.r&&T.s.c<=T.e.c&&(y["!ref"]=Ti(T),i.sheetRows)&&i.sheetRows<=T.e.r&&(y["!fullref"]=y["!ref"],T.e.r=i.sheetRows-1,y["!ref"]=Ti(T)),$.length&&(y["!merges"]=$),0<j.length&&(y["!cols"]=j),0<z.length&&(y["!rows"]=z),v[w]=y}else S=C=0,g.push([n[3],!(T={s:{r:2e6,c:2e6},e:{r:0,c:0}})]),c=bs(n[0]),w=dn(c.Name),y=i.dense?[]:{},$=[],q=[],z=[],U.Sheets.push(G={name:w,Hidden:0});break;case"table":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else{if("/>"==n[0].slice(-2))break;g.push([n[3],!1]),B=!(j=[])}break;case"style":"/"===n[1]?(p=A,f=O,(m=i).cellStyles&&f.Interior&&(m=f.Interior).Pattern&&(m.patternType=Nr[m.Pattern]||m.Pattern),p[f.ID]=f):O=bs(n[0]);break;case"numberformat":O.nf=dn(bs(n[0]).Format||"General"),ms[O.nf]&&(O.nf=ms[O.nf]);for(var J=0;392!=J&&Ke[J]!=O.nf;++J);if(392==J)for(J=57;392!=J;++J)if(null==Ke[J]){kt(O.nf,J);break}break;case"column":if("table"===g[g.length-1][0]){if((u=bs(n[0])).Hidden&&(u.hidden=!0,delete u.Hidden),u.Width&&(u.wpx=parseInt(u.Width,10)),!B&&10<u.wpx){B=!0,Ar=6;for(var Z=0;Z<j.length;++Z)j[Z]&&Rr(j[Z])}B&&Rr(u),j[u.Index-1||j.length]=u;for(var Q=0;Q<+u.Span;++Q)j[j.length]=Bt(u)}break;case"namedrange":"/"!==n[1]&&(U.Names||(U.Names=[]),p={Name:(m=sn(n[0])).Name,Ref:ta(m.RefersTo.slice(1),{r:0,c:0})},0<U.Sheets.length&&(p.Sheet=U.Sheets.length-1),U.Names.push(p));break;case"namedcell":case"b":case"i":case"u":case"s":case"em":case"h2":case"h3":case"sub":case"sup":case"span":case"alignment":case"borders":case"border":break;case"font":"/>"!==n[0].slice(-2)&&("/"===n[1]?M+=o.slice(D,n.index):D=n.index+n[0].length);break;case"interior":i.cellStyles&&(O.Interior=bs(n[0]));break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":"/>"!==n[0].slice(-2)&&("/"===n[1]?(f=P,d=K,h=o.slice(L,n.index),f[d=(co=co||Mt(ho))[d]||d]=h):L=n.index+n[0].length);break;case"paragraphs":break;case"styles":case"workbook":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else g.push([n[3],!1]);break;case"comment":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"));(d=F).t=d.v||"",d.t=d.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d.v=d.w=d.ixfe=void 0,N.push(F)}else g.push([n[3],!1]),F={a:(c=bs(n[0])).Author};break;case"autofilter":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else"/"!==n[0].charAt(n[0].length-2)&&(h=bs(n[0]),y["!autofilter"]={ref:ta(h.Range).replace(/\$/g,"")},g.push([n[3],!0]));break;case"name":break;case"datavalidation":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else"/"!==n[0].charAt(n[0].length-2)&&g.push([n[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if("/"===n[1]){if((c=g.pop())[0]!==n[3])throw new Error("Bad state: "+c.join("|"))}else"/"!==n[0].charAt(n[0].length-2)&&g.push([n[3],!0]);break;case"null":break;default:if(0==g.length&&"document"==n[3])return js(o,i);if(0==g.length&&"uof"==n[3])return js(o,i);var ee=!0;switch(g[g.length-1][0]){case"officedocumentsettings":switch(n[3]){case"allowpng":case"removepersonalinformation":case"downloadcomponents":case"locationofcomponents":case"colors":case"color":case"index":case"rgb":case"targetscreensize":case"readonlyrecommended":break;default:ee=!1}break;case"componentoptions":switch(n[3]){case"toolbar":case"hideofficelogo":case"spreadsheetautofit":case"label":case"caption":case"maxheight":case"maxwidth":case"nextsheetnumber":break;default:ee=!1}break;case"excelworkbook":switch(n[3]){case"date1904":U.WBProps.date1904=!0;break;case"windowheight":case"windowwidth":case"windowtopx":case"windowtopy":case"tabratio":case"protectstructure":case"protectwindow":case"protectwindows":case"activesheet":case"displayinknotes":case"firstvisiblesheet":case"supbook":case"sheetname":case"sheetindex":case"sheetindexfirst":case"sheetindexlast":case"dll":case"acceptlabelsinformulas":case"donotsavelinkvalues":case"iteration":case"maxiterations":case"maxchange":case"path":case"xct":case"count":case"selectedsheets":case"calculation":case"uncalced":case"startupprompt":case"crn":case"externname":case"formula":case"colfirst":case"collast":case"wantadvise":case"boolean":case"error":case"text":case"ole":case"noautorecover":case"publishobjects":case"donotcalculatebeforesave":case"number":case"refmoder1c1":case"embedsavesmarttags":break;default:ee=!1}break;case"workbookoptions":switch(n[3]){case"owcversion":case"height":case"width":break;default:ee=!1}break;case"worksheetoptions":switch(n[3]){case"visible":if("/>"!==n[0].slice(-2))if("/"===n[1])switch(o.slice(L,n.index)){case"SheetHidden":G.Hidden=1;break;case"SheetVeryHidden":G.Hidden=2}else L=n.index+n[0].length;break;case"header":y["!margins"]||qa(y["!margins"]={},"xlml"),isNaN(+sn(n[0]).Margin)||(y["!margins"].header=+sn(n[0]).Margin);break;case"footer":y["!margins"]||qa(y["!margins"]={},"xlml"),isNaN(+sn(n[0]).Margin)||(y["!margins"].footer=+sn(n[0]).Margin);break;case"pagemargins":var te=sn(n[0]);y["!margins"]||qa(y["!margins"]={},"xlml"),isNaN(+te.Top)||(y["!margins"].top=+te.Top),isNaN(+te.Left)||(y["!margins"].left=+te.Left),isNaN(+te.Right)||(y["!margins"].right=+te.Right),isNaN(+te.Bottom)||(y["!margins"].bottom=+te.Bottom);break;case"displayrighttoleft":U.Views||(U.Views=[]),U.Views[0]||(U.Views[0]={}),U.Views[0].RTL=!0;break;case"freezepanes":case"frozennosplit":break;case"splithorizontal":case"splitvertical":case"donotdisplaygridlines":case"activerow":case"activecol":case"toprowbottompane":case"leftcolumnrightpane":case"unsynced":case"print":case"printerrors":case"panes":case"scale":case"pane":case"number":case"layout":case"pagesetup":case"selected":case"protectobjects":case"enableselection":case"protectscenarios":case"validprinterinfo":case"horizontalresolution":case"verticalresolution":case"numberofcopies":case"activepane":case"toprowvisible":case"leftcolumnvisible":case"fittopage":case"rangeselection":case"papersizeindex":case"pagelayoutzoom":case"pagebreakzoom":case"filteron":case"fitwidth":case"fitheight":case"commentslayout":case"zoom":case"lefttoright":case"gridlines":case"allowsort":case"allowfilter":case"allowinsertrows":case"allowdeleterows":case"allowinsertcols":case"allowdeletecols":case"allowinserthyperlinks":case"allowformatcells":case"allowsizecols":case"allowsizerows":break;case"nosummaryrowsbelowdetail":y["!outline"]||(y["!outline"]={}),y["!outline"].above=!0;break;case"tabcolorindex":case"donotdisplayheadings":case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":y["!outline"]||(y["!outline"]={}),y["!outline"].left=!0;break;case"blackandwhite":case"donotdisplayzeros":case"displaypagebreak":case"rowcolheadings":case"donotdisplayoutline":case"noorientation":case"allowusepivottables":case"zeroheight":case"viewablerange":case"selection":case"protectcontents":break;default:ee=!1}break;case"pivottable":case"pivotcache":switch(n[3]){case"immediateitemsondrop":case"showpagemultipleitemlabel":case"compactrowindent":case"location":case"pivotfield":case"orientation":case"layoutform":case"layoutsubtotallocation":case"layoutcompactrow":case"position":case"pivotitem":case"datatype":case"datafield":case"sourcename":case"parentfield":case"ptlineitems":case"ptlineitem":case"countofsameitems":case"item":case"itemtype":case"ptsource":case"cacheindex":case"consolidationreference":case"filename":case"reference":case"nocolumngrand":case"norowgrand":case"blanklineafteritems":case"hidden":case"subtotal":case"basefield":case"mapchilditems":case"function":case"refreshonfileopen":case"printsettitles":case"mergelabels":case"defaultversion":case"refreshname":case"refreshdate":case"refreshdatecopy":case"versionlastrefresh":case"versionlastupdate":case"versionupdateablemin":case"versionrefreshablemin":case"calculation":break;default:ee=!1}break;case"pagebreaks":switch(n[3]){case"colbreaks":case"colbreak":case"rowbreaks":case"rowbreak":case"colstart":case"colend":case"rowend":break;default:ee=!1}break;case"autofilter":switch(n[3]){case"autofiltercolumn":case"autofiltercondition":case"autofilterand":case"autofilteror":break;default:ee=!1}break;case"querytable":switch(n[3]){case"id":case"autoformatfont":case"autoformatpattern":case"querysource":case"querytype":case"enableredirections":case"refreshedinxl9":case"urlstring":case"htmltables":case"connection":case"commandtext":case"refreshinfo":case"notitles":case"nextid":case"columninfo":case"overwritecells":case"donotpromptforfile":case"textwizardsettings":case"source":case"number":case"decimal":case"thousandseparator":case"trailingminusnumbers":case"formatsettings":case"fieldtype":case"delimiters":case"tab":case"comma":case"autoformatname":case"versionlastedit":case"versionlastrefresh":break;default:ee=!1}break;case"datavalidation":switch(n[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":case"cellrangelist":break;default:ee=!1}break;case"sorting":case"conditionalformatting":switch(n[3]){case"range":case"type":case"min":case"max":case"sort":case"descending":case"order":case"casesensitive":case"value":case"errorstyle":case"errormessage":case"errortitle":case"cellrangelist":case"inputmessage":case"inputtitle":case"combohide":case"inputhide":case"condition":case"qualifier":case"useblank":case"value1":case"value2":case"format":break;default:ee=!1}break;case"mapinfo":case"schema":case"data":switch(n[3]){case"map":case"entry":case"range":case"xpath":case"field":case"xsdtype":case"filteron":case"aggregate":case"elementtype":case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":case"row":break;default:ee=!1}break;case"smarttags":break;default:ee=!1}if(!ee&&!n[3].match(/!\[CDATA/)){if(!g[g.length-1][1])throw"Unrecognized tag: "+n[3]+"|"+g.join("|");if("customdocumentproperties"===g[g.length-1][0]){if("/>"!==n[0].slice(-2))if("/"===n[1]){ae=oe=ne=void 0;var ne=R,ie=K,oe=I,re=o.slice(L,n.index),ae=re;switch((oe[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":ae=gn(re);break;case"i2":case"int":ae=parseInt(re,10);break;case"r4":case"float":ae=parseFloat(re);break;case"date":case"dateTime.tz":ae=Ft(re);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+oe[0])}ne[dn(ie)]=ae}else L=(I=n).index+n[0].length}else if(i.WTF)throw"Unrecognized tag: "+n[3]+"|"+g.join("|")}}return t={},i.bookSheets||i.bookProps||(t.Sheets=v),t.SheetNames=b,t.Workbook=U,t.SSF=Bt(Ke),t.Props=P,t.Custprops=R,t}function xs(e,t){switch(Qs(t=t||{}),t.type||"base64"){case"base64":return ws(Ae(e),t);case"binary":case"buffer":case"file":return ws(e,t);case"array":return ws(Re(e),t)}}var _s=[60,1084,2066,2165,2175];function ks(e,t,n){if("z"!==e.t&&e.XF){var i=0;try{i=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=Ke[i])}catch(e){if(t.WTF)throw e}if(!t||!1!==t.cellText)try{"e"===e.t?e.w=e.w||Zi[e.v]:0===i||"General"==i?"n"===e.t?(0|e.v)===e.v?e.w=e.v.toString(10):e.w=ot(e.v):e.w=rt(e.v):e.w=_t(i,e.v,{date1904:!!n,dateNF:t&&t.dateNF})}catch(e){if(t.WTF)throw e}t.cellDates&&i&&"n"==e.t&&yt(Ke[i]||String(i))&&(n=Ze(e.v))&&(e.t="d",e.v=new Date(n.y,n.m-1,n.d,n.H,n.M,n.S,n.u))}}function Es(e,t,n){return{v:e,ixfe:t,t:n}}var Cs="e0859ff2f94f6810ab9108002b27b3d9",Ss="02d5cdd59c2e1b10939708002b2cf9ae";function Ts(e,t){var n,i,o;if(Qs(t=t||{}),ye(),t.codepage&&ve(t.codepage),e.FullPaths){if(At.find(e,"/encryption"))throw new Error("File is password-protected");r=At.find(e,"!CompObj"),a=At.find(e,"/Workbook")||At.find(e,"/Book")}else{switch(t.type){case"base64":e=Pe(Ae(e));break;case"binary":e=Pe(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e))}di(e,0),a={content:e}}if(r&&function(e){var t;(e=e.content).l=28,e.read_shift(0,"lpstr-ansi"),Hi(e,1),e.length-e.l<=4||0==(t=e.read_shift(4))||40<t||(e.l-=4,e.read_shift(0,"lpstr-ansi"),e.length-e.l<=4)||1907505652!==(t=e.read_shift(4))||(Hi(e,2),0==(t=e.read_shift(4)))||40<t||(e.l-=4,e.read_shift(0,"lpwstr"))}(r),t.bookProps&&!t.bookSheets)n={};else{var r=Oe?"buffer":"array";if(a&&a.content)n=function(e,t){for(var n,i,o,r,a,s,l={opts:{}},c={},u=t.dense?[]:{},d={},h={},p=null,f=[],m="",g={},v="",b={},y=[],w=[],x=[],_={Sheets:[],WBProps:{date1904:!1},Views:[{}]},k={},E=function(e){return!(e<8)&&e<64&&x[e-8]||Ji[e]},C=function(e,t,i){if(!(1<R||i.sheetRows&&e.r>=i.sheetRows)){var o,r,a;if(i.cellStyles&&t.XF&&t.XF.data&&(r=i,a=(o=t).XF.data)&&a.patternType&&r&&r.cellStyles&&(o.s={},o.s.patternType=a.patternType,(r=Sr(E(a.icvFore)))&&(o.s.fgColor={rgb:r}),r=Sr(E(a.icvBack)))&&(o.s.bgColor={rgb:r}),delete t.ixfe,delete t.XF,v=Ci(n=e),h&&h.s&&h.e||(h={s:{r:0,c:0},e:{r:0,c:0}}),e.r<h.s.r&&(h.s.r=e.r),e.c<h.s.c&&(h.s.c=e.c),e.r+1>h.e.r&&(h.e.r=e.r+1),e.c+1>h.e.c&&(h.e.c=e.c+1),i.cellFormula&&t.f)for(var s=0;s<y.length;++s)if(!(y[s][0].s.c>e.c||y[s][0].s.r>e.r||y[s][0].e.c<e.c||y[s][0].e.r<e.r)){t.F=Ti(y[s][0]),y[s][0].s.c==e.c&&y[s][0].s.r==e.r||delete t.f,t.f&&(t.f=""+Ta(y[s][1],0,e,$,S));break}i.dense?(u[e.r]||(u[e.r]=[]),u[e.r][e.c]=t):u[v]=t}},S={enc:!1,sbcch:0,snames:[],sharedf:b,arrayf:y,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf},T=(t.password&&(S.password=t.password),[]),A=[],O=[],M=[],D=!1,$=[],P=($.SheetNames=S.snames,$.sharedf=S.sharedf,$.arrayf=S.arrayf,$.names=[],$.XTI=[],0),R=0,L=0,I=[],N=[],F=(be(S.codepage=1200),!1);e.l<e.length-1;){var j=e.l,B=e.read_shift(2);if(0===B&&10===P)break;var q=e.l===e.length?0:e.read_shift(2),z=Os[B];if(z&&z.f){if(t.bookSheets&&133===P&&133!==B)break;if(P=B,2===z.r||12==z.r){var V=e.read_shift(2);if(q-=2,!S.enc&&V!==B&&((255&V)<<8|V>>8)!==B)throw new Error("rt mismatch: "+V+"!="+B);12==z.r&&(e.l+=10,q-=10)}var W,H,U,G={};G=10===B?z.f(e,q,S):function(e,t,n,i,o){var r=i,a=[],s=n.slice(n.l,n.l+r);if(o&&o.enc&&o.enc.insitu&&0<s.length)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:case 133:break;default:o.enc.insitu(s)}a.push(s),n.l+=r;for(var l=ni(n,n.l),c=Os[l],u=0;null!=c&&-1<_s.indexOf(l);)r=ni(n,n.l+2),u=n.l+4,2066==l?u+=4:2165!=l&&2175!=l||(u+=12),s=n.slice(u,n.l+4+r),a.push(s),n.l+=4+r,c=Os[l=ni(n,n.l)];var d=Ie(a),h=(di(d,0),0);d.lens=[];for(var p=0;p<a.length;++p)d.lens.push(h),h+=a[p].length;if(d.length<i)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+d.length+" < "+i;return t.f(d,d.length,o)}(B,z,e,q,S);if(0!=R||-1!==[9,521,1033,2057].indexOf(P))switch(B){case 34:l.opts.Date1904=_.WBProps.date1904=G;break;case 134:l.opts.WriteProtect=!0;break;case 47:if(S.enc||(e.l=0),S.enc=G,!t.password)throw new Error("File is password-protected");if(null==G.valid)throw new Error("Encryption scheme unsupported");if(G.valid)break;throw new Error("Password is incorrect");case 92:S.lastuser=G;break;case 66:var K=Number(G);switch(K){case 21010:K=1200;break;case 32768:K=1e4;break;case 32769:K=1252}be(S.codepage=K),F=!0;break;case 317:S.rrtabid=G;break;case 25:S.winlocked=G;break;case 439:l.opts.RefreshAll=G;break;case 12:l.opts.CalcCount=G;break;case 16:l.opts.CalcDelta=G;break;case 17:l.opts.CalcIter=G;break;case 13:l.opts.CalcMode=G;break;case 14:l.opts.CalcPrecision=G;break;case 95:l.opts.CalcSaveRecalc=G;break;case 15:S.CalcRefMode=G;break;case 2211:l.opts.FullCalc=G;break;case 129:G.fDialog&&(u["!type"]="dialog"),G.fBelow||((u["!outline"]||(u["!outline"]={})).above=!0),G.fRight||((u["!outline"]||(u["!outline"]={})).left=!0);break;case 224:w.push(G);break;case 430:$.push([G]),$[$.length-1].XTI=[];break;case 35:case 547:$[$.length-1].push(G);break;case 24:case 536:s={Name:G.Name,Ref:Ta(G.rgce,0,null,$,S)},0<G.itab&&(s.Sheet=G.itab-1),$.names.push(s),$[0]||($[0]=[],$[0].XTI=[]),$[$.length-1].push(G),"_xlnm._FilterDatabase"==G.Name&&0<G.itab&&G.rgce&&G.rgce[0]&&G.rgce[0][0]&&"PtgArea3d"==G.rgce[0][0][0]&&(N[G.itab-1]={ref:Ti(G.rgce[0][0][1][2])});break;case 22:S.ExternCount=G;break;case 23:0==$.length&&($[0]=[],$[0].XTI=[]),$[$.length-1].XTI=$[$.length-1].XTI.concat(G),$.XTI=$.XTI.concat(G);break;case 2196:S.biff<8||null!=s&&(s.Comment=G[1]);break;case 18:u["!protect"]=G;break;case 19:0!==G&&S.WTF&&console.error("Password verifier: "+G);break;case 133:d[G.pos]=G,S.snames.push(G.name);break;case 10:--R||(h.e&&(0<h.e.r&&0<h.e.c&&(h.e.r--,h.e.c--,u["!ref"]=Ti(h),t.sheetRows&&t.sheetRows<=h.e.r&&(W=h.e.r,h.e.r=t.sheetRows-1,u["!fullref"]=u["!ref"],u["!ref"]=Ti(h),h.e.r=W),h.e.r++,h.e.c++),0<T.length&&(u["!merges"]=T),0<A.length&&(u["!objects"]=A),0<O.length&&(u["!cols"]=O),0<M.length&&(u["!rows"]=M),_.Sheets.push(k)),""===m?g=u:c[m]=u,u=t.dense?[]:{});break;case 9:case 521:case 1033:case 2057:8===S.biff&&(S.biff={9:2,521:3,1033:4}[B]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[G.BIFFVer]||8),S.biffguess=0==G.BIFFVer,0==G.BIFFVer&&4096==G.dt&&(S.biff=5,F=!0,be(S.codepage=28591)),8==S.biff&&0==G.BIFFVer&&16==G.dt&&(S.biff=2),R++||(u=t.dense?[]:{},S.biff<8&&!F&&(F=!0,be(S.codepage=t.codepage||1252)),S.biff<5||0==G.BIFFVer&&4096==G.dt?(""===m&&(m="Sheet1"),h={s:{r:0,c:0},e:{r:0,c:0}},W={pos:e.l-q,name:m},d[W.pos]=W,S.snames.push(m)):m=(d[j]||{name:""}).name,32==G.dt&&(u["!type"]="chart"),64==G.dt&&(u["!type"]="macro"),T=[],A=[],S.arrayf=y=[],O=[],D=!(M=[]),k={Hidden:(d[j]||{hs:0}).hs,name:m});break;case 515:case 3:case 2:"chart"==u["!type"]&&(t.dense?(u[G.r]||[])[G.c]:u[Ci({c:G.c,r:G.r})])&&++G.c,J={ixfe:G.ixfe,XF:w[G.ixfe]||{},v:G.val,t:"n"},0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t);break;case 5:case 517:J={ixfe:G.ixfe,XF:w[G.ixfe],v:G.val,t:G.t},0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t);break;case 638:J={ixfe:G.ixfe,XF:w[G.ixfe],v:G.rknum,t:"n"},0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t);break;case 189:for(var Y=G.c;Y<=G.C;++Y){var X=G.rkrec[Y-G.c][0],J={ixfe:X,XF:w[X],v:G.rkrec[Y-G.c][1],t:"n"};0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:Y,r:G.r},J,t)}break;case 6:case 518:case 1030:"String"==G.val||((J=Es(G.val,G.cell.ixfe,G.tt)).XF=w[J.ixfe],t.cellFormula&&((U=G.formula)&&U[0]&&U[0][0]&&"PtgExp"==U[0][0][0]&&!b[H=Ci({r:Z=U[0][0][1][0],c:U=U[0][0][1][1]})]?J.F=((t.dense?(u[Z]||[])[U]:u[H])||{}).F:J.f=""+Ta(G.formula,0,G.cell,$,S)),0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C(G.cell,J,t)),p=G;break;case 7:case 519:if(!p)throw new Error("String record expects Formula");(J=Es(p.val=G,p.cell.ixfe,"s")).XF=w[J.ixfe],t.cellFormula&&(J.f=""+Ta(p.formula,0,p.cell,$,S)),0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C(p.cell,J,t),p=null;break;case 33:case 545:y.push(G);var Z=Ci(G[0].s),Q=t.dense?(u[G[0].s.r]||[])[G[0].s.c]:u[Z];if(t.cellFormula&&Q){if(!p)break;if(!Z||!Q)break;Q.f=""+Ta(G[1],0,G[0],$,S),Q.F=Ti(G[0])}break;case 1212:if(t.cellFormula&&v){if(!p)break;b[Ci(p.cell)]=G[0],((Q=t.dense?(u[p.cell.r]||[])[p.cell.c]:u[Ci(p.cell)])||{}).f=""+Ta(G[0],0,n,$,S)}break;case 253:J=Es(f[G.isst].t,G.ixfe,"s"),f[G.isst].h&&(J.h=f[G.isst].h),J.XF=w[J.ixfe],0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t);break;case 513:t.sheetStubs&&(J={ixfe:G.ixfe,XF:w[G.ixfe],t:"z"},0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t));break;case 190:if(t.sheetStubs)for(var ee=G.c;ee<=G.C;++ee){var te=G.ixfe[ee-G.c];J={ixfe:te,XF:w[te],t:"z"},0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:ee,r:G.r},J,t)}break;case 214:case 516:case 4:(J=Es(G.val,G.ixfe,"s")).XF=w[J.ixfe],0<L&&(J.z=I[J.ixfe>>8&63]),ks(J,t,l.opts.Date1904),C({c:G.c,r:G.r},J,t);break;case 0:case 512:1===R&&(h=G);break;case 252:f=G;break;case 1054:if(4==S.biff){I[L++]=G[1];for(var ne=0;ne<L+163&&Ke[ne]!=G[1];++ne);163<=ne&&kt(G[1],L+163)}else kt(G[1],G[0]);break;case 30:I[L++]=G;for(var ie=0;ie<L+163&&Ke[ie]!=G;++ie);163<=ie&&kt(G,L+163);break;case 229:T=T.concat(G);break;case 93:A[G.cmo[0]]=S.lastobj=G;break;case 438:S.lastobj.TxO=G;break;case 127:S.lastobj.ImData=G;break;case 440:for(o=G[0].s.r;o<=G[0].e.r;++o)for(i=G[0].s.c;i<=G[0].e.c;++i)(Q=t.dense?(u[o]||[])[i]:u[Ci({c:i,r:o})])&&(Q.l=G[1]);break;case 2048:for(o=G[0].s.r;o<=G[0].e.r;++o)for(i=G[0].s.c;i<=G[0].e.c;++i)(Q=t.dense?(u[o]||[])[i]:u[Ci({c:i,r:o})])&&Q.l&&(Q.l.Tooltip=G[1]);break;case 28:S.biff<=5&&2<=S.biff||(Q=t.dense?(u[G[0].r]||[])[G[0].c]:u[Ci(G[0])],U=A[G[2]],Q||(Q=t.dense?(u[G[0].r]||(u[G[0].r]=[]),u[G[0].r][G[0].c]={t:"z"}):u[Ci(G[0])]={t:"z"},h.e.r=Math.max(h.e.r,G[0].r),h.s.r=Math.min(h.s.r,G[0].r),h.e.c=Math.max(h.e.c,G[0].c),h.s.c=Math.min(h.s.c,G[0].c)),Q.c||(Q.c=[]),H={a:G[1],t:U.TxO.t},Q.c.push(H));break;case 2173:G.ixfe,G.ext.forEach((function(e){e[0]}));break;case 125:if(S.cellStyles)for(;G.e>=G.s;)O[G.e--]={width:G.w/256,level:G.level||0,hidden:!!(1&G.flags)},D||(D=!0,Pr(G.w/256)),Rr(O[G.e+1]);break;case 520:var oe={};null!=G.level&&((M[G.r]=oe).level=G.level),G.hidden&&((M[G.r]=oe).hidden=!0),G.hpt&&((M[G.r]=oe).hpt=G.hpt,oe.hpx=Ir(G.hpt));break;case 38:case 39:case 40:case 41:u["!margins"]||qa(u["!margins"]={}),u["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[B]]=G;break;case 161:u["!margins"]||qa(u["!margins"]={}),u["!margins"].header=G.header,u["!margins"].footer=G.footer;break;case 574:G.RTL&&(_.Views[0].RTL=!0);break;case 146:x=G;break;case 2198:a=G;break;case 140:r=G;break;case 442:m?k.CodeName=G||k.name:_.WBProps.CodeName=G||"ThisWorkbook"}}else z||console.error("Missing Info for XLS Record 0x"+B.toString(16)),e.l+=q}return l.SheetNames=Ot(d).sort((function(e,t){return Number(e)-Number(t)})).map((function(e){return d[e].name})),t.bookSheets||(l.Sheets=c),!l.SheetNames.length&&g["!ref"]?(l.SheetNames.push("Sheet1"),l.Sheets&&(l.Sheets.Sheet1=g)):l.Preamble=g,l.Sheets&&N.forEach((function(e,t){l.Sheets[l.SheetNames[t]]["!autofilter"]=e})),l.Strings=f,l.SSF=Bt(Ke),S.enc&&(l.Encryption=S.enc),a&&(l.Themes=a),l.Metadata={},void 0!==r&&(l.Metadata.Country=r),0<$.names.length&&(_.Names=$.names),l.Workbook=_,l}(a.content,t);else{if(!((a=At.find(e,"PerfectOffice_MAIN"))&&a.content||(a=At.find(e,"NativeContent_MAIN"))&&a.content))throw(a=At.find(e,"MN0"))&&a.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");n=ur.to_workbook(a.content,(t.type=r,t))}t.bookVBA&&e.FullPaths&&At.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(n.vbaraw=(i=e,o=At.utils.cfb_new({root:"R"}),i.FullPaths.forEach((function(e,t){"/"!==e.slice(-1)&&e.match(/_VBA_PROJECT_CUR/)&&(e=e.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,""),At.utils.cfb_add(o,e,i.FileIndex[t].content))})),At.write(o)))}var a={};if(e.FullPaths){r=e;var s=a,l=t,c=At.find(r,"/!DocumentSummaryInformation");if(c&&0<c.size)try{var u,d=_o(c,Gi,Ss);for(u in d)s[u]=d[u]}catch(e){if(l.WTF)throw e}if((c=At.find(r,"/!SummaryInformation"))&&0<c.size)try{var h,p=_o(c,Ki,Cs);for(h in p)null==s[h]&&(s[h]=p[h])}catch(e){if(l.WTF)throw e}s.HeadingPairs&&s.TitlesOfParts&&(lo(s.HeadingPairs,s.TitlesOfParts,s,l),delete s.HeadingPairs,delete s.TitlesOfParts)}return n.Props=n.Custprops=a,t.bookFiles&&(n.cfb=e),n}var As={0:{f:function(e,t){var n={},i=(t=e.l+t,n.r=e.read_shift(4),e.l+=4,e.read_shift(2)),o=(e.l+=1,e.read_shift(1));return e.l=t,7&o&&(n.level=7&o),16&o&&(n.hidden=!0),32&o&&(n.hpt=i/20),n}},1:{f:function(e){return[Li(e)]}},2:{f:function(e){return[Li(e),qi(e),"n"]}},3:{f:function(e){return[Li(e),e.read_shift(1),"e"]}},4:{f:function(e){return[Li(e),e.read_shift(1),"b"]}},5:{f:function(e){return[Li(e),Wi(e),"n"]}},6:{f:function(e){return[Li(e),Pi(e),"str"]}},7:{f:function(e){return[Li(e),e.read_shift(4),"s"]}},8:{f:function(e,t,n){t=e.l+t;var i,o=Li(e),r=(o.r=n["!row"],Pi(e));r=[o,r,"str"];return n.cellFormula?(e.l+=2,i=Da(e,t-e.l,n),r[3]=Ta(i,0,o,n.supbooks,n)):e.l=t,r}},9:{f:function(e,t,n){t=e.l+t;var i,o=Li(e),r=(o.r=n["!row"],Wi(e));r=[o,r,"n"];return n.cellFormula?(e.l+=2,i=Da(e,t-e.l,n),r[3]=Ta(i,0,o,n.supbooks,n)):e.l=t,r}},10:{f:function(e,t,n){t=e.l+t;var i,o=Li(e),r=(o.r=n["!row"],e.read_shift(1));r=[o,r,"b"];return n.cellFormula?(e.l+=2,i=Da(e,t-e.l,n),r[3]=Ta(i,0,o,n.supbooks,n)):e.l=t,r}},11:{f:function(e,t,n){t=e.l+t;var i,o=Li(e),r=(o.r=n["!row"],e.read_shift(1));r=[o,r,"e"];return n.cellFormula?(e.l+=2,i=Da(e,t-e.l,n),r[3]=Ta(i,0,o,n.supbooks,n)):e.l=t,r}},12:{f:function(e){return[Ii(e)]}},13:{f:function(e){return[Ii(e),qi(e),"n"]}},14:{f:function(e){return[Ii(e),e.read_shift(1),"e"]}},15:{f:function(e){return[Ii(e),e.read_shift(1),"b"]}},16:{f:ns},17:{f:function(e){return[Ii(e),Pi(e),"str"]}},18:{f:function(e){return[Ii(e),e.read_shift(4),"s"]}},19:{f:Ri},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:function(e,t,n){t=e.l+t;var i=(e.l+=4,e.l+=1,e.read_shift(4)),o=ji(e),r=(n=$a(e,0,n),Fi(e));e.l=t,e={Name:o,Ptg:n};return i<268435455&&(e.Sheet=i),r&&(e.Comment=r),e}},40:{},42:{},43:{f:function(e,t,n){var i={};switch(i.sz=e.read_shift(2)/20,r=(o=e).read_shift(1),o.l++,(o={fBold:1&r,fItalic:2&r,fUnderline:4&r,fStrikeout:8&r,fOutline:16&r,fShadow:32&r,fCondense:64&r,fExtend:128&r}).fItalic&&(i.italic=1),o.fCondense&&(i.condense=1),o.fExtend&&(i.extend=1),o.fShadow&&(i.shadow=1),o.fOutline&&(i.outline=1),o.fStrikeout&&(i.strike=1),700===e.read_shift(2)&&(i.bold=1),e.read_shift(2)){case 1:i.vertAlign="superscript";break;case 2:i.vertAlign="subscript"}var o,r=e.read_shift(1);switch(0!=r&&(i.underline=r),0<(o=e.read_shift(1))&&(i.family=o),0<(r=e.read_shift(1))&&(i.charset=r),e.l++,i.color=function(e){var t={},n=e.read_shift(1)>>>1,i=e.read_shift(1),o=e.read_shift(2,"i"),r=e.read_shift(1),a=e.read_shift(1),s=e.read_shift(1);switch(e.l++,n){case 0:t.auto=1;break;case 1:var l=Ji[t.index=i];l&&(t.rgb=Sr(l));break;case 2:t.rgb=Sr([r,a,s]);break;case 3:t.theme=i}return 0!=o&&(t.tint=0<o?o/32767:o/32768),t}(e),e.read_shift(1)){case 1:i.scheme="major";break;case 2:i.scheme="minor"}return i.name=Pi(e),i}},44:{f:function(e,t){return[e.read_shift(2),Pi(e)]}},45:{f:qr},46:{f:zr},47:{f:function(e,t){t=e.l+t;var n=e.read_shift(2),i=e.read_shift(2);return e.l=t,{ixfe:n,numFmtId:i}}},48:{},49:{f:function(e){return e.read_shift(4,"i")}},50:{},51:{f:function(e){for(var t=[],n=e.read_shift(4);0<n--;)t.push([e.read_shift(4),e.read_shift(4)]);return t}},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:er},62:{f:function(e){return[Li(e),Ri(e),"is"]}},63:{f:function(e){var t={},n=(t.i=e.read_shift(4),{});return n.r=e.read_shift(4),n.c=e.read_shift(4),t.r=Ci(n),2&(n=e.read_shift(1))&&(t.l="1"),8&n&&(t.a="1"),t}},64:{f:function(){}},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:hi,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:function(e){var t=e.read_shift(2);return e.l+=28,{RTL:32&t}}},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:function(e,t){var n={},i=e[e.l];return++e.l,n.above=!(64&i),n.left=!(128&i),e.l+=18,n.name=Ni(e,t-19),n}},148:{f:Vi,p:16},151:{f:function(){}},152:{},153:{f:function(e,t){var n={},i=e.read_shift(4);return n.defaultThemeVersion=e.read_shift(4),0<(t=8<t?Pi(e):"").length&&(n.CodeName=t),n.autoCompressPictures=!!(65536&i),n.backupFile=!!(64&i),n.checkCompatibility=!!(4096&i),n.date1904=!!(1&i),n.filterPrivacy=!!(8&i),n.hidePivotFieldList=!!(1024&i),n.promptedSolutions=!!(16&i),n.publishItems=!!(2048&i),n.refreshAllConnections=!!(262144&i),n.saveExternalLinkValues=!!(128&i),n.showBorderUnselectedTables=!!(4&i),n.showInkAnnotation=!!(32&i),n.showObjects=["all","placeholders","none"][i>>13&3],n.showPivotChartFilter=!!(32768&i),n.updateLinks=["userSet","never","always"][i>>8&3],n}},154:{},155:{},156:{f:function(e,t){var n={};return n.Hidden=e.read_shift(4),n.iTabID=e.read_shift(4),n.strRelID=Bi(e,t-8),n.name=Pi(e),n}},157:{},158:{},159:{T:1,f:function(e){return[e.read_shift(4),e.read_shift(4)]}},160:{T:-1},161:{T:1,f:Vi},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Vi},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:function(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Pi(e)}}},336:{T:-1},337:{f:function(e){return e.l+=4,0!=e.read_shift(4)},T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:Bi},357:{},358:{},359:{},360:{T:1},361:{},362:{f:Jo},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:function(e,t,n){t=e.l+t;var i=zi(e),o=e.read_shift(1);return(i=[i])[2]=o,n.cellFormula?(o=Ma(e,t-e.l,n),i[1]=o):e.l=t,i}},427:{f:function(e,t,n){t=e.l+t;var i=[Vi(e,16)];return n.cellFormula&&(n=Pa(e,t-e.l,n),i[1]=n),e.l=t,i}},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:function(e){var t={};return is.forEach((function(n){t[n]=Wi(e)})),t}},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:function(){}},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:function(e,t){t=e.l+t;var n=Vi(e,16),i=Fi(e),o=Pi(e),r=Pi(e),a=Pi(e);e.l=t,e={rfx:n,relId:i,loc:o,display:a};return r&&(e.Tooltip=r),e}},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:Bi},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:ea},633:{T:1},634:{T:-1},635:{T:1,f:function(e){var t={},n=(t.iauthor=e.read_shift(4),Vi(e,16));return t.rfx=n.s,t.ref=Ci(n.s),e.l+=16,t}},636:{T:-1},637:{f:te},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:function(e,t){return e.l+=10,{name:Pi(e)}}},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:function(){}},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},Os={6:{f:Aa},10:{f:ko},12:{f:Co},13:{f:Co},14:{f:Eo},15:{f:Eo},16:{f:Wi},17:{f:Eo},18:{f:Eo},19:{f:Co},20:{f:Go},21:{f:Go},23:{f:Jo},24:{f:Xo},25:{f:Eo},26:{},27:{},28:{f:function(e,t,n){var i,o,r,a,s;if(!(n.biff<8))return i=e.read_shift(2),o=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=Mo(e,0,n),n.biff<8&&e.read_shift(1),[{r:i,c:o},s,a,r]}},29:{},34:{f:Eo},35:{f:Ko},38:{f:Wi},39:{f:Wi},40:{f:Wi},41:{f:Wi},42:{f:Eo},43:{f:Eo},47:{f:function(e,t,n){var i={Type:8<=n.biff?e.read_shift(2):0};return i.Type?function(e,t,n){(n=n||{}).Info=e.read_shift(2),e.l-=2,1===n.Info?n.Data=function(e){var t={},n=t.EncryptionVersionInfo=xr(e,4);if(1!=n.Major||1!=n.Minor)throw"unrecognized version code "+n.Major+" : "+n.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}(e):n.Data=function(e,t){var n={},i=n.EncryptionVersionInfo=xr(e,4);if(t-=4,2!=i.Minor)throw new Error("unrecognized minor version code: "+i.Minor);if(4<i.Major||i.Major<2)throw new Error("unrecognized major version code: "+i.Major);return n.Flags=e.read_shift(4),t-=4,i=e.read_shift(4),t-=4,n.EncryptionHeader=_r(e,i),n.EncryptionVerifier=kr(e,t-=i),n}(e,t)}(e,t-2,i):(t=e,n.biff,e=n,n=i,t={key:Co(t),verificationBytes:Co(t)},e.password&&(t.verifier=function(e){var t,n=0,i=wr(e),o=i.length+1,r=De(o);for(r[0]=i.length,t=1;t!=o;++t)r[t]=i[t-1];for(t=o-1;0<=t;--t)n=((0==(16384&n)?0:1)|n<<1&32767)^r[t];return 52811^n}(e.password)),n.valid=t.verificationBytes===t.verifier,n.valid&&(n.insitu=function(e){var t=0,n=Er(e);return function(e){return e=function(e,t,n,i,o){var r,a;for(o=o||t,i=i||Er(""),r=0;r!=t.length;++r)a=t[r],a^=i[n],o[r]=255&(a>>5|a<<3),++n;return[o,n,i]}(0,e,t,n),t=e[1],e[0]}}(e.password))),i}},49:{f:function(e,t,n){var i={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(n&&n.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10}return i.name=To(e,0,n),i}},51:{f:Co},60:{},61:{f:function(e){return{Pos:[e.read_shift(2),e.read_shift(2)],Dim:[e.read_shift(2),e.read_shift(2)],Flags:e.read_shift(2),CurTab:e.read_shift(2),FirstTab:e.read_shift(2),Selected:e.read_shift(2),TabRatio:e.read_shift(2)}}},64:{f:Eo},65:{f:function(){}},66:{f:Co},77:{},80:{},81:{},82:{},85:{f:Co},89:{},90:{},91:{},92:{f:function(e,t,n){var i;return n.enc?(e.l+=t,""):(i=e.l,n=Mo(e,0,n),e.read_shift(t+i-e.l),n)}},93:{f:function(e,t,n){var i,o,r,a,s,l;return n&&n.biff<8?(i=t,n=n,(l=e).l+=4,o=l.read_shift(2),r=l.read_shift(2),a=l.read_shift(2),l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=2,l.l+=6,(s=[]).push((Qo[o]||hi)(l,i-=36,n)),{cmo:[r,o,a],ft:s}):{cmo:l=jo(e),ft:function(e,t){for(var n=e.l+t,i=[];e.l<n;){var o=e.read_shift(2);e.l-=2;try{i.push(qo[o](e,n-e.l))}catch(t){return e.l=n,i}}return e.l!=n&&(e.l=n),i}(e,t-22,l[1])}}},94:{},95:{f:Eo},96:{},97:{},99:{f:Eo},125:{f:er},128:{f:function(e){if(e.l+=4,0!==(e=[e.read_shift(2),e.read_shift(2)])[0]&&e[0]--,0!==e[1]&&e[1]--,7<e[0]||7<e[1])throw new Error("Bad Gutters: "+e.join("|"));return e}},129:{f:function(e,t,n){return{fDialog:16&(n=n&&8==n.biff||2==t?e.read_shift(2):(e.l+=t,0)),fBelow:64&n,fRight:128&n}}},130:{f:Co},131:{f:Eo},132:{f:Eo},133:{f:function(e,t,n){var i=e.read_shift(4),o=3&e.read_shift(1),r=e.read_shift(1);switch(r){case 0:r="Worksheet";break;case 1:r="Macrosheet";break;case 2:r="Chartsheet";break;case 6:r="VBAModule"}return{pos:i,hs:o,dt:r,name:e=0===(e=To(e,0,n)).length?"Sheet1":e}}},134:{},140:{f:function(e){var t=[0,0],n=e.read_shift(2);return t[0]=Yi[n]||n,n=e.read_shift(2),t[1]=Yi[n]||n,t}},141:{f:Co},144:{},146:{f:function(e){for(var t=e.read_shift(2),n=[];0<t--;)n.push(Po(e));return n}},151:{},152:{},153:{},154:{},155:{},156:{f:Co},157:{},158:{},160:{f:nr},161:{f:function(e,t){var n={};return t<32||(e.l+=16,n.header=Wi(e),n.footer=Wi(e),e.l+=2),n}},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:function(e,t){for(var n=e.l+t-2,i=(t=e.read_shift(2),e.read_shift(2)),o=[];e.l<n;)o.push(Lo(e));if(e.l!==n)throw new Error("MulRK read error");var r=e.read_shift(2);if(o.length!=r-i+1)throw new Error("MulRK length mismatch");return{r:t,c:i,C:r,rkrec:o}}},190:{f:function(e,t){for(var n=e.l+t-2,i=(t=e.read_shift(2),e.read_shift(2)),o=[];e.l<n;)o.push(e.read_shift(2));if(e.l!==n)throw new Error("MulBlank read error");var r=e.read_shift(2);if(o.length!=r-i+1)throw new Error("MulBlank length mismatch");return{r:t,c:i,C:r,ixfe:o}}},193:{f:ko},197:{},198:{},199:{},200:{},201:{},202:{f:Eo},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Co},220:{},221:{f:Eo},222:{},224:{f:function(e,t,n){var i,o,r,a,s={};return s.ifnt=e.read_shift(2),s.numFmtId=e.read_shift(2),s.flags=e.read_shift(2),s.fStyle=s.flags>>2&1,s.data=(n=n,i={},o=(e=e).read_shift(4),r=e.read_shift(4),a=e.read_shift(4),e=e.read_shift(2),i.patternType=Xi[a>>26],n.cellStyles&&(i.alc=7&o,i.fWrap=o>>3&1,i.alcV=o>>4&7,i.fJustLast=o>>7&1,i.trot=o>>8&255,i.cIndent=o>>16&15,i.fShrinkToFit=o>>20&1,i.iReadOrder=o>>22&2,i.fAtrNum=o>>26&1,i.fAtrFnt=o>>27&1,i.fAtrAlc=o>>28&1,i.fAtrBdr=o>>29&1,i.fAtrPat=o>>30&1,i.fAtrProt=o>>31&1,i.dgLeft=15&r,i.dgRight=r>>4&15,i.dgTop=r>>8&15,i.dgBottom=r>>12&15,i.icvLeft=r>>16&127,i.icvRight=r>>23&127,i.grbitDiag=r>>30&3,i.icvTop=127&a,i.icvBottom=a>>7&127,i.icvDiag=a>>14&127,i.dgDiag=a>>21&15,i.icvFore=127&e,i.icvBack=e>>7&127,i.fsxButton=e>>14&1),i),s}},225:{f:function(e,t){return 0!==t&&e.read_shift(2),1200}},226:{f:ko},227:{},229:{f:function(e,t){for(var n=[],i=e.read_shift(2);i--;)n.push(Io(e));return n}},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:function(e,t){for(var n,i,o,r,a,s,l,c,u,d=e.l+t,h=(t=e.read_shift(4),e.read_shift(4)),p=[],f=0;f!=h&&e.l<d;++f)p.push((r=l=u=c=l=r=i=void 0,o=pe,pe=1200,r=(n=e).read_shift(2),a=4&(l=n.read_shift(1)),s=8&l,l=1+(1&l),c=0,u={},s&&(c=n.read_shift(2)),a&&(i=n.read_shift(4)),l=2==l?"dbcs-cont":"sbcs-cont",r=0===r?"":n.read_shift(r,l),s&&(n.l+=4*c),a&&(n.l+=i),u.t=r,s||(u.raw="<t>"+u.t+"</t>",u.r=u.t),pe=o,u));return p.Count=t,p.Unique=h,p}},253:{f:function(e){var t=Ro(e);return t.isst=e.read_shift(4),t}},255:{f:function(e,t){var n={};return n.dsst=e.read_shift(2),e.l+=t-2,n}},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:So},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:Eo},353:{f:ko},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:function(e,t,n){var i=e.l+t,o=(t=e.read_shift(2),e.read_shift(2));if(1025==(n.sbcch=o)||14849==o)return[o,t];if(o<1||255<o)throw new Error("Unexpected SupBook type: "+o);n=Ao(e,o);for(var r=[];i>e.l;)r.push(Oo(e));return[o,t,n,r]}},431:{f:Eo},432:{},433:{},434:{},437:{},438:{f:function(e,t,n){var i,o=e.l,r="";try{e.l+=4;var a=(n.lastobj||{cmo:[0,0]}).cmo[1],s=(-1==[0,5,7,11,12,14].indexOf(a)?e.l+=6:((i=e).read_shift(1),i.l++,i.read_shift(2),i.l+=2),e.read_shift(2)),l=(e.read_shift(2),Co(e),e.read_shift(2));e.l+=l;for(var c=1;c<e.lens.length-1;++c){if(e.l-o!=e.lens[c])throw new Error("TxO: bad continue record");var u=e[e.l];if((r+=Ao(e,e.lens[c+1]-e.lens[c]-1)).length>=(u?s:2*s))break}if(r.length!==s&&r.length!==2*s)throw new Error("cchText: "+s+" != "+r.length);return e.l=o+t,{t:r}}catch(n){return e.l=o+t,{t:r}}}},439:{f:Eo},440:{f:function(e,t){var n=Io(e);return e.l+=16,[n,function(e,t){t=e.l+t;var n=e.read_shift(4);if(2!==n)throw new Error("Unrecognized streamVersion: "+n);n=e.read_shift(2),e.l+=2;var i,o,r,a,s,l,c="";return 16&n&&(i=Do(e,e.l)),128&n&&(o=Do(e,e.l)),257==(257&n)&&(r=Do(e,e.l)),1==(257&n)&&(a=function(e){var t,n,i=e.read_shift(16);switch(i){case"e0c9ea79f9bace118c8200aa004ba90b":return o=(t=e).read_shift(4),n=t.l,s=!1,24<o&&(t.l+=o-24,"795881f43b1d7f48af2c825dc4852763"===t.read_shift(16)&&(s=!0),t.l=n),n=t.read_shift((s?o-24:o)>>1,"utf16le").replace(Ne,""),s&&(t.l+=24),n;case"0303000000000000c000000000000046":for(var o=e,r=o.read_shift(2),a="";0<r--;)a+="../";var s=o.read_shift(0,"lpstr-ansi");if(o.l+=2,57005!=o.read_shift(2))throw new Error("Bad FileMoniker");if(0===o.read_shift(4))return a+s.replace(/\\/g,"/");if(s=o.read_shift(4),3!=o.read_shift(2))throw new Error("Bad FileMoniker");return a+o.read_shift(s>>1,"utf16le").replace(Ne,"");default:throw new Error("Unsupported Moniker "+i)}}(e,e.l)),8&n&&(c=Do(e,e.l)),32&n&&(s=e.read_shift(16)),64&n&&(l=po(e)),e.l=t,(e=o||r||a||"")&&c&&(e+="#"+c),e=e||"#"+c,t={Target:e=2&n&&"/"==e.charAt(0)&&"/"!=e.charAt(1)?"file://"+e:e},s&&(t.guid=s),l&&(t.time=l),i&&(t.Tooltip=i),t}(e,t-24)]}},441:{},442:{f:Oo},443:{},444:{f:Co},445:{},446:{},448:{f:ko},449:{f:function(e){return e.read_shift(2),e.read_shift(4)},r:2},450:{f:ko},512:{f:Ho},513:{f:tr},515:{f:function(e,t,n){return n.biffguess&&2==n.biff&&(n.biff=5),n=Ro(e),e=Wi(e),n.val=e,n}},516:{f:function(e,t,n){n.biffguess&&2==n.biff&&(n.biff=5),e.l;var i=Ro(e);2==n.biff&&e.l++,e=Oo(e,e.l,n);return i.val=e,i}},517:{f:Uo},519:{f:ir},520:{f:function(e){var t={},n=(t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c,e.read_shift(2)),i=(e.l+=4,e.read_shift(1));return e.l+=3,7&i&&(t.level=7&i),32&i&&(t.hidden=!0),64&i&&(t.hpt=n/20),t}},523:{},545:{f:Zo},549:{f:Vo},566:{},574:{f:function(e,t,n){return n&&2<=n.biff&&n.biff<5?{}:{RTL:64&e.read_shift(2)}}},638:{f:function(e){return{r:e.read_shift(2),c:e.read_shift(2),ixfe:(e=Lo(e))[0],rknum:e[1]}}},659:{},1048:{},1054:{f:function(e,t,n){return[e.read_shift(2),Mo(e,0,n)]}},1084:{},1212:{f:function(e,t,n){var i=No(e),o=(e.l++,e.read_shift(1));return[function(e,t,n){var i,o=e.l+t,r=e.read_shift(2),a=ka(e,r,n);return 65535==r?[[],hi(e,t-2)]:(t!==r+2&&(i=_a(e,o-r-2,a,n)),[a,i])}(e,t-=8,n),o,i]}},2048:{f:function(e,t){return e.read_shift(2),[Io(e),e.read_shift((t-10)/2,"dbcs-cont").replace(Ne,"")]}},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:zo},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:ko},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:function(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t},r:12},2173:{f:function(e,t){e.l,e.l+=2;for(var n=e.read_shift(2),i=(e.l+=2,e.read_shift(2)),o=[];0<i--;)o.push(Zr(e,e.l));return{ixfe:n,ext:o}},r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:Eo,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:function(e,t,n){var i,o;if(!(n.biff<8))return i=e.read_shift(2),o=e.read_shift(2),[Ao(e,i,n),Ao(e,o,n)];e.l+=t},r:12},2197:{},2198:{f:function(e,t,n){t=e.l+t;if(124226!==(o=e.read_shift(4)))if(n.cellStyles){var i,o=e.slice(e.l);e.l=t;try{i=Qt(o,{type:"array"})}catch(e){return}if(o=Jt(i,"theme/theme/theme1.xml",!0))return Jr(o,n)}else e.l=t},r:12},2199:{},2200:{},2201:{},2202:{f:function(e){return[0!==e.read_shift(4),0!==e.read_shift(4),e.read_shift(4)]},r:12},2203:{f:ko},2204:{},2205:{},2206:{},2207:{},2211:{f:function(e){t=(i=e).read_shift(2),n=i.read_shift(2),i.l+=8;var t,n,i={type:t,flags:n};if(2211!=i.type)throw new Error("Invalid Future Record "+i.type);return 0!==e.read_shift(4)}},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Co},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:function(e,t,n){var i={area:!1};return 5!=n.biff?e.l+=t:(n=e.read_shift(1),e.l+=3,16&n&&(i.area=!0)),i}},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:function(e){for(var t=e.read_shift(2),n=[];0<t--;)n.push(Po(e));return n}},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:Ho},1:{},2:{f:function(e){var t=Ro(e);++e.l,e=e.read_shift(2);return t.t="n",t.val=e,t}},3:{f:function(e){var t=Ro(e);++e.l,e=Wi(e);return t.t="n",t.val=e,t}},4:{f:function(e,t,n){n.biffguess&&5==n.biff&&(n.biff=2);var i=Ro(e);++e.l,e=Mo(e,0,n);return i.t="str",i.val=e,i}},5:{f:Uo},7:{f:function(e){var t=e.read_shift(1);return 0===t?(e.l++,""):e.read_shift(t,"sbcs-cont")}},8:{},9:{f:zo},11:{},22:{f:Co},30:{f:Wo},31:{},32:{},33:{f:Zo},36:{},37:{f:Vo},50:{f:function(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}},62:{},52:{},67:{},68:{f:Co},69:{},86:{},126:{},127:{f:function(e){var t=e.read_shift(2),n=e.read_shift(2),i=e.read_shift(4);t={fmt:t,env:n,len:i,data:e.slice(e.l,e.l+i)};return e.l+=i,t}},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:function(e,t,n){t=e.l+t;var i=Ro(e),o=e.read_shift(2);o=Ao(e,o,n);return e.l=t,i.t="str",i.val=o,i}},223:{},234:{},354:{},421:{},518:{f:Aa},521:{f:zo},536:{f:Xo},547:{f:Ko},561:{},579:{},1030:{f:Aa},1033:{f:zo},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function Ms(e,t,n,i){var o;isNaN(t)||(i=i||(n||[]).length||0,(o=e.next(4)).write_shift(2,t),o.write_shift(2,i),0<i&&ei(n)&&e.push(n))}function Ds(e,t){var n=t||{},i=n.dense?[]:{};if(!(t=(e=e.replace(/<!--.*?-->/g,"")).match(/<table/i)))throw new Error("Invalid HTML: could not find <table>");var o=e.match(/<\/table/i),r=t.index,a=o&&o.index||e.length,s=Ht(e.slice(r,a),/(:?<tr[^>]*>)/i,"<tr>"),l=-1,c=0,u={s:{r:1e7,c:1e7},e:{r:0,c:0}},d=[];for(r=0;r<s.length;++r){var h=s[r].trim(),p=h.slice(0,3).toLowerCase();if("<tr"==p){if(++l,n.sheetRows&&n.sheetRows<=l){--l;break}c=0}else if("<td"==p||"<th"==p){var f=h.split(/<\/t[dh]>/i);for(a=0;a<f.length;++a){if((y=f[a].trim()).match(/<t[dh]/i)){for(var m=y,g=0;"<"==m.charAt(0)&&-1<(g=m.indexOf(">"));)m=m.slice(g+1);for(var v=0;v<d.length;++v){var b=d[v];b.s.c==c&&b.s.r<l&&l<=b.e.r&&(c=b.e.c+1,v=-1)}var y,w=(y=sn(y.slice(0,y.indexOf(">")))).colspan?+y.colspan:1,x=((1<(x=+y.rowspan)||1<w)&&d.push({s:{r:l,c:c},e:{r:l+(x||1)-1,c:c+w-1}}),y.t||y["data-t"]||"");m.length&&(m=kn(m),u.s.r>l&&(u.s.r=l),u.e.r<l&&(u.e.r=l),u.s.c>c&&(u.s.c=c),u.e.c<c&&(u.e.c=c),m.length)&&(y={t:"s",v:m},!n.raw&&m.trim().length&&"s"!=x&&("TRUE"===m?y={t:"b",v:!0}:"FALSE"===m?y={t:"b",v:!1}:isNaN(zt(m))?isNaN(Wt(m).getDate())||(y={t:"d",v:Ft(m)},(y=n.cellDates?y:{t:"n",v:$t(y.v)}).z=n.dateNF||Ke[14]):y={t:"n",v:zt(m)}),n.dense?(i[l]||(i[l]=[]),i[l][c]=y):i[Ci({r:l,c:c})]=y),c+=w}}}}return i["!ref"]=Ti(u),d.length&&(i["!merges"]=d),i}function $s(e,t,n,i){for(var o=e["!merges"]||[],r=[],a=t.s.c;a<=t.e.c;++a){for(var s,l,c,u,d=0,h=0,p=0;p<o.length;++p)if(!(o[p].s.r>n||o[p].s.c>a||o[p].e.r<n||o[p].e.c<a)){if(o[p].s.r<n||o[p].s.c<a){d=-1;break}d=o[p].e.r-o[p].s.r+1,h=o[p].e.c-o[p].s.c+1;break}d<0||(s=Ci({r:n,c:a}),c=(l=i.dense?(e[n]||[])[a]:e[s])&&null!=l.v&&(l.h||fn(l.w||(Oi(l),l.w)||""))||"",u={},1<d&&(u.rowspan=d),1<h&&(u.colspan=h),i.editable?c='<span contenteditable="true">'+c+"</span>":l&&(u["data-t"]=l&&l.t||"z",null!=l.v&&(u["data-v"]=l.v),null!=l.z&&(u["data-z"]=l.z),l.l)&&"#"!=(l.l.Target||"#").charAt(0)&&(c='<a href="'+l.l.Target+'">'+c+"</a>"),u.id=(i.id||"sjs")+"-"+s,r.push(On("td",c,u)))}return"<tr>"+r.join("")+"</tr>"}function Ps(e,t,n){var i,o=n||{},r=0,a=0,s=(null!=o.origin&&("number"==typeof o.origin?r=o.origin:(r=(n="string"==typeof o.origin?Ei(o.origin):o.origin).r,a=n.c)),t.getElementsByTagName("tr")),l=Math.min(o.sheetRows||1e7,s.length),c={s:{r:0,c:0},e:{r:r,c:a}},u=(e["!ref"]&&(n=Si(e["!ref"]),c.s.r=Math.min(c.s.r,n.s.r),c.s.c=Math.min(c.s.c,n.s.c),c.e.r=Math.max(c.e.r,n.e.r),c.e.c=Math.max(c.e.c,n.e.c),-1==r)&&(c.e.r=r=n.e.r+1),[]),d=0,h=e["!rows"]||(e["!rows"]=[]),p=0,f=0,m=0,g=0;for(e["!cols"]||(e["!cols"]=[]);p<s.length&&f<l;++p){var v=s[p];if(Ls(v)){if(o.display)continue;h[f]={hidden:!0}}var b=v.children;for(m=g=0;m<b.length;++m){var y=b[m];if(!o.display||!Ls(y)){var w=y.hasAttribute("data-v")?y.getAttribute("data-v"):y.hasAttribute("v")?y.getAttribute("v"):kn(y.innerHTML),x=y.getAttribute("data-z")||y.getAttribute("z");for(d=0;d<u.length;++d){var _=u[d];_.s.c==g+a&&_.s.r<f+r&&f+r<=_.e.r&&(g=_.e.c+1-a,d=-1)}i=+y.getAttribute("colspan")||1,(1<(k=+y.getAttribute("rowspan")||1)||1<i)&&u.push({s:{r:f+r,c:g+a},e:{r:f+r+(k||1)-1,c:g+a+(i||1)-1}});var k={t:"s",v:w},E=y.getAttribute("data-t")||y.getAttribute("t")||"",C=(null!=w&&(0==w.length?k.t=E||"z":o.raw||0==w.trim().length||"s"==E||("TRUE"===w?k={t:"b",v:!0}:"FALSE"===w?k={t:"b",v:!1}:isNaN(zt(w))?isNaN(Wt(w).getDate())||(k={t:"d",v:Ft(w)},(k=o.cellDates?k:{t:"n",v:$t(k.v)}).z=o.dateNF||Ke[14]):k={t:"n",v:zt(w)})),void 0===k.z&&null!=x&&(k.z=x),""),S=y.getElementsByTagName("A");if(S&&S.length)for(var T=0;T<S.length&&(!S[T].hasAttribute("href")||"#"==(C=S[T].getAttribute("href")).charAt(0));++T);C&&"#"!=C.charAt(0)&&(k.l={Target:C}),o.dense?(e[f+r]||(e[f+r]=[]),e[f+r][g+a]=k):e[Ci({c:g+a,r:f+r})]=k,c.e.c<g+a&&(c.e.c=g+a),g+=i}}++f}return u.length&&(e["!merges"]=(e["!merges"]||[]).concat(u)),c.e.r=Math.max(c.e.r,f-1+r),e["!ref"]=Ti(c),l<=f&&(e["!fullref"]=Ti((c.e.r=s.length-p+f-1+r,c))),e}function Rs(e,t){return Ps((t||{}).dense?[]:{},e,t)}function Ls(e){var t="",n=(n=e).ownerDocument.defaultView&&"function"==typeof n.ownerDocument.defaultView.getComputedStyle?n.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null;return"none"===((t=n?n(e).getPropertyValue("display"):t)||e.style&&e.style.display)}var Is={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function Ns(e,t){var n,i,o,r,a,s=t||{},l=Mn(e),c=[],u={name:""},d=0,h={},p=[],f=s.dense?[]:{},m={value:""},g="",v=0,b=[],y=-1,w=-1,x={s:{r:1e6,c:1e7},e:{r:0,c:0}},_=0,k=[],E={},C=0,S=0,T=[],A=1,O=1,M=[],D={Names:[]},$={},P=["",""],R=[],L={},I="",N=0,F=!1,j=!1,B=0;for(Dn.lastIndex=0,l=l.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");o=Dn.exec(l);)switch(o[3]=o[3].replace(/_.*$/,"")){case"table":case"工作表":"/"===o[1]?(x.e.c>=x.s.c&&x.e.r>=x.s.r?f["!ref"]=Ti(x):f["!ref"]="A1:A1",0<s.sheetRows&&s.sheetRows<=x.e.r&&(f["!fullref"]=f["!ref"],x.e.r=s.sheetRows-1,f["!ref"]=Ti(x)),k.length&&(f["!merges"]=k),T.length&&(f["!rows"]=T),i.name=i["名称"]||i.name,"undefined"!=typeof JSON&&JSON.stringify(i),p.push(i.name),h[i.name]=f,j=!1):"/"!==o[0].charAt(o[0].length-2)&&(i=sn(o[0],!1),y=w=-1,x.s.r=x.s.c=1e7,x.e.r=x.e.c=0,f=s.dense?[]:{},k=[],T=[],j=!0);break;case"table-row-group":"/"===o[1]?--_:++_;break;case"table-row":case"行":if("/"===o[1])y+=A,A=1;else{if((q=sn(o[0],!1))["行号"]?y=q["行号"]-1:-1==y&&(y=0),(A=+q["number-rows-repeated"]||1)<10)for(B=0;B<A;++B)0<_&&(T[y+B]={level:_});w=-1}break;case"covered-table-cell":"/"!==o[1]&&++w,s.sheetStubs&&(s.dense?(f[y]||(f[y]=[]),f[y][w]={t:"z"}):f[Ci({r:y,c:w})]={t:"z"}),g="",b=[];break;case"table-cell":case"数据":if("/"===o[0].charAt(o[0].length-2))++w,m=sn(o[0],!1),O=parseInt(m["number-columns-repeated"]||"1",10),r={t:"z",v:null},m.formula&&0!=s.cellFormula&&(r.f=Na(dn(m.formula))),"string"==(m["数据类型"]||m["value-type"])&&(r.t="s",r.v=dn(m["string-value"]||""),s.dense?(f[y]||(f[y]=[]),f[y][w]=r):f[Ci({r:y,c:w})]=r),w+=O-1;else if("/"!==o[1]){g="",v=0,b=[],O=1;var q=A?y+A-1:y;if(++w>x.e.c&&(x.e.c=w),w<x.s.c&&(x.s.c=w),y<x.s.r&&(x.s.r=y),q>x.e.r&&(x.e.r=q),R=[],r={t:(m=sn(o[0],!(L={})))["数据类型"]||m["value-type"],v:null},s.cellFormula)if(m.formula&&(m.formula=dn(m.formula)),m["number-matrix-columns-spanned"]&&m["number-matrix-rows-spanned"]&&(C=parseInt(m["number-matrix-rows-spanned"],10)||0,S=parseInt(m["number-matrix-columns-spanned"],10)||0,r.F=Ti(E={s:{r:y,c:w},e:{r:y+C-1,c:w+S-1}}),M.push([E,r.F])),m.formula)r.f=Na(m.formula);else for(B=0;B<M.length;++B)y>=M[B][0].s.r&&y<=M[B][0].e.r&&w>=M[B][0].s.c&&w<=M[B][0].e.c&&(r.F=M[B][1]);switch((m["number-columns-spanned"]||m["number-rows-spanned"])&&(C=parseInt(m["number-rows-spanned"],10)||0,S=parseInt(m["number-columns-spanned"],10)||0,k.push(E={s:{r:y,c:w},e:{r:y+C-1,c:w+S-1}})),m["number-columns-repeated"]&&(O=parseInt(m["number-columns-repeated"],10)),r.t){case"boolean":r.t="b",r.v=gn(m["boolean-value"]);break;case"float":case"percentage":case"currency":r.t="n",r.v=parseFloat(m.value);break;case"date":r.t="d",r.v=Ft(m["date-value"]),s.cellDates||(r.t="n",r.v=$t(r.v)),r.z="m/d/yy";break;case"time":r.t="n",r.v=function(e){var t=0,n=0,i=!1,o=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!o)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var r=1;r!=o.length;++r)if(o[r]){switch(3<r&&(i=!0),o[r].slice(o[r].length-(n=1))){case"Y":throw new Error("Unsupported ISO Duration Field: "+o[r].slice(o[r].length-1));case"D":n*=24;case"H":n*=60;case"M":if(!i)throw new Error("Unsupported ISO Duration Field: M");n*=60}t+=n*parseInt(o[r],10)}return t}(m["time-value"])/86400,s.cellDates&&(r.t="d",r.v=Lt(r.v)),r.z="HH:MM:SS";break;case"number":r.t="n",r.v=parseFloat(m["数据数值"]);break;default:if("string"!==r.t&&"text"!==r.t&&r.t)throw new Error("Unsupported value type "+r.t);r.t="s",null!=m["string-value"]&&(g=dn(m["string-value"]),b=[])}}else{if(F=!1,"s"===r.t&&(r.v=g||"",b.length&&(r.R=b),F=0==v),$.Target&&(r.l=$),0<R.length&&(r.c=R,R=[]),g&&!1!==s.cellText&&(r.w=g),F&&(r.t="z",delete r.v),(!F||s.sheetStubs)&&!(s.sheetRows&&s.sheetRows<=y))for(var z=0;z<A;++z){if(O=parseInt(m["number-columns-repeated"]||"1",10),s.dense)for(f[y+z]||(f[y+z]=[]),f[y+z][w]=0==z?r:Bt(r);0<--O;)f[y+z][w+O]=Bt(r);else for(f[Ci({r:y+z,c:w})]=r;0<--O;)f[Ci({r:y+z,c:w+O})]=Bt(r);x.e.c<=w&&(x.e.c=w)}w+=(O=parseInt(m["number-columns-repeated"]||"1",10))-1,O=0,r={},g="",b=[]}$={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if("/"===o[1]){if((n=c.pop())[0]!==o[3])throw"Bad state: "+n}else"/"!==o[0].charAt(o[0].length-2)&&c.push([o[3],!0]);break;case"annotation":if("/"===o[1]){if((n=c.pop())[0]!==o[3])throw"Bad state: "+n;L.t=g,b.length&&(L.R=b),L.a=I,R.push(L)}else"/"!==o[0].charAt(o[0].length-2)&&c.push([o[3],!1]);g=I="",v=N=0,b=[];break;case"creator":"/"===o[1]?I=l.slice(N,o.index):N=o.index+o[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if("/"===o[1]){if((n=c.pop())[0]!==o[3])throw"Bad state: "+n}else"/"!==o[0].charAt(o[0].length-2)&&c.push([o[3],!1]);g="",v=0,b=[];break;case"scientific-number":case"currency-symbol":case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if("/"===o[1]){if(u.name,(n=c.pop())[0]!==o[3])throw"Bad state: "+n}else"/"!==o[0].charAt(o[0].length-2)&&(u=sn(o[0],!1),c.push([o[3],!0]));break;case"script":case"libraries":case"automatic-styles":break;case"default-style":case"page-layout":case"style":case"map":case"font-face":case"paragraph-properties":case"table-properties":case"table-column-properties":case"table-row-properties":case"table-cell-properties":break;case"number":switch(c[c.length-1][0]){case"time-style":case"date-style":V=sn(o[0],!1),Is[o[3]]["long"===V.style?1:0]}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(c[c.length-1][0]){case"time-style":case"date-style":V=sn(o[0],!1),Is[o[3]]["long"===V.style?1:0]}break;case"boolean-style":case"boolean":case"text-style":break;case"text":if("/>"!==o[0].slice(-2))if("/"===o[1])switch(c[c.length-1][0]){case"number-style":case"date-style":case"time-style":l.slice(d,o.index)}else d=o.index+o[0].length;break;case"named-range":P=Fa((V=sn(o[0],!1))["cell-range-address"]);var V,W={Name:V.name,Ref:P[0]+"!"+P[1]};j&&(W.Sheet=p.length),D.Names.push(W);break;case"text-content":case"text-properties":case"embedded-text":break;case"body":case"电子表格":case"forms":case"table-column":case"table-header-rows":case"table-rows":case"table-column-group":case"table-header-columns":case"table-columns":case"null-date":case"graphic-properties":case"calculation-settings":case"named-expressions":case"label-range":case"label-ranges":case"named-expression":case"sort":case"sort-by":case"sort-groups":case"tab":case"line-break":case"span":break;case"p":case"文本串":-1<["master-styles"].indexOf(c[c.length-1][0])||("/"!==o[1]||m&&m["string-value"]?(sn(o[0],!1),v=o.index+o[0].length):(W=(W=l.slice(v,o.index)).replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,(function(e,t){return Array(parseInt(t,10)+1).join(" ")})).replace(/<text:tab[^>]*\/>/g,"\t").replace(/<text:line-break\/>/g,"\n"),a=[dn(W.replace(/<[^>]*>/g,""))],g=(0<g.length?g+"\n":"")+a[0]));break;case"s":break;case"database-range":if("/"!==o[1])try{h[(P=Fa(sn(o[0])["target-range-address"]))[0]]["!autofilter"]={ref:P[1]}}catch(t){}break;case"date":case"object":break;case"title":case"标题":case"desc":case"binary-data":case"table-source":case"scenario":case"iteration":case"content-validations":case"content-validation":case"help-message":case"error-message":case"database-ranges":case"filter":case"filter-and":case"filter-or":case"filter-condition":case"list-level-style-bullet":case"list-level-style-number":case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":case"config-item":case"page-number":case"page-count":case"time":case"cell-range-source":case"detective":case"operation":case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":case"properties":case"property":break;case"a":if("/"!==o[1]){if(!($=sn(o[0],!1)).href)break;$.Target=dn($.href),delete $.href,"#"==$.Target.charAt(0)&&-1<$.Target.indexOf(".")?(P=Fa($.Target.slice(1)),$.Target="#"+P[0]+"!"+P[1]):$.Target.match(/^\.\.[\\\/]/)&&($.Target=$.Target.slice(3))}break;case"table-protection":case"data-pilot-grand-total":case"office-document-common-attrs":break;default:switch(o[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(s.WTF)throw new Error(o)}}return t={Sheets:h,SheetNames:p,Workbook:D},s.bookSheets&&delete t.Sheets,t}function Fs(e,t){if(t=t||{},Kt(e,"META-INF/manifest.xml"))for(var n,i,o=Xt(e,"META-INF/manifest.xml"),r=t,a=Mn(o);n=Dn.exec(a);)switch(n[3]){case"manifest":break;case"file-entry":if("/"==(i=sn(n[0],!1)).path&&"application/vnd.oasis.opendocument.spreadsheet"!==i.type)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(r&&r.WTF)throw n}if(o=Jt(e,"content.xml"))return t=Ns(wn(o),t),Kt(e,"meta.xml")&&(t.Props=ao(Xt(e,"meta.xml"))),t;throw new Error("Missing content.xml in ODS / UOF file")}function js(e,t){return Ns(e,t)}
|
116
116
|
/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Bs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function qs(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):wn(Re(e))}function zs(e){var t=e.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(t),i=0;return e.forEach((function(e){n.set(e,i),i+=e.length})),n}function Vs(e){return 16843009*((e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135)>>>24}function Ws(e,t){var n=t?t[0]:0,i=127&e[n];return 128<=e[n++]&&(i|=(127&e[n])<<7,e[n++]<128||(i|=(127&e[n])<<14,e[n++]<128)||(i|=(127&e[n])<<21,e[n++]<128)||(i+=(127&e[n])*Math.pow(2,28),++n,e[n++]<128)||(i+=(127&e[n])*Math.pow(2,35),++n,e[n++]<128)||(i+=(127&e[n])*Math.pow(2,42),++n,e[n++])),t&&(t[0]=n),i}function Hs(e){var t=0,n=127&e[0];return 128<=e[t++]&&(n|=(127&e[1])<<7,e[t++]<128||(n|=(127&e[2])<<14,e[t++]<128)||(n|=(127&e[3])<<21,e[+t]<128)||(n|=(127&e[4])<<28)),n}function Us(e){for(var t=[],n=[0];n[0]<e.length;){var i,o=n[0],r=Ws(e,n),a=7&r,s=0;if(0==(r=Math.floor(r/8)))break;switch(a){case 0:for(var l=n[0];128<=e[n[0]++];);i=e.slice(l,n[0]);break;case 5:i=e.slice(n[0],n[0]+(s=4)),n[0]+=s;break;case 1:i=e.slice(n[0],n[0]+(s=8)),n[0]+=s;break;case 2:s=Ws(e,n),i=e.slice(n[0],n[0]+s),n[0]+=s;break;default:throw new Error("PB Type ".concat(a," for Field ").concat(r," at offset ").concat(o))}var c={data:i,type:a};null==t[r]?t[r]=[c]:t[r].push(c)}return t}function Gs(e,t){return(null==e?void 0:e.map((function(e){return t(e.data)})))||[]}function Ks(e,t,n){switch(e[0]){case 0:case 1:case 2:case 3:var i,o=e,r=t,a=n,s=e[0],l=Bs(o),c=l.getUint32(4,!0),u=(1<s?12:8)+4*Vs(c&(1<s?3470:398)),d=-1,h=-1,p=NaN,f=new Date(2001,0,1);switch(512&c&&(d=l.getUint32(u,!0),u+=4),u+=4*Vs(c&(1<s?12288:4096)),16&c&&(h=l.getUint32(u,!0),u+=4),32&c&&(p=l.getFloat64(u,!0),u+=8),64&c&&(f.setTime(f.getTime()+1e3*l.getFloat64(u,!0)),u+=8),o[2]){case 0:break;case 2:i={t:"n",v:p};break;case 3:i={t:"s",v:r[h]};break;case 5:i={t:"d",v:f};break;case 6:i={t:"b",v:0<p};break;case 7:i={t:"n",v:p/86400};break;case 8:i={t:"e",v:0};break;case 9:if(-1<d)i={t:"s",v:a[d]};else if(-1<h)i={t:"s",v:r[h]};else{if(isNaN(p))throw new Error("Unsupported cell type ".concat(o.slice(0,4)));i={t:"n",v:p}}break;default:throw new Error("Unsupported cell type ".concat(o.slice(0,4)))}return i;case 5:return function(e,t,n){var i,o=Bs(e),r=o.getUint32(8,!0),a=12,s=-1,l=-1,c=NaN,u=NaN,d=new Date(2001,0,1);switch(1&r&&(c=function(e,t){for(var n=(127&e[t+15])<<7|e[t+14]>>1,i=1&e[t+14],o=t+13;t<=o;--o)i=256*i+e[o];return(128&e[t+15]?-i:i)*Math.pow(10,n-6176)}(e,a),a+=16),2&r&&(u=o.getFloat64(a,!0),a+=8),4&r&&(d.setTime(d.getTime()+1e3*o.getFloat64(a,!0)),a+=8),8&r&&(l=o.getUint32(a,!0),a+=4),16&r&&(s=o.getUint32(a,!0),a+=4),e[1]){case 0:break;case 2:i={t:"n",v:c};break;case 3:i={t:"s",v:t[l]};break;case 5:i={t:"d",v:d};break;case 6:i={t:"b",v:0<u};break;case 7:i={t:"n",v:u/86400};break;case 8:i={t:"e",v:0};break;case 9:if(!(-1<s))throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&r," : ").concat(e.slice(0,4)));i={t:"s",v:n[s]};break;case 10:i={t:"n",v:c};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(31&r," : ").concat(e.slice(0,4)))}return i}(e,t,n);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function Ys(e){return Ws(Us(e)[1][0].data)}function Xs(e,t){var n=Hs((t=Us(t.data))[1][0].data),i=(t=t[3],[]);return(t||[]).forEach((function(t){var o=Us(t.data),r=Hs(o[1][0].data)>>>0;switch(n){case 1:i[r]=qs(o[3][0].data);break;case 8:var a=Us(e[Ys(o[9][0].data)][0].data),s=Hs((a=e[Ys(a[1][0].data)][0]).meta[1][0].data);if(2001!=s)throw new Error("2000 unexpected reference to ".concat(s));s=Us(a.data),i[r]=s[3].map((function(e){return qs(e.data)})).join("")}})),i}function Js(e,t){var n={"!ref":"A1"};if(6001!=(o=Hs((t=e[Ys(Us(t.data)[2][0].data)])[0].meta[1][0].data)))throw new Error("6000 unexpected reference to ".concat(o));var i=e,o=t[0],r=n;o=Us(o.data);if((e={s:{r:0,c:0},e:{r:0,c:0}}).e.r=(Hs(o[6][0].data)>>>0)-1,e.e.r<0)throw new Error("Invalid row varint ".concat(o[6][0].data));if(e.e.c=(Hs(o[7][0].data)>>>0)-1,e.e.c<0)throw new Error("Invalid col varint ".concat(o[7][0].data));r["!ref"]=Ti(e);e=Us(o[4][0].data);var a=Xs(i,i[Ys(e[4][0].data)][0]),s=null!=(o=e[17])&&o[0]?Xs(i,i[Ys(e[17][0].data)][0]):[],l=(o=Us(e[3][0].data),0);return o[1].forEach((function(e){e=Us(e.data);var t=Hs((e=i[Ys(e[2][0].data)][0]).meta[1][0].data);if(6002!=t)throw new Error("6001 unexpected reference to ".concat(t));(t=function(e,t){var n=null!=(i=null==(t=Us(t.data))?void 0:t[7])&&i[0]?0<Hs(t[7][0].data)>>>0?1:0:-1,i=Gs(t[5],(function(e){var t,i,o,r=n,a=Hs((e=Us(e))[1][0].data)>>>0,s=Hs(e[2][0].data)>>>0,l=(null==(l=null==(l=e[8])?void 0:l[0])?void 0:l.data)&&0<Hs(e[8][0].data)||!1;if(null!=(t=null==(t=e[7])?void 0:t[0])&&t.data&&0!=r)i=null==(t=null==(t=e[7])?void 0:t[0])?void 0:t.data,o=null==(t=null==(t=e[6])?void 0:t[0])?void 0:t.data;else{if(null==(t=null==(t=e[4])?void 0:t[0])||!t.data||1==r)throw"NUMBERS Tile missing ".concat(r," cell storage");i=null==(r=null==(t=e[4])?void 0:t[0])?void 0:r.data,o=null==(r=null==(t=e[3])?void 0:t[0])?void 0:r.data}for(var c=l?4:1,u=Bs(i),d=[],h=0;h<i.length/2;++h){var p=u.getUint16(2*h,!0);p<65535&&d.push([h,p])}if(d.length!=s)throw"Expected ".concat(s," cells, found ").concat(d.length);var f=[];for(h=0;h<d.length-1;++h)f[d[h][0]]=o.subarray(d[h][1]*c,d[h+1][1]*c);return 1<=d.length&&(f[d[d.length-1][0]]=o.subarray(d[d.length-1][1]*c)),{R:a,cells:f}}));return{nrows:Hs(t[4][0].data)>>>0,data:i.reduce((function(e,t){return e[t.R]||(e[t.R]=[]),t.cells.forEach((function(n,i){if(e[t.R][i])throw new Error("Duplicate cell r=".concat(t.R," c=").concat(i));e[t.R][i]=n})),e}),[])}}(0,e)).data.forEach((function(e,t){e.forEach((function(e,n){n=Ci({r:l+t,c:n}),(e=Ks(e,a,s))&&(r[n]=e)}))})),l+=t.nrows})),n}function Zs(e){var t={},n=[];if(e.FullPaths.forEach((function(e){if(e.match(/\.iwpv2/))throw new Error("Unsupported password protection")})),e.FileIndex.forEach((function(e){if(e.name.match(/\.iwa$/)){var i,o;try{i=function(e){for(var t=[],n=0;n<e.length;){var i=e[n++],o=e[n]|e[n+1]<<8|e[n+2]<<16;n+=3,t.push(function(e,t){if(0!=e)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var n=[0],i=(e=Ws(t,n),[]);n[0]<t.length;){var o=3&t[n[0]];if(0==o){var r=t[n[0]++]>>2;r<60?++r:(a=r-59,r=t[n[0]],1<a&&(r|=t[n[0]+1]<<8),2<a&&(r|=t[n[0]+2]<<16),3<a&&(r|=t[n[0]+3]<<24),r>>>=0,r++,n[0]+=a),i.push(t.slice(n[0],n[0]+r)),n[0]+=r}else{var a=0,s=0;if(1==o?(s=4+(t[n[0]]>>2&7),a=(224&t[n[0]++])<<3,a|=t[n[0]++]):(s=1+(t[n[0]++]>>2),2==o?(a=t[n[0]]|t[n[0]+1]<<8,n[0]+=2):(a=(t[n[0]]|t[n[0]+1]<<8|t[n[0]+2]<<16|t[n[0]+3]<<24)>>>0,n[0]+=4)),i=[zs(i)],0==a)throw new Error("Invalid offset 0");if(a>i[0].length)throw new Error("Invalid offset beyond length");if(a<=s)for(i.push(i[0].slice(-a)),s-=a;s>=i[i.length-1].length;)i.push(i[i.length-1]),s-=i[i.length-1].length;i.push(i[0].slice(-a,-a+s))}}var l=zs(i);if(l.length!=e)throw new Error("Unexpected length: ".concat(l.length," != ").concat(e));return l}(i,e.slice(n,n+o))),n+=o}if(n!==e.length)throw new Error("data is not a valid framed stream!");return zs(t)}(e.content)}catch(i){return console.log("?? "+e.content.length+" "+(i.message||i))}try{o=function(e){for(var t=[],n=[0];n[0]<e.length;){var i=Ws(e,n),o=Us(e.slice(n[0],n[0]+i)),r=(n[0]+=i,{id:Hs(o[1][0].data),messages:[]});o[2].forEach((function(t){var i=Hs((t=Us(t.data))[3][0].data);r.messages.push({meta:t,data:e.slice(n[0],n[0]+i)}),n[0]+=i})),null!=(i=o[3])&&i[0]&&(r.merge=0<Hs(o[3][0].data)>>>0),t.push(r)}return t}(i)}catch(i){return console.log("## "+(i.message||i))}o.forEach((function(e){t[e.id]=e.messages,n.push(e.id)}))}})),!n.length)throw new Error("File has no messages");var i=(null==(e=null==(e=null==(e=null==(e=null==t?void 0:t[1])?void 0:e[0])?void 0:e.meta)?void 0:e[1])?void 0:e[0].data)&&1==Hs(t[1][0].meta[1][0].data)&&t[1][0];if(i||n.forEach((function(e){t[e].forEach((function(e){if(1==Hs(e.meta[1][0].data)>>>0){if(i)throw new Error("Document has multiple roots");i=e}}))})),i)return function(e,t){var n={SheetNames:[],Sheets:{}};if(Gs(Us(t.data)[1],Ys).forEach((function(t){e[t].forEach((function(t){var i,o,r,a;2==Hs(t.meta[1][0].data)&&(o=e,t=Us((t=t).data),a={name:null!=(r=t[1])&&r[0]?qs(t[1][0].data):"",sheets:[]},Gs(t[2],Ys).forEach((function(e){o[e].forEach((function(e){6e3==Hs(e.meta[1][0].data)&&a.sheets.push(Js(o,e))}))})),(i=a).sheets.forEach((function(e,t){gl(n,e,0==t?i.name:i.name+"_"+t,!0)})))}))})),0==n.SheetNames.length)throw new Error("Empty NUMBERS file");return n}(t,i);throw new Error("Cannot find Document root")}function Qs(e){!function(e){return function(t){for(var n=0;n!=e.length;++n){var i=e[n];void 0===t[i[0]]&&(t[i[0]]=i[1]),"n"===i[2]&&(t[i[0]]=Number(t[i[0]]))}}}([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function el(e,t,n,i,o,r,a,s,l,c,u,d){try{r[i]=io(Jt(e,n,!0),t);var h,p,f,m,g,v=Xt(e,t);switch(s){case"sheet":g=fs(v,t,o,l,r[i],c,u,d);break;case"chart":(g=function(e,t,n,i,o,r){if(".bin"===t.slice(-4)){var a=i,s=n,l=r;if(!(t=e))return t;i=(i=o)||{"!id":{}};var c={"!type":"chart","!drawel":null,"!rel":""},u=[],d=!1;return fi(t,(function(e,t,n){switch(n){case 550:c["!rel"]=e;break;case 651:l.Sheets[s]||(l.Sheets[s]={}),e.name&&(l.Sheets[s].CodeName=e.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:d=!0;break;case 36:d=!1;break;case 37:u.push(n);break;case 38:u.pop();break;default:if(0<t.T)u.push(n);else if(t.T<0)u.pop();else if(!d||a.WTF)throw new Error("Unexpected record 0x"+n.toString(16))}}),a),i["!id"][c["!rel"]]&&(c["!drawel"]=i["!id"][c["!rel"]]),c}return i=n,n=r,(t=e)?(e=(e=o)||{"!id":{}},o={"!type":"chart","!drawel":null,"!rel":""},(r=t.match(Xa))&&Qa(r[0],0,n,i),(r=t.match(/drawing r:id="(.*?)"/))&&(o["!rel"]=r[1]),e["!id"][o["!rel"]]&&(o["!drawel"]=e["!id"][o["!rel"]]),o):t}(v,t,o,l,r[i],c))&&g["!drawel"]&&(p=no(h=en(g["!drawel"].Target,t)),y=Jt(e,h,!0),w=io(Jt(e,p,!0),h),m=no(f=en(y?(y=(y.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1],w["!id"][y].Target):"??",h)),g=function(e,t,n,i,o,r){var a,s,l,c,u=r||{"!type":"chart"};return e?(l="A",c={s:{r:2e6,c:2e6},e:{r:s=a=0,c:0}},(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach((function(e){n=[],i=(e=e).match(/^<c:numCache>/),(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach((function(e){(e=e.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/))&&(n[+e[1]]=i?+e[2]:e[2])})),o=dn((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]),(e.match(/<c:f>(.*?)<\/c:f>/gm)||[]).forEach((function(e){t=e.replace(/<.*?>/g,"")}));var t,n,i,o,r=[n,o,t];c.s.r=c.s.c=0,c.e.c=a,l=ki(a),r[0].forEach((function(e,t){u[l+xi(t)]={t:"n",v:e,z:r[1]},s=t})),c.e.r<s&&(c.e.r=s),++a})),0<a&&(u["!ref"]=Ti(c)),u):r}(Jt(e,f,!0),0,0,io(Jt(e,m,!0),f),0,g));break;case"macro":r[i],t.slice(-4),g={"!type":"macro"};break;case"dialog":r[i],t.slice(-4),g={"!type":"dialog"};break;default:throw new Error("Unrecognized sheet type "+s)}a[i]=g;var b=[];r&&r[i]&&Ot(r[i]).forEach((function(n){var o,a,s,c,u,d,h="";if(r[i][n].Type==to.CMNT){h=en(r[i][n].Target,t);var p=function(e,t,n){var i,o,r,a,s,l,c,u;return".bin"===t.slice(-4)?(i=n,o=[],r=[],s=!(a={}),fi(e,(function(e,t,n){switch(n){case 632:r.push(e);break;case 635:a=e;break;case 637:a.t=e.t,a.h=e.h,a.r=e.r;break;case 636:a.author=r[a.iauthor],delete a.iauthor,i.sheetRows&&a.rfx&&i.sheetRows<=a.rfx.r||(a.t||(a.t=""),delete a.rfx,o.push(a));break;case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:case 38:break;default:if(!t.T&&(!s||i.WTF))throw new Error("Unexpected record 0x"+n.toString(16))}})),o):(l=n,(t=e).match(/<(?:\w+:)?comments *\/>/)?[]:(c=[],u=[],(n=t.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/))&&n[1]&&n[1].split(/<\/\w*:?author>/).forEach((function(e){""!==e&&""!==e.trim()&&(e=e.match(/<(?:\w+:)?author[^>]*>(.*)/))&&c.push(e[1])})),(n=t.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/))&&n[1]&&n[1].split(/<\/\w*:?comment>/).forEach((function(e){var t,n;""!==e&&""!==e.trim()&&(n=e.match(/<(?:\w+:)?comment[^>]*>/))&&(t={author:(n=sn(n[0])).authorId&&c[n.authorId]||"sheetjsghost",ref:n.ref,guid:n.guid},n=Ei(n.ref),l.sheetRows&&l.sheetRows<=n.r||(e=!!(n=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/))&&!!n[1]&&gr(n[1])||{r:"",t:"",h:""},t.r=e.r,"<t></t>"==e.r&&(e.t=e.h=""),t.t=(e.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),l.cellHTML&&(t.h=e.h),u.push(t)))})),u))}(Xt(e,h,!0),h,l);if(!p||!p.length)return;Qr(g,p,!1)}r[i][n].Type==to.TCMNT&&(h=en(r[i][n].Target,t),b=b.concat((o=Xt(e,h,!0),a=l,c=!(s=[]),u={},d=0,o.replace(on,(function(e,t){var n=sn(e);switch(ln(n[0])){case"<?xml":case"<ThreadedComments":case"</ThreadedComments>":break;case"<threadedComment":u={author:n.personId,guid:n.id,ref:n.ref,T:1};break;case"</threadedComment>":null!=u.t&&s.push(u);break;case"<text>":case"<text":d=t+e.length;break;case"</text>":u.t=o.slice(d,t).replace(/\r\n/g,"\n").replace(/\r/g,"\n");break;case"<mentions":case"<mentions>":c=!0;break;case"</mentions>":c=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":c=!0;break;case"</ext>":c=!1;break;default:if(!c&&a.WTF)throw new Error("unrecognized "+n[0]+" in threaded comments")}return e})),s)))})),b&&b.length&&Qr(g,b,!0,l.people||[])}catch(n){if(l.WTF)throw n}var y,w}function tl(e){return"/"==e.charAt(0)?e.slice(1):e}function nl(e,t){if(Et(),Qs(t=t||{}),Kt(e,"META-INF/manifest.xml"))return Fs(e,t);if(Kt(e,"objectdata.xml"))return Fs(e,t);if(Kt(e,"Index/Document.iwa")){if("undefined"==typeof Uint8Array)throw new Error("NUMBERS file parsing requires Uint8Array support");var n;return e.FileIndex?Zs(e):(n=At.utils.cfb_new(),Zt(e).forEach((function(t){!function(e,t,n){if(e.FullPaths){var i;if("string"==typeof n)return i=(Oe?Me:function(e){for(var t=[],n=0,i=e.length+250,o=De(e.length+255),r=0;r<e.length;++r){var a,s=e.charCodeAt(r);s<128?o[n++]=s:s<2048?(o[n++]=192|s>>6&31,o[n++]=128|63&s):55296<=s&&s<57344?(s=64+(1023&s),a=1023&e.charCodeAt(++r),o[n++]=240|s>>8&7,o[n++]=128|s>>2&63,o[n++]=128|a>>6&15|(3&s)<<4,o[n++]=128|63&a):(o[n++]=224|s>>12&15,o[n++]=128|s>>6&63,o[n++]=128|63&s),i<n&&(t.push(o.slice(0,n)),n=0,o=De(65535),i=65530)}return t.push(o.slice(0,n)),Ie(t)})(n),At.utils.cfb_add(e,t,i);At.utils.cfb_add(e,t,n)}else e.file(t,n)}(n,t,function e(t,n,i){if(!i)return Gt(Yt(t,n));if(!n)return null;try{return e(t,n)}catch(e){return null}}(e,t))})),Zs(n))}if(!Kt(e,"[Content_Types].xml")){if(Kt(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(Kt(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");throw new Error("Unsupported ZIP file")}var i=Zt(e),o=function(e){var t={workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""};if(e&&e.match){var n={};if((e.match(on)||[]).forEach((function(e){var i=sn(e);switch(i[0].replace(rn,"<")){case"<?xml":break;case"<Types":t.xmlns=i["xmlns"+(i[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":n[i.Extension]=i.ContentType;break;case"<Override":void 0!==t[eo[i.ContentType]]&&t[eo[i.ContentType]].push(i.PartName)}})),t.xmlns!==$n)throw new Error("Unknown Namespace: "+t.xmlns);t.calcchain=0<t.calcchains.length?t.calcchains[0]:"",t.sst=0<t.strs.length?t.strs[0]:"",t.style=0<t.styles.length?t.styles[0]:"",t.defaults=n,delete t.calcchains}return t}(Jt(e,"[Content_Types].xml")),r=!1;if(0===o.workbooks.length&&Xt(e,a="xl/workbook.xml",!0)&&o.workbooks.push(a),0===o.workbooks.length){if(!Xt(e,a="xl/workbook.bin",!0))throw new Error("Could not find workbook");o.workbooks.push(a),r=!0}"bin"==o.workbooks[0].slice(-3)&&(r=!0);var a,s={},l={};if(!t.bookSheets&&!t.bookProps){if(ja=[],o.sst)try{ja=function(e,t,n){if(".bin"===t.slice(-4))return i=n,r=!(o=[]),fi(e,(function(e,t,n){switch(n){case 159:o.Count=e[0],o.Unique=e[1];break;case 19:o.push(e);break;case 160:return 1;case 35:r=!0;break;case 36:r=!1;break;default:if(t.T,!r||i.WTF)throw new Error("Unexpected record 0x"+n.toString(16))}})),o;var i,o,r,a=n,s=[],l="";if((t=e)&&(t=t.match(vr))){l=t[2].replace(br,"").split(yr);for(var c=0;c!=l.length;++c){var u=gr(l[c].trim(),a);null!=u&&(s[s.length]=u)}t=sn(t[1]),s.Count=t.count,s.Unique=t.uniqueCount}return s}(Xt(e,tl(o.sst)),o.sst,t)}catch(i){if(t.WTF)throw i}t.cellStyles&&o.themes.length&&(a=Jt(e,o.themes[0].replace(/^\//,""),!0)||"",o.themes[0],s=Jr(a,t)),o.style&&(l=function(e,t,n,i){if(".bin"!==t.slice(-4))return Br(e,n,i);t=e;var o,r=n,a=i,s={NumberFmt:[]};for(o in Ke)s.NumberFmt[o]=Ke[o];s.CellXf=[];var l=[],c=!(s.Fonts=[]);return fi(t,(function(e,t,n){switch(n){case 44:s.NumberFmt[e[0]]=e[1],kt(e[1],e[0]);break;case 43:s.Fonts.push(e),null!=e.color.theme&&r&&r.themeElements&&r.themeElements.clrScheme&&(e.color.rgb=Tr(r.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0));break;case 1025:case 45:case 46:break;case 47:617==l[l.length-1]&&s.CellXf.push(e);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:c=!0;break;case 36:c=!1;break;case 37:l.push(n),c=!0;break;case 38:l.pop(),c=!1;break;default:if(0<t.T)l.push(n);else if(t.T<0)l.pop();else if(!c||a.WTF&&37!=l[l.length-1])throw new Error("Unexpected record 0x"+n.toString(16))}})),s}(Xt(e,tl(o.style)),o.style,s,t))}o.links.map((function(n){try{return io(Jt(e,no(tl(n))),n),function(e,t,n,i){if(".bin"===n.slice(-4)){if(!(n=e))return n;var o=(e=i)||{},r=!1;fi(n,(function(e,t,n){switch(n){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:r=!0;break;case 36:r=!1;break;default:if(!t.T&&(!r||o.WTF))throw new Error("Unexpected record 0x"+n.toString(16))}}),o)}}(Xt(e,tl(n)),0,n,t)}catch(n){}}));var c,u,d,h=function(e,t,n){if(".bin"===t.slice(-4))return t=e,o={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},a=!(r=[]),(i=(i=n)||{}).biff=12,s=[],(l=[[]]).SheetNames=[],l.XTI=[],As[16]={n:"BrtFRTArchID$",f:ps},fi(t,(function(e,t,n){switch(n){case 156:l.SheetNames.push(e.name),o.Sheets.push(e);break;case 153:o.WBProps=e;break;case 39:null!=e.Sheet&&(i.SID=e.Sheet),e.Ref=Ta(e.Ptg,0,null,l,i),delete i.SID,delete e.Ptg,s.push(e);break;case 1036:break;case 357:case 358:case 355:case 667:l[0].length?l.push([n,e]):l[0]=[n,e],l[l.length-1].XTI=[];break;case 362:0===l.length&&(l[0]=[],l[0].XTI=[]),l[l.length-1].XTI=l[l.length-1].XTI.concat(e),l.XTI=l.XTI.concat(e);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:r.push(n),a=!0;break;case 36:r.pop(),a=!1;break;case 37:r.push(n),a=!0;break;case 38:r.pop(),a=!1;break;case 16:break;default:if(!t.T&&(!a||i.WTF&&37!=r[r.length-1]&&35!=r[r.length-1]))throw new Error("Unexpected record 0x"+n.toString(16))}}),i),us(o),o.Names=s,o.supbooks=l,o;var i,o,r,a,s,l,c=e,u=n;if(!c)throw new Error("Could not find file");var d={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},h=!1,p="xmlns",f={},m=0;if(c.replace(on,(function(e,t){var n=sn(e);switch(ln(n[0])){case"<?xml":break;case"<workbook":e.match(hs)&&(p="xmlns"+e.match(/<(\w+):/)[1]),d.xmlns=n[p];break;case"</workbook>":break;case"<fileVersion":delete n[0],d.AppVersion=n;break;case"<fileVersion/>":case"</fileVersion>":case"<fileSharing":case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":os.forEach((function(e){if(null!=n[e[0]])switch(e[2]){case"bool":d.WBProps[e[0]]=gn(n[e[0]]);break;case"int":d.WBProps[e[0]]=parseInt(n[e[0]],10);break;default:d.WBProps[e[0]]=n[e[0]]}})),n.codeName&&(d.WBProps.CodeName=wn(n.codeName));break;case"</workbookPr>":case"<workbookProtection":case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete n[0],d.WBView.push(n);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(n.state){case"hidden":n.Hidden=1;break;case"veryHidden":n.Hidden=2;break;default:n.Hidden=0}delete n.state,n.name=dn(wn(n.name)),delete n[0],d.Sheets.push(n);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":case"<externalReference":case"<definedNames/>":break;case"<definedNames>":case"<definedNames":h=!0;break;case"</definedNames>":h=!1;break;case"<definedName":(f={}).Name=wn(n.name),n.comment&&(f.Comment=n.comment),n.localSheetId&&(f.Sheet=+n.localSheetId),gn(n.hidden||"0")&&(f.Hidden=!0),m=t+e.length;break;case"</definedName>":f.Ref=dn(wn(c.slice(m,t))),d.Names.push(f);break;case"<definedName/>":break;case"<calcPr":case"<calcPr/>":delete n[0],d.CalcPr=n;break;case"</calcPr>":case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":h=!0;break;case"</ext>":h=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":h=!0;break;case"</AlternateContent>":h=!1;break;case"<revisionPtr":break;default:if(!h&&u.WTF)throw new Error("unrecognized "+n[0]+" in workbook")}return e})),-1===Pn.indexOf(d.xmlns))throw new Error("Unknown Namespace: "+d.xmlns);return us(d),d}(Xt(e,tl(o.workbooks[0])),o.workbooks[0],t),p={},f="",m=(o.coreprops.length&&((f=Xt(e,tl(o.coreprops[0]),!0))&&(p=ao(f)),0!==o.extprops.length)&&(f=Xt(e,tl(o.extprops[0]),!0))&&(m=t,d={},u=(u=p)||{},c=wn(c=f),so.forEach((function(e){var t=(c.match(_n(e[0]))||[])[1];switch(e[2]){case"string":t&&(u[e[1]]=dn(t));break;case"bool":u[e[1]]="true"===t;break;case"raw":var n=c.match(new RegExp("<"+e[0]+"[^>]*>([\\s\\S]*?)</"+e[0]+">"));n&&0<n.length&&(d[e[1]]=n[1])}})),d.HeadingPairs)&&d.TitlesOfParts&&lo(d.HeadingPairs,d.TitlesOfParts,u,m),{}),g=(t.bookSheets&&!t.bookProps||0!==o.custprops.length&&(f=Jt(e,tl(o.custprops[0]),!0))&&(m=function(e,t){var n={},i="",o=e.match(uo);if(o)for(var r=0;r!=o.length;++r){var a=o[r],s=sn(a);switch(s[0]){case"<?xml":case"<Properties":break;case"<property":i=dn(s.name);break;case"</property>":i=null;break;default:if(0===a.indexOf("<vt:")){var l=a.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":n[i]=dn(u);break;case"bool":n[i]=gn(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":n[i]=parseInt(u,10);break;case"r4":case"r8":case"decimal":n[i]=parseFloat(u);break;case"filetime":case"date":n[i]=Ft(u);break;case"cy":case"error":n[i]=dn(u);break;default:"/"!=c.slice(-1)&&t.WTF&&"undefined"!=typeof console&&console.warn("Unexpected",a,c,l)}}else if("</"!==a.slice(0,2)&&t.WTF)throw new Error(a)}}return n}(f,t)),{});if(!t.bookSheets&&!t.bookProps||(h.Sheets?y=h.Sheets.map((function(e){return e.name})):p.Worksheets&&0<p.SheetNames.length&&(y=p.SheetNames),t.bookProps&&(g.Props=p,g.Custprops=m),t.bookSheets&&void 0!==y&&(g.SheetNames=y),t.bookSheets?!g.SheetNames:!t.bookProps)){var v,b,y={},w=(f={},t.bookDeps&&o.calcchain&&(f=function(e,t){var n,i,o;return".bin"===t.slice(-4)?(n=[],fi(e,(function(e,t,i){if(63===i)n.push(e);else if(!t.T)throw new Error("Unexpected record 0x"+i.toString(16))})),n):(o=[],(t=e)&&(i=1,(t.match(on)||[]).forEach((function(e){var t=sn(e);switch(t[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete t[0],t.i?i=t.i:t.i=i,o.push(t)}}))),o)}(Xt(e,tl(o.calcchain)),o.calcchain)),0),x={},_=h.Sheets;p.Worksheets=_.length,p.SheetNames=[];for(var k=0;k!=_.length;++k)p.SheetNames[k]=_[k].name;var E,C,S,T=r?"bin":"xml",A=(r=o.workbooks[0].lastIndexOf("/"),(o.workbooks[0].slice(0,r+1)+"_rels/"+o.workbooks[0].slice(r+1)+".rels").replace(/^\//,"")),O=(Kt(e,A)||(A="xl/_rels/workbook."+T+".rels"),io(Jt(e,A,!0),A.replace(/_rels.*/,"s5s"))),M=(1<=(o.metadata||[]).length&&(t.xlmeta=function(e,t,n){var i,o,r,a,s,l,c,u,d,h;return".bin"===t.slice(-4)?(i={Types:[],Cell:[],Value:[]},o=n||{},a=!(r=[]),s=2,fi(e,(function(e,t,n){switch(n){case 335:i.Types.push({name:e.name});break;case 51:e.forEach((function(e){1==s?i.Cell.push({type:i.Types[e[0]-1].name,index:e[1]}):0==s&&i.Value.push({type:i.Types[e[0]-1].name,index:e[1]})}));break;case 337:s=e?1:0;break;case 338:s=2;break;case 35:r.push(n),a=!0;break;case 36:r.pop(),a=!1;break;default:if(!t.T&&(!a||o.WTF&&35!=r[r.length-1]))throw new Error("Unexpected record 0x"+n.toString(16))}})),i):(l=n,h={Types:[],Cell:[],Value:[]},(t=e)&&(c=!1,u=2,t.replace(on,(function(e){var t=sn(e);switch(ln(t[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":h.Types.push({name:t.name});break;case"</metadataType>":break;case"<futureMetadata":for(var n=0;n<h.Types.length;++n)h.Types[n].name==t.name&&(d=h.Types[n]);break;case"</futureMetadata>":case"<bk>":case"</bk>":break;case"<rc":1==u?h.Cell.push({type:h.Types[t.t-1].name,index:+t.v}):0==u&&h.Value.push({type:h.Types[t.t-1].name,index:+t.v});break;case"</rc>":break;case"<cellMetadata":u=1;break;case"</cellMetadata>":u=2;break;case"<valueMetadata":u=0;break;case"</valueMetadata>":u=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":c=!0;break;case"</ext>":c=!1;break;case"<rvb":d&&(d.offsets||(d.offsets=[]),d.offsets.push(+t.i));break;default:if(!c&&l.WTF)throw new Error("unrecognized "+t[0]+" in metadata")}return e}))),h)}(Xt(e,tl(o.metadata[0])),o.metadata[0],t)),1<=(o.people||[]).length&&(t.people=(r=Xt(e,tl(o.people[0])),E=t,S=!(C=[]),r.replace(on,(function(e){var t=sn(e);switch(ln(t[0])){case"<?xml":case"<personList":case"</personList>":break;case"<person":C.push({name:t.displayname,id:t.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":S=!0;break;case"</ext>":S=!1;break;default:if(!S&&E.WTF)throw new Error("unrecognized "+t[0]+" in threaded comments")}return e})),C)),O=O&&function(e,t){if(!e)return 0;try{e=t.map((function(t){return t.id||(t.id=t.strRelID),[t.name,e["!id"][t.id].Target,(t=e["!id"][t.id].Type,-1<to.WS.indexOf(t)?"sheet":to.CS&&t==to.CS?"chart":to.DS&&t==to.DS?"dialog":to.MS&&t==to.MS?"macro":t&&t.length?t:"sheet")]}))}catch(t){return null}return e&&0!==e.length?e:null}(O,h.Sheets),Xt(e,"xl/worksheets/sheet.xml",!0)?1:0);for(w=0;w!=p.Worksheets;++w){var D="sheet";if(O&&O[w]?(v="xl/"+O[w][1].replace(/[\/]?xl\//,""),Kt(e,v)||(v=O[w][1]),Kt(e,v)||(v=A.replace(/_rels\/.*$/,"")+O[w][1]),D=O[w][2]):v=(v="xl/worksheets/sheet"+(w+1-M)+"."+T).replace(/sheet0\./,"sheet."),b=v.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&null!=t.sheets)switch(typeof t.sheets){case"number":if(w!=t.sheets)continue;break;case"string":if(p.SheetNames[w].toLowerCase()!=t.sheets.toLowerCase())continue;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var $=!1,P=0;P!=t.sheets.length;++P)"number"==typeof t.sheets[P]&&t.sheets[P]==w&&($=1),"string"==typeof t.sheets[P]&&t.sheets[P].toLowerCase()==p.SheetNames[w].toLowerCase()&&($=1);if(!$)continue}}el(e,v,b,p.SheetNames[w],w,x,y,D,t,h,s,l)}g={Directory:o,Workbook:h,Props:p,Custprops:m,Deps:f,Sheets:y,SheetNames:p.SheetNames,Strings:ja,Styles:l,Themes:s,SSF:Bt(Ke)},t&&t.bookFiles&&(e.files?(g.keys=i,g.files=e.files):(g.keys=[],g.files={},e.FullPaths.forEach((function(t,n){t=t.replace(/^Root Entry[\/]/,""),g.keys.push(t),g.files[t]=e.FileIndex[n]})))),t&&t.bookVBA&&(0<o.vba.length?g.vbaraw=Xt(e,tl(o.vba[0]),!0):o.defaults&&"application/vnd.ms-office.vbaProject"===o.defaults.bin&&(g.vbaraw=Xt(e,"xl/vbaProject.bin",!0)))}return g}function il(e,t){t=t||{};var n="Workbook",i=At.find(e,n);try{if(n="/!DataSpaces/Version",!(i=At.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if((a=i.content).read_shift(0,"lpp4"),xr(a,4),xr(a,4),xr(a,4),n="/!DataSpaces/DataSpaceMap",!(i=At.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=function(e){for(var t=[],n=(e.l+=4,e.read_shift(4));0<n--;)t.push(function(e){for(var t=e.read_shift(4),n=(t=e.l+t-4,{}),i=e.read_shift(4),o=[];0<i--;)o.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(n.name=e.read_shift(0,"lpp4"),n.comps=o,e.l!=t)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+t);return n}(e));return t}(i.content);if(1!==o.length||1!==o[0].comps.length||0!==o[0].comps[0].t||"StrongEncryptionDataSpace"!==o[0].name||"EncryptedPackage"!==o[0].comps[0].v)throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",!(i=At.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var r=function(e){for(var t=[],n=(e.l+=4,e.read_shift(4));0<n--;)t.push(e.read_shift(0,"lpp4"));return t}(i.content);if(1!=r.length||"StrongEncryptionTransform"!=r[0])throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",!(i=At.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);!function(e){t={},(n=e).read_shift(4),n.l+=4,t.id=n.read_shift(0,"lpp4"),t.name=n.read_shift(0,"lpp4"),t.R=xr(n,4),t.U=xr(n,4),t.W=xr(n,4);var t,n=t;if(n.ename=e.read_shift(0,"8lpp4"),n.blksz=e.read_shift(4),n.cmode=e.read_shift(4),4!=e.read_shift(4))throw new Error("Bad !Primary record")}(i.content)}catch(e){}if(!(i=At.find(e,n="/EncryptionInfo"))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=function(e){var t,n,i,o=xr(e);switch(o.Minor){case 2:return[o.Minor,function(e){if(36!=(63&e.read_shift(4)))throw new Error("EncryptionInfo mismatch");var t=e.read_shift(4);return{t:"Std",h:t=_r(e,t),v:e=kr(e,e.length-e.l)}}(e)];case 3:return[o.Minor,function(){throw new Error("File is password-protected: ECMA-376 Extensible")}()];case 4:return[o.Minor,(n=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"],(t=e).l+=4,t=t.read_shift(t.length-t.l,"utf8"),i={},t.replace(on,(function(e){var t=sn(e);switch(ln(t[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":n.forEach((function(e){i[e]=t[e]}));break;case"<dataIntegrity":i.encryptedHmacKey=t.encryptedHmacKey,i.encryptedHmacValue=t.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":i.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":i.uri=t.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":i.encs.push(t);break;default:throw t[0]}})),i)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+o.Minor)}(i.content);n="/EncryptedPackage";if(!(i=At.find(e,n))||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(4==a[0]&&"undefined"!=typeof decrypt_agile)return decrypt_agile(a[1],i.content,t.password||"",t);if(2==a[0]&&"undefined"!=typeof decrypt_std76)return decrypt_std76(a[1],i.content,t.password||"",t);throw new Error("File is password-protected")}function ol(e,t){var n="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":n=Ae(e.slice(0,12));break;case"binary":n=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3),n.charCodeAt(4),n.charCodeAt(5),n.charCodeAt(6),n.charCodeAt(7)]}function rl(e,t){var n=0;e:for(;n<e.length;)switch(e.charCodeAt(n)){case 10:case 13:case 32:++n;break;case 60:return xs(e.slice(n),t);default:break e}return cr.to_workbook(e,t)}function al(e,t,n,i){return i?(n.type="string",cr.to_workbook(e,n)):cr.to_workbook(t,n)}function sl(e,t){ye();var n=t||{};if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return sl(new Uint8Array(e),((n=Bt(n)).type="array",n));"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&!n.type&&(n.type="undefined"!=typeof Deno?"buffer":"array");var i,o,r=e,a=!1;if(n.cellStyles&&(n.cellNF=!0,n.sheetStubs=!0),Ba={},n.dateNF&&(Ba.dateNF=n.dateNF),n.type||(n.type=Oe&&Buffer.isBuffer(e)?"buffer":"base64"),"file"==n.type&&(n.type=Oe?"buffer":"binary",r=function(e){if("undefined"!=typeof Deno)return Deno.readFileSync(e);if("undefined"!=typeof $&&"undefined"!=typeof File&&"undefined"!=typeof Folder)try{var t=File(e),n=(t.open("r"),t.encoding="binary",t.read());return t.close(),n}catch(e){if(!e.message||!e.message.match(/onstruct/))throw e}throw new Error("Cannot access file "+e)}(e),"undefined"==typeof Uint8Array||Oe||(n.type="array")),"string"==n.type&&(a=!0,n.type="binary",n.codepage=65001,r=(t=e).match(/[^\x00-\x7F]/)?xn(t):t),"array"==n.type&&"undefined"!=typeof Uint8Array&&e instanceof Uint8Array&&"undefined"!=typeof ArrayBuffer&&(t=new ArrayBuffer(3),(t=new Uint8Array(t)).foo="bar",!t.foo))return(n=Bt(n)).type="array",sl(Le(r),n);switch((i=ol(r,n))[0]){case 208:if(207===i[1]&&17===i[2]&&224===i[3]&&161===i[4]&&177===i[5]&&26===i[6]&&225===i[7])return s=At.read(r,n),l=n,(At.find(s,"EncryptedPackage")?il:Ts)(s,l);break;case 9:if(i[1]<=8)return Ts(r,n);break;case 60:return xs(r,n);case 73:if(73===i[1]&&42===i[2]&&0===i[3])throw new Error("TIFF Image File is not a spreadsheet");if(68!==i[1])break;var s=r,l=n,c=l||{},u=!!c.WTF;c.WTF=!0;try{var d=ar.to_workbook(s,c);return c.WTF=u,d}catch(e){if(c.WTF=u,!e.message.match(/SYLK bad record ID/)&&u)throw e;return cr.to_workbook(s,l)}return;case 84:if(65===i[1]&&66===i[2]&&76===i[3])return sr.to_workbook(r,n);break;case 80:return 75===i[1]&&i[2]<9&&i[3]<9?(c=d=r,(u=(u=n)||{}).type||(u.type=Oe&&Buffer.isBuffer(d)?"buffer":"base64"),nl(Qt(c,u),u)):al(e,r,n,a);case 239:return 60===i[3]?xs(r,n):al(e,r,n,a);case 255:if(254===i[1])return m=r,"base64"==(o=n).type&&(m=Ae(m)),m=_e.utils.decode(1200,m.slice(2),"str"),o.type="binary",rl(m,o);if(0===i[1]&&2===i[2]&&0===i[3])return ur.to_workbook(r,n);break;case 0:if(0===i[1]){if(2<=i[2]&&0===i[3])return ur.to_workbook(r,n);if(0===i[2]&&(8===i[3]||9===i[3]))return ur.to_workbook(r,n)}break;case 3:case 131:case 139:case 140:return rr.to_workbook(r,n);case 123:if(92===i[1]&&114===i[2]&&116===i[3])return Cr.to_workbook(r,n);break;case 10:case 13:case 32:var h=r,p=n,f="",m=ol(h,p);switch(p.type){case"base64":f=Ae(h);break;case"binary":f=h;break;case"buffer":f=h.toString("binary");break;case"array":f=jt(h);break;default:throw new Error("Unrecognized type "+p.type)}return 239==m[0]&&187==m[1]&&191==m[2]&&(f=wn(f)),p.type="binary",rl(f,p);case 137:if(80===i[1]&&78===i[2]&&71===i[3])throw new Error("PNG Image File is not a spreadsheet")}return-1<or.indexOf(i[0])&&i[2]<=12&&i[3]<=31?rr.to_workbook(r,n):al(e,r,n,a)}function ll(e,t,n,i,o,r,a,s){var l=xi(n),c=s.defval,u=s.raw||!Object.prototype.hasOwnProperty.call(s,"raw"),d=!0,h=1===o?[]:{};if(1!==o)if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:n,enumerable:!1})}catch(e){h.__rowNum__=n}else h.__rowNum__=n;if(!a||e[n])for(var p=t.s.c;p<=t.e.c;++p){var f=a?e[n][p]:e[i[p]+l];if(void 0===f||void 0===f.t)void 0!==c&&null!=r[p]&&(h[r[p]]=c);else{var m=f.v;switch(f.t){case"z":if(null==m)break;continue;case"e":m=0==m?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+f.t)}if(null!=r[p]){if(null==m)if("e"==f.t&&null===m)h[r[p]]=null;else if(void 0!==c)h[r[p]]=c;else{if(!u||null!==m)continue;h[r[p]]=null}else h[r[p]]=u&&("n"!==f.t||"n"===f.t&&!1!==s.rawNumbers)?m:Oi(f,m,s);null!=m&&(d=!1)}}}return{row:h,isempty:d}}function cl(e,t){if(null==e||null==e["!ref"])return[];var n,i={t:"n",v:0},o=0,r=1,a=[],s="",l={s:{r:0,c:0},e:{r:0,c:0}},c=t||{},u=null!=c.range?c.range:e["!ref"];switch(1===c.header?o=1:"A"===c.header?o=2:Array.isArray(c.header)?o=3:null==c.header&&(o=0),typeof u){case"string":l=Ai(u);break;case"number":(l=Ai(e["!ref"])).s.r=u;break;default:l=u}0<o&&(r=0);var d,h=xi(l.s.r),p=[],f=[],m=0,g=0,v=Array.isArray(e),b=l.s.r,y=0,w={},x=(v&&!e[b]&&(e[b]=[]),c.skipHidden&&e["!cols"]||[]),_=c.skipHidden&&e["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(x[y]||{}).hidden)switch(p[y]=ki(y),i=v?e[b][y]:e[p[y]+h],o){case 1:a[y]=y-l.s.c;break;case 2:a[y]=p[y];break;case 3:a[y]=c.header[y-l.s.c];break;default:if(s=n=Oi(i=null==i?{w:"__EMPTY",t:"s"}:i,null,c),g=w[n]||0){for(;w[s=n+"_"+g++];);w[n]=g,w[s]=1}else w[n]=1;a[y]=s}for(b=l.s.r+r;b<=l.e.r;++b)!(_[b]||{}).hidden&&(!1===(d=ll(e,l,b,p,o,a,v,c)).isempty||(1===o?!1!==c.blankrows:c.blankrows))&&(f[m++]=d.row);return f.length=m,f}var ul=/"/g;function dl(e,t,n,i,o,r,a,s){for(var l=!0,c=[],u="",d=xi(n),h=t.s.c;h<=t.e.c;++h)if(i[h]){var p=s.dense?(e[n]||[])[h]:e[i[h]+d];if(null==p)u="";else if(null!=p.v){l=!1,u=""+(s.rawNumbers&&"n"==p.t?p.v:Oi(p,null,s));for(var f,m=0;m!==u.length;++m)if((f=u.charCodeAt(m))===o||f===r||34===f||s.forceQuotes){u='"'+u.replace(ul,'""')+'"';break}"ID"==u&&(u='"ID"')}else null==p.f||p.F?u="":(l=!1,0<=(u="="+p.f).indexOf(",")&&(u='"'+u.replace(ul,'""')+'"'));c.push(u)}return!1===s.blankrows&&l?null:c.join(a)}function hl(e,t){var n=[],i=null==t?{}:t;if(null==e||null==e["!ref"])return"";for(var o=Ai(e["!ref"]),r=void 0!==i.FS?i.FS:",",a=r.charCodeAt(0),s=void 0!==i.RS?i.RS:"\n",l=s.charCodeAt(0),c=new RegExp(("|"==r?"\\|":r)+"+$"),u="",d=[],h=(i.dense=Array.isArray(e),i.skipHidden&&e["!cols"]||[]),p=i.skipHidden&&e["!rows"]||[],f=o.s.c;f<=o.e.c;++f)(h[f]||{}).hidden||(d[f]=ki(f));for(var m=0,g=o.s.r;g<=o.e.r;++g)(p[g]||{}).hidden||null==(u=dl(e,o,g,d,a,l,r,i))||!(u=i.strip?u.replace(c,""):u)&&!1===i.blankrows||n.push((m++?s:"")+u);return delete i.dense,n.join("")}function pl(e,t,n){var i,o=n||{},r=+!o.skipHeader,a=e||{},s=0,l=0,c=(e=(a&&null!=o.origin&&("number"==typeof o.origin?s=o.origin:(n="string"==typeof o.origin?Ei(o.origin):o.origin,s=n.r,l=n.c)),{s:{c:0,r:0},e:{c:l,r:s+t.length-1+r}}),a["!ref"]?(n=Ai(a["!ref"]),e.e.c=Math.max(e.e.c,n.e.c),e.e.r=Math.max(e.e.r,n.e.r),-1==s&&(s=n.e.r+1,e.e.r=s+t.length-1+r)):-1==s&&(s=0,e.e.r=t.length-1+r),o.header||[]),u=0,d=(t.forEach((function(e,t){Ot(e).forEach((function(n){-1==(u=c.indexOf(n))&&(c[u=c.length]=n);n=e[n];var d="z",h="",p=Ci({c:l+u,r:s+t+r});i=fl(a,p),!n||"object"!=typeof n||n instanceof Date?("number"==typeof n?d="n":"boolean"==typeof n?d="b":"string"==typeof n?d="s":n instanceof Date?(d="d",o.cellDates||(d="n",n=$t(n)),h=o.dateNF||Ke[14]):null===n&&o.nullError&&(d="e",n=0),i?(i.t=d,i.v=n,delete i.w,delete i.R,h&&(i.z=h)):a[p]=i={t:d,v:n},h&&(i.z=h)):a[p]=n}))})),e.e.c=Math.max(e.e.c,l+c.length-1),xi(s));if(r)for(u=0;u<c.length;++u)a[ki(u+l)+d]={t:"s",v:c[u]};return a["!ref"]=Ti(e),a}function fl(e,t,n){var i;return"string"==typeof t?Array.isArray(e)?(e[(i=Ei(t)).r]||(e[i.r]=[]),e[i.r][i.c]||(e[i.r][i.c]={t:"z"})):e[t]||(e[t]={t:"z"}):fl(e,Ci("number"!=typeof t?t:{r:t,c:n||0}))}function ml(){return{SheetNames:[],Sheets:{}}}function gl(e,t,n,i){var o=1;if(!n)for(;o<=65535&&-1!=e.SheetNames.indexOf(n="Sheet"+o);++o,n=void 0);if(!n||65535<=e.SheetNames.length)throw new Error("Too many worksheets");if(i&&0<=e.SheetNames.indexOf(n)){o=(i=n.match(/(^.*?)(\d+)$/))&&+i[2]||0;var r=i&&i[1]||n;for(++o;o<=65535&&-1!=e.SheetNames.indexOf(n=r+o);++o);}if(function(e,t){if(31<e.length){if(t)return;throw new Error("Sheet names cannot exceed 31 chars")}ds.forEach((function(n){if(-1!=e.indexOf(n)&&!t)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}))}(n),0<=e.SheetNames.indexOf(n))throw new Error("Worksheet with name |"+n+"| already exists!");return e.SheetNames.push(n),e.Sheets[n]=t,n}function vl(e,t,n){return t?(e.l={Target:t},n&&(e.l.Tooltip=n)):delete e.l,e}var bl={encode_col:ki,encode_row:xi,encode_cell:Ci,encode_range:Ti,decode_col:_i,decode_row:wi,split_cell:function(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")},decode_cell:Ei,decode_range:Si,format_cell:Oi,sheet_add_aoa:Di,sheet_add_json:pl,sheet_add_dom:Ps,aoa_to_sheet:$i,json_to_sheet:function(e,t){return pl(null,e,t)},table_to_sheet:Rs,table_to_book:function(e,t){return Mi(Rs(e,t),t)},sheet_to_csv:hl,sheet_to_txt:function(e,t){return(t=t||{}).FS="\t",t.RS="\n",e=hl(e,t)},sheet_to_json:cl,sheet_to_html:function(e,t){var n=t||{},i=(t=null!=n.header?n.header:'<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',null!=n.footer?n.footer:"</body></html>"),o=[t],r=Si(e["!ref"]);n.dense=Array.isArray(e),o.push(function(e,t,n){return[].join("")+"<table"+(n&&n.id?' id="'+n.id+'"':"")+">"}(0,0,n));for(var a=r.s.r;a<=r.e.r;++a)o.push($s(e,r,a,n));return o.push("</table>"+i),o.join("")},sheet_to_formulae:function(e){var t,n="",i="";if(null==e||null==e["!ref"])return[];for(var o,r=Ai(e["!ref"]),a=[],s=[],l=Array.isArray(e),c=r.s.c;c<=r.e.c;++c)a[c]=ki(c);for(var u=r.s.r;u<=r.e.r;++u)for(o=xi(u),c=r.s.c;c<=r.e.c;++c)if(n=a[c]+o,i="",void 0!==(t=l?(e[u]||[])[c]:e[n])){if(null!=t.F){if(n=t.F,!t.f)continue;i=t.f,-1==n.indexOf(":")&&(n=n+":"+n)}if(null!=t.f)i=t.f;else{if("z"==t.t)continue;if("n"==t.t&&null!=t.v)i=""+t.v;else if("b"==t.t)i=t.v?"TRUE":"FALSE";else if(void 0!==t.w)i="'"+t.w;else{if(void 0===t.v)continue;i="s"==t.t?"'"+t.v:""+t.v}}s[s.length]=n+"="+i}return s},sheet_to_row_object_array:cl,sheet_get_cell:fl,book_new:ml,book_append_sheet:gl,book_set_sheet_visibility:function(e,t,n){switch(e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]),t=function(e,t){if("number"==typeof t){if(0<=t&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}if("string"!=typeof t)throw new Error("Cannot find sheet |"+t+"|");if(-1<(e=e.SheetNames.indexOf(t)))return e;throw new Error("Cannot find sheet name |"+t+"|")}(e,t),e.Workbook.Sheets[t]||(e.Workbook.Sheets[t]={}),n){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+n)}e.Workbook.Sheets[t].Hidden=n},cell_set_number_format:function(e,t){return e.z=t,e},cell_set_hyperlink:vl,cell_set_internal_link:function(e,t,n){return vl(e,"#"+t,n)},cell_add_comment:function(e,t,n){e.c||(e.c=[]),e.c.push({t:t,a:n||"SheetJS"})},sheet_set_array_formula:function(e,t,n,i){for(var o="string"!=typeof t?t:Ai(t),r="string"==typeof t?t:Ti(t),a=o.s.r;a<=o.e.r;++a)for(var s=o.s.c;s<=o.e.c;++s){var l=fl(e,a,s);l.t="n",l.F=r,delete l.v,a==o.s.r&&s==o.s.c&&(l.f=n,i)&&(l.D=!0)}return e},consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function yl(e){return(yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */wl=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=(p="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",o=p.asyncIterator||"@@asyncIterator",r=p.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(t){a=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o,r,a,s;t=t&&t.prototype instanceof u?t:u,t=Object.create(t.prototype),i=new w(i||[]);return t._invoke=(o=e,r=n,a=i,s="suspendedStart",function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return{value:void 0,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n&&(n=function e(t,n){var i=t.iterator[n.method];if(void 0===i){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=void 0,e(t,n),"throw"===n.method))return c;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}return"throw"===(i=l(i,t.iterator,n.arg)).type?(n.method="throw",n.arg=i.arg,n.delegate=null,c):(i=i.arg)?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,c):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,c)}(n,a))){if(n===c)continue;return n}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);if(s="executing","normal"===(n=l(o,r,a)).type){if(s=a.done?"completed":"suspendedYield",n.arg===c)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}}),t}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function u(){}function d(){}function h(){}var p,f,m=((f=(f=(a(p={},i,(function(){return this})),Object.getPrototypeOf))&&f(f(x([]))))&&f!==t&&n.call(f,i)&&(p=f),h.prototype=u.prototype=Object.create(p));function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var i;this._invoke=function(o,r){function a(){return new t((function(i,a){!function i(o,r,a,s){var c;if("throw"!==(o=l(e[o],e,r)).type)return(r=(c=o.arg).value)&&"object"==yl(r)&&n.call(r,"__await")?t.resolve(r.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(r).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}));s(o.arg)}(o,r,i,a)}))}return i=i?i.then(a,a):a()}}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function y(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function x(e){if(e){var t,o=e[i];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return t=-1,(o=function i(){for(;++t<e.length;)if(n.call(e,t))return i.value=e[t],i.done=!1,i;return i.value=void 0,i.done=!0,i}).next=o}return{next:_}}function _(){return{value:void 0,done:!0}}return a(m,"constructor",d.prototype=h),a(h,"constructor",d),d.displayName=a(h,r,"GeneratorFunction"),e.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a(e,r,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(v.prototype),a(v.prototype,o,(function(){return this})),e.AsyncIterator=v,e.async=function(t,n,i,o,r){void 0===r&&(r=Promise);var a=new v(s(t,n,i,o),r);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),a(m,r,"Generator"),a(m,i,(function(){return this})),a(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t,n=[];for(t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=x,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(y),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var o=this.tryEntries.length-1;0<=o;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var s=n.call(r,"catchLoc"),l=n.call(r,"finallyLoc");if(s&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}var a=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),y(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,i,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(n=o.completion).type&&(i=n.arg,y(o)),i}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function xl(e,t){var n,i,o,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,o=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw o}}};if(Array.isArray(e)||(a=function(e,t){var n;if(e)return"string"==typeof e?_l(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_l(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function kl(e,t,n,i,o,r,a){try{var s=e[r](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,o)}qr={name:"thFormMaking",components:{Draggable:H.a,WidgetConfig:X,FormConfig:Q,WidgetForm:ee,GenerateForm:oe},props:{data:{type:Object,default:function(){return{}}},tools:{type:Array,default:function(){return["monitor","mobile","upload","clearable","preview","generateCode","generateJson"]}},basicFields:{type:Array,default:function(){return["input","textarea","cell","radio","checkbox","time","date","rate","number","color","select","switch","slider","text","button","filler","image","upload","editor","cascader"]}},advanceFields:{type:Array,default:function(){return["table","table_h5","tabs","blank"]}},layoutFields:{type:Array,default:function(){return["grid","alliance","divider"]}},remoteApis:{type:Array,default:function(){return[]}}},data:function(){return this.basicComponents=ae,this.layoutComponents=le,this.advanceComponents=se,this.baseConfig=JSON.parse(JSON.stringify(ce)),{widgetFormData:this.data,widgetFormSelect:{},widgetValue:{},configTab:"widget",client:"monitor",dialog:{import:{visible:!1,value:""},preview:{visible:!1,value:""},data:{visible:!1,value:"",valueCopy:""},config:{visible:!1,value:"",valueCopy:""},code:{visible:!1,valueHtml:"",valueVue:"",type:"vue"}},remoteFuncs:{func_test:function(e){setTimeout((function(){e([{id:"1",name:"1111"},{id:"2",name:"2222"},{id:"3",name:"3333"}])}),2e3)},funcGetToken:function(e){de.get("http://tools-server.making.link/api/uptoken").then((function(t){e(t.uptoken)}))},upload_callback:function(e,t,n){console.log("callback",e,t,n)}},jsonClipboard:null,slotKeys:[]}},computed:{getBasicComponents:function(){var e=this;return this.basicComponents.filter((function(t){return e.basicFields.includes(t.type)}))},getAdvanceComponents:function(){var e=this;return this.advanceComponents.filter((function(t){return e.advanceFields.includes(t.type)}))},getLayoutComponents:function(){var e=this;return this.layoutComponents.filter((function(t){return e.layoutFields.includes(t.type)}))}},watch:{widgetFormData:{deep:!0,handler:function(e){this.$emit("update:data",e),this.$emit("on-change",e)}},data:function(e){e&&e.config&&(e.config=Object.assign(this.baseConfig,e.config)),this.setJSON(e)}},created:function(){this.widgetFormData.config=Object.assign(this.baseConfig,this.widgetFormData.config),this.widgetFormData&&this.widgetFormData.list.length&&(this.widgetFormSelect=this.widgetFormData.list[0])},mounted:function(){},methods:{readExcelFile:function(e){return new Promise((function(t){var n=new FileReader;n.readAsBinaryString(e),n.onload=function(e){t(e.target.result)}}))},onExcelFileChange:function(e){var t,n=this;return t=wl().mark((function t(){var i,o,r,a,s,l,c,u,d,h,p,f,m,g,v,b,y,w;return wl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.raw){t.next=6;break}return console.log("文件打开失败"),t.abrupt("return");case 6:return t.next=8,n.readExcelFile(i);case 8:for(l=(l=sl(l=t.sent,{type:"binary"})).Sheets[l.SheetNames[0]],l=n.parseDom(bl.sheet_to_html(l)),o=l.getElementsByTagName("tr"),console.log("rowsDom =>",o),a=r=0;a<o[0].childNodes.length;a++)s=o[0].childNodes[a],r+=s.colSpan||1;console.log("rowSpan =>",r),l=24/r,c={list:[],config:n.baseConfig},u=xl(o),t.prev=20,u.s();case 22:if((p=u.n()).done){t.next=51;break}p=p.value,d=Date.parse(new Date)+"_"+Math.ceil(99999*Math.random()),(h=n.getComponentsConfig("grid")).columns=[],h.key=d,h.model="grid_"+d,p=p.childNodes,console.log("colsDom =>",p),m=f=0;case 33:m<p.length?m%2!=0?t.next=38:(f=0,t.next=39):t.next=48;break;case 38:return t.abrupt("continue",45);case 39:if(g=Date.parse(new Date)+"_"+Math.ceil(99999*Math.random()),v=p[m],b=p[m+1],v.innerText||b.innerText){t.next=44;break}return t.abrupt("continue",45);case 44:b?(f=((v.colSpan||1)+(b.colSpan||1))*l,w=n.getComponentsConfig("input"),"*"===(y=v.innerText).charAt(0)&&(y=y.slice(1),w.options.required=!0,w.rules=w.rules||[],w.rules.push({required:!0,message:"单行文本必须填写"})),w.name=y,w.options.defaultValue=b.innerText,w.key=g,w.model="input_"+g,h.columns.push({span:f,list:[w]})):(f=v.colSpan*l,(y=n.getComponentsConfig("text")).name=v.innerText,y.options.defaultValue=v.innerText,y.options.hideLabel=!0,y.key=g,y.model="text_"+g,h.columns.push({span:f,list:[y]}));case 45:m++,t.next=33;break;case 48:h.columns.length?c.list.push(h):((w=n.getComponentsConfig("filler")).name="",w.key=d,w.model="filler_"+d,c.list.push(w));case 49:t.next=22;break;case 51:t.next=56;break;case 53:t.prev=53,t.t0=t.catch(20),u.e(t.t0);case 56:return t.prev=56,u.f(),t.finish(56);case 59:n.setJSON(c);case 60:case"end":return t.stop()}}),t,null,[[20,53,56,59]])})),function(){var e=this,n=arguments;return new Promise((function(i,o){var r=t.apply(e,n);function a(e){kl(r,i,o,a,s,"next",e)}function s(e){kl(r,i,o,a,s,"throw",e)}a(void 0)}))}()},getComponentsConfig:function(e){var t,n=null,i=xl(this.basicComponents);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(e===o.type)return n=JSON.parse(JSON.stringify(o))}}catch(e){i.e(e)}finally{i.f()}var r,a=xl(this.layoutComponents);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(e===s.type)return n=JSON.parse(JSON.stringify(s))}}catch(e){a.e(e)}finally{a.f()}return n},parseDom:function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[2]},initClipboard:function(){var e=this;this.jsonClipboard||(this.jsonClipboard=new J.a(".json-btn"),this.jsonClipboard.on("success",(function(t){e.$message.success("复制成功")})))},handleConfigSelect:function(e){this.configTab=e},handlePreview:function(){this.slotKeys=Object.keys(this.$slots),this.dialog.preview.visible=!0},handleGetData:function(){var e=this;this.$refs.generateForm.getData().then((function(t){e.dialog.data={visible:!0,value:JSON.stringify(t,null,2),valueCopy:JSON.stringify(t,null,2)},e.$nextTick((function(){e.initClipboard()}))}))},handleReset:function(){this.$refs.generateForm.reset()},handleGenerateJson:function(){var e=this;this.dialog.config={visible:!0,value:JSON.stringify(this.widgetFormData,null,2),valueCopy:JSON.stringify(this.widgetFormData,null,2)},this.$nextTick((function(){e.initClipboard()}))},handleGenerateCode:function(){this.dialog.code={visible:!0,valueHtml:he(JSON.stringify(this.widgetFormData),"html"),valueVue:he(JSON.stringify(this.widgetFormData),"vue"),type:"vue"}},handleUploadJson:function(){try{this.setJSON(JSON.parse(this.dialog.import.value)),this.dialog.import.visible=!1}catch(e){this.$message.error(e.message)}},handleDialogFullscreen:function(){this.$refs.vueCodeEditor.resize(),this.$refs.htmlCodeEditor.resize()},handleClear:function(){this.widgetFormData={list:[],config:this.baseConfig},this.widgetFormSelect={}},clear:function(){this.handleClear()},getJSON:function(){return this.widgetFormData},getHtml:function(){return he(JSON.stringify(this.widgetFormData))},setJSON:function(e){0<(this.widgetFormData=e).list.length&&(this.widgetFormSelect=e.list[0])},handleDataChange:function(e,t,n){}}};var El=Object(l.a)(qr,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"fm-container"},[e.widgetFormData.config?n("el-container",{staticClass:"container-box"},[n("el-main",[n("el-container",[n("el-aside",{attrs:{width:"250px"}},[n("div",{staticClass:"components-list"},[e.basicFields.length?n("div",[n("div",{staticClass:"widget-cate"},[e._v("基础字段")]),e._v(" "),n("draggable",e._b({attrs:{tag:"ul",list:e.getBasicComponents}},"draggable",{group:{name:"people",pull:"clone",put:!1},sort:!1,ghostClass:"ghost"},!1),e._l(e.getBasicComponents,(function(t,i){return n("li",{key:i,staticClass:"form-edit-widget-label",class:((i={"no-put":"divider"==t.type})[t.type]=!0,i)},[n("a",[n("i",{staticClass:"icon iconfont",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))])])])})),0)],1):e._e(),e._v(" "),e.advanceFields.length?n("div",[n("div",{staticClass:"widget-cate"},[e._v("高级字段")]),e._v(" "),n("draggable",e._b({attrs:{tag:"ul",list:e.getAdvanceComponents}},"draggable",{group:{name:"people",pull:"clone",put:!1},sort:!1,ghostClass:"ghost"},!1),e._l(e.getAdvanceComponents,(function(t,i){return n("li",{key:i,staticClass:"form-edit-widget-label",class:((i={"no-put":["table","table_h5","tabs"].includes(t.type)})[t.type]=!0,i)},[n("a",[n("i",{staticClass:"icon iconfont",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))])])])})),0)],1):e._e(),e._v(" "),e.layoutFields.length?n("div",[n("div",{staticClass:"widget-cate"},[e._v("布局字段")]),e._v(" "),n("draggable",e._b({attrs:{tag:"ul",list:e.getLayoutComponents}},"draggable",{group:{name:"people",pull:"clone",put:!1},sort:!1,ghostClass:"ghost"},!1),e._l(e.getLayoutComponents,(function(t,i){return n("li",{key:i,staticClass:"form-edit-widget-label",class:((i={"no-put":["alliance"].includes(t.type)})[t.type]=!0,i)},[n("a",[n("i",{staticClass:"icon iconfont",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))])])])})),0)],1):e._e()])]),e._v(" "),n("el-container",{staticClass:"center-container",attrs:{direction:"vertical"}},[n("el-header",[n("div",{staticClass:"client"},[e.tools.includes("monitor")?n("el-button",{class:{active:"monitor"===e.client},attrs:{type:"text",size:"medium",icon:"el-icon-monitor"},on:{click:function(t){e.client="monitor"}}},[e._v("\n 桌面端\n ")]):e._e(),e._v(" "),e.tools.includes("mobile")?n("el-button",{class:{active:"mobile"===e.client},attrs:{type:"text",size:"medium",icon:"el-icon-mobile"},on:{click:function(t){e.client="mobile"}}},[e._v("\n 移动端\n ")]):e._e()],1),e._v(" "),e._t("action"),e._v(" "),n("el-popover",{staticStyle:{margin:"0 10px"},attrs:{placement:"bottom",trigger:"hover"}},[e.tools.includes("upload")?n("el-button",{attrs:{slot:"reference",type:"text",size:"medium",icon:"el-icon-upload2"},slot:"reference"},[e._v("导入")]):e._e(),e._v(" "),n("div",[n("el-upload",{attrs:{action:"",accept:".xlsx, .xls","auto-upload":!1,"show-file-list":!1,"on-change":e.onExcelFileChange}},[n("el-button",{attrs:{type:"text",size:"medium"}},[e._v("导入EXCEL ")])],1),e._v(" "),n("el-button",{attrs:{type:"text",size:"medium"},on:{click:function(t){e.dialog.import.visible=!0}}},[e._v("导入JSON\n ")])],1)],1),e._v(" "),e.tools.includes("clearable")?n("el-button",{attrs:{type:"text",size:"medium",icon:"el-icon-delete"},on:{click:e.handleClear}},[e._v("清空\n ")]):e._e(),e._v(" "),e.tools.includes("preview")?n("el-button",{attrs:{type:"text",size:"medium",icon:"el-icon-view"},on:{click:e.handlePreview}},[e._v("预览\n ")]):e._e(),e._v(" "),e.tools.includes("generateJson")?n("el-button",{attrs:{type:"text",size:"medium",icon:"el-icon-tickets"},on:{click:e.handleGenerateJson}},[e._v("生成JSON")]):e._e(),e._v(" "),e.tools.includes("generateCode")?n("el-button",{attrs:{type:"text",size:"medium",icon:"el-icon-document"},on:{click:e.handleGenerateCode}},[e._v("生成代码")]):e._e()],2),e._v(" "),n("el-main",[n("widget-form",{ref:"widgetForm",attrs:{data:e.widgetFormData,select:e.widgetFormSelect,client:e.client},on:{"update:select":function(t){e.widgetFormSelect=t}}})],1)],1),e._v(" "),n("el-aside",{staticClass:"config-container"},[n("el-container",[n("el-header",{attrs:{height:"45px"}},[n("div",{staticClass:"config-tab",class:{active:"widget"==e.configTab},on:{click:function(t){return e.handleConfigSelect("widget")}}},[e._v("\n 字段属性\n ")]),e._v(" "),n("div",{staticClass:"config-tab",class:{active:"form"==e.configTab},on:{click:function(t){return e.handleConfigSelect("form")}}},[e._v("\n 表单属性\n ")])]),e._v(" "),n("el-main",{staticClass:"config-container-content"},[n("widget-config",{directives:[{name:"show",rawName:"v-show",value:"widget"==e.configTab,expression:"configTab == 'widget'"}],attrs:{data:e.widgetFormSelect,remoteApis:e.remoteApis,config:e.widgetFormData.config}}),e._v(" "),n("form-config",{directives:[{name:"show",rawName:"v-show",value:"form"==e.configTab,expression:"configTab == 'form'"}],attrs:{data:e.widgetFormData.config}})],1)],1)],1),e._v(" "),n("th-dialog",{attrs:{title:"导入JSON",visible:e.dialog.import.visible,"modal-append-to-body":!1},on:{"on-close":function(t){e.dialog.import.visible=!1},"on-affirm":e.handleUploadJson,"on-fullscreen":function(t){return e.$refs.valueCodeEditor.resize()}}},[n("el-alert",{attrs:{type:"info",title:"JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可"}}),e._v(" "),n("th-code-editor",{ref:"valueCodeEditor",model:{value:e.dialog.import.value,callback:function(t){e.$set(e.dialog.import,"value",t)},expression:"dialog.import.value"}})],1),e._v(" "),n("th-dialog",{attrs:{title:"预览","modal-append-to-body":!1},on:{"on-close":function(t){e.dialog.preview.visible=!1}},model:{value:e.dialog.preview.visible,callback:function(t){e.$set(e.dialog.preview,"visible",t)},expression:"dialog.preview.visible"}},[e.dialog.preview.visible?n("generate-form",{ref:"generateForm",attrs:{data:e.widgetFormData,value:e.widgetValue,remote:e.remoteFuncs,slotKeys:e.slotKeys,client:e.client,insite:"true"},on:{"on-change":e.handleDataChange}},[e._l(e.slotKeys,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2):e._e(),e._v(" "),n("template",{slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.handleGetData}},[e._v("获取数据")]),e._v(" "),n("el-button",{on:{click:e.handleReset}},[e._v("重置")])],1)],2),e._v(" "),n("th-dialog",{attrs:{title:"获取数据",visible:e.dialog.data.visible,"modal-append-to-body":!1},on:{"on-close":function(t){e.dialog.data.visible=!1},"on-fullscreen":function(t){return e.$refs.dataCodeEditor.resize()}}},[n("th-code-editor",{ref:"dataCodeEditor",model:{value:e.dialog.data.value,callback:function(t){e.$set(e.dialog.data,"value",t)},expression:"dialog.data.value"}}),e._v(" "),n("template",{slot:"footer"},[n("el-button",{staticClass:"json-btn",attrs:{type:"primary","data-clipboard-text":e.dialog.data.valueCopy}},[e._v("复制数据")])],1)],2),e._v(" "),n("th-dialog",{attrs:{title:"生成JSON",visible:e.dialog.config.visible,"modal-append-to-body":!1},on:{"on-close":function(t){e.dialog.config.visible=!1},"on-fullscreen":function(t){return e.$refs.jsonCodeEditor.resize()}}},[n("th-code-editor",{ref:"jsonCodeEditor",model:{value:e.dialog.config.value,callback:function(t){e.$set(e.dialog.config,"value",t)},expression:"dialog.config.value"}}),e._v(" "),n("template",{slot:"footer"},[n("el-button",{staticClass:"json-btn",attrs:{type:"primary","data-clipboard-text":e.dialog.config.valueCopy}},[e._v("复制数据")])],1)],2),e._v(" "),n("th-dialog",{staticClass:"codeDialog",attrs:{title:"生成代码",visible:e.dialog.code.visible,showFooter:!1,"modal-append-to-body":!1},on:{"on-close":function(t){e.dialog.code.visible=!1},"on-fullscreen":e.handleDialogFullscreen}},[n("el-tabs",{staticStyle:{"box-shadow":"none"},attrs:{type:"border-card"},model:{value:e.dialog.code.type,callback:function(t){e.$set(e.dialog.code,"type",t)},expression:"dialog.code.type"}},[n("el-tab-pane",{attrs:{label:"Vue Component",name:"vue"}},[n("th-code-editor",{ref:"vueCodeEditor",attrs:{language:"html",readonly:""},model:{value:e.dialog.code.valueVue,callback:function(t){e.$set(e.dialog.code,"valueVue",t)},expression:"dialog.code.valueVue"}})],1),e._v(" "),n("el-tab-pane",{attrs:{label:"HTML",name:"html"}},[n("th-code-editor",{ref:"htmlCodeEditor",attrs:{language:"html",readonly:""},model:{value:e.dialog.code.valueHtml,callback:function(t){e.$set(e.dialog.code,"valueHtml",t)},expression:"dialog.code.valueHtml"}})],1)],1)],1)],1)],1)],1):e._e()],1)}),[],!1,null,null,null).exports,Cl=(El.install=function(e){e.component(El.name,El)},El),Sl=(oe.install=function(e){e.component(oe.name,oe)},oe);zr={components:{Draggable:H.a},props:{searchFields:{type:Array,default:function(){return[]}},tableFields:{type:Array,default:function(){return[]}}},data:function(){return{searchData:this.searchFields,tableData:this.tableFields,componentOptions:[{label:"输入框",value:"input"},{label:"下拉框",value:"select"},{label:"日期框",value:"date"}],alignOptions:[{label:"左对齐",value:"left"},{label:"居中对齐",value:"center"},{label:"右对齐",value:"right"}],dialog:{visible:!1,title:"",data:null},codeEditorValue:""}},watch:{searchData:{handler:function(e){this.$emit("update:searchFields",e)},deep:!0},searchFields:function(e){this.searchData=e},tableData:{handler:function(e){this.$emit("update:tableFields",e)},deep:!0},tableFields:function(e){this.tableData=e}},mounted:function(){},methods:{handleSearchMoveEnd:function(e){this.$emit("move",{type:"search",data:e})},handleTableMoveEnd:function(e){this.$emit("move",{type:"table",data:e})},handleStaticData:function(e){this.dialog={visible:!0,title:"静态数据 - ".concat(e.label),data:e},this.codeEditorValue=e.staticData||""},handleDialogAffirm:function(){this.dialog.data.staticData=this.codeEditorValue,this.dialog={visible:!1,title:"",data:null}}}};function Tl(e,t){var n,i,o,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,o=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw o}}};if(Array.isArray(e)||(a=function(e,t){var n;if(e)return"string"==typeof e?Al(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Al(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Al(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}ea=Object(l.a)(zr,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"widgetTable"},[n("div",{staticClass:"table-title"},[e._v("查询字段")]),e._v(" "),n("div",{staticClass:"searchList"},[e._m(0),e._v(" "),n("draggable",e._b({staticClass:"table-content",on:{end:e.handleSearchMoveEnd},model:{value:e.searchData,callback:function(t){e.searchData=t},expression:"searchData"}},"draggable",{group:"people",ghostClass:"ghost",animation:200,handle:".drag-widget"},!1),e._l(e.searchData,(function(t){return n("div",{key:t.key,staticClass:"table-content-item"},[n("div",{staticClass:"drag"},[n("i",{staticClass:"iconfont icon-drag drag-widget"})]),e._v(" "),n("div",[e._v(e._s(t.label))]),e._v(" "),n("div",[e._v(e._s(t.prop))]),e._v(" "),n("div",[n("el-select",{attrs:{placeholder:"请选择",size:"mini"},model:{value:t.type,callback:function(n){e.$set(t,"type",n)},expression:"item.type"}},e._l(e.componentOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("div",[n("el-input",{attrs:{placeholder:"请输入内容",size:"mini"},model:{value:t.defaultValue,callback:function(n){e.$set(t,"defaultValue",n)},expression:"item.defaultValue"}})],1),e._v(" "),n("div",["select"===t.type?[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.handleStaticData(t)}}},[e._v("静态")]),e._v(" "),n("el-button",{attrs:{type:"text",size:"mini",disabled:""}},[e._v("远端")])]:e._e()],2)])})),0)],1),e._v(" "),n("div",{staticClass:"table-title"},[e._v("列表字段")]),e._v(" "),n("div",{staticClass:"tableList"},[e._m(1),e._v(" "),n("draggable",e._b({staticClass:"table-content",on:{end:e.handleTableMoveEnd},model:{value:e.tableData,callback:function(t){e.tableData=t},expression:"tableData"}},"draggable",{group:"people",ghostClass:"ghost",animation:200,handle:".drag-widget"},!1),e._l(e.tableData,(function(t){return n("div",{key:t.key,staticClass:"table-content-item"},[n("div",{staticClass:"drag"},[n("i",{staticClass:"iconfont icon-drag drag-widget"})]),e._v(" "),n("div",[e._v(e._s(t.label))]),e._v(" "),n("div",[e._v(e._s(t.prop))]),e._v(" "),n("div",[n("el-checkbox",{model:{value:t.sortable,callback:function(n){e.$set(t,"sortable",n)},expression:"item.sortable"}})],1),e._v(" "),n("div",[n("el-select",{attrs:{placeholder:"请选择",size:"mini"},model:{value:t.align,callback:function(n){e.$set(t,"align",n)},expression:"item.align"}},e._l(e.alignOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("div",[n("el-input-number",{attrs:{"controls-position":"right",min:0,size:"mini"},model:{value:t.width,callback:function(n){e.$set(t,"width",n)},expression:"item.width"}})],1)])})),0)],1),e._v(" "),n("th-dialog",{attrs:{title:e.dialog.title,"modal-append-to-body":!1},on:{"on-affirm":e.handleDialogAffirm},model:{value:e.dialog.visible,callback:function(t){e.$set(e.dialog,"visible",t)},expression:"dialog.visible"}},[n("th-code-editor",{model:{value:e.codeEditorValue,callback:function(t){e.codeEditorValue=t},expression:"codeEditorValue"}})],1)],1)}),[function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"table-header"},[t("div",[e._v("拖动")]),e._v(" "),t("div",[e._v("列名")]),e._v(" "),t("div",[e._v("字段")]),e._v(" "),t("div",[e._v("类型")]),e._v(" "),t("div",[e._v("默认值")]),e._v(" "),t("div",[e._v("数据来源")])])},function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"table-header"},[t("div",[e._v("拖动")]),e._v(" "),t("div",[e._v("列名")]),e._v(" "),t("div",[e._v("字段")]),e._v(" "),t("div",[e._v("排序")]),e._v(" "),t("div",[e._v("对齐")]),e._v(" "),t("div",[e._v("宽度")])])}],!1,(function(e){n(391)}),"data-v-f7f4378e",null).exports,te={props:{fields:{type:Array,default:function(){return[]}}},data:function(){return{tabsMenus:[{title:"查询字段",value:0},{title:"列表字段",value:1},{title:"列表属性",value:2}],activeTab:{title:"查询字段",value:0},search:{fields:[],isCheckAll:!1,isIndeterminate:!1},table:{fields:[],isCheckAll:!1,isIndeterminate:!1},tableCollapse:["1","3"],tableConfig:{search:{show:!0,options:[]},table:{options:[],pageInfo:{show:!0,options:{pageCount:0,pageSize:20,currentPage:1,total:0,sizes:[10,20,30,50,100]}},sort:{type:"1",key:"createTime"},loading:{show:!1,text:"加载中",image:""},empty:{show:!0,text:"暂无数据",image:""},sequence:!0},tools:{add:{show:!0,name:"新增",position:1},edit:{show:!0,name:"编辑",position:2},detail:{show:!1,name:"查看",position:2},delete:{show:!0,name:"删除",position:2},batchDelete:{show:!1,name:"批量删除",position:1},export:{show:!1,name:"导出",position:1},import:{show:!1,name:"导入",position:1}},network:{}},sortFieldOptions:[{label:"创建时间",value:"createTime"}]}},mounted:function(){},methods:{handleTabsSelect:function(e){this.activeTab=e},handleChange:function(){var e;0===this.activeTab.value?(e=this.search.fields.length,this.search.isCheckAll=e===this.fields.length,this.search.isIndeterminate=0<e&&e<this.fields.length,this.$emit("fields-change",{type:this.activeTab.value,data:this.search.fields})):(e=this.table.fields.length,this.table.isCheckAll=e===this.fields.length,this.table.isIndeterminate=0<e&&e<this.fields.length,this.$emit("fields-change",{type:this.activeTab.value,data:this.table.fields}))},handleSearchCheckAllChange:function(e){var t=[];if(e)for(var n=0;n<this.fields.length;n++)t.push(n);this.search.fields=t,this.search.isIndeterminate=!1,this.handleChange()},handleTableCheckAllChange:function(e){var t=[];if(e)for(var n=0;n<this.fields.length;n++)t.push(n);this.table.fields=t,this.table.isIndeterminate=!1,this.handleChange()},getJson:function(){return JSON.parse(JSON.stringify(this.tableConfig))}}},nr={name:"ThTableMaking",components:{WidgetTable:ea,WidgetConfig:Object(l.a)(te,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"widgetConfig"},[n("div",{staticClass:"tabs"},e._l(e.tabsMenus,(function(t,i){return n("div",{key:i,staticClass:"tabs-item",class:{"tabs-item__active":e.activeTab.value===t.value},on:{click:function(n){return e.handleTabsSelect(t)}}},[e._v("\n "+e._s(t.title)+"\n ")])})),0),e._v(" "),0===e.activeTab.value?n("div",{staticClass:"fields"},[n("el-checkbox",{attrs:{indeterminate:e.search.isIndeterminate},on:{change:e.handleSearchCheckAllChange},model:{value:e.search.isCheckAll,callback:function(t){e.$set(e.search,"isCheckAll",t)},expression:"search.isCheckAll"}},[e._v("全选")]),e._v(" "),n("el-checkbox-group",{on:{change:e.handleChange},model:{value:e.search.fields,callback:function(t){e.$set(e.search,"fields",t)},expression:"search.fields"}},e._l(e.fields,(function(t,i){return n("el-checkbox",{key:i,attrs:{label:i}},[e._v(e._s(t.label))])})),1)],1):e._e(),e._v(" "),1===e.activeTab.value?n("div",{staticClass:"fields"},[n("el-checkbox",{attrs:{indeterminate:e.table.isIndeterminate},on:{change:e.handleTableCheckAllChange},model:{value:e.table.isCheckAll,callback:function(t){e.$set(e.table,"isCheckAll",t)},expression:"table.isCheckAll"}},[e._v("全选")]),e._v(" "),n("el-checkbox-group",{on:{change:e.handleChange},model:{value:e.table.fields,callback:function(t){e.$set(e.table,"fields",t)},expression:"table.fields"}},e._l(e.fields,(function(t,i){return n("el-checkbox",{key:i,attrs:{label:i}},[e._v(e._s(t.label))])})),1)],1):e._e(),e._v(" "),2===e.activeTab.value?n("div",{staticClass:"tableConfig"},[n("el-form",{attrs:{model:e.tableConfig,"label-position":"left","label-width":"80px",size:"mini"}},[n("el-collapse",{model:{value:e.tableCollapse,callback:function(t){e.tableCollapse=t},expression:"tableCollapse"}},[n("el-collapse-item",{attrs:{title:"表格配置",name:"1"}},[n("el-form-item",{attrs:{label:"高级查询"}},[n("el-switch",{model:{value:e.tableConfig.search.show,callback:function(t){e.$set(e.tableConfig.search,"show",t)},expression:"tableConfig.search.show"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"排序类型"}},[n("el-radio-group",{model:{value:e.tableConfig.table.sort.type,callback:function(t){e.$set(e.tableConfig.table.sort,"type",t)},expression:"tableConfig.table.sort.type"}},[n("el-radio-button",{attrs:{label:"1"}},[e._v("降序")]),e._v(" "),n("el-radio-button",{attrs:{label:"2"}},[e._v("升序")])],1)],1),e._v(" "),n("el-form-item",{attrs:{label:"排序字段"}},[n("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.tableConfig.table.sort.key,callback:function(t){e.$set(e.tableConfig.table.sort,"key",t)},expression:"tableConfig.table.sort.key"}},e._l(e.sortFieldOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"序号"}},[n("el-switch",{model:{value:e.tableConfig.table.sequence,callback:function(t){e.$set(e.tableConfig.table,"sequence",t)},expression:"tableConfig.table.sequence"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"分页设置"}},[n("el-switch",{model:{value:e.tableConfig.table.pageInfo.show,callback:function(t){e.$set(e.tableConfig.table.pageInfo,"show",t)},expression:"tableConfig.table.pageInfo.show"}})],1),e._v(" "),e.tableConfig.table.pageInfo.show?n("el-form-item",{attrs:{label:"分页条数"}},[n("el-radio-group",{model:{value:e.tableConfig.table.pageInfo.options.pageSize,callback:function(t){e.$set(e.tableConfig.table.pageInfo.options,"pageSize",t)},expression:"tableConfig.table.pageInfo.options.pageSize"}},[n("el-radio-button",{attrs:{label:20}},[e._v("20条")]),e._v(" "),n("el-radio-button",{attrs:{label:50}},[e._v("50条")]),e._v(" "),n("el-radio-button",{attrs:{label:100}},[e._v("100条")]),e._v(" "),n("el-radio-button",{attrs:{label:500}},[e._v("500条")])],1)],1):e._e()],1),e._v(" "),n("el-collapse-item",{attrs:{title:"按钮配置",name:"3"}},[n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.add.show,callback:function(t){e.$set(e.tableConfig.tools.add,"show",t)},expression:"tableConfig.tools.add.show"}},[e._v("新增")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.add.name,callback:function(t){e.$set(e.tableConfig.tools.add,"name",t)},expression:"tableConfig.tools.add.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.edit.show,callback:function(t){e.$set(e.tableConfig.tools.edit,"show",t)},expression:"tableConfig.tools.edit.show"}},[e._v("编辑")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.edit.name,callback:function(t){e.$set(e.tableConfig.tools.edit,"name",t)},expression:"tableConfig.tools.edit.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.detail.show,callback:function(t){e.$set(e.tableConfig.tools.detail,"show",t)},expression:"tableConfig.tools.detail.show"}},[e._v("详情")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.detail.name,callback:function(t){e.$set(e.tableConfig.tools.detail,"name",t)},expression:"tableConfig.tools.detail.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.delete.show,callback:function(t){e.$set(e.tableConfig.tools.delete,"show",t)},expression:"tableConfig.tools.delete.show"}},[e._v("删除")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.delete.name,callback:function(t){e.$set(e.tableConfig.tools.delete,"name",t)},expression:"tableConfig.tools.delete.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.batchDelete.show,callback:function(t){e.$set(e.tableConfig.tools.batchDelete,"show",t)},expression:"tableConfig.tools.batchDelete.show"}},[e._v("批量删除")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.batchDelete.name,callback:function(t){e.$set(e.tableConfig.tools.batchDelete,"name",t)},expression:"tableConfig.tools.batchDelete.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.export.show,callback:function(t){e.$set(e.tableConfig.tools.export,"show",t)},expression:"tableConfig.tools.export.show"}},[e._v("导出")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.export.name,callback:function(t){e.$set(e.tableConfig.tools.export,"name",t)},expression:"tableConfig.tools.export.name"}})],1),e._v(" "),n("el-form-item",{attrs:{"label-width":"90px"}},[n("el-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:e.tableConfig.tools.import.show,callback:function(t){e.$set(e.tableConfig.tools.import,"show",t)},expression:"tableConfig.tools.import.show"}},[e._v("导入")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.tableConfig.tools.import.name,callback:function(t){e.$set(e.tableConfig.tools.import,"name",t)},expression:"tableConfig.tools.import.name"}})],1)],1)],1)],1)],1):e._e()])}),[],!1,(function(e){n(392),n(393)}),"data-v-fd6f11b8",null).exports},props:{fields:{type:Array,default:function(){return[]}},config:{type:Object,default:function(){return{}}}},data:function(){return{searchFields:[],tableFields:[],client:"monitor"}},watch:{fields:{handler:function(e,t){0===t.length&&this.initConfig()},deep:!0},config:function(e){this.initConfig()}},mounted:function(){this.initConfig()},methods:{initConfig:function(){Object.keys(this.config).length&&(this.$refs.configRef.tableConfig=this.config);var e=[],t=[];if(this.config.search){var n,i=Tl(this.config.search.options);try{for(i.s();!(n=i.n()).done;)for(var o=n.value,r=0;r<this.fields.length;r++)this.fields[r].prop===o.prop&&(e.push(o),t.push(r))}catch(e){i.e(e)}finally{i.f()}this.searchFields=e,this.$refs.configRef.search={fields:t,isCheckAll:t.length===this.fields.length,isIndeterminate:0<t.length&&t.length<this.fields.length}}var a=[],s=[];if(this.config.table){var l,c=Tl(this.config.table.options);try{for(c.s();!(l=c.n()).done;)for(var u=l.value,d=0;d<this.fields.length;d++)this.fields[d].prop===u.prop&&(a.push(u),s.push(d))}catch(e){c.e(e)}finally{c.f()}this.tableFields=a,this.$refs.configRef.table={fields:s,isCheckAll:s.length===this.fields.length,isIndeterminate:0<s.length&&s.length<this.fields.length}}},handleFieldsChange:function(e){var t=this,n=e.type,i=(e=e.data,[]);e.forEach((function(e){i.push(t.fields[e])})),0===n?this.searchFields=i:this.tableFields=i},handleMoveChange:function(e){var t=e.type,n=(e=e.data).newIndex;e=e.oldIndex;"search"===t?(t=this.$refs.configRef.search.fields,t=this.mobile(t,e,n),this.$refs.configRef.search.fields=t,this.searchFields=this.mobile(this.searchFields,e,n)):(t=this.$refs.configRef.table.fields,t=this.mobile(t,e,n),this.$refs.configRef.table.fields=t,this.tableFields=this.mobile(this.tableFields,e,n))},mobile:function(e,t,n){var i=JSON.parse(JSON.stringify(e[t]));return t<n&&(e.splice(n+1,0,i),e.splice(t,1)),n<t&&(e.splice(n,0,i),e.splice(t+1,1)),e},getJson:function(){var e=this.$refs.configRef.getJson();return e.search.options=this.searchFields,e.table.options=this.tableFields,e}}};var Ol=Object(l.a)(nr,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-table-making"},[t("el-container",[t("el-container",[t("el-header",[t("div",{staticClass:"client"},[t("el-button",{class:{active:"monitor"===e.client},attrs:{type:"text",size:"medium",icon:"el-icon-monitor"},on:{click:function(t){e.client="monitor"}}},[e._v("\n 桌面端\n ")]),e._v(" "),t("el-button",{class:{active:"mobile"===e.client},attrs:{type:"text",size:"medium",icon:"el-icon-mobile"},on:{click:function(t){e.client="mobile"}}},[e._v("\n 移动端\n ")])],1),e._v(" "),e._t("action")],2),e._v(" "),t("el-main",[t("widget-table",{attrs:{searchFields:e.searchFields,tableFields:e.tableFields},on:{move:e.handleMoveChange}})],1)],1),e._v(" "),t("el-aside",{attrs:{width:"300px"}},[t("widget-config",{ref:"configRef",attrs:{fields:e.fields},on:{"fields-change":e.handleFieldsChange}})],1)],1)],1)}),[],!1,(function(e){n(390)}),"data-v-2690040d",null).exports,Ml=(Ol.install=function(e){e.component(Ol.name,Ol)},Ol);tr={props:{options:{type:Array,default:function(){return[]}},data:{type:Object,default:function(){return{}}}},data:function(){return{params:this.data,datePickerTypes:["year","month","date","dates","week","datetime","datetimerange","daterange","monthrange"]}},watch:{options:{handler:function(e,t){var n=this;e&&e.length&&e.map((function(e){n.$set(n.params,e.prop,e.defaultValue||"")}))},deep:!0,immediate:!0},data:function(e){this.params=e},params:{deep:!0,handler:function(e){this.$emit("update:data",e)}}},methods:{doSearch:function(){this.$emit("on-search",this.params)},doReset:function(){var e=this;this.options.map((function(t){e.$set(e.params,t.prop,t.defaultValue||"")})),this.$emit("on-reset",this.params)}}};ir=Object(l.a)(tr,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.options.length?n("div",{staticClass:"th-table-search"},[e._l(e.options,(function(t,i){return n("div",{key:i,staticClass:"th-table-search-item"},[n("span",{staticClass:"th-table-search-item-title"},[e._v(e._s(t.label)+":")]),e._v(" "),"input"===t.type?n("el-input",{style:{width:(t.width||"180")+"px"},attrs:{placeholder:t.placeholder||"请输入",disabled:t.disabled,clearable:""},model:{value:e.params[t.prop],callback:function(n){e.$set(e.params,t.prop,n)},expression:"params[item.prop]"}}):e._e(),e._v(" "),"date"===t.type?n("el-date-picker",{style:{width:(t.width||"180")+"px"},attrs:{type:t.dateType||"date",format:t.format,"value-format":t.valueFormat,"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",clearable:""},model:{value:e.params[t.prop],callback:function(n){e.$set(e.params,t.prop,n)},expression:"params[item.prop]"}}):e._e(),e._v(" "),"select"===t.type?n("el-select",{style:{width:(t.width||"180")+"px"},attrs:{placeholder:t.placeholder||"请选择",multiple:t.multiple,"multiple-limit":t.multipleLimit,filterable:t.filterable,disabled:t.disabled,clearable:""},model:{value:e.params[t.prop],callback:function(n){e.$set(e.params,t.prop,n)},expression:"params[item.prop]"}},[t.remote?e._l(t.remoteData,(function(e){return n("el-option",{key:e[t.props.value],attrs:{label:e[t.props.label],value:e[t.props.value]}})})):e._l(t.staticData,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],2):e._e()],1)})),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-search",plain:""},on:{click:e.doSearch}},[e._v("查询")]),e._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-refresh-right",plain:""},on:{click:e.doReset}},[e._v("重置")])],2):e._e()}),[],!1,(function(e){n(395)}),"data-v-8022468c",null).exports,Wo={name:"ThTableTools",props:{options:{type:Array,default:function(){return[]}},disabled:{type:Object,default:function(){return{}}}},data:function(){return{}},methods:{handleClick:function(e){this.$emit("on-click",e)}}};X=Object(l.a)(Wo,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"th-table-tools"},e._l(e.options,(function(t,i){return n("el-button",{key:i,style:t.style,attrs:{type:t.type,icon:t.icon,disabled:t.disabled||e.disabled[t.act],loading:t.loading},on:{click:function(n){return e.handleClick(t)}}},[e._v(e._s(t.name))])})),1)}),[],!1,(function(e){n(396)}),"data-v-3a268c21",null).exports;var Dl={add:{act:"add",name:"",type:"primary",icon:"el-icon-plus",disabled:!1,loading:!1},edit:{act:"edit",name:"",type:"text",icon:"el-icon-edit",disabled:!1,loading:!1},detail:{act:"detail",name:"",type:"text",icon:"el-icon-view",disabled:!1,loading:!1},delete:{act:"delete",name:"",type:"text",icon:"el-icon-delete",style:"color:#ff4949;",disabled:!1,loading:!1},batchDelete:{act:"batchDelete",name:"",type:"danger",icon:"el-icon-delete",disabled:!1,loading:!1},export:{act:"export",name:"",type:"primary",icon:"el-icon-download",disabled:!1,loading:!1},import:{act:"import",name:"",type:"primary",icon:"el-icon-upload2",disabled:!1,loading:!1}},$l={1:{list:[{name:"平台名称",type:"input",icon:"icon-input",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"string",pattern:"",placeholder:"",maxlength:-1,required:!0,disabled:!1,readonly:!1,clearable:!1,showWordLimit:!1,showPassword:!1,prefixIcon:"",suffixIcon:"",prepend:"",append:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""},rules:[{type:"string",message:"平台名称格式不正确"},{required:!0,message:"平台名称必须填写"}],key:"1669859814000_5209",model:"name"},{name:"平台分类",type:"select",icon:"icon-select",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",multiple:!1,disabled:!1,clearable:!1,placeholder:"",required:!1,showLabel:!1,collapseTags:!1,allowCreate:!1,options:[{value:"Option 1"},{value:"Option 2"},{value:"Option 3"}],remote:!0,filterable:!1,remoteOptions:[],props:{value:"id",label:"name"},remoteFunc:"getUserList",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""},key:"1669859824000_68681",model:"projectTypeId",rules:[]},{name:"访问地址",type:"input",icon:"icon-input",options:{width:"100%",labelWidth:100,isLabelWidth:!1,defaultValue:"",dataType:"url",pattern:"",placeholder:"",maxlength:-1,required:!1,disabled:!1,readonly:!1,clearable:!1,showWordLimit:!1,showPassword:!1,prefixIcon:"",suffixIcon:"",prepend:"",append:"",hidden:!1,hideLabel:!1},events:{onChange:"",onFocus:"",onBlur:""},rules:[{type:"url",message:"访问地址格式不正确"}],key:"1669859816000_814",model:"targetUrl"}],config:{ui:"element",title:"",width:"",labelWidth:100,labelPosition:"right",labelSuffix:":",size:"small",disabled:!1,hideLabel:!1,eventScript:[{key:"mounted",name:"mounted",func:""},{key:"refresh",name:"refresh",func:""}]}},2:{}},Pl={1:{search:{show:!0,options:[{type:"input",label:"平台名称",prop:"name",defaultValue:"",align:"left",width:0}]},table:{options:[{label:"平台名称",type:"input",prop:"name",align:"left"},{label:"平台分类",type:"select",prop:"projectTypeName",align:"left",width:0},{label:"访问地址",type:"input",prop:"targetUrl",align:"left",width:0},{label:"编辑人",type:"input",prop:"user",sortable:!0,align:"left",width:0}],pageInfo:{show:!1,options:{pageCount:0,pageSize:20,currentPage:1,total:0,sizes:[10,20,30,50,100]}},sort:{type:"1",key:"createTime"},loading:{show:!1,text:"加载中",image:""},empty:{show:!0,text:"暂无数据",image:""},sequence:!0},tools:{add:{show:!0,name:"新增",position:1,form:{id:"1"}},edit:{show:!0,name:"编辑",position:2,form:{id:"1"}},detail:{show:!1,name:"查看",position:2,form:{id:"1"}},delete:{show:!0,name:"删除",position:2},batchDelete:{show:!0,name:"批量删除",position:1},export:{show:!0,name:"导出",position:1},import:{show:!0,name:"导入",position:1},key_123456:{}},network:{mounted:{name:"获取列表",api:"tenant/project/list",method:"post"},add:{name:"新增",api:"tenant/project/add",method:"post"},edit:{name:"编辑",api:"tenant/project/edit",method:"post"},delete:{name:"删除",api:"tenant/project/delete",method:"post"},key_123456:{name:"获取列表",url:"https://"}}},2:{search:{show:!1,options:[]},table:{options:[{label:"平台名称",type:"input",prop:"name",align:"left"},{label:"平台分类",type:"select",prop:"projectTypeName",align:"left",width:0},{label:"访问地址",type:"input",prop:"targetUrl",align:"left",width:0},{label:"编辑人",type:"input",prop:"user",sortable:!0,align:"left",width:0},{label:"编辑时间",type:"input",prop:"updateTime",align:"left",width:0}],pageInfo:{show:!0,options:{pageCount:0,pageSize:20,currentPage:1,total:0,sizes:[10,20,30,50,100]}},sort:{type:"1",key:"createTime"},loading:{show:!1,text:"加载中",image:""},empty:{show:!0,text:"暂无数据",image:""},sequence:!0},tools:{add:{show:!0,name:"新增",position:1,form:{id:"1"}},edit:{show:!0,name:"编辑",position:2,form:{id:"1"}},detail:{show:!1,name:"查看",position:2,form:{id:"1"}},delete:{show:!0,name:"删除",position:2},batchDelete:{show:!1,name:"批量删除",position:1},export:{show:!1,name:"导出",position:1},import:{show:!1,name:"导入",position:1}},network:{mounted:{name:"获取列表",api:"tenant/project/list",method:"post"},add:{name:"新增",api:"tenant/project/add",method:"post"},edit:{name:"编辑",api:"tenant/project/edit",method:"post"},delete:{name:"删除",api:"tenant/project/delete",method:"post"},key_123456:{name:"获取列表",url:"https://"}}}};function Rl(e){return(Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ll(){}Ll.prototype.type=["primary","success","warn","error","info"],Ll.prototype.typeColor=function(e){var t="";switch(e){case"primary":t="#2d8cf0";break;case"success":t="#19be6b";break;case"info":t="#909399";break;case"warn":t="#ff9900";break;case"error":t="#f03f14";break;default:t="#35495E"}return t},Ll.prototype.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ll.prototype.print=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default",n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];"object"===Rl(e)?this.isArray(e)?console.table(e):console.dir(e):n?console.log("%c ".concat(e," "),"background:".concat(this.typeColor(t),"; padding: 2px; border-radius: 4px; color: #fff;")):console.log("%c ".concat(e," "),"border: 1px solid ".concat(this.typeColor(t),";\n padding: 2px; border-radius: 4px;\n color: ").concat(this.typeColor(t),";"))},Ll.prototype.printBack=function(){this.print(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"primary",1<arguments.length?arguments[1]:void 0,!0)},Ll.prototype.pretty=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"primary",t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;"object"===Rl(n)?(console.log("%c ".concat(t),"background:".concat(this.typeColor(e),";border:1px solid ").concat(this.typeColor(e),";\n padding: 1px; border-radius: 4px; color: #fff;")),this.isArray(n)?console.table(n):console.dir(n),console.groupEnd()):console.log("%c ".concat(t," %c ").concat(n," %c"),"background:".concat(this.typeColor(e),";border:1px solid ").concat(this.typeColor(e),";\n padding: 1px; border-radius: 4px 0 0 4px; color: #fff;"),"border:1px solid ".concat(this.typeColor(e),";\n padding: 1px; border-radius: 0 4px 4px 0; color: ").concat(this.typeColor(e),";"),"background:transparent")},Ll.prototype.prettyPrimary=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("primary",e,n)}))},Ll.prototype.prettySuccess=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("success",e,n)}))},Ll.prototype.prettyWarn=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("warn",e,n)}))},Ll.prototype.prettyError=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("error",e,n)}))},Ll.prototype.prettyInfo=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("info",e,n)}))};var Il=new Ll,Nl=n(44);function Fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function jl(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}Q={name:"thTableGenerate",components:{Search:ir,Tools:X},props:{config:{type:Object,default:function(){return{debug:!1,appId:""}}}},data:function(){return{id:"",tableJson:{},axios:null,networkConfig:{},searchConfig:{show:!1,options:[]},searchData:{},toolsConfig:{show:!1,options:[]},tableConfig:{options:[],pageInfo:{}},tableData:[],tableSelectionData:[],dialog:{show:!1,data:{},action:{}},formConfig:null,remoteData:{projectTypeId:[{id:"1597785308467281921",name:"自然资源",sort:"1",tenantId:"1514528042264793089",createBy:"舒浪",createTime:1669776678e3,updateBy:"舒浪",updateTime:1669787428e3},{id:"1597785379552346114",name:"智慧政务",sort:"2",tenantId:"1514528042264793089",createBy:"舒浪",createTime:1669776695e3,updateBy:"舒浪",updateTime:1669776893e3},{id:"1597785424695640065",name:"数字乡村",sort:"3",tenantId:"1514528042264793089",createBy:"舒浪",createTime:1669776705e3,updateBy:null,updateTime:null},{id:"1597885800635691009",name:"测试分类啊啊啊",sort:"0",tenantId:"1514528042264793089",createBy:"舒浪",createTime:1669800637e3,updateBy:null,updateTime:null},{id:"1597886150885240833",name:"123123123",sort:"0",tenantId:"1514528042264793089",createBy:"舒浪",createTime:166980072e4,updateBy:null,updateTime:null},{id:"1597886566523990017",name:"2222",sort:"0",tenantId:"1514528042264793089",createBy:"舒浪",createTime:1669800819e3,updateBy:null,updateTime:null}]}}},created:function(){var e=this.$route.path.split("/").pop();this.id=e,this.initConfig()},mounted:function(){},methods:{initConfig:function(){var e,t,n=this;this.axios=(e=this.config,(t=ue.a.create({baseURL:e.baseUrl,timeout:6e4})).interceptors.request.use((function(t){var n=sessionStorage.getItem("th_oauth_info");return n&&(n=JSON.parse(n).token,t.headers.Authorization=n),e.headers&&(t.headers=Object.assign(t.headers,e.headers)),t}),(function(e){console.log(e),Promise.reject(e)})),t.interceptors.response.use((function(t){var n=t.status;return n<200||300<n?(Nl.Notification.error({title:t.message}),Promise.reject("error")):(n=t.data.code)&&200!==n?(Nl.Notification.error({title:t.data.message}),Promise.reject("error")):(e.debug&&(Il.prettyPrimary("Request Url:",t.request.responseURL),Il.prettySuccess("Request Res:",t)),t.data)}),(function(e){var t=0;try{t=e.response.data.status}catch(t){if(-1!==e.toString().indexOf("Error: timeout"))return Nl.Notification.error({title:"网络请求超时",duration:5e3}),Promise.reject(e)}return t?(t=e.response.data.message,Nl.Notification.error({title:t||"未知错误",duration:5e3})):Nl.Notification.error({title:"接口请求失败",duration:5e3}),Promise.reject(e)})),t),sessionStorage.getItem("th_oauth_info")?this.requestConfigData():this.config.token?(t={token:this.config.token,baseUrl:this.config.baseUrl},sessionStorage.setItem("th_oauth_info",JSON.stringify(t)),this.requestConfigData()):this.config.network&&this.axios({url:this.config.network.url,method:this.config.network.method,data:this.config.network.params,headers:this.config.network.headers}).then((function(e){e={token:e.data,baseUrl:n.config.baseUrl},sessionStorage.setItem("th_oauth_info",JSON.stringify(e)),n.requestConfigData()}))},requestConfigData:function(){var e,t=this;if(this.tableJson=(e=this.id,JSON.parse(JSON.stringify(Pl[e]||null))),this.tableJson){this.networkConfig=this.tableJson.network,this.searchConfig=this.tableJson.search,this.searchConfig.show&&this.searchConfig.options.map((function(e){t.$set(t.searchData,e.prop,e.defaultValue||"")}));for(var n=0;n<this.tableJson.table.options.length;n++)delete this.tableJson.table.options[n].type;this.tableJson.table.sequence&&this.tableJson.table.options.unshift({type:"index",label:"序号"});var i,o,r,a={label:"操作",hide:!0,slot:"action",actions:[]};for(i in this.tableJson.tools)Object.hasOwnProperty.call(this.tableJson.tools,i)&&(o=this.tableJson.tools[i]).show&&("batchDelete"===i&&this.tableJson.table.options.unshift({type:"selection"}),(r=function(e,t){return(e=Dl[e]||{}).name=t.name,JSON.parse(JSON.stringify(e))}(i,o)).form=o.form,1===o.position?(this.toolsConfig.show=!0,this.toolsConfig.options.push(r)):2===o.position&&(a.hide=!1,a.actions.push(r)));a.width=60*a.actions.length+20,this.tableJson.table.options.push(a),this.tableConfig=this.tableJson.table,this.requestListData()}},requestListData:function(){var e,t,n=this;this.networkConfig.mounted&&(this.tableConfig.loading.show=!0,e=this.networkConfig.mounted,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jl(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({current:this.tableConfig.pageInfo.options.currentPage,size:this.tableConfig.pageInfo.options.pageSize},this.searchData),this.axios({url:e.api,method:e.method,data:t}).then((function(e){var t=e.data.records;n.tableData=t,n.tableConfig.loading.show=!1,n.tableConfig.pageInfo.options.total=Number(e.data.total)})).catch((function(e){n.tableConfig.loading.show=!1})))},requestAddData:function(e){var t,n=this;this.networkConfig.add&&(this.dialog.action.loading=!0,t=this.networkConfig.add,this.axios({url:t.api,method:t.method,data:e}).then((function(e){n.dialog.action.loading=!1,n.requestListData()})).catch((function(e){n.dialog.action.loading=!1})))},requestEditData:function(e){var t,n=this;this.networkConfig.edit&&(this.dialog.action.loading=!0,t=this.networkConfig.edit,this.axios({url:t.api,method:t.method,data:e}).then((function(e){n.dialog.action.loading=!1,n.requestListData()})).catch((function(e){n.dialog.action.loading=!1})))},requestDeleteData:function(e){var t,n=this;this.networkConfig.delete&&(this.dialog.action.loading=!0,t=this.networkConfig.delete,this.axios({url:t.api,method:t.method,data:{ids:this.dialog.data.id}}).then((function(t){e(!0),n.dialog.action.loading=!1,n.requestListData()})).catch((function(e){n.dialog.action.loading=!1})))},requestBatchDeleteData:function(){var e=this;this.networkConfig.batchDelete&&this.$confirm("确认删除多条数据吗?","操作提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then((function(){e.dialog.action.loading=!0;var t,n=[],i=function(e,t){var n,i,o,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,o=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw o}}};if(Array.isArray(e)||(a=function(e,t){var n;if(e)return"string"==typeof e?Fl(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fl(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.tableSelectionData);try{for(i.s();!(t=i.n()).done;){var o=t.value;n.push(o.id)}}catch(t){i.e(t)}finally{i.f()}var r=e.networkConfig.batchDelete;e.axios({url:r.api,method:r.method,data:n}).then((function(t){callback(!0),e.dialog.action.loading=!1,e.requestListData()})).catch((function(t){e.dialog.action.loading=!1}))})).catch((function(){}))},requestFormConfigData:function(){var e=this;setTimeout((function(){var t=(t=(t=e.dialog.action.form).id,JSON.parse(JSON.stringify($l[t]||{})));e.formConfig=t}),1e3)},handleSearchSubmit:function(e){this.requestListData()},handleSearchReset:function(e){this.requestListData()},handleToolsClick:function(e){var t=this;switch(console.log("handleToolsClick =>",e),e.act){case"add":this.dialog={show:!0,data:{},action:e},this.requestFormConfigData();break;case"batchDelete":this.dialog={show:!1,data:{},action:e},this.requestBatchDeleteData();break;case"export":e.loading=!0,setTimeout((function(){e.loading=!1,t.tableSelectionData=[],t.$refs.tableRef.getTable().clearSelection()}),1e3)}},handleActionClick:function(e,t,n,i){switch(console.log("handleActionClick =>",t,n),n.act){case"edit":case"detail":this.dialog={show:!0,data:t,action:n},this.requestFormConfigData();break;case"delete":this.dialog={show:!1,data:t,action:n},this.requestDeleteData(i)}},handleDialogAffirm:function(e){var t=this;this.$refs.formGenerate.getData().then((function(e){switch(console.log("handleDialogAffirm =>",e),t.dialog.action.act){case"add":t.requestAddData(e);break;case"edit":t.dialog.data=Object.assign(t.dialog.data,e),t.requestEditData(t.dialog.data)}t.formConfig=null,t.dialog.show=!1}))},handleDialogClose:function(){this.formConfig=null},handlePagingChange:function(e){this.requestListData()},handleSelectionChange:function(e){this.tableSelectionData=e}}};var Bl=Object(l.a)(Q,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.tableJson?i("div",[e.searchConfig.show?i("search",{attrs:{data:e.searchData,options:e.searchConfig.options},on:{"on-search":e.requestListData,"on-reset":e.requestListData}}):e._e(),e._v(" "),e.toolsConfig.show?i("tools",{attrs:{options:e.toolsConfig.options,disabled:{batchDelete:0===e.tableSelectionData.length,export:0===e.tableSelectionData.length}},on:{"on-click":e.handleToolsClick}}):e._e(),e._v(" "),e.tableConfig.options.length?i("th-table",{ref:"tableRef",attrs:{data:e.tableData,options:e.tableConfig.options,"page-info":e.tableConfig.pageInfo.options,"show-page":e.tableConfig.pageInfo.show,loading:e.tableConfig.loading.show,"loading-text":e.tableConfig.loading.text,"empty-text":e.tableConfig.empty.text,"select-type":"single",border:""},on:{"selection-change":e.handleSelectionChange,"pagination-change":e.handlePagingChange},scopedSlots:e._u([{key:"action",fn:function(t){var n=t.scope,o=t.option;return[i("th-table-action",{attrs:{actions:o.actions},on:{"on-click":function(t,i){e.handleActionClick(n.$index,n.row,t,i,o)}}})]}}],null,!1,1455248534)}):e._e(),e._v(" "),i("th-dialog",{attrs:{title:e.dialog.action.name,"modal-append-to-body":!1},on:{"on-affirm":e.handleDialogAffirm,"on-close":e.handleDialogClose},model:{value:e.dialog.show,callback:function(t){e.$set(e.dialog,"show",t)},expression:"dialog.show"}},[e.formConfig?i("th-form-generate",{ref:"formGenerate",attrs:{data:e.formConfig,value:e.dialog.data,remoteData:e.remoteData}}):e._e()],1)],1):i("th-empty",{attrs:{image:n(116),description:"未获取到配置信息,请联系管理员。"}})}),[],!1,(function(e){n(394)}),"data-v-2f304688",null).exports,ql=(Bl.install=function(e){e.component(Bl.name,Bl)},Bl),zl=(ee=n(105),qr=n.n(ee),H={insert:"head",singleton:!1},zr=(s()(qr.a,H),qr.a.locals,n(106)),ea=n.n(zr),te={insert:"head",singleton:!1},nr=(s()(ea.a,te),ea.a.locals,n(107)),tr=n.n(nr),Wo={insert:"head",singleton:!1},ir=(s()(tr.a,Wo),tr.a.locals,n(108)),X=n.n(ir),Q={insert:"head",singleton:!1},s()(X.a,Q),X.a.locals,{"Exclusive Gateway":"Exklusives Gateway","Parallel Gateway":"Paralleles Gateway","Inclusive Gateway":"Inklusives Gateway","Complex Gateway":"Komplexes Gateway","Event based Gateway":"Ereignis-basiertes Gateway","Message Start Event":"消息启动事件","Timer Start Event":"定时启动事件","Conditional Start Event":"条件启动事件","Signal Start Event":"信号启动事件","Error Start Event":"错误启动事件","Escalation Start Event":"升级启动事件","Compensation Start Event":"补偿启动事件","Message Start Event (non-interrupting)":"消息启动事件 (非中断)","Timer Start Event (non-interrupting)":"定时启动事件 (非中断)","Conditional Start Event (non-interrupting)":"条件启动事件 (非中断)","Signal Start Event (non-interrupting)":"信号启动事件 (非中断)","Escalation Start Event (non-interrupting)":"升级启动事件 (非中断)"}),Vl=(ee=n(2),H=n.n(ee),n(0));function Wl(e,t){var n=this;e.on(["render.shape","render.connection"],t=t||1e3,(function(e,t){e=e.type;var i=t.element,o=t.gfx;t=t.attrs;if(n.canRender(i))return"render.shape"===e?n.drawShape(o,i,t):n.drawConnection(o,i,t)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function Hl(e,t){return(e=Gl(e))&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function Ul(e,t){return Object(Vl.some)(t,(function(t){return Hl(e,t)}))}function Gl(e){return e&&e.businessObject||e}function Kl(e){return!Hl(e,"bpmn:CallActivity")&&(Hl(e,"bpmn:SubProcess")?Gl(e).di&&!!Gl(e).di.isExpanded:!Hl(e,"bpmn:Participant")||!!Gl(e).processRef)}function Yl(e){return e&&Gl(e).triggeredByEvent}function Xl(e,t){e=Gl(e);var n=!1;return e.eventDefinitions&&Object(Vl.forEach)(e.eventDefinitions,(function(e){Hl(e,t)&&(n=!0)})),n}function Jl(e){return Hl(e,"bpmn:FlowElement")||Hl(e,"bpmn:Participant")||Hl(e,"bpmn:Lane")||Hl(e,"bpmn:SequenceFlow")||Hl(e,"bpmn:MessageFlow")||Hl(e,"bpmn:DataInput")||Hl(e,"bpmn:DataOutput")?"name":Hl(e,"bpmn:TextAnnotation")?"text":Hl(e,"bpmn:Group")?"categoryValueRef":void 0}function Zl(e){var t,n=Jl(e=e.businessObject);if(n)return"categoryValueRef"===n?(t=(t=e).categoryValueRef)&&t.value||"":e[n]||""}function Ql(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function ec(e,t){Ql(t,e)}Wl.prototype.canRender=function(){},Wl.prototype.drawShape=function(){},Wl.prototype.drawConnection=function(){},Wl.prototype.getShapePath=function(){},Wl.prototype.getConnectionPath=function(){};var tc={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function nc(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=tc[i];o?(2===o&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function ic(e,t,n){if("string"==typeof t){if(void 0===n)return l=e,tc[c=t]?l.style[c]:l.getAttributeNS(null,c);nc(e,t,n)}else for(var i,o=e,r=t,a=Object.keys(r),s=0;i=a[s];s++)nc(o,i,r[i]);var l,c;return e}function oc(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var rc=/\s+/,ac=Object.prototype.toString;function sc(e){return void 0!==e}function lc(e){return new cc(e)}function cc(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function uc(e){var t=e.parentNode;return t&&t.removeChild(e),e}function dc(e){for(var t;t=e.firstChild;)uc(t)}function hc(e){return e.cloneNode(!0)}cc.prototype.add=function(e){var t;return this.list?this.list.add(e):(~oc(t=this.array(),e)||t.push(e),sc(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" ")),this},cc.prototype.remove=function(e){var t;return"[object RegExp]"===ac.call(e)?this.removeMatching(e):(this.list?this.list.remove(e):(~(e=oc(t=this.array(),e))&&t.splice(e,1),this.el.className.baseVal=t.join(" ")),this)},cc.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},cc.prototype.toggle=function(e,t){return this.list?sc(t)&&t===this.list.toggle(e,t)||this.list.toggle(e):sc(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},cc.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(rc);return""===e[0]&&e.shift(),e},cc.prototype.has=cc.prototype.contains=function(e){return this.list?this.list.contains(e):!!~oc(this.array(),e)};var pc="http://www.w3.org/2000/svg",fc='<svg xmlns="'+pc+'"';function mc(e){var t=!1,n=("<svg"===e.substring(0,4)?-1===e.indexOf(pc)&&(e=fc+e.substring(4)):(e=fc+">"+e+"</svg>",t=!0),e=e,(n=new DOMParser).async=!1,n.parseFromString(e,"text/xml"));if(!t)return n;for(var i=document.createDocumentFragment(),o=n.firstChild;o.firstChild;)i.appendChild(o.firstChild);return i}function gc(e,t){var n="<"===e.charAt(0)?(n=mc(e).firstChild,document.importNode(n,!0)):document.createElementNS(pc,e);return t&&ic(n,t),n}var vc=null;function bc(){return vc=null===vc?gc("svg"):vc}function yc(e,t){for(var n,i=Object.keys(t),o=0;n=i[o];o++)e[n]=t[n];return e}function wc(e){return e?bc().createSVGTransformFromMatrix(e):bc().createSVGTransform()}var xc=/([&<>]{1})/g,_c=/([\n\r"]{1})/g,kc={"&":"&","<":"<",">":">",'"':"'"};function Ec(e,t){return e.replace(t,(function(e,t){return kc[t]||t}))}function Cc(e,t){if(void 0===t)return function(e){for(var t=e.firstChild,n=[];t;)!function e(t,n){var i,o,r,a,s;switch(t.nodeType){case 3:n.push(Ec(t.textContent,xc));break;case 1:if(n.push("<",t.tagName),t.hasAttributes())for(i=0,o=(r=t.attributes).length;i<o;++i)a=r.item(i),n.push(" ",a.name,'="',Ec(a.value,_c),'"');if(t.hasChildNodes()){for(n.push(">"),i=0,o=(s=t.childNodes).length;i<o;++i)e(s.item(i),n);n.push("</",t.tagName,">")}else n.push("/>");break;case 8:n.push("\x3c!--",Ec(t.nodeValue,xc),"--\x3e");break;case 4:n.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}}(t,n),t=t.nextSibling;return n.join("")}(e);try{!function(e,t){var n=mc(t);if(dc(e),t){"#document-fragment"!==n.nodeName&&(n=n.documentElement),t=n.childNodes;for(var i=Array.prototype.slice.call(t),o=0;o<i.length;o++)Ql(i[o],e)}}(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}function Sc(e,t){return e=e.transform.baseVal,t&&function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem((i=i)instanceof SVGMatrix?e.createSVGTransformFromMatrix(i):i)}(e,t=Array.isArray(t)?t:[t]),e.consolidate()}function Tc(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function Ac(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Oc(e,t){var n=gc("polyline");return ic(n,{points:Ac(e)}),t&&ic(n,t),n}function Mc(e,t,n){return Object(Vl.some)(e.eventDefinitions,(function(i){return i.$type===t&&(o=e,i=n,Object(Vl.every)(i,(function(e,t){return o[t]==e})));var o}))}function Dc(e){return e.businessObject.di}function $c(e){return e.businessObject}function Pc(e,t){return(e=Dc(e)).get("color:background-color")||e.get("bioc:fill")||t||"white"}function Rc(e,t){return(e=Dc(e)).get("color:border-color")||e.get("bioc:stroke")||t||"black"}function Lc(e,t,n){var i=Dc(e).get("label");return i&&i.get("color:color")||t||Rc(e,n)}function Ic(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}function Nc(e,t){if(Fc)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}Object.prototype.toString,Object.prototype.hasOwnProperty;var Fc=[].indexOf,jc=/\s+/,Bc=Object.prototype.toString;function qc(e){return new zc(e)}function zc(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Vc(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t)}zc.prototype.add=function(e){var t;return this.list?this.list.add(e):(~Nc(t=this.array(),e)||t.push(e),this.el.className=t.join(" ")),this},zc.prototype.remove=function(e){var t;return"[object RegExp]"==Bc.call(e)?this.removeMatching(e):(this.list?this.list.remove(e):(~(e=Nc(t=this.array(),e))&&t.splice(e,1),this.el.className=t.join(" ")),this)},zc.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},zc.prototype.toggle=function(e,t){return this.list?void 0!==t&&t===this.list.toggle(e,t)||this.list.toggle(e):void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this},zc.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(jc);return""===e[0]&&e.shift(),e},zc.prototype.has=zc.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Nc(this.array(),e)};var Wc=(qr="undefined"!=typeof Element?Element.prototype:{}).matches||qr.matchesSelector||qr.webkitMatchesSelector||qr.mozMatchesSelector||qr.msMatchesSelector||qr.oMatchesSelector,Hc=function(e,t){if(e&&1===e.nodeType){if(Wc)return Wc.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0}return!1};function Uc(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Hc(i,t))return i;i=i.parentNode}return Hc(i,t)?i:null}var Gc=window.addEventListener?"addEventListener":"attachEvent",Kc=window.removeEventListener?"removeEventListener":"detachEvent",Yc="addEventListener"!=Gc?"on":"",Xc={bind:function(e,t,n,i){return e[Gc](Yc+t,n,i||!1),n},unbind:function(e,t,n,i){return e[Kc](Yc+t,n,i||!1),n}},Jc=["focus","blur"],Zc=function(e,t,n,i,o){return-1!==Jc.indexOf(n)&&(o=!0),Xc.bind(e,n,(function(n){var o=n.target||n.srcElement;n.delegateTarget=Uc(o,t,!0),n.delegateTarget&&i.call(e,n)}),o)},Qc=function(e,t,n,i){return-1!==Jc.indexOf(t)&&(i=!0),Xc.unbind(e,t,n,i)},eu=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");if(t=t||document,!(r=/<([\w:]+)/.exec(e)))return t.createTextNode(e);if(e=e.replace(/^\s+|\s+$/g,""),"body"==(r=r[1]))return(n=t.createElement("html")).innerHTML=e,n.removeChild(n.lastChild);var n,i=(r=tu[r]||tu._default)[0],o=r[1],r=r[2];for((n=t.createElement("div")).innerHTML=o+e+r;i--;)n=n.lastChild;if(n.firstChild==n.lastChild)return n.removeChild(n.firstChild);for(var a=t.createDocumentFragment();n.firstChild;)a.appendChild(n.removeChild(n.firstChild));return a},tu=(zr=!1,"undefined"!=typeof document&&((te=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',zr=!te.getElementsByTagName("link").length,te=void 0),{legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:zr?[1,"X<div>","</div>"]:[0,"",""]});function nu(e,t){return(t=t||document).querySelector(e)}function iu(e,t){return(t=t||document).querySelectorAll(e)}function ou(e){e.parentNode&&e.parentNode.removeChild(e)}function ru(e,t,n,i,o){var r=wc();(n=((t=(r.setTranslate(t,n),wc())).setRotate(i||0,0,0),wc())).setScale(o||1,o||1),Sc(e,[r,t,n])}function au(e,t,n){var i=wc();i.setTranslate(t,n),Sc(e,i)}function su(e,t){var n=wc();n.setRotate(t,0,0),Sc(e,n)}tu.td=tu.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],tu.option=tu.optgroup=[1,'<select multiple="multiple">',"</select>"],tu.thead=tu.tbody=tu.colgroup=tu.caption=tu.tfoot=[1,"<table>","</table>"],tu.polyline=tu.ellipse=tu.polygon=tu.circle=tu.text=tu.line=tu.path=tu.rect=tu.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"],function(e){var t=e.exports=function(e,n){if(n=n||16,(e=void 0===e?128:e)<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),o=2;i===1/0;o*=2)i=Math.log(Math.pow(2,e/o))/Math.log(n)*o;var r=i-Math.floor(i),a="";for(o=0;o<Math.floor(i);o++)a=Math.floor(Math.random()*n).toString(n)+a;return r&&(r=Math.pow(n,r),a=Math.floor(Math.random()*r).toString(n)+a),(r=parseInt(a,n))!==1/0&&r>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){function o(o){var a=0;do{if(10<a++){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(r,s));return r[s]=o,s}var r=o.hats={};return o.get=function(e){return o.hats[e]},o.set=function(e,t){return o.hats[e]=t,o},o.bits=e||128,o.base=n||16,o}}(ea={exports:{}});var lu=ea.exports;function cu(e){if(!(this instanceof cu))return new cu(e);this._seed=(e=e||[128,36,1]).length?lu.rack(e[0],e[1],e[2]):e}cu.prototype.next=function(e){return this._seed(e||!0)},cu.prototype.nextPrefixed=function(e,t){for(var n;n=e+this.next(!0),this.assigned(n););return this.claim(n,t),n},cu.prototype.claim=function(e,t){this._seed.set(e,t||!0)},cu.prototype.assigned=function(e){return this._seed.get(e)||!1},cu.prototype.unclaim=function(e){delete this._seed.hats[e]},cu.prototype.clear=function(){for(var e in this._seed.hats)this.unclaim(e)};var uu=cu,du=new uu;function hu(e,t,n,i,o,r,a){Wl.call(this,t,a);var s=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=du.next(),d={},h=n.computeStyle;function p(e,t){var n=Object(Vl.assign)({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},r=t.scale||1,a=("none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]),gc("marker"));(n=(ic(t.element,n),ec(a,t.element),ic(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"}),nu("defs",o._svg)))||(n=gc("defs"),ec(o._svg,n)),ec(n,a),d[e]=a}function f(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function m(e,t,n){var i,o,r=e+"-"+f(t)+"-"+f(n)+"-"+u;return d[r]||(i=r,t=t,n=n,"sequenceflow-end"===(e=e)&&(ic(o=gc("path"),{d:"M 1 5 L 11 10 L 1 15 Z"}),p(i,{element:o,ref:{x:11,y:10},scale:.5,attrs:{fill:n,stroke:n}})),"messageflow-start"===e&&(ic(o=gc("circle"),{cx:6,cy:6,r:3.5}),p(i,{element:o,attrs:{fill:t,stroke:n},ref:{x:6,y:6}})),"messageflow-end"===e&&(ic(o=gc("path"),{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),p(i,{element:o,attrs:{fill:t,stroke:n,strokeLinecap:"butt"},ref:{x:8.5,y:5}})),"association-start"===e&&(ic(o=gc("path"),{d:"M 11 5 L 1 10 L 11 15"}),p(i,{element:o,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})),"association-end"===e&&(ic(o=gc("path"),{d:"M 1 5 L 11 10 L 1 15"}),p(i,{element:o,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})),"conditional-flow-marker"===e&&(ic(o=gc("path"),{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),p(i,{element:o,attrs:{fill:t,stroke:n},ref:{x:-1,y:10},scale:.5})),"conditional-default-flow-marker"===e&&(ic(o=gc("path"),{d:"M 6 4 L 10 16"}),p(i,{element:o,attrs:{stroke:n},ref:{x:0,y:10},scale:.5}))),"url(#"+r+")"}function g(e,t,n,i,o){Object(Vl.isObject)(i)&&(o=i,i=0),i=i||0,"none"===(o=h(o,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete o.fillOpacity;var r=t/2,a=n/2,s=gc("circle");return ic(s,{cx:r,cy:a,r:Math.round((t+n)/4-i)}),ic(s,o),ec(e,s),s}function v(e,t,n,i,o,r){Object(Vl.isObject)(o)&&(r=o,o=0),o=o||0,r=h(r,{stroke:"black",strokeWidth:2,fill:"white"});var a=gc("rect");return ic(a,{x:o,y:o,width:t-2*o,height:n-2*o,rx:i,ry:i}),ic(a,r),ec(e,a),a}function b(e,t,n){return ec(e,t=Oc(t,n=h(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}))),t}function y(e,t,n){n=h(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=gc("path");return ic(i,{d:t}),ic(i,n),ec(e,i),i}function w(e,t,n,i){y(t,n,Object(Vl.assign)({"data-marker":e},i))}function x(e){return function(t,n){return A[e](t,n)}}function _(e){return A[e]}function k(e,t){var n=$c(e),i="bpmn:IntermediateThrowEvent"===(i=n).$type||"bpmn:EndEvent"===i.$type;return n.eventDefinitions&&1<n.eventDefinitions.length?(n.parallelMultiple?_("bpmn:ParallelMultipleEventDefinition"):_("bpmn:MultipleEventDefinition"))(t,e,i):Mc(n,"bpmn:MessageEventDefinition")?_("bpmn:MessageEventDefinition")(t,e,i):Mc(n,"bpmn:TimerEventDefinition")?_("bpmn:TimerEventDefinition")(t,e,i):Mc(n,"bpmn:ConditionalEventDefinition")?_("bpmn:ConditionalEventDefinition")(t,e):Mc(n,"bpmn:SignalEventDefinition")?_("bpmn:SignalEventDefinition")(t,e,i):Mc(n,"bpmn:EscalationEventDefinition")?_("bpmn:EscalationEventDefinition")(t,e,i):Mc(n,"bpmn:LinkEventDefinition")?_("bpmn:LinkEventDefinition")(t,e,i):Mc(n,"bpmn:ErrorEventDefinition")?_("bpmn:ErrorEventDefinition")(t,e,i):Mc(n,"bpmn:CancelEventDefinition")?_("bpmn:CancelEventDefinition")(t,e,i):Mc(n,"bpmn:CompensateEventDefinition")?_("bpmn:CompensateEventDefinition")(t,e,i):Mc(n,"bpmn:TerminateEventDefinition")?_("bpmn:TerminateEventDefinition")(t,e,i):void 0}function E(e,t,n){return n=Object(Vl.assign)({size:{width:100}},n),lc(t=r.createText(t||"",n)).add("djs-label"),ec(e,t),t}function C(e,t,n){E(e,$c(t).name,{box:t,align:n,padding:5,style:{fill:Lc(t,c,l)}})}function S(e,t,n){ru(E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:Lc(n,c,l)}}),0,1*n.height,270)}function T(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var A=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=.95),g(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:Pc(t,s),stroke:Rc(t,l)};$c(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:Pc(t,s),stroke:Rc(t,l)}),n=_("bpmn:Event")(e,t,n);return k(t,e),n},"bpmn:MessageEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?Rc(t,l):Pc(t,s),stroke:n?Pc(t,s):Rc(t,l)})},"bpmn:TimerEventDefinition":function(e,t){var n=g(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:Pc(t,s),stroke:Rc(t,l)});y(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:Rc(t,l)});for(var o=0;o<12;o++){var r=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;y(e,r,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+t.height/2+","+a+")",stroke:Rc(t,l)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)})},"bpmn:ConditionalEventDefinition":function(e,t){return y(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Rc(t,l)})},"bpmn:LinkEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)})},"bpmn:ErrorEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)})},"bpmn:CancelEventDefinition":function(e,t,n){return su(e=y(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)}),45),e},"bpmn:CompensateEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)})},"bpmn:SignalEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?Rc(t,l):"none",stroke:Rc(t,l)})},"bpmn:MultipleEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?Rc(t,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return y(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:Rc(t,l),stroke:Rc(t,l)})},"bpmn:EndEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:4,fill:Pc(t,s),stroke:Rc(t,l)});return k(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return g(e,t.width,t.height,8,{strokeWidth:4,fill:Rc(t,l),stroke:Rc(t,l)})},"bpmn:IntermediateEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)});return g(e,t.width,t.height,3,{strokeWidth:1,fill:Pc(t,"none"),stroke:Rc(t,l)}),k(t,e),n},"bpmn:IntermediateCatchEvent":x("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":x("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=.95),v(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:Pc(t,s),stroke:Rc(t,l)};n=_("bpmn:Activity")(e,t,n);return C(e,t,"center-middle"),O(e,t),n},"bpmn:ServiceTask":function(e,t){var n=_("bpmn:Task")(e,t),o=(y(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)}),i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}));y(e,o,{strokeWidth:0,fill:Pc(t,s)}),o=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return y(e,o,{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)}),n},"bpmn:UserTask":function(e,t){var n=_("bpmn:Task")(e,t),o=(y(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Pc(t,s),stroke:Rc(t,l)}),i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}));y(e,o,{strokeWidth:.5,fill:Pc(t,s),stroke:Rc(t,l)}),o=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}});return y(e,o,{strokeWidth:.5,fill:Rc(t,l),stroke:Rc(t,l)}),n},"bpmn:ManualTask":function(e,t){var n=_("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Pc(t,s),stroke:Rc(t,l)}),n},"bpmn:SendTask":function(e,t){var n=_("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Rc(t,l),stroke:Pc(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n=$c(t),o=_("bpmn:Task")(e,t);return y(e,n=n.instantiate?(g(e,28,28,4.4,{strokeWidth:1}),i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)}),o},"bpmn:ScriptTask":function(e,t){var n=_("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Rc(t,l)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=_("bpmn:Task")(e,t),o=(ic(y(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Pc(t,"#aaaaaa"),stroke:Rc(t,l)}),i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return ic(y(e,o),{strokeWidth:1,stroke:Rc(t,l)}),n},"bpmn:SubProcess":function(e,t,n){n=Object(Vl.assign)({fill:Pc(t,s),stroke:Rc(t,l)},n);n=_("bpmn:Activity")(e,t,n);var i=Kl(t);return Yl(t)&&ic(n,{strokeDasharray:"1,2"}),C(e,t,i?"center-top":"center-middle"),i?O(e,t):O(e,t,["SubProcessMarker"]),n},"bpmn:AdHocSubProcess":function(e,t){return _("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=_("bpmn:SubProcess")(e,t),o=n.style(["no-fill","no-events"],{stroke:Rc(t,l)});return v(e,t.width,t.height,8,3,o),i},"bpmn:CallActivity":function(e,t){return _("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:.95,fill:Pc(t,s),stroke:Rc(t,l)};n=_("bpmn:Lane")(e,t,n);return Kl(t)?(b(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:Rc(t,l)}),S(e,$c(t).name,t)):E(e,$c(t).name,{box:t,align:"center-middle",style:{fill:Lc(t,c,l)}}),!$c(t).participantMultiplicity||(0,A.ParticipantMultiplicityMarker)(e,t),n},"bpmn:Lane":function(e,t,n){n=v(e,t.width,t.height,0,Object(Vl.assign)({fill:Pc(t,s),fillOpacity:.35,stroke:Rc(t,l)},n));var i=$c(t);return"bpmn:Lane"===i.$type&&S(e,i.name,t),n},"bpmn:InclusiveGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return g(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:Pc(t,s),stroke:Rc(t,l)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=_("bpmn:Gateway")(e,t),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Dc(t).isMarkerVisible&&y(e,o,{strokeWidth:1,fill:Rc(t,l),stroke:Rc(t,l)}),n},"bpmn:ComplexGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return y(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Rc(t,l),stroke:Rc(t,l)}),n},"bpmn:ParallelGateway":function(e,t){var n=_("bpmn:Gateway")(e,t);return y(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Rc(t,l),stroke:Rc(t,l)}),n},"bpmn:EventBasedGateway":function(e,t){var n=$c(t),o=_("bpmn:Gateway")(e,t),r=(g(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:Rc(t,l)}),n.eventGatewayType);n=!!n.instantiate;return"Parallel"===r?ic(y(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}})),{strokeWidth:1,fill:"none"}):"Exclusive"===r&&(n||ic(g(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:Rc(t,l)}),y(e,i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:Pc(t,"none"),stroke:Rc(t,l)})),o},"bpmn:Gateway":function(e,t){var n,i,o,r={fill:Pc(t,s),fillOpacity:.95,stroke:Rc(t,l)};return e=e,r=r,n=[{x:i=(n=t.width)/2,y:0},{x:n,y:o=(t=t.height)/2},{x:i,y:t},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" "),r=h(r,{stroke:"black",strokeWidth:2,fill:"white"}),ic(i=gc("polygon"),{points:n}),ic(i,r),ec(e,i),i},"bpmn:SequenceFlow":function(e,t){var n=T(t),i=Pc(t,s),o=Rc(t,l);e=y(e,n,{strokeLinejoin:"round",markerEnd:m("sequenceflow-end",i,o),stroke:Rc(t,l)}),n=$c(t);return t.source&&(t=t.source.businessObject,n.conditionExpression&&t.$instanceOf("bpmn:Activity")&&ic(e,{markerStart:m("conditional-flow-marker",i,o)}),t.default)&&(t.$instanceOf("bpmn:Gateway")||t.$instanceOf("bpmn:Activity"))&&t.default===n&&ic(e,{markerStart:m("conditional-default-flow-marker",i,o)}),e},"bpmn:Association":function(e,t,n){var i=$c(t),o=Pc(t,s),r=Rc(t,l);return n=Object(Vl.assign)({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Rc(t,l)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=m("association-end",o,r)),"Both"===i.associationDirection&&(n.markerStart=m("association-start",o,r)),b(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=Pc(t,s),i=Rc(t,l);return _("bpmn:Association")(e,t,{markerEnd:m("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=Pc(t,s),i=Rc(t,l);return _("bpmn:Association")(e,t,{markerEnd:m("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n,o,r=$c(t),a=Dc(t),u=Pc(t,s),d=Rc(t,l);u=y(e,T(t),{markerEnd:m("messageflow-end",u,d),markerStart:m("messageflow-start",u,d),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Rc(t,l)});return r.messageRef&&(d=u.getPointAtLength(u.getTotalLength()/2),n=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:d.x,y:d.y}}),o={strokeWidth:1},"initiating"===a.messageVisibleKind?(o.fill="white",o.stroke="black"):(o.fill="#888",o.stroke="white"),a=y(e,n,o),n=E(e,r.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Rc(t,c)}}),o=a.getBBox(),e=n.getBBox(),ru(n,d.x-e.width/2,d.y+o.height/2+10,0)),u},"bpmn:DataObject":function(e,t){var n,o=y(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:Pc(t,s),fillOpacity:.95,stroke:Rc(t,l)}),r=$c(t);return n=r.dataObjectRef,(r.isCollection||n&&n.isCollection)&&(r=e,e=((n=t).height-18)/t.height,y(r,n=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:e}}),{strokeWidth:2})),o},"bpmn:DataObjectReference":x("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW");t=_("bpmn:DataObject")(e,t);return y(e,n,{strokeWidth:1}),t},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW");t=_("bpmn:DataObject")(e,t);return y(e,n,{strokeWidth:1,fill:"black"}),t},"bpmn:DataStoreReference":function(e,t){return y(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Pc(t,s),fillOpacity:.95,stroke:Rc(t,l)})},"bpmn:BoundaryEvent":function(e,t){var n=$c(t).cancelActivity,i={strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)};n||(i.strokeDasharray="6",i.strokeLinecap="round"),n=Object(Vl.assign)({},i,{fillOpacity:1}),i=Object(Vl.assign)({},i,{fill:"none"}),n=_("bpmn:Event")(e,t,n);return g(e,t.width,t.height,3,i),k(t,e),n},"bpmn:Group":function(e,t){return v(e,t.width,t.height,10,{stroke:Rc(t,l),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return n={width:90,height:30,x:(t=t).width/2+t.x,y:t.height/2+t.y},E(e,Zl(t),{box:n,fitBox:!0,style:Object(Vl.assign)({},r.getExternalStyle(),{fill:Lc(t,c,l)})});var n},"bpmn:TextAnnotation":function(e,t){var n=v(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return y(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:Rc(t,l)}),E(e,$c(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:Lc(t,c,l)}}),n},ParticipantMultiplicityMarker:function(e,t){w("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}),{strokeWidth:2,fill:Pc(t,s),stroke:Rc(t,l)})},SubProcessMarker:function(e,t){au(v(e,14,14,0,{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)}),t.width/2-7.5,t.height-20),w("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:Pc(t,s),stroke:Rc(t,l)})},ParallelMarker:function(e,t,n){w("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:Pc(t,s),stroke:Rc(t,l)})},SequentialMarker:function(e,t,n){w("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:Pc(t,s),stroke:Rc(t,l)})},CompensationMarker:function(e,t,n){w("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l)})},LoopMarker:function(e,t,n){w("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:Pc(t,s),stroke:Rc(t,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){w("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:Rc(t,l),stroke:Rc(t,l)})}};function O(e,t,n){var i=$c(t),o=n&&-1!==n.indexOf("SubProcessMarker")?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10};i=(n=(Object(Vl.forEach)(n,(function(n){_(n)(e,t,o)})),i.isForCompensation&&(0,A.CompensationMarker)(e,t,o),"bpmn:AdHocSubProcess"===i.$type&&(0,A.AdhocMarker)(e,t,o),i.loopCharacteristics))&&n.isSequential;n&&(void 0===i&&(0,A.LoopMarker)(e,t,o),!1===i&&(0,A.ParallelMarker)(e,t,o),!0===i)&&(0,A.SequentialMarker)(e,t,o)}this._drawPath=y}function pu(e,t,n,i,o){hu.call(this,{defaultFillColor:"",defaultStrokeColor:"#8b238f",defaultLabelColor:"#2dd257"},e,t,n,i,o,2e3)}function fu(){}H()(hu,Wl),hu.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],hu.prototype.canRender=function(e){return Hl(e,"bpmn:BaseElement")},hu.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},hu.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},hu.prototype.getShapePath=function(e){var t,n,i,o,r,a;return Hl(e,"bpmn:Event")?Tc([["M",n=(i=e).x+i.width/2,t=i.y+i.height/2],["m",0,-(i=i.width/2)],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]]):Hl(e,"bpmn:Activity")?(n=10,Tc([["M",(i=(t=e).x)+n,o=t.y],["l",(r=t.width)-2*n,0],["a",n,n,0,0,1,n,n],["l",0,(t=t.height)-2*n],["a",n,n,0,0,1,-n,n],["l",2*n-r,0],["a",n,n,0,0,1,-n,-n],["l",0,2*n-t],["a",n,n,0,0,1,n,-n],["z"]])):Hl(e,"bpmn:Gateway")?(o=e.width/2,r=e.height/2,Tc([["M",e.x+o,e.y],["l",o,r],["l",-o,r],["l",-o,-r],["z"]])):Tc([["M",e.x,e.y],["l",a=e.width,0],["l",0,e.height],["l",-a,0],["z"]])},pu.$inject=["eventBus","styles","pathMap","canvas","textRenderer"],fu.prototype=hu.prototype;var mu={__init__:["customRenderer"],customRenderer:["type",(pu.prototype=new fu).constructor=pu]};function gu(e,t){for("string"==typeof t&&(t=[t]);e=e.parent;)if(Ul(e,t))return e;return null}function vu(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function bu(e,t,n,i){if(void 0===i&&(i=5),e&&t&&n)return n=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),e=vu(e,t),Math.abs(n/e)<=i}function yu(e,t){var n,i,o;return t=e=Object(Vl.isArray)(e)?e:[e,t],t=Object(Vl.isArray)(t)?t:[t,i],n=t.slice().shift(),Object(Vl.every)(t,(function(e){return Math.abs(n.y-e.y)<=2}))?"h":(i=e,i=Object(Vl.isArray)(i)?i:[i,void 0],o=i.slice().shift(),!!Object(Vl.every)(i,(function(e){return Math.abs(o.x-e.x)<=2}))&&"v")}function wu(e,t,n){return e.x>t.x-(n=n||0)&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function xu(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}nr=n(64);var _u=n.n(nr);function ku(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Eu(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Cu(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Su(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Tu(e){return Eu({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Au(e,t,n){n=n||0,Object(Vl.isObject)(n)||(n={x:n,y:n});e=Cu(e),t=Cu(t);var i=e.bottom+n.y<=t.top,o=e.left-n.x>=t.right,r=e.top-n.y>=t.bottom;i=i?"top":r?"bottom":null;return(r=e.right+n.x<=t.left?"left":o?"right":null)&&i?i+"-"+r:r||i||"intersect"}function Ou(e,t,n){return e=e,t=t,1===(e=_u()(e,t)).length||2===e.length&&vu(e[0],e[1])<1?Eu(e[0]):1<e.length?Eu((e=Object(Vl.sortBy)(e,(function(e){var t=Math.floor(100*e.t2)||1;return e.segment2+"#"+((t=100-t)<10?"0":"")+t})))[n?0:e.length-1]):null}function Mu(e){return Object(Vl.filter)(e,(function(t){return!Object(Vl.find)(e,(function(e){return e!==t&&function e(t,n){if(n){if(t===n)return n;if(t.parent)return e(t.parent,n)}}(t,e)}))}))}function Du(e,t,n){return(n=!n||-1===e.indexOf(t))&&e.push(t),n}function $u(e,t,n){n=n||0,Object(Vl.isArray)(e)||(e=[e]),Object(Vl.forEach)(e,(function(e,i){e=t(e,i,n),Object(Vl.isArray)(e)&&e.length&&$u(e,t,n+1)}))}function Pu(e,t){return function(e,t,n){var i=[],o=[];return $u(e,(function(e,r,a){if(Du(i,e,t),e=e.children,(-1===n||a<n)&&e&&Du(o,e,t))return e})),i}(e,!t,-1)}function Ru(e,t){var n,i,o,r;return t=!!t,Object(Vl.isArray)(e)||(e=[e]),Object(Vl.forEach)(e,(function(e){var a=e,s=(e=(a=e.waypoints&&!t?Ru(e.waypoints,!0):a).x,a.y),l=a.height||0;a=a.width||0;(e<n||void 0===n)&&(n=e),(s<i||void 0===i)&&(i=s),(o<e+a||void 0===o)&&(o=e+a),(r<s+l||void 0===r)&&(r=s+l)})),{x:n,y:i,height:r-i,width:o-n}}function Lu(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Iu(e){return!(!e||!e.isFrame)}function Nu(e,t){return Object(Vl.assign)({},e||{},t||{})}var Fu=Math.max,ju=Math.min;function Bu(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function qu(e,t,n){t=t[e];var i=n.min&&n.min[e];n=n.max&&n.max[e];return Object(Vl.isNumber)(i)&&(t=(/top|left/.test(e)?ju:Fu)(t,i)),Object(Vl.isNumber)(n)?(/top|left/.test(e)?Fu:ju)(t,n):t}function zu(e){return void 0!==e?e:20}function Vu(e){return!e.waypoints&&"label"!==e.type}function Wu(e,t){var n,i,o,r;if((e=void 0===e.length?Object(Vl.filter)(e.children,Vu):e).length)return e=Ru(e),"object"==typeof(t=t)?(n=zu(t.left),i=zu(t.right),o=zu(t.top),r=zu(t.bottom)):n=i=o=r=zu(t),{x:e.x-n,y:e.y-o,width:e.width+n+i,height:e.height+o+r}}var Hu=Math.abs,Uu=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"];function Gu(e,t){return t=t||[],e.children.filter((function(e){Hl(e,"bpmn:Lane")&&(Gu(e,t),t.push(e))})),t}function Ku(e){return e.children.filter((function(e){return Hl(e,"bpmn:Lane")}))}function Yu(e){return gu(e,Uu)||e}function Xu(e){return e.originalEvent||e.srcEvent}function Ju(e,t){return(Xu(e)||e).button===t}function Zu(e){return Ju(e,0)}function Qu(e,t,n,i,o,r,a,s,l,c,u,d,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=o,this._elementFactory=r,this._connect=a,this._create=s,this._popupMenu=l,this._canvas=c,this._rules=u,this._translate=d,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t,n=e.context.shape;(function(e){var t=Xu(e)||e;return Zu(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)})(e)&&i.isOpen(n)&&(t=i.getEntries(n)).replace&&t.replace.action.click(e,n)}))}function ed(e,t,n){t=e.$instanceOf(t);var i=!1;e=e.eventDefinitions||[];return Object(Vl.forEach)(e,(function(e){e.$type===n&&(i=!0)})),t&&i}Qu.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","elementRegistry"],Qu.prototype.getContextPadEntries=function(e){var t,n,i=this._contextPad,o=this._modeling,r=this._elementFactory,a=this._connect,s=this._create,l=this._popupMenu,c=this._canvas,u=this._rules,d=this._autoPlace,h=this._translate,p={};return"label"!==e.type&&(Ul(t=e.businessObject,["bpmn:Lane","bpmn:Participant"])&&Kl(t)&&(n=Ku(e),Object(Vl.assign)(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:h("Add Lane above"),action:{click:function(e,t){o.addLane(t,"top")}}}}),n.length<2&&(120<=e.height&&Object(Vl.assign)(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:h("Divide into two Lanes"),action:{click:g(2)}}}),180<=e.height)&&Object(Vl.assign)(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:h("Divide into three Lanes"),action:{click:g(3)}}}),Object(Vl.assign)(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:h("Add Lane below"),action:{click:function(e,t){o.addLane(t,"bottom")}}}})),Hl(t,"bpmn:FlowNode")&&(Hl(t,"bpmn:EventBasedGateway")?Object(Vl.assign)(p,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",h("Append ReceiveTask")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",h("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",h("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",h("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",h("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):ed(t,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?Object(Vl.assign)(p,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",h("Append compensation activity"),{isForCompensation:!0})}):Hl(t,"bpmn:EndEvent")||t.isForCompensation||ed(t,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Yl(t)||Object(Vl.assign)(p,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",h("Append EndEvent")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",h("Append Gateway")),"append.append-task":m("bpmn:UserTask","bpmn-icon-user-task",h("Append Task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",h("Append Intermediate/Boundary Event"))})),l.isEmpty(e,"bpmn-replace")||Object(Vl.assign)(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:h("Change type"),action:{click:function(e,t){var n,o,r=Object(Vl.assign)((n=t,r=c.getContainer(),n=i.getPad(n).html,r=r.getBoundingClientRect(),o=(n=n.getBoundingClientRect()).top-r.top,{x:n.left-r.left,y:o+n.height+5}),{cursor:{x:e.x,y:e.y}});l.open(t,"bpmn-replace",r)}}}}),Ul(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Object(Vl.assign)(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:h("Connect using "+(t.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),Ul(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Object(Vl.assign)(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:h("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),Hl(t,"bpmn:Group")&&Object(Vl.assign)(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation")}),n=u.allowed("elements.delete",{elements:[e]}),n=Object(Vl.isArray)(n)?n[0]===e:n)&&Object(Vl.assign)(p,{delete:{group:"edit",className:"bpmn-icon-trash",title:h("Remove"),action:{click:function(){o.removeElements([e])}}}}),p;function f(e,t){a.start(e,t)}function m(e,t,n,i){function o(t,n){var o=r.createShape(Object(Vl.assign)({type:e},i));s.start(t,o,{source:n})}return"string"!=typeof n&&(i=n,n=h("Append {type}",{type:e.replace(/^bpmn:/,"")})),{group:"model",className:t,title:n,action:{dragstart:o,click:d?function(t,n){var o=r.createShape(Object(Vl.assign)({type:e},i));d.append(n,o)}:o}}}function g(e){return function(t,n){o.splitLane(n,e),i.open(n,!0)}}};var td={__init__:["contextPadProvider"],contextPadProvider:["type",Qu]};function nd(e,t,n,i,o,r,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=o,this._handTool=r,this._globalConnect=a,this._translate=s,e.registerProvider(this)}function id(e,t,n,i,o,r,a,s){nd.call(this,e,t,n,i,o,r,a,s,2e3)}function od(){}nd.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],nd.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,o=this._spaceTool,r=this._lassoTool,a=this._handTool,s=this._globalConnect,l=this._translate;function c(e,t,o,r,a){function s(t){var o=i.createShape(Object(Vl.assign)({type:e},a));a&&(o.businessObject.di.isExpanded=a.isExpanded),n.start(t,o)}var c=e.replace(/^bpmn:/,"");return{group:t,className:o,title:r||l("Create {type}",{type:c}),action:{dragstart:s,click:s}}}function u(e){var t=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),o=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:t});n.start(e,[t,o],{hints:{autoSelect:[t]}})}function d(e){n.start(e,i.createParticipantShape())}return Object(Vl.assign)(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:l("Activate the hand tool"),action:{click:function(e){a.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:l("Activate the lasso tool"),action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:l("Activate the create/remove space tool"),action:{click:function(e){o.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:l("Activate the global connect tool"),action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",l("Create StartEvent")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",l("Create Intermediate/Boundary Event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",l("Create EndEvent")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",l("Create Gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",l("Create Task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",l("Create DataObjectReference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",l("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:l("Create expanded SubProcess"),action:{dragstart:u,click:u}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:l("Create Pool/Participant"),action:{dragstart:d,click:d}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",l("Create Group"))}),t},(od.prototype=nd.prototype).getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,o=this._lassoTool,r=this._handTool,a=this._globalConnect,s=this._translate;function l(e,i,o,r,a){function l(i){var o=n.createShape(Object(Vl.assign)({type:e},a));a&&(o.businessObject.di.isExpanded=a.isExpanded),t.start(i,o)}var c=e.replace(/^bpmn:/,"");return{group:i,className:o,title:r||s("Create {type}",{type:c}),action:{dragstart:l,click:l}}}function c(e){var i=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),o=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:i});t.start(e,[i,o],{hints:{autoSelect:[o]}})}function u(e){t.start(e,n.createParticipantShape())}return Object(Vl.assign)(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate the hand tool"),action:{click:function(e){r.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate the lasso tool"),action:{click:function(e){o.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate the create/remove space tool"),action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate the global connect tool"),action:{click:function(e){a.toggle(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":l("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create StartEvent")),"create.intermediate-event":l("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create Intermediate/Boundary Event")),"create.end-event":l("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create EndEvent")),"create.exclusive-gateway":l("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create Gateway")),"create.user-task":l("bpmn:UserTask","activity","bpmn-icon-user-task",s("Create User Task")),"create.data-object":l("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create DataObjectReference")),"create.data-store":l("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded SubProcess"),action:{dragstart:c,click:c}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create Pool/Participant"),action:{dragstart:u,click:u}},"create.group":l("bpmn:Group","artifact","bpmn-icon-group",s("Create Group"))}),e},id.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"];var rd={__init__:["customPalette"],customPalette:["type",(id.prototype=new od).constructor=id]};function ad(e){return(ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sd(){}sd.prototype.type=["primary","success","warn","error","info"],sd.prototype.typeColor=function(e){var t="";switch(e){case"primary":t="#2d8cf0";break;case"success":t="#19be6b";break;case"info":t="#909399";break;case"warn":t="#ff9900";break;case"error":t="#f03f14";break;default:t="#35495E"}return t},sd.prototype.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},sd.prototype.print=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default",n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];"object"===ad(e)?this.isArray(e)?console.table(e):console.dir(e):n?console.log("%c ".concat(e," "),"background:".concat(this.typeColor(t),"; padding: 2px; border-radius: 4px; color: #fff;")):console.log("%c ".concat(e," "),"border: 1px solid ".concat(this.typeColor(t),";\n padding: 2px; border-radius: 4px;\n color: ").concat(this.typeColor(t),";"))},sd.prototype.printBack=function(){this.print(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"primary",1<arguments.length?arguments[1]:void 0,!0)},sd.prototype.pretty=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"primary",t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;"object"===ad(n)?(console.group("Console Group",t),console.log("%c ".concat(t),"background:".concat(this.typeColor(e),";border:1px solid ").concat(this.typeColor(e),";\n padding: 1px; border-radius: 4px; color: #fff;")),this.isArray(n)?console.table(n):console.dir(n),console.groupEnd()):console.log("%c ".concat(t," %c ").concat(n," %c"),"background:".concat(this.typeColor(e),";border:1px solid ").concat(this.typeColor(e),";\n padding: 1px; border-radius: 4px 0 0 4px; color: #fff;"),"border:1px solid ".concat(this.typeColor(e),";\n padding: 1px; border-radius: 0 4px 4px 0; color: ").concat(this.typeColor(e),";"),"background:transparent")},sd.prototype.prettyPrimary=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("primary",e,n)}))},sd.prototype.prettySuccess=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("success",e,n)}))},sd.prototype.prettyWarn=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("warn",e,n)}))},sd.prototype.prettyError=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("error",e,n)}))},sd.prototype.prettyInfo=function(e){for(var t=this,n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.forEach((function(n){return t.pretty("info",e,n)}))};var ld=new sd;const cd=Object.prototype.toString,ud=Object.prototype.hasOwnProperty;function dd(e){return"[object Array]"===cd.call(e)}function hd(e){return"[object Number]"===cd.call(e)}function pd(e){return"[object Function]"===(e=cd.call(e))||"[object AsyncFunction]"===e||"[object GeneratorFunction]"===e||"[object AsyncGeneratorFunction]"===e||"[object Proxy]"===e}function fd(e,t){if(!function(e){return void 0===e}(e)){var n,i,o,r=dd(e)?gd:md;for(n in e)if(i=e,o=n,ud.call(i,o)&&!1===t(e[n],r(n)))return}}function md(e){return e}function gd(e){return Number(e)}function vd(e,...t){return Object.assign(e,...t)}function bd(e){this._eventBus=e}function yd(e){bd.call(this,e),this.init()}function wd(e,t){yd.call(this,e),this.taskResizingEnabled=t||!1}function xd(e,t){yd.call(this,e),this.eventResizingEnabled=t||!1}bd.$inject=["eventBus"],bd.prototype.on=function(e,t,n,i,o,r){if((pd(t)||hd(t))&&(r=o,o=i,i=n,n=t,t=null),pd(n)&&(r=o,o=i,i=n,n=1e3),function(e){return"[object Object]"===cd.call(e)}(o)&&(r=o,o=!1),!pd(i))throw new Error("handlerFn must be a function");dd(e)||(e=[e]);var a=this._eventBus;fd(e,(function(e){var s,l;e=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(e,n,o?(s=i,l=r,function(e){return s.call(l||null,e.context,e.command,e)}):i,r)}))},fd(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){bd.prototype[e]=function(t,n,i,o,r){(pd(t)||hd(t))&&(r=o,o=i,i=n,n=t,t=null),this.on(t,e,n,i,o,r)}})),yd.$inject=["eventBus"],Wo=yd,(tr=bd)&&(Wo.super_=tr,Wo.prototype=Object.create(tr.prototype,{constructor:{value:Wo,enumerable:!1,writable:!0,configurable:!0}})),yd.prototype.addRule=function(e,t,n){var i=this;(e="string"==typeof e?[e]:e).forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},yd.prototype.init=function(){},H()(wd,yd),wd.$inject=["eventBus","config.taskResizingEnabled"],wd.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.taskResizingEnabled&&t.shape.businessObject&&(t.shape.businessObject.$instanceOf("bpmn:Task")||t.shape.businessObject.$instanceOf("bpmn:CallActivity")||t.shape.businessObject.$instanceOf("bpmn:SubProcess")))return t.newBounds&&(t.newBounds.width=Math.max(100,t.newBounds.width),t.newBounds.height=Math.max(80,t.newBounds.height)),!0}))},H()(xd,yd),xd.$inject=["eventBus","config.eventResizingEnabled"],xd.prototype.init=function(){var e=this;e.addRule("shape.resize",1500,(function(t){if(e.eventResizingEnabled&&t.shape.businessObject&&t.shape.businessObject.$instanceOf("bpmn:Event"))return t.newBounds&&(t.newBounds.width=Math.max(36,t.newBounds.width),t.newBounds.height=Math.max(36,t.newBounds.height)),!0}))};const _d="http://www.w3.org/2000/svg";function kd(e,t,n){if(e&&e.length){const[i,o]=t;t=Math.PI/180*n;const r=Math.cos(t),a=Math.sin(t);e.forEach(e=>{var[t,n]=e;e[0]=(t-i)*r-(n-o)*a+i,e[1]=(t-i)*a+(n-o)*r+o})}}function Ed(e){var t=e[0];e=e[1];return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Cd(e,t){return e.type===t}const Sd={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:4,t:2,V:1,v:1,Z:0,z:0};class Td{constructor(e){this.COMMAND=0,this.NUMBER=1,this.EOD=2,this.segments=[],this.parseData(e),this.processPoints()}tokenize(e){for(var t=new Array;""!==e;){if(!e.match(/^([ \t\r\n,]+)/))if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:this.COMMAND,text:RegExp.$1};else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:this.NUMBER,text:""+parseFloat(RegExp.$1)}}e=e.substr(RegExp.$1.length)}return t[t.length]={type:this.EOD,text:""},t}parseData(e){var t=this.tokenize(e);let n=0,i=t[n],o="BOD";for(this.segments=new Array;!Cd(i,this.EOD);){let l;var r=new Array;if("BOD"===o){if("M"!==i.text&&"m"!==i.text)return void this.parseData("M0,0"+e);n++,l=Sd[i.text],o=i.text}else Cd(i,this.NUMBER)?l=Sd[o]:(n++,l=Sd[i.text],o=i.text);if(n+l<t.length){for(let e=n;e<n+l;e++){var a=t[e];if(!Cd(a,this.NUMBER))return void console.error("Param not a number: "+o+","+a.text);r[r.length]=+a.text}if("number"!=typeof Sd[o])return void console.error("Bad segment: "+o);var s={key:o,data:r};this.segments.push(s),n+=l,i=t[n],"m"===(o="M"===o?"L":o)&&(o="l")}else console.error("Path data ended short")}}get closed(){if(void 0===this._closed){this._closed=!1;for(const e of this.segments)"z"===e.key.toLowerCase()&&(this._closed=!0)}return this._closed}processPoints(){let e=null,t=[0,0];for(let i=0;i<this.segments.length;i++){var n=this.segments[i];switch(n.key){case"M":case"L":case"T":n.point=[n.data[0],n.data[1]];break;case"m":case"l":case"t":n.point=[n.data[0]+t[0],n.data[1]+t[1]];break;case"H":n.point=[n.data[0],t[1]];break;case"h":n.point=[n.data[0]+t[0],t[1]];break;case"V":n.point=[t[0],n.data[0]];break;case"v":n.point=[t[0],n.data[0]+t[1]];break;case"z":case"Z":e&&(n.point=[e[0],e[1]]);break;case"C":n.point=[n.data[4],n.data[5]];break;case"c":n.point=[n.data[4]+t[0],n.data[5]+t[1]];break;case"S":n.point=[n.data[2],n.data[3]];break;case"s":n.point=[n.data[2]+t[0],n.data[3]+t[1]];break;case"Q":n.point=[n.data[2],n.data[3]];break;case"q":n.point=[n.data[2]+t[0],n.data[3]+t[1]];break;case"A":n.point=[n.data[5],n.data[6]];break;case"a":n.point=[n.data[5]+t[0],n.data[6]+t[1]]}"m"!==n.key&&"M"!==n.key||(e=null),n.point&&(t=n.point,e=e||n.point),"z"!==n.key&&"Z"!==n.key||(e=null)}}}class Ad{constructor(e){this._position=[0,0],this._first=null,this.bezierReflectionPoint=null,this.quadReflectionPoint=null,this.parsed=new Td(e)}get segments(){return this.parsed.segments}get closed(){return this.parsed.closed}get linearPoints(){if(!this._linearPoints){var e=[];let n=[];for(const i of this.parsed.segments){var t=i.key.toLowerCase();("m"!==t&&"z"!==t||(n.length&&(e.push(n),n=[]),"z"!==t))&&i.point&&n.push(i.point)}n.length&&(e.push(n),n=[]),this._linearPoints=e}return this._linearPoints}get first(){return this._first}set first(e){this._first=e}setPosition(e,t){this._position=[e,t],this._first||(this._first=[e,t])}get position(){return this._position}get x(){return this._position[0]}get y(){return this._position[1]}}class Od{constructor(e,t,n,i,o,r){if(this._segIndex=0,this._numSegs=0,this._rx=0,this._ry=0,this._sinPhi=0,this._cosPhi=0,this._C=[0,0],this._theta=0,this._delta=0,this._T=0,(this._from=e)[0]!==t[0]||e[1]!==t[1]){var a=Math.PI/180;n=(this._rx=Math.abs(n[0]),this._ry=Math.abs(n[1]),this._sinPhi=Math.sin(i*a),this._cosPhi=Math.cos(i*a),this._cosPhi*(e[0]-t[0])/2+this._sinPhi*(e[1]-t[1])/2),i=-this._sinPhi*(e[0]-t[0])/2+this._cosPhi*(e[1]-t[1])/2;let l=0;var s=(l=(a=this._rx*this._rx*this._ry*this._ry-this._rx*this._rx*i*i-this._ry*this._ry*n*n)<0?(s=Math.sqrt(1-a/(this._rx*this._rx*this._ry*this._ry)),this._rx=this._rx*s,this._ry=this._ry*s,0):(o===r?-1:1)*Math.sqrt(a/(this._rx*this._rx*i*i+this._ry*this._ry*n*n)))*this._rx*i/this._ry;o=-l*this._ry*n/this._rx;this._C=[0,0],this._C[0]=this._cosPhi*s-this._sinPhi*o+(e[0]+t[0])/2,this._C[1]=this._sinPhi*s+this._cosPhi*o+(e[1]+t[1])/2,this._theta=this.calculateVectorAngle(1,0,(n-s)/this._rx,(i-o)/this._ry);let c=this.calculateVectorAngle((n-s)/this._rx,(i-o)/this._ry,(-n-s)/this._rx,(-i-o)/this._ry);!r&&0<c?c-=2*Math.PI:r&&c<0&&(c+=2*Math.PI),this._numSegs=Math.ceil(Math.abs(c/(Math.PI/2))),this._delta=c/this._numSegs,this._T=8/3*Math.sin(this._delta/4)*Math.sin(this._delta/4)/Math.sin(this._delta/2)}}getNextSegment(){var e,t,n,i,o,r;return this._segIndex===this._numSegs?null:(r=Math.cos(this._theta),o=Math.sin(this._theta),e=this._theta+this._delta,t=Math.cos(e),n=Math.sin(e),i=[this._cosPhi*this._rx*t-this._sinPhi*this._ry*n+this._C[0],this._sinPhi*this._rx*t+this._cosPhi*this._ry*n+this._C[1]],o=[this._from[0]+this._T*(-this._cosPhi*this._rx*o-this._sinPhi*this._ry*r),this._from[1]+this._T*(-this._sinPhi*this._rx*o+this._cosPhi*this._ry*r)],r=[i[0]+this._T*(this._cosPhi*this._rx*n+this._sinPhi*this._ry*t),i[1]+this._T*(this._sinPhi*this._rx*n-this._cosPhi*this._ry*t)],this._theta=e,this._from=[i[0],i[1]],this._segIndex++,{cp1:o,cp2:r,to:i})}calculateVectorAngle(e,t,n,i){return(t=Math.atan2(t,e))<=(e=Math.atan2(i,n))?e-t:2*Math.PI-(t-e)}}class Md{constructor(e,t){this.sets=e,this.closed=t}fit(e){var t=[];for(const i of this.sets){var n=i.length;let o=Math.floor(e*n);if(o<5){if(n<=5)continue;o=5}t.push(this.reduce(i,o))}let i="";for(const e of t){for(let t=0;t<e.length;t++){var o=e[t];i+=0===t?"M"+o[0]+","+o[1]:"L"+o[0]+","+o[1]}this.closed&&(i+="z ")}return i}reduce(e,t){if(e.length<=t)return e;for(var n=e.slice(0);n.length>t;){let e=-1,t=-1;for(let s=1;s<n.length-1;s++){var i=Ed([n[s-1],n[s]]),o=Ed([n[s],n[s+1]]),r=Ed([n[s-1],n[s+1]]),a=(i+o+r)/2;i=Math.sqrt(a*(a-i)*(a-o)*(a-r));(e<0||i<e)&&(e=i,t=s)}if(!(0<t))break;n.splice(t,1)}return n}}function Dd(e,t){var n=[0,0],i=Math.round(t.hachureAngle+90);i&&kd(e,n,i),t=function(e,t){var n=[...e];n[0].join(",")!==n[n.length-1].join(",")&&n.push([n[0][0],n[0][1]]);var i=[];if(n&&2<n.length){let e=t.hachureGap;e<0&&(e=4*t.strokeWidth),e=Math.max(e,.1);var o=[];for(let e=0;e<n.length-1;e++){var r,a=n[e],s=n[e+1];a[1]!==s[1]&&(r=Math.min(a[1],s[1]),o.push({ymin:r,ymax:Math.max(a[1],s[1]),x:(r===a[1]?a:s)[0],islope:(s[0]-a[0])/(s[1]-a[1])}))}if(o.sort((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!o.length)return i;let u=[],d=o[0].ymin;for(;u.length||o.length;){if(o.length){let e=-1;for(let t=0;t<o.length&&!(o[t].ymin>d);t++)e=t;o.splice(0,e+1).forEach(e=>{u.push({s:d,edge:e})})}if((u=u.filter(e=>!(e.edge.ymax<=d))).sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),1<u.length)for(let e=0;e<u.length;e+=2){if((c=e+1)>=u.length)break;var l=u[e].edge,c=u[c].edge;i.push([[Math.round(l.x),d],[Math.round(c.x),d]])}d+=e,u.forEach(t=>{t.edge.x=t.edge.x+e*t.edge.islope})}}return i}(e,t);if(i){kd(e,n,-i);{i=-i;const o=[];(e=t).forEach(e=>o.push(...e)),kd(o,n,i)}}return t}class $d{constructor(e){this.helper=e}fillPolygon(e,t){return this._fillPolygon(e,t)}_fillPolygon(e,t,n=!1){return e=Dd(e,t),{type:"fillSketch",ops:this.renderLines(e,t,n)}}renderLines(e,t,n){let i=[],o=null;for(const r of e)i=i.concat(this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t)),n&&o&&(i=i.concat(this.helper.doubleLineOps(o[0],o[1],r[0][0],r[0][1],t))),o=r[1];return i}}class Pd extends $d{fillPolygon(e,t){return this._fillPolygon(e,t,!0)}}class Rd extends $d{fillPolygon(e,t){var n=this._fillPolygon(e,t);t=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),e=this._fillPolygon(e,t);return n.ops=n.ops.concat(e.ops),n}}class Ld{constructor(e){this.helper=e}fillPolygon(e,t){return e=Dd(e,t=Object.assign({},t,{curveStepCount:4,hachureAngle:0,roughness:1})),this.dotsOnLines(e,t)}dotsOnLines(e,t){let n=[],i=t.hachureGap,o=(i<0&&(i=4*t.strokeWidth),i=Math.max(i,.1),t.fillWeight);o<0&&(o=t.strokeWidth/2);for(const u of e){var r=Ed(u)/i,a=Math.ceil(r)-1,s=Math.atan((u[1][1]-u[0][1])/(u[1][0]-u[0][0]));for(let e=0;e<a;e++){var l=(c=i*(e+1))*Math.sin(s),c=c*Math.cos(s);c=[u[0][0]-c,u[0][1]+l],l=this.helper.randOffsetWithRange(c[0]-i/4,c[0]+i/4,t),c=this.helper.randOffsetWithRange(c[1]-i/4,c[1]+i/4,t),l=this.helper.ellipse(l,c,o,o,t);n=n.concat(l.ops)}}return{type:"fillSketch",ops:n}}}class Id{constructor(e){this.helper=e}fillPolygon(e,t){return e=Dd(e,t),{type:"fillSketch",ops:this.dashedLine(e,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,i=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap;let o=[];return e.forEach(e=>{var r=Ed(e),a=Math.floor(r/(n+i)),s=(r+i-a*(n+i))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);var u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){var d=(h=e*(n+i))+n,h=[l[0]+h*Math.cos(u)+s*Math.cos(u),l[1]+h*Math.sin(u)+s*Math.sin(u)];d=[l[0]+d*Math.cos(u)+s*Math.cos(u),l[1]+d*Math.sin(u)+s*Math.sin(u)];o=o.concat(this.helper.doubleLineOps(h[0],h[1],d[0],d[1],t))}}),o}}class Nd{constructor(e){this.helper=e}fillPolygon(e,t){var n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,i=t.zigzagOffset<0?n:t.zigzagOffset;e=Dd(e,t=Object.assign({},t,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(e,i,t)}}zigzagLines(e,t,n){let i=[];return e.forEach(e=>{var o=Ed(e),r=Math.round(o/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);var l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<r;e++){var c=2*e*t,u=2*(e+1)*t,d=Math.sqrt(2*Math.pow(t,2));c=[a[0]+c*Math.cos(l),a[1]+c*Math.sin(l)],u=[a[0]+u*Math.cos(l),a[1]+u*Math.sin(l)],d=[c[0]+d*Math.cos(l+Math.PI/4),c[1]+d*Math.sin(l+Math.PI/4)];i=(i=i.concat(this.helper.doubleLineOps(c[0],c[1],d[0],d[1],n))).concat(this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}}),i}}const Fd={};class jd{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const Bd={randOffset:Xd,randOffsetWithRange:Yd,ellipse:function(e,t,n,i,o){return Wd(e,t,o,n=Vd(n,i,o)).opset},doubleLineOps:Jd};function qd(e,t,n,i,o){return{type:"path",ops:Jd(e,t,n,i,o)}}function zd(e,t,n){var i=(e||[]).length;if(2<i){let o=[];for(let t=0;t<i-1;t++)o=o.concat(Jd(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return{type:"path",ops:o=t?o.concat(Jd(e[i-1][0],e[i-1][1],e[0][0],e[0][1],n)):o}}return 2===i?qd(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function Vd(e,t,n){var i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=(i=Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*i),i=2*Math.PI/i,e=Math.abs(e/2),t=Math.abs(t/2),1-n.curveFitting);return{increment:i,rx:e+=Xd(e*o,n),ry:t+=Xd(t*o,n)}}function Wd(e,t,n,i){var[o,r]=th(i.increment,e,t,i.rx,i.ry,1,i.increment*Yd(.1,Yd(.4,1,n),n),n),[e]=th(i.increment,e,t,i.rx,i.ry,1.5,0,n);t=eh(o,null,n),i=eh(e,null,n);return{estimatedPoints:r,opset:{type:"path",ops:t.concat(i)}}}function Hd(e,t,n,i,o,r,a,s,l){n=Math.abs(n/2),i=Math.abs(i/2),n+=Xd(.01*n,l),i+=Xd(.01*i,l);let c=o,u=r;for(;c<0;)c+=2*Math.PI,u+=2*Math.PI;u-c>2*Math.PI&&(c=0,u=2*Math.PI),o=2*Math.PI/l.curveStepCount,o=nh(r=Math.min(o/2,(u-c)/2),e,t,n,i,c,u,1,l),r=nh(r,e,t,n,i,c,u,1.5,l);let d=o.concat(r);return a&&(s?d=(d=d.concat(Jd(e,t,e+n*Math.cos(c),t+i*Math.sin(c),l))).concat(Jd(e,t,e+n*Math.cos(u),t+i*Math.sin(u),l)):(d.push({op:"lineTo",data:[e,t]}),d.push({op:"lineTo",data:[e+n*Math.cos(c),t+i*Math.sin(c)]}))),{type:"path",ops:d}}function Ud(e,t){var n=[];if(e.length){var i=t.maxRandomnessOffset||0,o=e.length;if(2<o){n.push({op:"move",data:[e[0][0]+Xd(i,t),e[0][1]+Xd(i,t)]});for(let r=1;r<o;r++)n.push({op:"lineTo",data:[e[r][0]+Xd(i,t),e[r][1]+Xd(i,t)]})}}return{type:"fillPath",ops:n}}function Gd(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!Fd[n])switch(n){case"zigzag":Fd[n]||(Fd[n]=new Pd(t));break;case"cross-hatch":Fd[n]||(Fd[n]=new Rd(t));break;case"dots":Fd[n]||(Fd[n]=new Ld(t));break;case"dashed":Fd[n]||(Fd[n]=new Id(t));break;case"zigzag-line":Fd[n]||(Fd[n]=new Nd(t));break;default:n="hachure",Fd[n]||(Fd[n]=new $d(t))}return Fd[n]}(t,Bd).fillPolygon(e,t)}function Kd(e){return e.randomizer||(e.randomizer=new jd(e.seed||0)),e.randomizer.next()}function Yd(e,t,n){return n.roughness*n.roughnessGain*(Kd(n)*(t-e)+e)}function Xd(e,t){return Yd(-e,e,t)}function Jd(e,t,n,i,o){var r=Zd(e,t,n,i,o,!0,!1);e=Zd(e,t,n,i,o,!0,!0);return r.concat(e)}function Zd(e,t,n,i,o,r,a){var s=Math.pow(e-n,2)+Math.pow(t-i,2),l=Math.sqrt(s);o.roughnessGain=l<200?1:500<l?.4:-.0016668*l+1.233334;let c=o.maxRandomnessOffset||0;const u=(c=c*c*100>s?l/10:c)/2;s=.2+.2*Kd(o),l=o.bowing*o.maxRandomnessOffset*(i-t)/200;var d=o.bowing*o.maxRandomnessOffset*(e-n)/200,h=(l=Xd(l,o),d=Xd(d,o),[]),p=()=>Xd(u,o),f=()=>Xd(c,o);return r&&h.push(a?{op:"move",data:[e+p(),t+p()]}:{op:"move",data:[e+Xd(c,o),t+Xd(c,o)]}),h.push(a?{op:"bcurveTo",data:[l+e+(n-e)*s+p(),d+t+(i-t)*s+p(),l+e+2*(n-e)*s+p(),d+t+2*(i-t)*s+p(),n+p(),i+p()]}:{op:"bcurveTo",data:[l+e+(n-e)*s+f(),d+t+(i-t)*s+f(),l+e+2*(n-e)*s+f(),d+t+2*(i-t)*s+f(),n+f(),i+f()]}),h}function Qd(e,t,n){var i=[];i.push([e[0][0]+Xd(t,n),e[0][1]+Xd(t,n)]),i.push([e[0][0]+Xd(t,n),e[0][1]+Xd(t,n)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+Xd(t,n),e[o][1]+Xd(t,n)]),o===e.length-1&&i.push([e[o][0]+Xd(t,n),e[o][1]+Xd(t,n)]);return eh(i,null,n)}function eh(e,t,n){var i=e.length;let o=[];if(3<i){var r,a=[],s=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<i;t++){var l=e[t];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*e[t+1][0]-s*e[t-1][0])/6,l[1]+(s*e[t+1][1]-s*e[t-1][1])/6],a[2]=[e[t+1][0]+(s*e[t][0]-s*e[t+2][0])/6,e[t+1][1]+(s*e[t][1]-s*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}t&&2===t.length&&(r=n.maxRandomnessOffset,o.push({op:"lineTo",data:[t[0]+Xd(r,n),t[1]+Xd(r,n)]}))}else 3===i?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===i&&(o=o.concat(Jd(e[0][0],e[0][1],e[1][0],e[1][1],n)));return o}function th(e,t,n,i,o,r,a,s){var l=[],c=[],u=Xd(.5,s)-Math.PI/2;c.push([Xd(r,s)+t+.9*i*Math.cos(u-e),Xd(r,s)+n+.9*o*Math.sin(u-e)]);for(let a=u;a<2*Math.PI+u-.01;a+=e){var d=[Xd(r,s)+t+i*Math.cos(a),Xd(r,s)+n+o*Math.sin(a)];l.push(d),c.push(d)}return c.push([Xd(r,s)+t+i*Math.cos(u+2*Math.PI+.5*a),Xd(r,s)+n+o*Math.sin(u+2*Math.PI+.5*a)]),c.push([Xd(r,s)+t+.98*i*Math.cos(u+a),Xd(r,s)+n+.98*o*Math.sin(u+a)]),c.push([Xd(r,s)+t+.9*i*Math.cos(u+.5*a),Xd(r,s)+n+.9*o*Math.sin(u+.5*a)]),[c,l]}function nh(e,t,n,i,o,r,a,s,l){r+=Xd(.1,l);var c=[];c.push([Xd(s,l)+t+.9*i*Math.cos(r-e),Xd(s,l)+n+.9*o*Math.sin(r-e)]);for(let u=r;u<=a;u+=e)c.push([Xd(s,l)+t+i*Math.cos(u),Xd(s,l)+n+o*Math.sin(u)]);return c.push([t+i*Math.cos(a),n+o*Math.sin(a)]),c.push([t+i*Math.cos(a),n+o*Math.sin(a)]),eh(c,null,l)}function ih(e,t,n,i,o,r,a,s){var l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.5];let u=[0,0];for(let d=0;d<2;d++)0===d?l.push({op:"move",data:[a.x,a.y]}):l.push({op:"move",data:[a.x+Xd(c[0],s),a.y+Xd(c[0],s)]}),u=[o+Xd(c[d],s),r+Xd(c[d],s)],l.push({op:"bcurveTo",data:[e+Xd(c[d],s),t+Xd(c[d],s),n+Xd(c[d],s),i+Xd(c[d],s),u[0],u[1]]});return a.setPosition(u[0],u[1]),l}const oh="undefined"!=typeof self,rh="none";class ah{constructor(e,t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,roughnessGain:1},this.config=e||{},this.surface=t,this.config.options&&(this.defaultOptions=this._options(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_options(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_drawable(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,i,o){return o=this._options(o),this._drawable("line",[qd(e,t,n,i,o)],o)}rectangle(e,t,n,i,o){var r=[],a=function(e,t,n,i,o){return zd([[e,t],[e+n,t],[e+n,t+i],[e,t+i]],!0,o)}(e,t,n,i,o=this._options(o));return o.fill&&(n=[[e,t],[e+n,t],[e+n,t+i],[e,t+i]],"solid"===o.fillStyle?r.push(Ud(n,o)):r.push(Gd(n,o))),o.stroke!==rh&&r.push(a),this._drawable("rectangle",r,o)}ellipse(e,t,n,i,o){var r=[];i=Wd(e,t,o=this._options(o),n=Vd(n,i,o));return o.fill&&("solid"===o.fillStyle?((e=Wd(e,t,o,n).opset).type="fillPath",r.push(e)):r.push(Gd(i.estimatedPoints,o))),o.stroke!==rh&&r.push(i.opset),this._drawable("ellipse",r,o)}circle(e,t,n,i){return(e=this.ellipse(e,t,n,n,i)).shape="circle",e}linearPath(e,t){return t=this._options(t),this._drawable("linearPath",[zd(e,!1,t)],t)}arc(e,t,n,i,o,r,a=!1,s){var l=[],c=Hd(e,t,n,i,o,r,a,!0,s=this._options(s));return a&&s.fill&&("solid"===s.fillStyle?((a=Hd(e,t,n,i,o,r,!0,!1,s)).type="fillPath",l.push(a)):l.push(function(e,t,n,i,o,r,a){var s=e,l=t,c=Math.abs(n/2),u=Math.abs(i/2);c+=Xd(.01*c,a),u+=Xd(.01*u,a);let d=o,h=r;for(;d<0;)d+=2*Math.PI,h+=2*Math.PI;h-d>2*Math.PI&&(d=0,h=2*Math.PI);var p=(h-d)/a.curveStepCount,f=[];for(let e=d;e<=h;e+=p)f.push([s+c*Math.cos(e),l+u*Math.sin(e)]);return f.push([s+c*Math.cos(h),l+u*Math.sin(h)]),f.push([s,l]),Gd(f,a)}(e,t,n,i,o,r,s))),s.stroke!==rh&&l.push(c),this._drawable("arc",l,s)}curve(e,t){var n,i;t=this._options(t);return this._drawable("curve",[(i=Qd(e=e,1+.2*(n=t).roughness,n),e=Qd(e,1.5*(1+.22*n.roughness),n),{type:"path",ops:i.concat(e)})],t)}polygon(e,t){var n=[],i=zd(e,!0,t=this._options(t));return t.fill&&("solid"===t.fillStyle?n.push(Ud(e,t)):n.push(Gd(e,t))),t.stroke!==rh&&n.push(i),this._drawable("polygon",n,t)}path(e,t){t=this._options(t);var n,i,o,r=[];return e&&(n=function(e,t){e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let n=new Ad(e);t.simplification&&(e=new Md(n.linearPoints,n.closed).fit(t.simplification),n=new Ad(e));let i=[];var o=n.segments||[];for(let e=0;e<o.length;e++){var r;(r=function(e,t,n,i){let o=[];switch(t.key){case"M":case"m":var r="m"===t.key;if(2<=t.data.length){let n=+t.data[0],a=+t.data[1];r&&(n+=e.x,a+=e.y),n+=Xd(r=+(i.maxRandomnessOffset||0),i),a+=Xd(r,i),e.setPosition(n,a),o.push({op:"move",data:[n,a]})}break;case"L":case"l":if(r="l"===t.key,2<=t.data.length){let n=+t.data[0],a=+t.data[1];r&&(n+=e.x,a+=e.y),o=o.concat(Jd(e.x,e.y,n,a,i)),e.setPosition(n,a)}break;case"H":case"h":var a="h"===t.key;if(t.data.length){let n=+t.data[0];a&&(n+=e.x),o=o.concat(Jd(e.x,e.y,n,e.y,i)),e.setPosition(n,e.y)}break;case"V":case"v":if(a="v"===t.key,t.data.length){let n=+t.data[0];a&&(n+=e.y),o=o.concat(Jd(e.x,e.y,e.x,n,i)),e.setPosition(e.x,n)}break;case"Z":case"z":e.first&&(o=o.concat(Jd(e.x,e.y,e.first[0],e.first[1],i)),e.setPosition(e.first[0],e.first[1]),e.first=null);break;case"C":case"c":var s="c"===t.key;if(6<=t.data.length){let n=+t.data[0],r=+t.data[1],a=+t.data[2],l=+t.data[3],c=+t.data[4],u=+t.data[5];s&&(n+=e.x,a+=e.x,c+=e.x,r+=e.y,l+=e.y,u+=e.y),s=ih(n,r,a,l,c,u,e,i),o=o.concat(s),e.bezierReflectionPoint=[c+(c-a),u+(u-l)]}break;case"S":case"s":if(s="s"===t.key,4<=t.data.length){let r=+t.data[0],a=+t.data[1],c=+t.data[2],u=+t.data[3],d=(s&&(r+=e.x,c+=e.x,a+=e.y,u+=e.y),r),h=a;var l=n?n.key:"";let p=null;(p="c"!==l&&"C"!==l&&"s"!==l&&"S"!==l?p:e.bezierReflectionPoint)&&(d=p[0],h=p[1]),l=ih(d,h,r,a,c,u,e,i),o=o.concat(l),e.bezierReflectionPoint=[c+(c-r),u+(u-a)]}break;case"Q":case"q":if(l="q"===t.key,4<=t.data.length){let n=+t.data[0],r=+t.data[1],a=+t.data[2],s=+t.data[3];l&&(n+=e.x,a+=e.x,r+=e.y,s+=e.y);var c=1+.2*i.roughness,u=1.5*(1+.22*i.roughness),d=(o.push({op:"move",data:[e.x+Xd(c,i),e.y+Xd(c,i)]}),[a+Xd(c,i),s+Xd(c,i)]);o.push({op:"qcurveTo",data:[n+Xd(c,i),r+Xd(c,i),d[0],d[1]]}),o.push({op:"move",data:[e.x+Xd(u,i),e.y+Xd(u,i)]}),d=[a+Xd(u,i),s+Xd(u,i)],o.push({op:"qcurveTo",data:[n+Xd(u,i),r+Xd(u,i),d[0],d[1]]}),e.setPosition(d[0],d[1]),e.quadReflectionPoint=[a+(a-n),s+(s-r)]}break;case"T":case"t":if(c="t"===t.key,2<=t.data.length){let r=+t.data[0],a=+t.data[1],s=(c&&(r+=e.x,a+=e.y),r),l=a,f=null;(f="q"!==(u=n?n.key:"")&&"Q"!==u&&"t"!==u&&"T"!==u?f:e.quadReflectionPoint)&&(s=f[0],l=f[1]);d=1+.2*i.roughness;var h=1.5*(1+.22*i.roughness),p=(o.push({op:"move",data:[e.x+Xd(d,i),e.y+Xd(d,i)]}),[r+Xd(d,i),a+Xd(d,i)]);o.push({op:"qcurveTo",data:[s+Xd(d,i),l+Xd(d,i),p[0],p[1]]}),o.push({op:"move",data:[e.x+Xd(h,i),e.y+Xd(h,i)]}),p=[r+Xd(h,i),a+Xd(h,i)],o.push({op:"qcurveTo",data:[s+Xd(h,i),l+Xd(h,i),p[0],p[1]]}),e.setPosition(p[0],p[1]),e.quadReflectionPoint=[r+(r-s),a+(a-l)]}break;case"A":case"a":if(h="a"===t.key,7<=t.data.length){var f=+t.data[0],m=+t.data[1],g=+t.data[2],v=+t.data[3],b=+t.data[4];let n=+t.data[5],r=+t.data[6];if(h&&(n+=e.x,r+=e.y),n===e.x&&r===e.y)break;if(0==f||0==m)o=o.concat(Jd(e.x,e.y,n,r,i)),e.setPosition(n,r);else for(let t=0;t<1;t++){var y=new Od([e.x,e.y],[n,r],[f,m],g,!!v,!!b);let t=y.getNextSegment();for(;t;){var w=ih(t.cp1[0],t.cp1[1],t.cp2[0],t.cp2[1],t.to[0],t.to[1],e,i);o=o.concat(w),t=y.getNextSegment()}}}}return o}(n,r=o[e],0<e?o[e-1]:null,t))&&r.length&&(i=i.concat(r))}return{type:"path",ops:i}}(e,t),t.fill&&("solid"===t.fillStyle?r.push({type:"path2Dfill",path:e,ops:[]}):((o=Gd([[0,0],[(i=this.computePathSize(e))[0],0],[i[0],i[1]],[0,i[1]]],t)).type="path2Dpattern",o.size=i,o.path=e,r.push(o))),t.stroke!==rh)&&r.push(n),this._drawable("path",r,t)}computePathSize(e){let t=[0,0];if(oh&&self.document)try{var n=self.document.createElementNS(_d,"svg"),i=(n.setAttribute("width","0"),n.setAttribute("height","0"),self.document.createElementNS(_d,"path")),o=(i.setAttribute("d",e),n.appendChild(i),self.document.body.appendChild(n),i.getBBox());o&&(t[0]=o.width||0,t[1]=o.height||0),self.document.body.removeChild(n)}catch(e){}return e=this.getCanvasSize(),t[0]*t[1]?t:e}getCanvasSize(){var e=e=>e&&"object"==typeof e&&e.baseVal&&e.baseVal.value?e.baseVal.value:e||100;return this.surface?[e(this.surface.width),e(this.surface.height)]:[100,100]}opsToPath(e){let t="";for(const i of e.ops){var n=i.data;switch(i.op){case"move":t+=`M${n[0]} ${n[1]} `;break;case"bcurveTo":t+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case"qcurveTo":t+=`Q${n[0]} ${n[1]}, ${n[2]} ${n[3]} `;break;case"lineTo":t+=`L${n[0]} ${n[1]} `}}return t.trim()}toPaths(e){var t=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:rh};break;case"fillPath":t={d:this.opsToPath(e),stroke:rh,strokeWidth:0,fill:n.fill||rh};break;case"fillSketch":t=this.fillSketch(e,n);break;case"path2Dfill":t={d:e.path||"",stroke:rh,strokeWidth:0,fill:n.fill||rh};break;case"path2Dpattern":var o=e.size;o={x:0,y:0,width:1,height:1,viewBox:`0 0 ${Math.round(o[0])} `+Math.round(o[1]),patternUnits:"objectBoundingBox",path:this.fillSketch(e,n)};t={d:e.path,stroke:rh,strokeWidth:0,pattern:o}}t&&i.push(t)}return i}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||rh,strokeWidth:n,fill:rh}}}const sh="undefined"!=typeof document;class lh{constructor(e,t){this.svg=e,this.gen=new ah(t,this.svg)}get defs(){var e=this.svg.ownerDocument||sh&&document;return e&&!this._defs&&(e=e.createElementNS(_d,"defs"),this.svg.firstChild?this.svg.insertBefore(e,this.svg.firstChild):this.svg.appendChild(e),this._defs=e),this._defs||null}draw(e){var t,n,i,o=e.sets||[],r=e.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,s=a.createElementNS(_d,"g");for(const e of o){let o=null;switch(e.type){case"path":(o=a.createElementNS(_d,"path")).setAttribute("d",this.opsToPath(e)),o.style.stroke=r.stroke,o.style.strokeWidth=r.strokeWidth+"",o.style.fill="none";break;case"fillPath":(o=a.createElementNS(_d,"path")).setAttribute("d",this.opsToPath(e)),o.style.stroke="none",o.style.strokeWidth="0",o.style.fill=r.fill||"";break;case"fillSketch":o=this.fillSketch(a,e,r);break;case"path2Dfill":(o=a.createElementNS(_d,"path")).setAttribute("d",e.path||""),o.style.stroke="none",o.style.strokeWidth="0",o.style.fill=r.fill||"";break;case"path2Dpattern":this.defs?(i=e.size,t=a.createElementNS(_d,"pattern"),n="rough-"+Math.floor(Math.random()*(Number.MAX_SAFE_INTEGER||999999)),t.setAttribute("id",n),t.setAttribute("x","0"),t.setAttribute("y","0"),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("height","1"),t.setAttribute("viewBox",`0 0 ${Math.round(i[0])} `+Math.round(i[1])),t.setAttribute("patternUnits","objectBoundingBox"),i=this.fillSketch(a,e,r),t.appendChild(i),this.defs.appendChild(t),(o=a.createElementNS(_d,"path")).setAttribute("d",e.path||""),o.style.stroke="none",o.style.strokeWidth="0",o.style.fill=`url(#${n})`):console.error("Pattern fill fail: No defs")}o&&s.appendChild(o)}return s}fillSketch(e,t,n){let i=n.fillWeight;return i<0&&(i=n.strokeWidth/2),(e=e.createElementNS(_d,"path")).setAttribute("d",this.opsToPath(t)),e.style.stroke=n.fill||"",e.style.strokeWidth=i+"",e.style.fill="none",e}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e){return this.gen.opsToPath(e)}line(e,t,n,i,o){return e=this.gen.line(e,t,n,i,o),this.draw(e)}rectangle(e,t,n,i,o){return e=this.gen.rectangle(e,t,n,i,o),this.draw(e)}ellipse(e,t,n,i,o){return e=this.gen.ellipse(e,t,n,i,o),this.draw(e)}circle(e,t,n,i){return e=this.gen.circle(e,t,n,i),this.draw(e)}linearPath(e,t){return e=this.gen.linearPath(e,t),this.draw(e)}polygon(e,t){return e=this.gen.polygon(e,t),this.draw(e)}arc(e,t,n,i,o,r,a=!1,s){return e=this.gen.arc(e,t,n,i,o,r,a,s),this.draw(e)}curve(e,t){return e=this.gen.curve(e,t),this.draw(e)}path(e,t){return e=this.gen.path(e,t),this.draw(e)}}function ch(e,t){var n=this;e.on(["render.shape","render.connection"],t=t||1e3,(function(e,t){e=e.type;var i=t.element;t=t.gfx;if(n.canRender(i))return"render.shape"===e?n.drawShape(t,i):n.drawConnection(t,i)})),e.on(["render.getShapePath","render.getConnectionPath"],t,(function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)}))}function uh(e,t){return(e=dh(e))&&"function"==typeof e.$instanceOf&&e.$instanceOf(t)}function dh(e){return e&&e.businessObject||e}function hh(e){return!(uh(e,"bpmn:CallActivity")||(uh(e,"bpmn:SubProcess")?!dh(e).di.isExpanded:uh(e,"bpmn:Participant")&&!dh(e).processRef))}function ph(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function fh(e,t,n){return Object(Vl.some)(e.eventDefinitions,(function(i){return i.$type===t&&(o=e,i=n,Object(Vl.every)(i,(function(e,t){return o[t]==e})));var o}))}function mh(e){return e.businessObject.di}function gh(e){return e.businessObject}function vh(e,t){return mh(e).get("bioc:fill")||t||"white"}function bh(e,t){return mh(e).get("bioc:stroke")||t||"black"}function yh(e,t){var n=e.x,i=e.y,o=e.width;return ph([["M",n+t,i],["l",o-2*t,0],["a",t,t,0,0,1,t,t],["l",0,(e=e.height)-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-o,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-e],["a",t,t,0,0,1,t,-t],["z"]])}ch.prototype.canRender=function(){},ch.prototype.drawShape=function(){},ch.prototype.drawConnection=function(){},ch.prototype.getShapePath=function(){},ch.prototype.getConnectionPath=function(){},function(e){var t=e.exports=function(e,n){if(n=n||16,(e=void 0===e?128:e)<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),o=2;i===1/0;o*=2)i=Math.log(Math.pow(2,e/o))/Math.log(n)*o;var r=i-Math.floor(i),a="";for(o=0;o<Math.floor(i);o++)a=Math.floor(Math.random()*n).toString(n)+a;return r&&(r=Math.pow(n,r),a=Math.floor(Math.random()*r).toString(n)+a),(r=parseInt(a,n))!==1/0&&r>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){function o(o){var a=0;do{if(10<a++){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(r,s));return r[s]=o,s}var r=o.hats={};return o.get=function(e){return o.hats[e]},o.set=function(e,t){return o.hats[e]=t,o},o.bits=e||128,o.base=n||16,o}}(ir={exports:{}});var wh=ir.exports;function xh(e){if(!(this instanceof xh))return new xh(e);this._seed=(e=e||[128,36,1]).length?wh.rack(e[0],e[1],e[2]):e}xh.prototype.next=function(e){return this._seed(e||!0)},xh.prototype.nextPrefixed=function(e,t){for(var n;n=e+this.next(!0),this.assigned(n););return this.claim(n,t),n},xh.prototype.claim=function(e,t){this._seed.set(e,t||!0)},xh.prototype.assigned=function(e){return this._seed.get(e)||!1},xh.prototype.unclaim=function(e){delete this._seed.hats[e]},xh.prototype.clear=function(){for(var e in this._seed.hats)this.unclaim(e)};var _h=new xh;function kh(e,t,n,i,o,r,a){ch.call(this,t,a);var s=e.bpmnRenderer&&e.bpmnRenderer.defaultFillColor,l=e.bpmnRenderer&&e.bpmnRenderer.defaultStrokeColor,c=function(e,t){return new lh(e,t)}(o._svg),u=_h.next(),d={},h=n.computeStyle;function p(e,t){var n=Object(Vl.assign)({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},r=t.scale||1,a=("none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]),gc("marker"));(n=(ic(t.element,n),ec(a,t.element),ic(a,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*r,markerHeight:20*r,orient:"auto"}),nu("defs",o._svg)))||(n=gc("defs"),ec(o._svg,n)),ec(n,a),d[e]=a}function f(e,t,n){var i,o=e+"-"+t+"-"+n+"-"+u;return d[o]||(i=(e=e)+"-"+(t=t)+"-"+(n=n)+"-"+u,"sequenceflow-end"===e&&p(i,{element:c.path("M 1 5 L 11 10 L 1 15 Z",{roughness:.3,fillStyle:"solid",fill:n,stroke:n}),ref:{x:11,y:10},scale:.5,attrs:{fill:n,stroke:n}}),"messageflow-start"===e&&p(i,{element:c.circle(6,6,5,{roughness:.3,fillStyle:"solid",fill:t,stroke:n}),attrs:{fill:t,stroke:n},ref:{x:6,y:6}}),"messageflow-end"===e&&p(i,{element:c.path("m 1 5 l 0 -3 l 7 3 l -7 3 z",{roughness:.5,fillStyle:"solid",fill:t,stroke:n}),attrs:{fill:t,stroke:n,strokeLinecap:"butt"},ref:{x:8.5,y:5}}),"association-start"===e&&p(i,{element:c.path("M 11 5 L 1 10 L 11 15",{roughness:.5,stroke:n}),attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5}),"association-end"===e&&p(i,{element:c.path("M 1 5 L 11 10 L 1 15",{roughness:.5,stroke:n}),attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5}),"conditional-flow-marker"===e&&p(i,{element:c.path("M 0 10 L 8 6 L 16 10 L 8 14 Z",{roughness:.5,stroke:n}),attrs:{fill:t,stroke:n},ref:{x:-1,y:10},scale:.5}),"conditional-default-flow-marker"===e&&p(i,{element:c.path("M 6 4 L 10 16",{roughness:.5,stroke:n}),attrs:{stroke:n},ref:{x:0,y:10},scale:.5})),"url(#"+o+")"}function m(e,t,n,i,o){return Object(Vl.isObject)(i)&&(o=i,i=0),i=i||0,"none"===(o=h(o,{stroke:"black",strokeWidth:2,fill:"white",fillStyle:"solid",roughness:.5})).fill&&delete o.fillOpacity,ec(e,t=c.circle(t/2,n/2,Math.round((t+n)/2-i),o)),t}function g(e,t,n,i,o,r){return Object(Vl.isObject)(o)&&(r=o,o=0),o=o||0,r=h(r,{stroke:"black",strokeWidth:2,fill:"white",fillStyle:"solid"}),ec(e,t=c.rectangle(o,o,t-2*o,n-2*o,r)),t}function v(e,t,n){return n=h(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}),ic(t=c.linearPath(t.map((function(e){return[e.x,e.y]})),n),n),ec(e,t),t}function b(e,t,n,i){return n=h(n,["no-fill"],{strokeWidth:2,stroke:"black",fillStyle:"solid"}),ic(t=c.path(t,n),n),ec(e,t),t}function y(e,t,n,i){i=i||{},b(t,n,Object(Vl.assign)({"data-marker":e},Object(Vl.assign)(i,{roughness:.5})))}function w(e){return function(t,n){return T[e](t,n)}}function x(e){return T[e]}function _(e,t){var n=gh(e),i="bpmn:IntermediateThrowEvent"===(i=n).$type||"bpmn:EndEvent"===i.$type;return fh(n,"bpmn:MessageEventDefinition")?x("bpmn:MessageEventDefinition")(t,e,i):fh(n,"bpmn:TimerEventDefinition")?x("bpmn:TimerEventDefinition")(t,e,i):fh(n,"bpmn:ConditionalEventDefinition")?x("bpmn:ConditionalEventDefinition")(t,e):fh(n,"bpmn:SignalEventDefinition")?x("bpmn:SignalEventDefinition")(t,e,i):fh(n,"bpmn:CancelEventDefinition")&&fh(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?x("bpmn:MultipleEventDefinition")(t,e,i):fh(n,"bpmn:CancelEventDefinition")&&fh(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?x("bpmn:ParallelMultipleEventDefinition")(t,e,i):fh(n,"bpmn:EscalationEventDefinition")?x("bpmn:EscalationEventDefinition")(t,e,i):fh(n,"bpmn:LinkEventDefinition")?x("bpmn:LinkEventDefinition")(t,e,i):fh(n,"bpmn:ErrorEventDefinition")?x("bpmn:ErrorEventDefinition")(t,e,i):fh(n,"bpmn:CancelEventDefinition")?x("bpmn:CancelEventDefinition")(t,e,i):fh(n,"bpmn:CompensateEventDefinition")?x("bpmn:CompensateEventDefinition")(t,e,i):fh(n,"bpmn:TerminateEventDefinition")?x("bpmn:TerminateEventDefinition")(t,e,i):void 0}function k(e,t,n){return n=Object(Vl.assign)({size:{width:100}},n),lc(t=r.createText(t||"",n)).add("djs-label"),ec(e,t),t}function E(e,t,n){k(e,gh(t).name,{box:t,align:n,padding:5,style:{fill:bh(t,l)}})}function C(e,t,n){var i;e=k(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:bh(n,l)}}),t=-1*n.height;n=e,e=0,t=-t,(i=wc()).setTranslate(e,t),(e=wc()).setRotate(270,0,0),(t=wc()).setScale(1,1),Sc(n,[i,e,t])}function S(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var T=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=.95),m(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:vh(t,s),stroke:bh(t,l),roughness:.5},i=gh(t);n=x("bpmn:Event")(e,t,n);return i.isInterrupting||ic(n,{strokeDasharray:"6, 6",strokeLinecap:"round"}),_(t,e),n},"bpmn:MessageEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:n?2:1,fill:n?bh(t,l):vh(t,s),stroke:n?vh(t,s):bh(t,l)})},"bpmn:TimerEventDefinition":function(e,t){var n=m(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:vh(t,s),stroke:bh(t,l)});b(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:bh(t,l),roughness:.2});for(var o=0;o<12;o++){var r=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),a=t.width/2;b(e,r,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+t.height/2+","+a+")",stroke:bh(t,l),roughness:.75})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)})},"bpmn:ConditionalEventDefinition":function(e,t){return b(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:bh(t,l),roughness:.5})},"bpmn:LinkEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)})},"bpmn:ErrorEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)})},"bpmn:CancelEventDefinition":function(e,t,n){var o;return n=e=b(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)}),t=45,(o=wc()).setRotate(t,0,0),Sc(n,o),e},"bpmn:CompensateEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)})},"bpmn:SignalEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?bh(t,l):"none",stroke:bh(t,l)})},"bpmn:MultipleEventDefinition":function(e,t,n){return b(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?bh(t,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return b(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:bh(t,l),stroke:bh(t,l)})},"bpmn:EndEvent":function(e,t){var n=x("bpmn:Event")(e,t,{strokeWidth:4,fill:vh(t,s),stroke:bh(t,l)});return _(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return m(e,t.width,t.height,14,{strokeWidth:4,fill:bh(t,l),stroke:bh(t,l),fillStyle:"solid"})},"bpmn:IntermediateEvent":function(e,t){var n=x("bpmn:Event")(e,t,{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)});return m(e,t.width,t.height,7,{strokeWidth:1,fill:vh(t,"none"),stroke:bh(t,l)}),_(t,e),n},"bpmn:IntermediateCatchEvent":w("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":w("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=.95),b(e,yh(Object(Vl.assign)({},t,{x:0,y:0}),10),Object(Vl.assign)(n,{roughness:.4}))},"bpmn:Task":function(e,t){var n={fill:vh(t,s),stroke:bh(t,l)};n=x("bpmn:Activity")(e,t,n);return E(e,t,"center-middle"),A(e,t),n},"bpmn:ServiceTask":function(e,t){var n=x("bpmn:Task")(e,t),o=(b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l),simplification:.5,roughness:.1}),i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}));b(e,o,{strokeWidth:0,fill:vh(t,s),simplification:.5,roughness:.1}),o=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(e,o,{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l),simplification:.5,roughness:.1}),n},"bpmn:UserTask":function(e,t){var n=x("bpmn:Task")(e,t),o=(b(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l),roughness:.2}),i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}));b(e,o,{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l),roughness:.2}),o=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}});return b(e,o,{strokeWidth:1,fill:bh(t,l),stroke:bh(t,l),roughness:.2}),n},"bpmn:ManualTask":function(e,t){var n=x("bpmn:Task")(e,t);return b(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l),simplification:.9}),n},"bpmn:SendTask":function(e,t){var n=x("bpmn:Task")(e,t);return b(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:bh(t,l),stroke:vh(t,s)}),n},"bpmn:ReceiveTask":function(e,t){var n=gh(t),o=x("bpmn:Task")(e,t);return b(e,n=n.instantiate?(m(e,28,28,4.4,{strokeWidth:1}),i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)}),o},"bpmn:ScriptTask":function(e,t){var n=x("bpmn:Task")(e,t);return b(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:bh(t,l),roughness:.3}),n},"bpmn:BusinessRuleTask":function(e,t){var n=x("bpmn:Task")(e,t),o=(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),{roughness:.5,strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)}),i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return b(e,o,{roughness:.5,strokeWidth:1,stroke:bh(t,l)}),n},"bpmn:SubProcess":function(e,t,n){n=Object(Vl.assign)({fill:vh(t,s),stroke:bh(t,l)},n);n=x("bpmn:Activity")(e,t,n);var i,o=hh(t);return(i=t)&&dh(i).triggeredByEvent&&ic(n,{strokeDasharray:"1,2"}),E(e,t,o?"center-top":"center-middle"),o?A(e,t):A(e,t,["SubProcessMarker"]),n},"bpmn:AdHocSubProcess":function(e,t){return x("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=x("bpmn:SubProcess")(e,t),o=n.style(["no-fill","no-events"],{stroke:bh(t,l)});return b(e,yh({x:7,y:7,width:t.width-14,height:t.height-14},10),Object(Vl.assign)(o,{roughness:.4})),i},"bpmn:CallActivity":function(e,t){return x("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:.95,fill:vh(t,s),stroke:bh(t,l)};n=x("bpmn:Lane")(e,t,n);return hh(t)?(v(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:bh(t,l)}),C(e,gh(t).name,t)):k(e,gh(t).name,{box:t,align:"center-middle",style:{fill:bh(t,l)}}),!gh(t).participantMultiplicity||(0,T.ParticipantMultiplicityMarker)(e,t),n},"bpmn:Lane":function(e,t,n){n=g(e,t.width,t.height,0,Object(Vl.assign)({fill:vh(t,s),fillOpacity:.35,stroke:bh(t,l),roughness:.3},n));var i=gh(t);return"bpmn:Lane"===i.$type&&C(e,i.name,t),n},"bpmn:InclusiveGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return m(e,t.width,t.height,.5*t.height,{strokeWidth:2.5,fill:vh(t,s),stroke:bh(t,l)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=x("bpmn:Gateway")(e,t),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return mh(t).isMarkerVisible&&b(e,o,{strokeWidth:1,fill:bh(t,l),stroke:bh(t,l)}),n},"bpmn:ComplexGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return b(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:bh(t,l),stroke:bh(t,l)}),n},"bpmn:ParallelGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:bh(t,l),stroke:bh(t,l)}),n},"bpmn:EventBasedGateway":function(e,t){var n=gh(t),o=x("bpmn:Gateway")(e,t),r=(m(e,t.width,t.height,.4*t.height,{strokeWidth:1,fill:"none",stroke:bh(t,l)}),n.eventGatewayType);n=!!n.instantiate;return"Parallel"===r?b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)}):"Exclusive"===r&&(n||m(e,t.width,t.height,.55*t.height,{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)}),b(e,i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),{strokeWidth:2,fill:vh(t,s),stroke:bh(t,l)})),o},"bpmn:Gateway":function(e,t){var n,i,o,r={fill:vh(t,s),fillOpacity:.95,stroke:bh(t,l)};return e=e,r=r,n=[{x:o=(n=t.width)/2,y:0},{x:n,y:i=(t=t.height)/2},{x:o,y:t},{x:0,y:i}].map((function(e){return[e.x,e.y]})),r=h(r,{stroke:"black",strokeWidth:2,fill:"white"}),ec(e,o=c.polygon(n,r)),o},"bpmn:SequenceFlow":function(e,t){var n=S(t),i=vh(t,s),o=bh(t,l);e=b(e,n,{strokeLinejoin:"round",markerEnd:f("sequenceflow-end",i,o),stroke:bh(t,l),roughness:.1}),n=gh(t);return t.source&&(t=t.source.businessObject,n.conditionExpression&&t.$instanceOf("bpmn:Activity")&&ic(e,{markerStart:f("conditional-flow-marker",i,o)}),t.default)&&(t.$instanceOf("bpmn:Gateway")||t.$instanceOf("bpmn:Activity"))&&t.default===n&&ic(e,{markerStart:f("conditional-default-flow-marker",i,o)}),e},"bpmn:Association":function(e,t,n){var i=gh(t),o=vh(t,s),r=bh(t,l);return n=Object(Vl.assign)({strokeDasharray:"1, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:bh(t,l),roughness:.5,bowing:0},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=f("association-end",o,r)),"Both"===i.associationDirection&&(n.markerStart=f("association-start",o,r)),v(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=vh(t,s),i=bh(t,l);return x("bpmn:Association")(e,t,{markerEnd:f("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=vh(t,s),i=bh(t,l);return x("bpmn:Association")(e,t,{markerEnd:f("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=gh(t),o=mh(t),r=vh(t,s),a=bh(t,l);r=b(e,S(t),{markerEnd:f("messageflow-end",r,a),markerStart:f("messageflow-start",r,a),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:bh(t,l),roughness:.5,bowing:0});return n.messageRef&&(a=r.getPointAtLength(r.getTotalLength()/2),t=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:a.x,y:a.y}}),n={strokeWidth:1},"initiating"===o.messageVisibleKind?(n.fill="white",n.stroke="black"):(n.fill="#888",n.stroke="white"),b(e,t,n)),r},"bpmn:DataObject":function(e,t){var n,o=b(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:vh(t,s),fillOpacity:.95,stroke:bh(t,l)}),r=gh(t);return n=r.dataObjectRef,(r.isCollection||n&&n.isCollection)&&(r=e,e=((n=t).height-16)/t.height,b(r,n=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:e}}),{strokeWidth:2})),o},"bpmn:DataObjectReference":w("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW");t=x("bpmn:DataObject")(e,t);return b(e,n,{strokeWidth:1}),t},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW");t=x("bpmn:DataObject")(e,t);return b(e,n,{strokeWidth:1,fill:"black"}),t},"bpmn:DataStoreReference":function(e,t){return b(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:vh(t,s),fillOpacity:.95,stroke:bh(t,l)})},"bpmn:BoundaryEvent":function(e,t){var n=gh(t).cancelActivity,i={strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)},o=Object(Vl.assign)({},i,{fillOpacity:1,roughness:.5});i=Object(Vl.assign)({},i,{fill:"none",roughness:.5}),o=x("bpmn:Event")(e,t,o),n||ic(o,{strokeDasharray:"6, 6",strokeLinecap:"round"}),i=m(e,t.width,t.height,7,i);return n||ic(i,{strokeDasharray:"6, 6",strokeLinecap:"round"}),_(t,e),o},"bpmn:Group":function(e,t){return b(e,yh(Object(Vl.assign)({},t,{x:0,y:0}),10),{strokeWidth:1.5,strokeDasharray:"8,6,1,6",strokeLinecap:"round",strokeLinejoin:"round",stroke:bh(t,l),fill:"none",pointerEvents:"none",roughness:.5,bowing:0})},label:function(e,t){return n={width:90,height:30,x:(t=t).width/2+t.x,y:t.height/2+t.y},i=t.labelTarget.y>t.y?"center-bottom":"center-top",k(e,function(e){var t,n=uh(n=e=e.businessObject,"bpmn:FlowElement")||uh(n,"bpmn:Participant")||uh(n,"bpmn:Lane")||uh(n,"bpmn:SequenceFlow")||uh(n,"bpmn:MessageFlow")||uh(n,"bpmn:DataInput")||uh(n,"bpmn:DataOutput")?"name":uh(n,"bpmn:TextAnnotation")?"text":uh(n,"bpmn:Group")?"categoryValueRef":void 0;if(n)return"categoryValueRef"===n?(t=(t=e).categoryValueRef)&&t.value||"":e[n]||""}(t),{box:n,align:i,fitBox:!0,style:Object(Vl.assign)({},r.getExternalStyle(),{fill:bh(t,l)})});var n,i},"bpmn:TextAnnotation":function(e,t){var n=g(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return b(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:bh(t,l)}),k(e,gh(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:bh(t,l)}}),n},ParticipantMultiplicityMarker:function(e,t){y("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}))},SubProcessMarker:function(e,t){var n,o,r,a=g(e,14,14,0,{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)});a=a,n=t.width/2-7.5,o=t.height-20,(r=wc()).setTranslate(n,o),Sc(a,r),y("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:vh(t,s),stroke:bh(t,l)})},ParallelMarker:function(e,t,n){y("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}),{fill:vh(t,s),stroke:bh(t,l)})},SequentialMarker:function(e,t,n){y("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:vh(t,s),stroke:bh(t,l)})},CompensationMarker:function(e,t,n){y("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:vh(t,s),stroke:bh(t,l)})},LoopMarker:function(e,t,n){y("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:"none",stroke:bh(t,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){y("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:"black"})}};function A(e,t,n){var i=gh(t),o=n&&-1!==n.indexOf("SubProcessMarker")?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10};i=(n=(Object(Vl.forEach)(n,(function(n){x(n)(e,t,o)})),i.isForCompensation&&(0,T.CompensationMarker)(e,t,o),"bpmn:AdHocSubProcess"===i.$type&&(0,T.AdhocMarker)(e,t,o),i.loopCharacteristics))&&n.isSequential;n&&(void 0===i&&(0,T.LoopMarker)(e,t,o),!1===i&&(0,T.ParallelMarker)(e,t,o),!0===i)&&(0,T.SequentialMarker)(e,t,o)}this._drawPath=b}H()(kh,ch),kh.$inject=["config","eventBus","styles","pathMap","canvas","textRenderer"],kh.prototype.canRender=function(e){return uh(e,"bpmn:BaseElement")},kh.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},kh.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},kh.prototype.getShapePath=function(e){var t,n,i,o;return uh(e,"bpmn:Event")?ph([["M",t=(i=e).x+i.width/2,n=i.y+i.height/2],["m",0,-(i=i.width/2)],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]]):uh(e,"bpmn:Activity")?yh(e,10):uh(e,"bpmn:Gateway")?(t=e.width/2,n=e.height/2,ph([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])):ph([["M",i=e.x,e.y],["l",o=e.width,0],["l",0,e.height],["l",-o,0],["z"]])};s=n(28);var Eh=n.n(s),Ch={min:.2,max:4};function Sh(e,t,n,i,o){var r=this;function a(e){r._state._svgClientRect&&!Dh(r._state._svgClientRect)||(r._state._svgClientRect=r._svg.getBoundingClientRect()),Ah(Th({x:e.clientX-r._state._svgClientRect.left,y:e.clientY-r._state._svgClientRect.top},r._svg,r._lastViewbox),r._canvas),r._update()}function s(e){return function(t){r._state._svgClientRect&&!Dh(r._state._svgClientRect)||(r._state._svgClientRect=r._svg.getBoundingClientRect()),e&&a(t);var n=Th({x:t.clientX-r._state._svgClientRect.left,y:t.clientY-r._state._svgClientRect.top},r._svg,r._lastViewbox),o=i.viewbox(),s=(n=function(e,t){var n=t.x+t.width/2;t=t.y+t.height/2;return{x:e.x-n,y:e.y-t}}(n,o),r._viewportDom.getBoundingClientRect());s={x:t.clientX-s.left+1,y:t.clientY-s.top+1};Object(Vl.assign)(r._state,{cachedViewbox:o,initialDragPosition:{x:t.clientX,y:t.clientY},isDragging:!0,offsetViewport:n,offsetViewportDom:s,viewportClientRect:r._viewport.getBoundingClientRect(),parentClientRect:r._parent.getBoundingClientRect()}),Xc.bind(document,"mousemove",l),Xc.bind(document,"mouseup",c)}}function l(e){var t,n,i;r._state.isDragging&&(r._state._svgClientRect&&!Dh(r._state._svgClientRect)||(r._state._svgClientRect=r._svg.getBoundingClientRect()),n=r._state.offsetViewportDom,t=r._state.viewportClientRect,i=r._state.parentClientRect,Object(Vl.assign)(r._viewportDom.style,{top:e.clientY-n.y-i.top+"px",left:e.clientX-n.x-i.left+"px"}),n=Ph(i,{top:e.clientY-n.y-i.top,left:e.clientX-n.x-i.left,width:t.width,height:t.height}),Object(Vl.assign)(r._overlay.style,{clipPath:n}),Ah({x:(i=Th({x:e.clientX-r._state._svgClientRect.left,y:e.clientY-r._state._svgClientRect.top},r._svg,r._lastViewbox)).x-r._state.offsetViewport.x,y:i.y-r._state.offsetViewport.y},r._canvas))}function c(e){r._state.isDragging&&(r._state.initialDragPosition.x===e.clientX&&r._state.initialDragPosition.y===e.clientY&&a(e),r._update(),Object(Vl.assign)(r._state,{cachedViewbox:null,initialDragPosition:null,isDragging:!1,offsetViewport:null,offsetViewportDom:null}),Xc.unbind(document,"mousemove",l),Xc.unbind(document,"mouseup",c))}this._canvas=i,this._elementRegistry=o,this._eventBus=n,this._injector=t,this._state={isOpen:void 0,isDragging:!1,initialDragPosition:null,offsetViewport:null,cachedViewbox:null,dragger:null,svgClientRect:null,parentClientRect:null,zoomDelta:0},this._init(),this.toggle(e&&e.open||!1),Xc.bind(this._svg,"click",(function(e){e.preventDefault(),e.stopPropagation(),a(e)})),Xc.bind(this._viewportDom,"mousedown",s(!1)),Xc.bind(this._svg,"mousedown",s(!0)),Xc.bind(this._parent,"wheel",(function(e){var t,n,o,a,s,l;e.preventDefault(),e.stopPropagation(),e.ctrlKey&&(r._state._svgClientRect&&!Dh(r._state._svgClientRect)||(r._state._svgClientRect=r._svg.getBoundingClientRect()),t=e,n=r._state._svgClientRect,t.x>n.left)&&t.x<n.left+n.width&&t.y>n.top&&t.y<n.top+n.height&&(t=0===e.deltaMode?.02:.32,n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*$h(e.deltaY)*-t,r._state.zoomDelta+=n,.1<Math.abs(r._state.zoomDelta))&&(t=0<n?1:-1,n=Math.log(i.zoom())/Math.log(10),a=Ch,s=20,l=Math.log(a.min)/Math.log(10),a=Math.log(a.max)/Math.log(10),l=(Math.abs(l)+Math.abs(a))/s,a=Math.round(n/l)*l,a+=l*t,s=Math.pow(10,a),i.zoom(Math.max(Ch.min,Math.min(Ch.max,s)),o),r._state.zoomDelta=0,Ah(o=Th({x:e.clientX-r._state._svgClientRect.left,y:e.clientY-r._state._svgClientRect.top},r._svg,r._lastViewbox),r._canvas),r._update())})),Xc.bind(this._toggle,"click",(function(e){e.preventDefault(),e.stopPropagation(),r.toggle()})),n.on(["shape.added","connection.added"],(function(e){e=e.element,r._addElement(e),r._update()})),n.on(["shape.removed","connection.removed"],(function(e){e=e.element,r._removeElement(e),r._update()})),n.on("elements.changed",250,(function(e){e.elements.forEach((function(e){r._updateElement(e)})),r._update()})),n.on("element.updateId",(function(e){var t=e.element;e=e.newId;r._updateElementId(t,e)})),n.on("canvas.viewbox.changed",(function(){r._state.isDragging||r._update()})),n.on("canvas.resized",(function(){document.body.contains(r._parent)&&(r._state.isDragging||r._update(),r._state._svgClientRect=r._svg.getBoundingClientRect())})),n.on(["root.set","plane.set"],(function(e){r._clear(),(e.element||e.plane.rootElement).children.forEach((function(e){r._addElement(e)})),r._update()}))}function Th(e,t,n){return n=function(e,t){var n,i,o=e.width/e.height;e=Object(Vl.assign)({},{x:e.x,y:e.y,width:e.width,height:e.height});return t<o?(i=e.width*(1/t),n=e.y-(i-e.height)/2,Object(Vl.assign)(e,{y:n,height:i})):o<t&&(n=e.height*t,i=e.x-(n-e.width)/2,Object(Vl.assign)(e,{x:i,width:n})),e}(n,(t=t.getBoundingClientRect()).width/t.height),{x:Oh(e.x,0,t.width,n.x,n.x+n.width),y:Oh(e.y,0,t.height,n.y,n.y+n.height)}}function Ah(e,t){var n=(i=t.viewbox()).width,i=i.height;t.viewbox({x:e.x-n/2,y:e.y-i/2,width:n,height:i})}function Oh(e,t,n,i,o){return(e-t)*(o-i)/(n-t)+i}function Mh(e,t,n){var i=function(e){var t=nu(".children",e);return t||ec(e,t=gc("g",{class:"children"})),t}(t);(i=[].slice.call(i.childNodes)[n])?t.insertBefore(e,i.nextSibling):t.appendChild(e)}function Dh(e){return 0===e.width&&0===e.height}Sh.$inject=["config.minimap","injector","eventBus","canvas","elementRegistry"],Sh.prototype._init=function(){var e=this._canvas.getContainer(),t=this._parent=document.createElement("div"),n=(e=(qc(t).add("djs-minimap"),e.appendChild(t),this._toggle=document.createElement("div")),e=(qc(e).add("toggle"),t.appendChild(e),this._map=document.createElement("div")),e=(ic(n=(qc(e).add("map"),t.appendChild(e),this._svg=gc("svg")),{width:"100%",height:"100%"}),ec(e,n),this._elementsGroup=gc("g")),e=(ec(n,e),this._viewportGroup=gc("g")),qc(e=(lc(n=(ec(n,e),this._viewport=gc("rect"))).add("viewport"),ec(e,n),Xc.bind(t,"mousedown",(function(e){e.stopPropagation()})),this._viewportDom=document.createElement("div"))).add("viewport-dom"),this._parent.appendChild(e),this._overlay=document.createElement("div"));qc(n).add("overlay"),this._parent.appendChild(n)},Sh.prototype._update=function(){var e,t,n,i,o,r,a=this._canvas.viewbox(),s=a.inner,l=a.outer;!function e(t){return Object(Vl.every)(t,(function(t){return Object(Vl.isObject)(t)?e(t):Object(Vl.isNumber)(t)&&isFinite(t)}))}(a)||(o=l.width-s.width,r=l.height-s.height,s.width<l.width?(e=s.x-o/2,n=l.width,s.x+s.width<l.width&&(e=Math.min(0,s.x))):(e=s.x,n=s.width),s.height<l.height?(t=s.y-r/2,i=l.height,s.y+s.height<l.height&&(t=Math.min(0,s.y))):(t=s.y,i=s.height),this._lastViewbox={x:e-=50,y:t-=50,width:n+=100,height:i+=100},ic(this._svg,{viewBox:e+", "+t+", "+n+", "+i}),ic(this._viewport,{x:a.x,y:a.y,width:a.width,height:a.height}),o=this._state._parentClientRect=this._parent.getBoundingClientRect(),l={top:(r=this._viewport.getBoundingClientRect()).top-o.top,left:r.left-o.left,width:r.width,height:r.height},Object(Vl.assign)(this._viewportDom.style,{top:l.top+"px",left:l.left+"px",width:l.width+"px",height:l.height+"px"}),s=Ph(o,l),Object(Vl.assign)(this._overlay.style,{clipPath:s}))},Sh.prototype.open=function(){Object(Vl.assign)(this._state,{isOpen:!0}),qc(this._parent).add("open");var e=this._injector.get("translate",!1)||function(e){return e};Ic(this._toggle,"title",e("Close minimap")),this._update(),this._eventBus.fire("minimap.toggle",{open:!0})},Sh.prototype.close=function(){Object(Vl.assign)(this._state,{isOpen:!1}),qc(this._parent).remove("open");var e=this._injector.get("translate",!1)||function(e){return e};Ic(this._toggle,"title",e("Open minimap")),this._eventBus.fire("minimap.toggle",{open:!1})},Sh.prototype.toggle=function(e){var t=this.isOpen();(e=void 0===e?!t:e)!=t&&(e?this.open():this.close())},Sh.prototype.isOpen=function(){return this._state.isOpen},Sh.prototype._updateElement=function(e){try{void 0!==e.parent&&null!==e.parent&&(this._removeElement(e),this._addElement(e))}catch(e){console.warn("Minimap#_updateElement errored",e)}},Sh.prototype._updateElementId=function(e,t){try{var n=nu("#"+Eh()(e.id),this._elementsGroup);n&&(n.id=t)}catch(e){console.warn("Minimap#_updateElementId errored",e)}},Sh.prototype.isOnActivePlane=function(e){var t=this._canvas;return t.findRoot?t.findRoot(e)===t.getRootElement():!t.findPlane||t.findPlane(e)===t.getActivePlane()},Sh.prototype._addElement=function(e){var t,n,i,o,r,a,s=this;if(this._removeElement(e),this.isOnActivePlane(e))return o=this._createElement(e),r=nu("#"+Eh()(e.parent.id),this._elementsGroup),o?("undefined"!==(a=function(e,t){var n;if(t=nu(".djs-children",t.parentNode))return t=[].slice.call(t.childNodes),n=-1,t.forEach((function(t,i){nu(".djs-element",t)===e&&(n=i)})),n}(this._elementRegistry.getGraphics(e),this._elementRegistry.getGraphics(e.parent)))&&r?r.childNodes.length>a?Mh(o,r,a):Mh(o,r,r.childNodes.length-1):this._elementsGroup.appendChild(o),e.waypoints?void(i=n=0)!==(t=e.parent).x&&void 0!==t.y&&(n=-t.x,i=-t.y):(n=e.x,i=e.y,r&&(n-=(t=e.parent).x,i-=t.y)),ic(o,{transform:"translate("+n+" "+i+")"}),e.children&&e.children.length&&e.children.forEach((function(e){s._addElement(e)})),o):void 0},Sh.prototype._removeElement=function(e){(e=this._svg.getElementById(e.id))&&uc(e)},Sh.prototype._createElement=function(e){var t=this._elementRegistry.getGraphics(e);if(t&&(t=t.childNodes[0]))return ic(t=hc(t),{id:e.id}),t},Sh.prototype._clear=function(){dc(this._elementsGroup)};var $h=Math.sign||function(e){return 0<=e?1:-1};function Ph(e,t){return"polygon("+[Rh(t.left,t.top),Rh(t.left+t.width,t.top),Rh(t.left+t.width,t.top+t.height),Rh(t.left,t.top+t.height),Rh(t.left,e.height),Rh(e.width,e.height),Rh(e.width,0),Rh(0,0),Rh(0,e.height),Rh(t.left,e.height)].join(", ")+")"}function Rh(e,t){return e+"px "+t+"px"}var Lh={__init__:["minimap"],minimap:["type",Sh]},Ih=(Q=n(61),X=n.n(Q),/^class /);function Nh(e){return"[object Array]"===Object.prototype.toString.call(e)}function Fh(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jh(){var e=Array.prototype.slice.call(arguments),t=(e=1===e.length&&Nh(e[0])?e[0]:e).pop();return t.$inject=e,t}var Bh=/constructor\s*[^(]*\(\s*([^)]*)\)/m,qh=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,zh=/\/\*([^*]*)\*\//m;function Vh(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(Ih.test(e.toString())?Bh:qh);return t&&t[1]&&t[1].split(",").map((function(e){return((t=e.match(zh))?t[1]:e).trim()}))||[]}function Wh(e,t){function n(e){var t=(e=u(e)).fn;e=e.dependencies;return new(Function.prototype.bind.apply(t,[null].concat(e)))}function i(e,t,n){return n=(e=u(e,n)).fn,e=e.dependencies,n.apply(t,e)}t=t||{get:function(e,t){if(o.push(e),!1===t)return null;throw l('No provider for "'+e+'"!')}};var o=[],r=this._providers=Object.create(t._providers||null),a=this._instances=Object.create(null),s=a.injector=this,l=function(e){var t=o.join(" -> ");return o.length=0,new Error(t?e+" (Resolving: "+t+")":e)},c=function(e,n){if(!r[e]&&-1!==e.indexOf(".")){for(var i=e.split("."),s=c(i.shift());i.length;)s=s[i.shift()];return s}if(Fh(a,e))return a[e];if(Fh(r,e)){if(-1!==o.indexOf(e))throw o.push(e),l("Cannot resolve circular dependency!");return o.push(e),a[e]=r[e][0](r[e][1]),o.pop(),a[e]}return t.get(e,n)},u=function(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Nh(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=jh(e.slice())}return{fn:e,dependencies:(e.$inject||Vh(e)).map((function(e){return Fh(t,e)?t[e]:c(e)}))}},d=function(e){return jh((function(t){return e.get(t)}))},h={factory:i,type:n,value:function(e){return e}};e.forEach((function(e){function t(e,t){return"value"!==e&&Nh(t)?jh(t.slice()):t}var n,i,o;"object"==typeof e&&(e.__exports__?(n=Object.keys(e).reduce((function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t}),Object.create(null)),i=new Wh((e.__modules__||[]).concat([n]),s),o=jh((function(e){return i.get(e)})),e.__exports__.forEach((function(e){r[e]=[o,e,"private",i]}))):Object.keys(e).forEach((function(n){var i,o;"private"===e[n][2]?r[n]=e[n]:(i=e[n][0],o=e[n][1],r[n]=[h[i],t(i,o),i])})))})),this.get=c,this.invoke=i,this.instantiate=n,this.createChild=function(e,t){if(t&&t.length){var n,i,o,a,l,c=Object.create(null),u=Object.create(null),h=[],p=[],f=[];for(l in r)n=r[l],-1!==t.indexOf(l)&&("private"===n[2]?-1===(i=h.indexOf(n[3]))?(o=n[3].createChild([],t),a=d(o),h.push(n[3]),p.push(o),f.push(a),c[l]=[a,l,"private",o]):c[l]=[f[i],l,"private",p[i]]:c[l]=[n[2],n[1]],u[l]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(e){-1!==n[1].$scope.indexOf(e)&&(c[l]=[n[2],n[1]],u[e]=!0)}));t.forEach((function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(c)}return new Wh(e,s)}}function Hh(e,t){Wl.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}function Uh(e,t){return e&&t?(-1!==(t=e.indexOf(t))&&e.splice(t,1),t):-1}function Gh(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function Kh(e,t){return e&&t?e.indexOf(t):-1}function Yh(e,t){return Math.round(e*t)/t}function Xh(e){return Object(Vl.isNumber)(e)?e+"px":e}function Jh(e,t,n){var i=gc("g");lc(i).add(t),t=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[t]||null),i}H()(Hh,Wl),Hh.prototype.canRender=function(){return!0},Hh.prototype.drawShape=function(e,t,n){var i=gc("rect");return ic(i,{x:0,y:0,width:t.width||0,height:t.height||0}),Iu(t)?ic(i,Object(Vl.assign)({},this.FRAME_STYLE,n||{})):ic(i,Object(Vl.assign)({},this.SHAPE_STYLE,n||{})),ec(e,i),i},Hh.prototype.drawConnection=function(e,t,n){return ec(e,t=Oc(t.waypoints,Object(Vl.assign)({},this.CONNECTION_STYLE,n||{}))),t},Hh.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Tc([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},Hh.prototype.getConnectionPath=function(e){for(var t,n=e.waypoints,i=[],o=0;t=n[o];o++)t=t.original||t,i.push([0===o?"M":"L",t.x,t.y]);return Tc(i)},Hh.$inject=["eventBus","styles"],ee={__init__:["defaultRenderer"],defaultRenderer:["type",Hh],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return t=this.style(t,n),Object(Vl.assign)(t,{class:e})},this.style=function(t,n){return Object(Vl.isArray)(t)||n||(n=t,t=[]),t=Object(Vl.reduce)(t,(function(t,n){return Object(Vl.assign)(t,e[n]||{})}),{}),n?Object(Vl.assign)(t,n):t},this.computeStyle=function(e,n,i){return Object(Vl.isArray)(n)||(i=n,n=[]),t.style(n||[],Object(Vl.assign)({},i,e||{}))}}]};var Zh="base",Qh="djs-element-hidden",ep={shape:["x","y","width","height"],connection:["waypoints"]};function tp(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function np(e,t){t="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")",e.setAttribute("transform",t)}tp.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],tp.prototype._init=function(e){var t,n,i=this._eventBus,o=this._container=(o=e,t=(o=Object(Vl.assign)({},{width:"100%",height:"100%"},o)).container||document.body,(n=document.createElement("div")).setAttribute("class","djs-container"),Object(Vl.assign)(n.style,{position:"relative",overflow:"hidden",width:Xh(o.width),height:Xh(o.height)}),t.appendChild(n),n),r=this._svg=gc("svg"),a=(ic(r,{width:"100%",height:"100%"}),ec(o,r),this._viewport=Jh(r,"viewport"));this._layers={},!(this._planes={})!==e.deferUpdate&&(this._viewboxChanged=Object(Vl.debounce)(Object(Vl.bind)(this._viewboxChanged,this),300)),i.on("diagram.init",(function(){i.fire("canvas.init",{svg:r,viewport:a})}),this),i.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],(function(){delete this._cachedViewbox}),this),i.on("diagram.destroy",500,this._destroy,this),i.on("diagram.clear",500,this._clear,this)},tp.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},tp.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=Lu(t);"root"===n?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)})),this._activePlane=null,this._planes={},delete this._cachedViewbox},tp.prototype.getDefaultLayer=function(){return this.getLayer(Zh,0)},tp.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=(n=this._layers[e])||(this._layers[e]=this._createLayer(e,t));if(void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},tp.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=Object(Vl.reduce)(this._layers,(function(e,n){return t>=n.index&&e++,e}),0);return{group:Jh(this._viewport,"layer-"+e,n),index:t}},tp.prototype.getPlane=function(e){if(e)return this._planes[e];throw new Error("must specify a name")},tp.prototype.createPlane=function(e,t){if(!e)throw new Error("must specify a name");if(this._planes[e])throw new Error("plane "+e+" already exists");t=t||{id:"__implicitroot"+e,children:[],isImplicit:!0};var n=(lc(n=this.getLayer(e,0)).add(Qh),this._planes[e]={layer:n,name:e,rootElement:null});return this.setRootElementForPlane(t,n),n},tp.prototype.setActivePlane=function(e){if(e)return"string"==typeof e&&(e=this.getPlane(e)),this._activePlane&&lc(this._activePlane.layer).add(Qh),lc((this._activePlane=e).layer).remove(Qh),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e;throw new Error("must specify a plane")},tp.prototype.getActiveLayer=function(){return this.getActivePlane().layer},tp.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(Zh),this.setActivePlane(Zh)),e},tp.prototype.findPlane=function(e){var t=function(e){for(;e.parent;)e=e.parent;return e}(e="string"==typeof e?this._elementRegistry.get(e):e);return Object(Vl.find)(this._planes,(function(e){return e.rootElement===t}))},tp.prototype.getContainer=function(){return this._container},tp.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(Object(Vl.forEach)([i.gfx,i.secondaryGfx],(function(e){e&&(n?lc(e).add(t):lc(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},tp.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},tp.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},tp.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),lc(this.getGraphics(e)).has(t)},tp.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},tp.prototype.getRootElement=function(){return this.getActivePlane().rootElement},tp.prototype.setRootElement=function(e,t){var n=this._activePlane;return n?this.setRootElementForPlane(e,n,t):(n=this.createPlane(Zh,e),this.setActivePlane(n),n.rootElement)},tp.prototype.setRootElementForPlane=function(e,t,n){"string"==typeof t&&(t=this.getPlane(t)),e&&this._ensureValid("root",e);var i=t.rootElement,o=this._elementRegistry,r=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:i}),r.fire("root.removed",{element:i}),o.remove(i)}return e&&(n=t.layer,r.fire("root.add",{element:e}),o.add(e,n),r.fire("root.added",{element:e,gfx:n}),t===this._activePlane)&&this._elementRegistry.updateGraphics(e,this._svg,!0),t.rootElement=e},tp.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=ep[e];if(!Object(Vl.every)(n,(function(e){return void 0!==t[e]})))throw new Error("must supply { "+n.join(", ")+" } with "+e)},tp.prototype._setParent=function(e,t,n){Gh(t.children,e,n),e.parent=t},tp.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var o=this._eventBus,r=this._graphicsFactory;this._ensureValid(e,t),o.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i),n=r.create(e,t,i);return this._elementRegistry.add(t,n),r.update(e,t,n),o.fire(e+".added",{element:t,gfx:n}),t},tp.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},tp.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},tp.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,o=this._eventBus;if(e=n.get(e.id||e))return o.fire(t+".remove",{element:e}),i.remove(e),Uh(e.parent&&e.parent.children,e),e.parent=null,o.fire(t+".removed",{element:e}),n.remove(e),e},tp.prototype.removeShape=function(e){return this._removeElement(e,"shape")},tp.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},tp.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},tp.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},tp.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},tp.prototype.viewbox=function(e){var t,n,i,o,r,a;return void 0===e&&this._cachedViewbox?this._cachedViewbox:(t=this._viewport,i=this.getSize(),e?(this._changeViewbox((function(){o=Math.min(i.width/e.width,i.height/e.height);var n=this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y);Sc(t,n)})),e):(n=this._activePlane&&this._activePlane.layer.getBBox()||{},a=(a=Sc(t))?a.matrix:function(e,t,n,i,o,r){var a=bc().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return yc(a,e);case 6:return yc(a,{a:e,b:t,c:n,d:i,e:o,f:r})}}(),o=Yh(a.a,1e3),r=Yh(-a.e||0,1e3),a=Yh(-a.f||0,1e3),e=this._cachedViewbox={x:r?r/o:0,y:a?a/o:0,width:i.width/o,height:i.height/o,scale:o,inner:{width:n.width||0,height:n.height||0,x:n.x||0,y:n.y||0},outer:i}))},tp.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=Object(Vl.assign)({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),np(t,n)})),{x:n.e,y:n.f}},tp.prototype.scrollToElement=function(e,t){var n,i,o,r,a=100,s=(a=Cu(r=((r=("string"==typeof e&&(e=this._elementRegistry.get(e)),this.findPlane(e)))!==this._activePlane&&this.setActivePlane(r),"number"==typeof(t=t||{})&&(a=t),t={top:t.top||a,right:t.right||a,bottom:t.bottom||a,left:t.left||a},Ru(e))),e=this.viewbox(),this.zoom());e.y+=t.top/s,e.x+=t.left/s,e.width-=(t.right+t.left)/s,e.height-=(t.bottom+t.top)/s,t=Cu(e);t=r.width<e.width&&r.height<e.height?(o=Math.max(0,a.right-t.right),n=Math.min(0,a.left-t.left),i=Math.max(0,a.bottom-t.bottom),a=Math.min(0,a.top-t.top),o=o||n,i||a):(o=r.x-e.x,r.y-e.y),this.scroll({dx:-o*s,dy:-t*s})},tp.prototype.zoom=function(e,t){var n,i;return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox((function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)})),Yh(i.a,1e3)):this.viewbox(e).scale},tp.prototype._fitViewport=function(e){var t,n,i=(n=this.viewbox()).outer;e=0<=(n=n.inner).x&&0<=n.y&&n.x+n.width<=i.width&&n.y+n.height<=i.height&&!e?{x:0,y:0,width:Math.max(n.width+n.x,i.width),height:Math.max(n.height+n.y,i.height)}:(t=Math.min(1,i.width/n.width,i.height/n.height),{x:n.x+(e?n.width/2-i.width/t/2:0),y:n.y+(e?n.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t});return this.viewbox(e),this.viewbox(!1).scale},tp.prototype._setZoom=function(e,t){var n=this._svg,i=this._viewport,o=n.createSVGMatrix(),r=(n=n.createSVGPoint(),(i=i.getCTM()).a);r=t?(n=Object(Vl.assign)(n,t).matrixTransform(i.inverse()),t=o.translate(n.x,n.y).scale(1/r*e).translate(-n.x,-n.y),i.multiply(t)):o.scale(e);return np(this._viewport,r),r},tp.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},tp.prototype.getAbsoluteBBox=function(e){var t=this.viewbox();return{x:(e=e.waypoints?this.getGraphics(e).getBBox():e).x*t.scale-t.x*t.scale,y:e.y*t.scale-t.y*t.scale,width:e.width*t.scale,height:e.height*t.scale}},tp.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var ip="data-element-id";function op(e){this._elements={},this._eventBus=e}op.$inject=["eventBus"],op.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),ic(t,ip,i),n&&ic(n,ip,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},op.prototype.remove=function(e){var t=this._elements,n=(e=e.id||e)&&t[e];n&&(ic(n.gfx,ip,""),n.secondaryGfx&&ic(n.secondaryGfx,ip,""),delete t[e])},op.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},op.prototype.updateGraphics=function(e,t,n){e=e.id||e;var i=this._elements[e];return n?i.secondaryGfx=t:i.gfx=t,ic(t,ip,e),t},op.prototype.get=function(e){return e="string"==typeof e?e:e&&ic(e,ip),(e=this._elements[e])&&e.element},op.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},op.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var o=t[n[i]],r=o.element;if(e(r,o.gfx))return r}},op.prototype.getAll=function(){return this.filter((function(e){return e}))},op.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach((function(n){var i=(n=t[n]).element;n=n.gfx;return e(i,n)}))},op.prototype.getGraphics=function(e,t){return e=e.id||e,(e=this._elements[e])&&(t?e.secondaryGfx:e.gfx)},op.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};qr=n(29);var rp=new((te=n.n(qr)).a)({name:"children",enumerable:!0,collection:!0},{name:"parent"}),ap=new te.a({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),sp=new te.a({name:"attachers",collection:!0},{name:"host"}),lp=new te.a({name:"outgoing",collection:!0},{name:"source"}),cp=new te.a({name:"incoming",collection:!0},{name:"target"});function up(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),rp.bind(this,"parent"),ap.bind(this,"labels"),lp.bind(this,"outgoing"),cp.bind(this,"incoming")}function dp(){up.call(this),rp.bind(this,"children"),sp.bind(this,"host"),sp.bind(this,"attachers")}function hp(){dp.call(this)}function pp(){dp.call(this),ap.bind(this,"labelTarget")}function fp(){up.call(this),lp.bind(this,"source"),cp.bind(this,"target")}H()(dp,up),H()(hp,dp),H()(pp,dp),H()(fp,up);var mp={connection:fp,shape:dp,label:pp,root:hp};function gp(){this._uid=12}gp.prototype.createRoot=function(e){return this.create("root",e)},gp.prototype.createLabel=function(e){return this.create("label",e)},gp.prototype.createShape=function(e){return this.create("shape",e)},gp.prototype.createConnection=function(e){return this.create("connection",e)},gp.prototype.create=function(e,t){(t=Object(Vl.assign)({},t||{})).id||(t.id=e+"_"+this._uid++);var n=mp[e];if(n)return Object(Vl.assign)(new n,t);throw new Error("unknown type: <"+e+">")};var vp=Array.prototype.slice;function bp(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function yp(){}function wp(e){return e.childNodes[0]}function xp(e,t){this._eventBus=e,this._elementRegistry=t}function _p(e,t,n){e!==(n=n||t.firstChild)&&t.insertBefore(e,n)}bp.prototype.on=function(e,t,n,i){if(e=Object(Vl.isArray)(e)?e:[e],Object(Vl.isFunction)(t)&&(i=n,n=t,t=1e3),!Object(Vl.isNumber)(t))throw new Error("priority must be a number");var o=n,r=(i&&((o=Object(Vl.bind)(n,i)).__fn=n.__fn||n),this);e.forEach((function(e){r._addListener(e,{priority:t,callback:o,next:null})}))},bp.prototype.once=function(e,t,n,i){var o=this;if(Object(Vl.isFunction)(t)&&(i=n,n=t,t=1e3),!Object(Vl.isNumber)(t))throw new Error("priority must be a number");function r(){r.__isTomb=!0;var t=n.apply(i,arguments);return o.off(e,r),t}r.__fn=n,this.on(e,t,r)},bp.prototype.off=function(e,t){e=Object(Vl.isArray)(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},bp.prototype.createEvent=function(e){var t=new yp;return t.init(e),t},bp.prototype.fire=function(e,t){var n,i,o=vp.call(arguments);if(!(e="object"==typeof e?(t=e).type:e))throw new Error("no event type specified");if(n=this._listeners[e]){t=t instanceof yp?t:this.createEvent(t);var r=(o[0]=t).type;e!==r&&(t.type=e);try{i=this._invokeListeners(t,o,n)}finally{e!==r&&(t.type=r)}return(void 0!==i||!t.defaultPrevented)&&i}},bp.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},bp.prototype._destroy=function(){this._listeners={}},bp.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},bp.prototype._invokeListener=function(e,t,n){var i,o,r;if(!n.callback.__isTomb)try{o=n.callback,r=t,void 0!==(i=o.apply(null,r))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},bp.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));i=(n=i).next}n.next=t}else this._setListeners(e,t)},bp.prototype._getListeners=function(e){return this._listeners[e]},bp.prototype._setListeners=function(e,t){this._listeners[e]=t},bp.prototype._removeListener=function(e,t){var n,i,o,r=this._getListeners(e);if(t)for(;r;)n=r.next,(o=r.callback)!==t&&o.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=r,r=n;else this._setListeners(e,null)},yp.prototype.stopPropagation=function(){this.cancelBubble=!0},yp.prototype.preventDefault=function(){this.defaultPrevented=!0},yp.prototype.init=function(e){Object(Vl.assign)(this,e||{})},xp.$inject=["eventBus","elementRegistry"],xp.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(lc(t=gc("g")).add("djs-children"),ec(n.parentNode,t)):t=n,t},xp.prototype._clear=function(e){return Vc(e=wp(e)),e},xp.prototype._createContainer=function(e,t,n,i){var o=gc("g");lc(o).add("djs-group"),void 0!==n?_p(o,t,t.childNodes[n]):ec(t,o),n=gc("g"),lc(n).add("djs-element"),lc(n).add("djs-"+e),i&&lc(n).add("djs-frame"),ec(o,n),t=gc("g");return lc(t).add("djs-visual"),ec(n,t),n},xp.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Iu(t))},xp.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry;e=Object(Vl.reduce)(e,(function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e}),{});Object(Vl.forEach)(e,(function(e){var i,o=e.children;o&&(i=t._getChildrenContainer(e),Object(Vl.forEach)(o.slice().reverse(),(function(e){_p(n.getGraphics(e).parentNode,i)})))}))},xp.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},xp.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},xp.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},xp.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},xp.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),au(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?ic(n,"display","none"):ic(n,"display","block")}},xp.prototype.remove=function(e){uc(this._elementRegistry.getGraphics(e).parentNode)};var kp={__depends__:[ee],__init__:["canvas"],canvas:["type",tp],elementRegistry:["type",op],elementFactory:["type",gp],eventBus:["type",bp],graphicsFactory:["type",xp]};function Ep(e,t){this.injector=t=t||function(e){var t=[],n=[];function i(e){return 0<=t.indexOf(e)}e.forEach((function e(o){i(o)||((o.__depends__||[]).forEach(e),i(o))||(t.push(o),(o.__init__||[]).forEach((function(e){n.push(e)})))}));var o=new Wh(t);return n.forEach((function(e){try{o["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}})),o}([{config:["value",e=(e=e)||{}]},kp].concat(e.modules||[])),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Cp(){}function Sp(e,t){this.model=e,this.properties=t}Ep.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ep.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Cp.prototype.get=function(e){return this.$model.properties.get(this,e)},Cp.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Sp.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Cp.prototype),o=(Object(Vl.forEach)(e.properties,(function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)})),n.defineModel(i,t),n.defineDescriptor(i,e),e.ns.name);function r(e){n.define(this,"$type",{value:o,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),Object(Vl.forEach)(e,Object(Vl.bind)((function(e,t){this.set(t,e)}),this))}return r.prototype=i,r.hasType=i.$instanceOf=this.model.hasType,n.defineModel(r,t),n.defineDescriptor(r,e),r};var Tp={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ap={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Op(e,t){return(e=Ap[e])?e(t):t}function Mp(e){return Tp[e]}function Dp(e,t){var n,i,o=e.split(/:/);if(1===o.length)n=e,i=t;else{if(2!==o.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=o[1],i=o[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function $p(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Pp(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Object(Vl.forEach)(e,Object(Vl.bind)(this.registerPackage,this))}function Rp(e,t,n){if((t=t[n])in e)throw new Error("package with "+n+" <"+t+"> already defined")}function Lp(e){this.model=e}function Ip(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Np(e){this.properties=new Lp(this),this.factory=new Sp(this,this.properties),this.registry=new Pp(e,this.properties),this.typeCache={}}$p.prototype.build=function(){return Object(Vl.pick)(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},$p.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n),n=this.properties,void 0!==t?n.splice(t,0,e):n.push(e)},$p.prototype.replaceProperty=function(e,t,n){var i=e.ns,o=this.properties,r=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}if(-1===(e=o.indexOf(e)))throw new Error("property <"+i.name+"> not found in property list");o.splice(e,1),this.addProperty(t,n?void 0:e,a),r[i.name]=r[i.localName]=t},$p.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix;i=Dp((t=t.split("#"))[0],i),t=Dp(t[1],i.prefix).name;if(!(i=this.propertiesByName[t]))throw new Error("refined property <"+t+"> not found");this.replaceProperty(i,e,n),delete e.redefines},$p.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},$p.prototype.removeNamedProperty=function(e){e=e.ns;var t=this.propertiesByName;delete t[e.name],delete t[e.localName]},$p.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},$p.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},$p.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},$p.prototype.hasProperty=function(e){return this.propertiesByName[e]},$p.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,o=e.name;o in n||(Object(Vl.forEach)(e.properties,Object(Vl.bind)((function(n){n=Object(Vl.assign)({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,o=n.redefines;i||o?this.redefineProperty(n,i||o,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))}),this)),i.push(e),n[o]=e)},Pp.prototype.getPackage=function(e){return this.packageMap[e]},Pp.prototype.getPackages=function(){return this.packages},Pp.prototype.registerPackage=function(e){e=Object(Vl.assign)({},e);var t=this.packageMap;Rp(t,e,"prefix"),Rp(t,e,"uri"),Object(Vl.forEach)(e.types,Object(Vl.bind)((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Pp.prototype.registerType=function(e,t){var n=Dp((e=Object(Vl.assign)({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Object(Vl.assign)(e.meta||{})})).name,t.prefix),i=n.name,o={};Object(Vl.forEach)(e.properties,Object(Vl.bind)((function(e){var t=Dp(e.name,n.prefix),i=t.name;Mp(e.type)||(e.type=Dp(e.type,t.prefix).name),Object(Vl.assign)(e,{ns:t,name:i}),o[i]=e}),this)),Object(Vl.assign)(e,{ns:n,name:i,propertiesByName:o}),Object(Vl.forEach)(e.extends,Object(Vl.bind)((function(e){(e=this.typeMap[e]).traits=e.traits||[],e.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},Pp.prototype.mapTypes=function(e,t,n){var i=Mp(e.name)?{name:e.name}:this.typeMap[e.name],o=this;function r(e){return a(e,!0)}function a(n,i){n=Dp(n,Tp[n]?"":e.prefix),o.mapTypes(n,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");Object(Vl.forEach)(i.superClass,n?r:a),t(i,!n),Object(Vl.forEach)(i.traits,r)},Pp.prototype.getEffectiveDescriptor=function(e){var t=new $p(e=Dp(e));this.mapTypes(e,(function(e,n){t.addTrait(e,n)})),e=t.build();return this.definePackage(e,e.allTypes[e.allTypes.length-1].$pkg),e},Pp.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Lp.prototype.set=function(e,t,n){if(!Object(Vl.isString)(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),o=i&&i.name;void 0===n?i?delete e[o]:delete e.$attrs[t]:i?o in e?e[o]=n:Ip(e,i,n):e.$attrs[t]=n},Lp.prototype.get=function(e,t){var n,i=this.model.getPropertyDescriptor(e,t);return i?(!e[n=i.name]&&i.isMany&&Ip(e,i,[]),e[n]):e.$attrs[t]},Lp.prototype.define=function(e,t,n){var i;n.writable||(i=n.value,delete(n=Object(Vl.assign)({},n,{get:function(){return i}})).value),Object.defineProperty(e,t,n)},Lp.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Lp.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Np.prototype.create=function(e,t){var n=this.getType(e);if(n)return new n(t);throw new Error("unknown type <"+e+">")},Np.prototype.getType=function(e){var t=this.typeCache,n=Object(Vl.isString)(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Np.prototype.createAny=function(e,t,n){var i=Dp(e),o={$type:e,$instanceOf:function(e){return e===this.$type}};e={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(o,e),this.properties.defineModel(o,this),this.properties.define(o,"$parent",{enumerable:!1,writable:!0}),this.properties.define(o,"$instanceOf",{enumerable:!1,writable:!0}),Object(Vl.forEach)(n,(function(e,t){Object(Vl.isObject)(e)&&void 0!==e.value?o[e.name]=e.value:o[t]=e})),o},Np.prototype.getPackage=function(e){return this.registry.getPackage(e)},Np.prototype.getPackages=function(){return this.registry.getPackages()},Np.prototype.getElementDescriptor=function(e){return e.$descriptor},Np.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Np.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Np.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Fp=String.fromCharCode,jp=Object.prototype.hasOwnProperty,Bp=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,qp={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function zp(e,t,n,i){return i?jp.call(qp,i)?qp[i]:"&"+i+";":Fp(t||parseInt(n,16))}function Vp(e){return 3<e.length&&-1!==e.indexOf("&")?e.replace(Bp,zp):e}Object.keys(qp).forEach((function(e){qp[e.toUpperCase()]=qp[e]}));var Wp="non-whitespace outside of root node";function Hp(e){return new Error(e)}function Up(e){return"missing namespace for prefix <"+e+">"}function Gp(e){return{get:e,enumerable:!0}}function Kp(e){return e+"$uri"}function Yp(){return{line:0,column:0}}function Xp(e){throw e}function Jp(e){if(!this)return new Jp(e);var t,n,i,o,r,a,s,l,c,u=e&&e.proxy,d=Xp,h=Yp,p=!1,f=!1,m=null,g=!1;function v(e){e instanceof Error||(e=Hp(e)),d(m=e,h)}function b(e){r&&(e instanceof Error||(e=Hp(e)),r(e,h))}this.on=function(e,c){if("function"!=typeof c)throw Hp("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":d=c;break;case"warn":r=c;break;case"cdata":o=c;break;case"attention":l=c;break;case"question":s=c;break;case"comment":a=c;break;default:throw Hp("unsupported event: "+e)}return this},this.ns=function(e){if("object"!=typeof(e=void 0===e?{}:e))throw Hp("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,c=n,this},this.parse=function(e){if("string"!=typeof e)throw Hp("required args <xml=string>");return m=null,function(e){var r,d,m,y,w,x,_,k,E,C,S,T=f?[]:null,A=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Kp(n)]=t;return i}(c):null,O=[],M=0,D=!1,$=!1,P=0,R=0,L="",I=0;function N(){if(null!==S)return S;var e,t,n,i,o,r,a,s,l,u,d,h=f&&A.xmlns,m=f&&p?[]:null,g=I,v=L,y=v.length,w={},x={};e:for(;g<y;g++)if(l=!1,!(32===(u=v.charCodeAt(g))||u<14&&8<u)){for((u<65||122<u||90<u&&u<97)&&95!==u&&58!==u&&(b("illegal first char attribute name"),l=!0),d=g+1;d<y;d++)if(!(96<(u=v.charCodeAt(d))&&u<123||64<u&&u<91||47<u&&u<59||46===u||45===u||95===u)){if(32===u||u<14&&8<u){b("missing attribute value"),g=d;continue e}if(61===u)break;b("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=v.substring(g,d))&&(b("illegal declaration of xmlns"),l=!0),34===(u=v.charCodeAt(d+1)))-1===(d=v.indexOf('"',g=d+2))&&-1!==(d=v.indexOf("'",g))&&(b("attribute value quote missmatch"),l=!0);else if(39===u)-1===(d=v.indexOf("'",g=d+2))&&-1!==(d=v.indexOf('"',g))&&(b("attribute value quote missmatch"),l=!0);else for(b("missing attribute value quotes"),l=!0,d+=1;d<y&&!(32===(u=v.charCodeAt(d+1))||u<14&&8<u);d++);for(-1===d&&(b("missing closing quotes"),d=y,l=!0),l||(r=v.substring(g,d)),g=d;d+1<y&&!(32===(u=v.charCodeAt(d+1))||u<14&&8<u);d++)g===d&&(b("illegal character after attribute end"),l=!0);if(g=d+1,!l)if(s in x)b("attribute <"+s+"> already defined");else if(x[s]=!0,f)if(p)if(null!==(o="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Vp(r),t=Kp(o),!(a=c[e])){if("xmlns"===o||t in A&&A[t]!==e)for(;a="ns"+M++,void 0!==A[a];);else a=o;c[e]=a}A[o]!==a&&(i||(A=function(e){var t,n={};for(t in e)n[t]=e[t];return n}(A),i=!0),A[o]=a,"xmlns"===o&&(A[Kp(a)]=e,h=a),A[t]=e),w[s]=r}else m.push(s,r);else-1===(u=s.indexOf(":"))?w[s]=r:(n=A[s.substring(0,u)])?("xsi:type"===(s=h===n?s.substr(u+1):n+s.substr(u))&&(r=-1!==(u=r.indexOf(":"))?(n=r.substring(0,u),(n=A[n]||n)+r.substring(u)):h+":"+r),w[s]=r):b(Up(s.substring(0,u)));else w[s]=r}if(p)for(g=0,y=m.length;g<y;g++){if(s=m[g++],r=m[g],-1!==(u=s.indexOf(":"))){if(!(n=A[s.substring(0,u)])){b(Up(s.substring(0,u)));continue}"xsi:type"===(s=h===n?s.substr(u+1):n+s.substr(u))&&(r=-1!==(u=r.indexOf(":"))?(n=r.substring(0,u),(n=A[n]||n)+r.substring(u)):h+":"+r)}w[s]=r}return S=w}for(h=function(){for(var t,n=/(\r\n|\r|\n)/g,i=0,o=0,r=0,a=R;r<=P&&(t=n.exec(e))&&(a=t[0].length+t.index,!(P<a));)i+=1,r=a;return{data:-1==P?(o=a,e.substring(R)):0===R?e.substring(R,P):(o=P-r,-1==R?e.substring(P):e.substring(P,R+1)),line:i,column:o}},u&&(C=Object.create({},{name:Gp((function(){return k})),originalName:Gp((function(){return E})),attrs:Gp(N),ns:Gp((function(){return A}))}));-1!==R;){if(-1===(P=60===e.charCodeAt(R)?R:e.indexOf("<",R)))return O.length?v("unexpected end of file"):0===R?v("missing start tag"):R<e.length&&e.substring(R).trim()&&b(Wp);if(R!==P)if(O.length){if(t&&(t(e.substring(R,P),Vp,h),g))return}else if(e.substring(R,P).trim()&&(b(Wp),g))return;if(33===(w=e.charCodeAt(P+1))){if(91===(y=e.charCodeAt(P+2))&&"CDATA["===e.substr(P+3,6)){if(-1===(R=e.indexOf("]]>",P)))return v("unclosed cdata");if(o&&(o(e.substring(P+9,R),h),g))return;R+=3;continue}if(45===y&&45===e.charCodeAt(P+3)){if(-1===(R=e.indexOf("--\x3e",P)))return v("unclosed comment");if(a&&(a(e.substring(P+4,R),Vp,h),g))return;R+=3;continue}}if(63===w){if(-1===(R=e.indexOf("?>",P)))return v("unclosed question");if(s&&(s(e.substring(P,R+2),h),g))return;R+=2}else{for(d=P+1;;d++){if(x=e.charCodeAt(d),isNaN(x))return R=-1,v("unclosed tag");if(34===x)d=-1!==(y=e.indexOf('"',d+1))?y:d;else if(39===x)d=-1!==(y=e.indexOf("'",d+1))?y:d;else if(62===x){R=d;break}}if(33===w){if(l&&(l(e.substring(P,R+1),Vp,h),g))return}else{if(S={},47===w){if($=!(D=!1),!O.length)return v("missing open tag");if(d=k=O.pop(),y=P+2+d.length,e.substring(P+2,y)!==d)return v("closing tag mismatch");for(;y<R;y++)if(!(32===(w=e.charCodeAt(y))||8<w&&w<14))return v("close tag")}else{if($=47===e.charCodeAt(R-1)?(d=k=e.substring(P+1,R-1),D=!0):(d=k=e.substring(P+1,R),!(D=!0)),!(96<w&&w<123||64<w&&w<91||95===w||58===w))return v("illegal first char nodeName");for(y=1,m=d.length;y<m;y++)if(!(96<(w=d.charCodeAt(y))&&w<123||64<w&&w<91||47<w&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&8<w){k=d.substring(0,y),S=null;break}return v("invalid nodeName")}$||O.push(k)}if(f){if(r=A,D&&($||T.push(r),null===S)&&(p=-1!==d.indexOf("xmlns",y))&&(I=y,L=d,N(),p=!1),-1!==(w=(E=k).indexOf(":"))){if(!(_=A[k.substring(0,w)]))return v("missing namespace on <"+E+">");k=k.substr(w+1)}else _=A.xmlns;_&&(k=_+":"+k)}if(D&&(I=y,L=d,n)&&(u?n(C,Vp,$,h):n(k,N,Vp,$,h),g))return;if($){if(i&&(i(u?C:k,Vp,D,h),g))return;f&&(A=D?r:T.pop())}}R+=1}}}(e),h=Yp,g=!1,m},this.stop=function(){g=!0}}function Zp(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Qp={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ef="xsi:type";function tf(e){return e.xml&&e.xml.serialize}function nf(e){return tf(e)===ef}function of(e,t){return Zp(t)?e.prefix+":"+((t=e.localName).charAt(0).toUpperCase()+t.slice(1)):e.name}function rf(e){return new Error(e)}function af(e){return e.$descriptor}function sf(e){Object(Vl.assign)(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw rf("expected element");var t=this.elementsById,n=af(e).idProperty;if(n&&(n=e.get(n.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(t[n])throw rf("duplicate ID <"+n+">");t[n]=e}},this.addWarning=function(e){this.warnings.push(e)}}function lf(){}function cf(){}function uf(){}function df(e,t){this.property=e,this.context=t}function hf(e,t){this.element=t,this.propertyDesc=e}function pf(){}function ff(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function mf(e,t,n){ff.call(this,e,t,n)}function gf(e,t,n){this.model=e,this.context=n}function vf(e){e instanceof Np&&(e={model:e}),Object(Vl.assign)(this,{lax:!1},e)}lf.prototype.handleEnd=function(){},lf.prototype.handleText=function(){},lf.prototype.handleNode=function(){},(cf.prototype=Object.create(lf.prototype)).handleNode=function(){return this},(uf.prototype=Object.create(lf.prototype)).handleText=function(e){this.body=(this.body||"")+e},(df.prototype=Object.create(uf.prototype)).handleNode=function(e){if(this.element)throw rf("expected no sub nodes");return this.element=this.createReference(e),this},df.prototype.handleEnd=function(){this.element.id=this.body},df.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(hf.prototype=Object.create(uf.prototype)).handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Op(n.type,e);n.isMany?t.get(n.name).push(e):t.set(n.name,e)},(pf.prototype=Object.create(uf.prototype)).handleNode=function(e){var t=this;return this.element?t=this.handleChild(e):(e=this.element=this.createElement(e),this.context.addElement(e)),t},(ff.prototype=Object.create(pf.prototype)).addReference=function(e){this.context.addReference(e)},ff.prototype.handleText=function(e){if(!af(this.element).bodyProperty)throw rf("unexpected body text <"+e+">");uf.prototype.handleText.call(this,e)},ff.prototype.handleEnd=function(){var e=this.body,t=this.element,n=af(t).bodyProperty;n&&void 0!==e&&(e=Op(n.type,e),t.set(n.name,e))},ff.prototype.createElement=function(e){e=e.attributes;var t,n=this.type,i=af(n),o=this.context,r=new n({}),a=this.model;return Object(Vl.forEach)(e,(function(e,n){var s,l=i.propertiesByName[n];l&&l.isReference?l.isMany?(s=e.split(" "),Object(Vl.forEach)(s,(function(e){o.addReference({element:r,property:l.ns.name,id:e})}))):o.addReference({element:r,property:l.ns.name,id:e}):(l?e=Op(l.type,e):"xmlns"!==n&&(t=Dp(n,i.ns.prefix),a.getPackage(t.prefix))&&o.addWarning({message:"unknown attribute <"+n+">",element:r,property:n,value:e}),r.set(n,e))})),r},ff.prototype.getPropertyForNode=function(e){var t,n,i,o,r=Dp(e.name),a=this.type,s=this.model,l=(a=af(a),r.name);if((l=a.propertiesByName[l])&&!l.isAttr)return nf(l)&&(t=e.attributes[ef])?(e=s,c=Dp(c=t),e=e=e.getPackage(c.prefix),i=(c=c).name,o=c.localName,t=(e=e.xml&&e.xml.typePrefix)&&0===o.indexOf(e)?c.prefix+":"+o.slice(e.length):i,n=s.getType(t),Object(Vl.assign)({},l,{effectiveType:af(n).name})):l;var c=s.getPackage(r.prefix);if(c){if(t=of(r,c),n=s.getType(t),l=Object(Vl.find)(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return Object(Vl.assign)({},l,{effectiveType:af(n).name})}else if(l=Object(Vl.find)(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw rf("unrecognized element <"+r.name+">")},ff.prototype.toString=function(){return"ElementDescriptor["+af(this.type).name+"]"},ff.prototype.valueHandler=function(e,t){return new hf(e,t)},ff.prototype.referenceHandler=function(e){return new df(e,this.context)},ff.prototype.handler=function(e){return new("Element"===e?gf:ff)(this.model,e,this.context)},ff.prototype.handleChild=function(e){var t=this.getPropertyForNode(e),n=this.element,i=t.effectiveType||t.type;return Ap[i]?this.valueHandler(t,n):(void 0!==(e=(i=(t.isReference?this.referenceHandler(t):this.handler(i)).handleNode(e)).element)&&(t.isMany?n.get(t.name).push(e):n.set(t.name,e),t.isReference?(Object(Vl.assign)(e,{element:n}),this.context.addReference(e)):e.$parent=n),i)},(mf.prototype=Object.create(ff.prototype)).createElement=function(e){var t=e.name,n=Dp(t),i=this.model,o=this.type;n=(i=i.getPackage(n.prefix))&&of(n,i)||t;if(o.hasType(n))return ff.prototype.createElement.call(this,e);throw rf("unexpected element <"+e.originalName+">")},(gf.prototype=Object.create(pf.prototype)).createElement=function(e){var t=e.name,n=Dp(t).prefix;n=e.ns[n+"$uri"],e=e.attributes;return this.model.createAny(t,n,e)},gf.prototype.handleChild=function(e){e=new gf(this.model,0,this.context).handleNode(e);var t=this.element,n=e.element;return void 0!==n&&((t.$children=t.$children||[]).push(n),n.$parent=t),e},gf.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},vf.prototype.fromXML=function(e,t,n){var i=t.rootHandler,o=(t instanceof ff?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i)),this.model),r=this.lax,a=new sf(Object(Vl.assign)({},t,{rootHandler:i})),s=new Jp({proxy:!0}),l=(t=[],Object.defineProperty(t,"peek",{value:function(){return this[this.length-1]}}),t);function c(e,t,n){var i=(t=t()).line,o=t.column;t="unparsable content "+((t="<"===(t=t.data).charAt(0)&&-1!==t.indexOf(" ")?t.slice(0,t.indexOf(" "))+">":t)?t+" ":"")+"detected\n\tline: "+i+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:t,error:e}),!0;throw rf(t)}function u(e,t){return c(e,t,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,h=/ encoding="([^"]+)"/i,p=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){u(e,t)}}return t=o.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"}),s.ns(t).on("openTag",(function(e,t,n,i){var o=e.attrs||{},a=Object.keys(o).reduce((function(e,n){var i=t(o[n]);return e[n]=i,e}),{});a={name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},e=i,i=l.peek();try{l.push(i.handleNode(a))}catch(n){c(n,e,r)&&l.push(new cf)}})).on("question",(function(e){d.test(e)&&(e=(e=h.exec(e))&&e[1])&&!p.test(e)&&a.addWarning({message:"unsupported document encoding <"+e+">, falling back to UTF-8"})})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){t=t(e),e=n,t.trim()&&f(t,e)})).on("error",c).on("warn",u),new Promise((function(t,n){var o;try{s.parse(e);for(var r=a.elementsById,l=a.references,c=0;d=l[c];c++){var u,d,h=d.element,p=r[d.id],f=af(h).propertiesByName[d.property];p||a.addWarning({message:"unresolved reference <"+d.id+">",element:d.element,property:d.property,value:d.id}),f.isMany?(-1===(d=(u=h.get(f.name)).indexOf(d))&&(d=u.length),p?u[d]=p:u.splice(d,1)):h.set(f.name,p)}}catch(t){o=t}var m=i.element,g=(o||m||(o=rf("failed to parse document as <"+i.type.$descriptor.name+">")),a.warnings),v=a.references,b=a.elementsById;return o?(o.warnings=g,n(o)):t({rootElement:m,elementsById:b,references:v,warnings:g})}))},vf.prototype.handler=function(e){return new mf(this.model,e)};var bf=/<|>|'|"|&|\n\r|\n/g,yf=/<|>|&/g;function wf(e){var t={},n={},i={},o=[],r=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,(t?o:r).push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,o=this.getNSKey(t);i[o]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(o,r).filter((function(e){return e=t.getNSKey(e),i[e]}))}}function xf(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function _f(e){return Object(Vl.isString)(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var kf={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ef={"<":"lt",">":"gt","&":"amp"};function Cf(e,t,n){return(e=Object(Vl.isString)(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Sf(e){this.tagName=e}function Tf(){}function Af(e){this.tagName=e}function Of(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Mf(e,t){Of.call(this,e,t)}function Df(){this.value="",this.write=function(e){this.value+=e}}function $f(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Pf(e){return e=Object(Vl.assign)({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Df,o=new $f(i,e.format);if(e.preamble&&o.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new Of).build(t).serializeTo(o),!n)return i.value}}}function Rf(e,t){Np.call(this,e,t)}Sf.prototype.build=function(e){return this.element=e,this},Sf.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Tf.prototype.serializeValue=Tf.prototype.serializeTo=function(e){e.append(this.escape?Cf(this.value,yf,Ef):this.value)},Tf.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(yf)&&(this.escape=!0),this},xf(Af,Tf),Af.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Of.prototype.build=function(e){var t,n=(this.element=e).$descriptor,i=this.propertyDescriptor,o=n.isGeneric,r=o?this.parseGeneric(e):this.parseNsAttributes(e);return this.ns=i?this.nsPropertyTagName(i):this.nsTagName(n),this.tagName=this.addTagName(this.ns),o||(i=(t=e).$descriptor,n=Object(Vl.filter)(i.properties,(function(e){var n=e.name;return!e.isVirtual&&!!Object(Vl.has)(t,n)&&(n=t[n])!==e.default&&null!==n&&(!e.isMany||n.length)})),this.parseAttributes((o=n,Object(Vl.filter)(o,(function(e){return e.isAttr})))),this.parseContainments((i=n,Object(Vl.filter)(i,(function(e){return!e.isAttr}))))),this.parseGenericAttributes(e,r),this},Of.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?Object(Vl.assign)({localName:t.ns.localName},e):Object(Vl.assign)({localName:(n=t.ns.localName,Zp(t=t.$pkg)?(t=n).charAt(0).toLowerCase()+t.slice(1):n)},e);var n}(this.logNamespaceUsed(e.ns),e)},Of.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return t=t,e=e,Object(Vl.assign)({localName:e.ns.localName},t)},Of.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Of.prototype.nsAttributeName=function(e){var t=Object(Vl.isString)(e)?Dp(e):e.ns;return e.inherited||(e=this.logNamespaceUsed(t),this.getNamespaces().logUsed(e),this.isLocalNs(e))?{localName:t.localName}:Object(Vl.assign)({localName:t.localName},e)},Of.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return Object(Vl.forEach)(e,(function(o,r){"$body"===r?n.push((new Tf).build({type:"String"},o)):"$children"===r?Object(Vl.forEach)(o,(function(e){n.push(new Of(t).build(e))})):0!==r.indexOf("$")&&t.parseNsAttribute(e,r,o)&&i.push({name:r,value:o})})),i},Of.prototype.parseNsAttribute=function(e,t,n){e=e.$model;var i,o=Dp(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),!(i=o.prefix||"xmlns"!==o.localName?i:{uri:n}))return{name:t,value:n};e&&e.getPackage(n)?this.logNamespace(i,!0,!0):(o=this.logNamespaceUsed(i,!0),this.getNamespaces().logUsed(o))},Of.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,o=[];return Object(Vl.forEach)(i,(function(t,i){(i=n.parseNsAttribute(e,i,t))&&o.push(i)})),o},Of.prototype.parseGenericAttributes=function(e,t){var n=this;Object(Vl.forEach)(t,(function(t){if(t.name!==ef)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},Of.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;Object(Vl.forEach)(e,(function(e){var o,r,a=i.get(e.name),s=e.isReference;e.isMany||(a=[a]),e.isBody?n.push((new Tf).build(e,a[0])):function(e){return Ap[e]}(e.type)?Object(Vl.forEach)(a,(function(i){n.push(new Af(t.addTagName(t.nsPropertyTagName(e))).build(e,i))})):s?Object(Vl.forEach)(a,(function(i){n.push(new Sf(t.addTagName(t.nsPropertyTagName(e))).build(i))})):(o=nf(e),r="property"===tf(e),Object(Vl.forEach)(a,(function(i){var a=o?new Mf(t,e):r?new Of(t,e):new Of(t);n.push(a.build(i))})))}))},Of.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent;return t||(n=n&&n.getNamespaces(),e||!n?this.namespaces=t=new wf(n):t=n),t},Of.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),o=e.uri,r=e.prefix;return i.byUri(o)&&!n||i.add(e,t),i.mapPrefix(r,o),e},Of.prototype.logNamespaceUsed=function(e,t){var n,i,o=this.element.$model,r=this.getNamespaces(t),a=e.prefix;t=e.uri;if(!a&&!t)return{localName:e.localName};if(o=Qp[a]||o&&(o.getPackage(a)||{}).uri,!(t=t||o||r.uriByPrefix(a)))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=r.byUri(t))){for(n=a,i=1;r.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:t},o===t)}return a&&r.mapPrefix(a,t),e},Of.prototype.parseAttributes=function(e){var t=this,n=this.element;Object(Vl.forEach)(e,(function(e){var i,o=n.get(e.name);e.isReference&&(o=e.isMany?(i=[],Object(Vl.forEach)(o,(function(e){i.push(e.id)})),i.join(" ")):o.id),t.addAttribute(t.nsAttributeName(e),o)}))},Of.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),_f(e)},Of.prototype.addAttribute=function(e,t){var n=this.attrs,i=(Object(Vl.isString)(t)&&(t=Cf(t,bf,kf)),Object(Vl.findIndex)(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})));t={name:e,value:t};-1!==i?n.splice(i,1,t):n.push(t)},Of.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=n.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})).concat(t)),Object(Vl.forEach)(t,(function(t){e.append(" ").append(_f(t.name)).append('="').append(t.value).append('"')}))},Of.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Tf;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),Object(Vl.forEach)(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},xf(Mf,Of),Mf.prototype.parseNsAttributes=function(e){var t,n=Of.prototype.parseNsAttributes.call(this,e),i=e.$descriptor;return i.name!==this.propertyDescriptor.type&&(t=this.typeNs=this.nsTagName(i),this.getNamespaces().logUsed(this.typeNs),e=(e=e.$model.getPackage(t.uri)).xml&&e.xml.typePrefix||"",this.addAttribute(this.nsAttributeName(ef),(t.prefix?t.prefix+":":"")+e+i.ns.localName)),n},Mf.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},(Rf.prototype=Object.create(Np.prototype)).fromXML=function(e,t,n){return Object(Vl.isString)(t)||(n=t,t="bpmn:Definitions"),t=(n=new vf(Object(Vl.assign)({model:this,lax:!0},n))).handler(t),n.fromXML(e,t)};var Lf={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!(Rf.prototype.toXML=function(e,t){var n=new Pf(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(t){return i(t)}}))}),isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function If(e,t){return new Rf(Object(Vl.assign)({},Lf,e),t)}function Nf(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var Ff=new te.a({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function jf(e,t){return e.$instanceOf(t)}function Bf(e,t){var n={},i=[];function o(e,t){return function(n){e(n,t)}}function r(e){n[e.id]=e}function a(n,i){try{var o=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Nf(n)}));return e.element(n,i)}(n,i);return r(n),o}catch(i){s(i.message,{element:n,error:i}),console.error(t("failed to import {element}",{element:Nf(n)})),console.error(i)}}function s(t,n){e.error(t,n)}function l(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:Nf(n)}),{element:n}):(Ff.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:Nf(e)}),{element:e})}function c(e){l(e=e.plane),Object(Vl.forEach)(e.planeElement,u)}function u(e){l(e)}function d(){for(;i.length;)i.shift()()}function h(e,t){E(e,t),y(e.ioSpecification,t),b(e.artifacts,t),r(e)}function p(e,t){a(e,t)}function f(e,t){a(e,t)}function m(e,t){a(e,t)}function g(e,t){a(e,t)}function v(e,t){a(e,t)}function b(e,t){Object(Vl.forEach)(e,(function(e){jf(e,"bpmn:Association")?i.push((function(){v(e,t)})):v(e,t)}))}function y(e,t){e&&(Object(Vl.forEach)(e.dataInputs,o(m,t)),Object(Vl.forEach)(e.dataOutputs,o(g,t)))}function w(e,t){E(e,t),b(e.artifacts,t)}function x(e,t){var n=a(e,t);jf(e,"bpmn:SubProcess")&&w(e,n||t),jf(e,"bpmn:Activity")&&y(e.ioSpecification,t),i.push((function(){Object(Vl.forEach)(e.dataInputAssociations,o(f,t)),Object(Vl.forEach)(e.dataOutputAssociations,o(f,t))}))}function _(e,t){i.push((function(){var n,i=a(e,t);e.childLaneSet&&k(e.childLaneSet,i||t),n=e,Object(Vl.forEach)(n.flowNodeRef,(function(e){(e=e.get("lanes"))&&e.push(n)}))}))}function k(e,t){Object(Vl.forEach)(e.lanes,o(_,t))}function E(e,n){var r,l;l=e.flowElements,r=n,Object(Vl.forEach)(l,(function(e){jf(e,"bpmn:SequenceFlow")?i.push((function(){a(e,r)})):jf(e,"bpmn:BoundaryEvent")?i.unshift((function(){x(e,r)})):jf(e,"bpmn:FlowNode")?x(e,r):jf(e,"bpmn:DataObject")||(jf(e,"bpmn:DataStoreReference")||jf(e,"bpmn:DataObjectReference")?function(e,t){a(e,t)}(e,r):s(t("unrecognized flowElement {element} in context {context}",{element:Nf(e),context:r?Nf(r.businessObject):"null"}),{element:e,context:r}))})),e.laneSets&&(l=e.laneSets,e=n,Object(Vl.forEach)(l,o(k,e)))}function C(e,t){var n=a(e,t);(e=e.processRef)&&h(e,n||t)}return{handleDeferred:d,handleDefinitions:function(r,a){var u=r.diagrams;if(a&&-1===u.indexOf(a))throw new Error(t("diagram not part of bpmn:Definitions"));if(!(a=!a&&u&&u.length?u[0]:a))throw new Error(t("no diagram to display"));if(c(a),!(u=a.plane))throw new Error(t("no plane for {element}",{element:Nf(a)}));if(!(a=u.bpmnElement)){if(f=r,!(a=Object(Vl.find)(f.rootElements,(function(e){return jf(e,"bpmn:Process")||jf(e,"bpmn:Collaboration")}))))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Nf(u),rootElement:Nf(a)})),u.bpmnElement=a,l(u)}f=a;var f,m,g=e.root(f,u);if(jf(a,"bpmn:Process"))h(a,g);else{if(!jf(a,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Nf(u),rootElement:Nf(a)}));m=a,Object(Vl.forEach)(m.participants,o(C)),b(m.artifacts),i.push((function(){var e;e=m.messageFlows,Object(Vl.forEach)(e,o(p,void 0))})),u=r.rootElements,a=g,Object(Vl.filter)(u,(function(e){return!n[e.id]&&jf(e,"bpmn:Process")&&e.laneSets})).forEach(o(h,a))}d()},handleSubProcess:w,registerDi:l}}function qf(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");if(!(1<=(n=arguments.length)&&Object(Vl.isFunction)(arguments[n-1])))return e.apply(this,arguments);var t=arguments[n-1],n=(console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html")),Array.prototype.slice.call(arguments,0,-1));e.apply(this,n).then((function(e){var n=Object.keys(e)[0];return t(null,e[n])}),(function(e){return t(e,e.warnings)}))}}var zf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function Vf(e){return e.join(";")}var Wf,Hf=Vf(["color: #404040"]),Uf='<div class="bjs-powered-by-lightbox" style="'+Vf(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Vf(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+Vf(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;'+Hf+'">'+zf+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function Gf(e){var t,n;e=Object(Vl.assign)({},Yf,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=eu('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100; '+Hf+'">'+zf+"</a>"),t.appendChild(n),Xc.bind(n,"click",(function(e){Wf||(Wf=eu(Uf),Zc(Wf,".backdrop","click",(function(e){document.body.removeChild(Wf)}))),document.body.appendChild(Wf),e.preventDefault()})),this._init(this._container,this._moddle,e)}function Kf(e,t){return e.warnings=t,e}H()(Gf,Ep),Gf.prototype.importXML=qf((function(e,t){var n=this;return new Promise((function(i,o){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var r,a=e.rootElement,s=e.references,l=e.warnings;e=e.elementsById,a=n._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:e,references:s,warnings:l},e=n.get("eventBus").createEvent(r),Object.defineProperty(e,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:r.warnings,references:r.references,elementsById:r.elementsById}}}),e))||a;n.importDefinitions(a,t).then((function(e){return e=[].concat(l,e.warnings||[]),n._emit("import.done",{error:null,warnings:e}),i({warnings:e})})).catch((function(e){var t=[].concat(l,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),o(Kf(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:e.warnings}),o(e)}))}))})),Gf.prototype.importDefinitions=qf((function(e,t){var n=this;return new Promise((function(i,o){n._setDefinitions(e),n.open(t).then((function(e){return e=e.warnings,i({warnings:e})})).catch((function(e){return o(e)}))}))})),Gf.prototype.open=qf((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(o,r){var a,s,l;if(!t)return s=new Error("no XML imported"),r(Kf(s,[]));if("string"==typeof e&&(s=t,!(n=(l=e)&&Object(Vl.find)(s.diagrams,(function(e){return e.id===l}))||null)))return a=new Error("BPMNDiagram <"+e+"> not found"),r(Kf(a,[]));try{i.clear()}catch(a){return r(Kf(a,[]))}(function(e,t,n){var i,o,r,a=[];return new Promise((function(s,l){try{return i=e.get("bpmnImporter"),o=e.get("eventBus"),r=e.get("translate"),o.fire("import.render.start",{definitions:t}),new Bf({root:function(e){return i.add(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){a.push({message:e,context:t})}},r).handleDefinitions(t,n),o.fire("import.render.complete",{error:void 0,warnings:a}),s({warnings:a})}catch(s){return s.warnings=a,l(s)}}))})(i,t,n).then((function(e){return e=e.warnings,o({warnings:e})})).catch((function(e){return r(e)}))}))})),Gf.prototype.saveXML=qf((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){return e=e.xml,e=t._emit("saveXML.serialized",{xml:e})||e,i({xml:e})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),Gf.prototype.saveSVG=qf((function(e){var t=this;return new Promise((function(e,n){var i;t._emit("saveSVG.start");try{var o=t.get("canvas"),r=o.getDefaultLayer(),a=nu("defs",o._svg),s=Cc(r),l=a?"<defs>"+Cc(a)+"</defs>":"",c=r.getBBox(),u='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+l+s+"</svg>"}catch(e){i=e}return t._emit("saveSVG.done",{error:i,svg:u}),i?n(i):e({svg:u})}))})),Gf.prototype._setDefinitions=function(e){this._definitions=e},Gf.prototype.getModules=function(){return this._modules},Gf.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach((function(e){(e=e.businessObject)&&e.di&&delete e.di})),Ep.prototype.clear.call(this))},Gf.prototype.destroy=function(){Ep.prototype.destroy.call(this),ou(this._container)},Gf.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Gf.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Gf.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),(e="string"==typeof(e=e.get&&e.constructor.prototype.jquery?e.get(0):e)?nu(e):e).appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Gf.prototype.getDefinitions=function(){return this._definitions},Gf.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Gf.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),o=n.additionalModules||[];t=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,o),i=Object(Vl.assign)(Object(Vl.omit)(n,["additionalModules"]),{canvas:Object(Vl.assign)({},n.canvas,{container:e}),modules:t});Ep.call(this,i),n&&n.container&&this.attachTo(n.container)},Gf.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Gf.prototype._createContainer=function(e){var t=eu('<div class="bjs-container"></div>');return Object(Vl.assign)(t.style,{width:Xf(e.width),height:Xf(e.height),position:e.position}),t},Gf.prototype._createModdle=function(e){return new If(Object(Vl.assign)({},this._moddleExtensions,e.moddleExtensions))},Gf.prototype._modules=[];var Yf={width:"100%",height:"100%",position:"relative"};function Xf(e){return e+(Object(Vl.isNumber)(e)?"px":"")}function Jf(e){Gf.call(this,e),this.on("import.parse.complete",(function(e){e.error||this._collectIds(e.definitions,e.elementsById)}),this),this.on("diagram.destroy",(function(){this.get("moddle").ids.clear()}),this)}H()(Jf,Gf),Jf.prototype._createModdle=function(e){return(e=Gf.prototype._createModdle.call(this,e)).ids=new uu([32,36,1]),e},Jf.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Zf={width:150,height:50};function Qf(e,t,n){for(var i,o,r,a,s,l=e.shift(),c=l;;){if((s=function(e,t){var n;t.textContent=e;try{var i,o=""===e;return t.textContent=o?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},o&&(i.width=0),i}catch(e){return{width:0,height:0}}}(c,n)).width=c?s.width:0," "===c||""===c||s.width<Math.round(t)||c.length<2)return i=e,r=l,a=s,(o=c).length<r.length&&(r=r.slice(o.length).trim(),i.unshift(r)),{width:a.width,height:a.height,text:o};c=function(e,t,n){return t=(t=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),o=[],r=0;if(1<i.length)for(;n=i.shift();){if(!(n.length+r<t)){"-"!==n&&n!==em||o.pop();break}o.push(n),r+=n.length}return(e=o[o.length-1])&&e===em&&(o[o.length-1]="-"),o.join("")}(e,n=Math.max(e.length*(n/t),1)))||e.slice(0,Math.max(Math.round(n-1),1))}(c,s.width,t)}}var em="";function tm(e){this._config=Object(Vl.assign)({},{size:Zf,padding:0,style:{},align:"center-top"},e||{})}function nm(e){var t=Object(Vl.assign)({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=Object(Vl.assign)({},t,{fontSize:n},e&&e.externalStyle||{}),o=new tm({style:t});this.getExternalLabelBounds=function(e,t){return t=o.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i}),{x:Math.round(e.x+e.width/2-t.width/2),y:Math.round(e.y),width:Math.ceil(t.width),height:Math.ceil(t.height)}},this.getTextAnnotationBounds=function(e,n){return n=o.getDimensions(n,{box:e,style:t,align:"left-top",padding:5}),{x:e.x,y:e.y,width:e.width,height:Math.max(30,Math.round(n.height))}},this.createText=function(e,t){return o.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}tm.prototype.createText=function(e,t){return this.layoutText(e,t).element},tm.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},tm.prototype.layoutText=function(e,t){var n,i=Object(Vl.assign)({},this._config.size,t.box),o=Object(Vl.assign)({},this._config.style,t.style),r=(n=(n=t.align||this._config.align).split("-"))[0]||"center",a=n[1]||"top",s=(n=(void 0!==t.padding?t:this._config).padding,Object(Vl.isObject)(n)?Object(Vl.assign)({top:0,left:0,right:0,bottom:0},n):{top:n,left:n,right:n,bottom:n}),l=t.fitBox||!1,c=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(o),u=e.split(/\u00AD?\r?\n/),d=[],h=i.width-s.left-s.right,p=gc("text");for(ic(p,{x:0,y:0}),ic(p,o),(n=document.getElementById("helper-svg"))||(ic(n=gc("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(n)),ec(n,p);u.length;)d.push(Qf(u,h,p));"middle"===a&&(s.top=s.bottom=0);t=Object(Vl.reduce)(d,(function(e,t,n){return e+(c||t.height)}),0)+s.top+s.bottom;var f=Object(Vl.reduce)(d,(function(e,t,n){return t.width>e?t.width:e}),0),m=s.top,g=("middle"===a&&(m+=(i.height-t)/2),m-=(c||d[0].height)/4,gc("text"));return ic(g,o),Object(Vl.forEach)(d,(function(e){var t;switch(m+=c||e.height,r){case"left":t=s.left;break;case"right":t=(l?f:h)-s.right-e.width;break;default:t=Math.max(((l?f:h)-e.width)/2+s.left,0)}var n=gc("tspan");ic(n,{x:t,y:m}),n.textContent=e.text,ec(g,n)})),uc(p),{dimensions:{width:f,height:t},element:g}},nm.$inject=["config.textRenderer"];var im=/\{([^{}]+)\}/g,om=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;zr={__init__:["bpmnRenderer"],bpmnRenderer:["type",hu],textRenderer:["type",nm],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,o=this.pathMap[e],r=(e=t.abspos?(n=t.abspos.x,t.abspos.y):(n=t.containerWidth*t.position.mx,t.containerHeight*t.position.my),{});if(t.position){for(var a=t.containerHeight/o.height*t.yScaleFactor,s=t.containerWidth/o.width*t.xScaleFactor,l=0;l<o.heightElements.length;l++)r["y"+l]=o.heightElements[l]*a;for(var c=0;c<o.widthElements.length;c++)r["x"+c]=o.widthElements[c]*s}return t=o.d,i={mx:n,my:e,e:r},String(t).replace(im,(function(e,t){return e=e,o=n=i,t.replace(om,(function(e,t,n,i,r){t=t||i,o&&"function"==typeof(o=t in o?o[t]:o)&&r&&(o=o())})),o=(null==o||o==n?e:o)+"";var n,o}))}}]};ea={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]};var rm={width:90,height:20};function am(e){return Hl(e,"bpmn:Event")||Hl(e,"bpmn:Gateway")||Hl(e,"bpmn:DataStoreReference")||Hl(e,"bpmn:DataObjectReference")||Hl(e,"bpmn:DataInput")||Hl(e,"bpmn:DataOutput")||Hl(e,"bpmn:SequenceFlow")||Hl(e,"bpmn:MessageFlow")||Hl(e,"bpmn:Group")}function sm(e){return cm(e.label)}function lm(e){return e.waypoints?function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=(t=e[Math.ceil(.01+t)],i=(e=e).length/2-1,o=e[Math.floor(i)],e=e[Math.ceil(.01+i)],{x:o.x+(e.x-o.x)/2,y:o.y+(e.y-o.y)/2}),o=(e=Math.atan((t.y-n.y)/(t.x-n.x)),i.x);return t=i.y,Math.abs(e)<Math.PI/2?t-=15:o+=15,{x:o,y:t}}(e.waypoints):Hl(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+rm.height/2}:{x:e.x+e.width/2,y:e.y+e.height+rm.height/2}}function cm(e){return e&&!!e.labelTarget}function um(e,t){return Object(Vl.assign)({id:e.id,type:e.$type,businessObject:e},t)}function dm(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Nf(n),referenced:Nf(t),property:i}))}function hm(e,t,n,i,o,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=o,this._textRenderer=r}function pm(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function fm(e){return e.originalEvent||e.srcEvent}function mm(e){pm(e),pm(fm(e))}function gm(e){return(e=(e=e.pointers&&e.pointers.length?e.pointers[0]:e).touches&&e.touches.length?e.touches[0]:e)?{x:e.clientX,y:e.clientY}:null}function vm(e,t){return(fm(e)||e).button===t}function bm(e){return vm(e,0)}function ym(e){var t=fm(e)||e;return!!bm(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function wm(e){var t=fm(e)||e;return bm(e)&&t.shiftKey}function xm(e){return!0}function _m(e){return bm(e)||vm(e,1)}function km(e,t,n){var i=this;function o(n,i,o){var r,a;(l[n]||bm)(i)&&(o?a=t.getGraphics(o):(r=i.delegateTarget||i.target)&&(o=t.get(a=r)),a)&&o&&!1===e.fire(n,{element:o,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault())}var r={};function a(e){return r[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":xm,"element.mousedown":_m,"element.mouseup":_m,"element.click":_m,"element.dblclick":_m};function c(e,t,n,i){var a=r[n]=function(e){o(n,e)};i&&(l[n]=i),a.$delegate=Zc(e,"svg, .djs-element",t,a)}function u(e,t,n){(n=a(n))&&Qc(e,t,n.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,Object(Vl.forEach)(s,(function(e,n){u(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,Object(Vl.forEach)(s,(function(e,n){c(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element;t=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:t})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element;t=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:t})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element;e=e.gfx;i.createDefaultHit(t,e)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element;e=e.gfx;i.updateDefaultHit(t,e)}));var d=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),p={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:d};function f(e,t){return t=Object(Vl.assign)({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=p[t];if(!n)throw new Error("invalid hit type <"+t+">");ic(e,n)}function g(e,t){ec(e,t)}this.removeHits=function(e){e=iu(".djs-hit",e),Object(Vl.forEach)(e,uc)},this.createDefaultHit=function(e,t){var n=e.waypoints,i=e.isFrame;return n?this.createWaypointsHit(t,n):this.createBoxHit(t,i?"stroke":"all",{width:e.width,height:e.height})},this.createWaypointsHit=function(e,t){return m(t=Oc(t),"stroke"),g(e,t),t},this.createBoxHit=function(e,t,n){n=Object(Vl.assign)({x:0,y:0},n);var i=gc("rect");return m(i,t),ic(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){if(t=nu(".djs-hit",t))return e.waypoints?ic(t,{points:Ac(e.waypoints)}):ic(t,{width:e.width,height:e.height}),t},this.fire=o,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(i)return o(i,t,n);throw new Error("unmapped DOM event name <"+e+">")},this.mouseHandler=a,this.registerEvent=c,this.unregisterEvent=u}function Em(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),o=this;function r(e){var t=gc("rect");return ic(t,Object(Vl.assign)({x:10,y:10,width:100,height:100},i)),ec(e,t),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=(n=nu(".djs-outline",e=e.gfx))||r(e);o.updateShapeOutline(n,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=(n=nu(".djs-outline",e=e.gfx))||r(e);o.updateConnectionOutline(n,t)}))}function Cm(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){e=e.element,n.deselect(e)})),e.on(["diagram.clear","plane.set"],(function(e){n.select(null)}))}function Sm(e,t,n,i){function o(e,n){t.addMarker(e,n)}function r(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",(function(e){o(e.element,"hover")})),e.on("element.out",(function(e){r(e.element,"hover")})),e.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;Object(Vl.forEach)(t,(function(e){-1===n.indexOf(e)&&r(e,"selected")})),Object(Vl.forEach)(n,(function(e){-1===t.indexOf(e)&&o(e,"selected")}))}))}function Tm(e,t,n,i){e.on("create.end",500,(function(e){var n=(e=e.context).canExecute,i=e.elements;e=(e.hints||{}).autoSelect;n&&!1!==e&&(Object(Vl.isArray)(e)?t.select(e):t.select(i.filter(Am)))})),e.on("connect.end",500,(function(e){var n=(e=e.context).canExecute;e=e.hover;n&&e&&t.select(e)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],o=i.get(e.context.shape.id);Object(Vl.find)(n,(function(e){return o.id===e.id}))||t.select(o)})),e.on("element.click",(function(e){if(bm(e)){var i=e.element,o=(i===n.getRootElement()&&(i=null),t.isSelected(i)),r=1<t.get().length;e=ym(e)||wm(e);if(o&&r)return e?t.deselect(i):t.select(i);o?t.deselect(i):t.select(i,e)}}))}function Am(e){return!e.hidden}function Om(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}hm.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],hm.prototype.add=function(e,t){var n,i=e.di,o=this._translate;if(Hl(i,"bpmndi:BPMNPlane"))c=this._elementFactory.createRoot(um(e)),this._canvas.setRootElement(c);else if(Hl(i,"bpmndi:BPMNShape")){var r=!Kl(e),a=Hl(e,"bpmn:Group"),s=t&&(t.hidden||t.collapsed),l=e.di.bounds,c=this._elementFactory.createShape(um(e,{collapsed:r,hidden:s,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:a}));Hl(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,c),Hl(e,"bpmn:Lane")&&(n=0),Hl(e,"bpmn:DataStoreReference")&&(r=t,l=(a=Tu(l)).x,a=a.y,l>=r.x&&l<=r.x+r.width&&a>=r.y&&a<=r.y+r.height||(t=this._canvas.getRootElement())),this._canvas.addShape(c,t,n)}else{if(!Hl(i,"bpmndi:BPMNEdge"))throw new Error(o("unknown di {di} for element {semantic}",{di:Nf(i),semantic:Nf(e)}));l=this._getSource(e),a=this._getTarget(e),s=t&&(t.hidden||t.collapsed),c=this._elementFactory.createConnection(um(e,{hidden:s,source:l,target:a,waypoints:(r=l,o=a,!(i=(i=e).di.waypoint)||i.length<2?[Tu(r),Tu(o)]:i.map((function(e){return{x:e.x,y:e.y}})))})),Hl(e,"bpmn:DataAssociation")&&(t=null),Hl(e,"bpmn:SequenceFlow")&&(n=0),this._canvas.addConnection(c,t,n)}return am(e)&&Zl(c)&&this.addLabel(e,c),this._eventBus.fire("bpmnElement.added",{element:c}),c},hm.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Nf(e)}));var o=this._elementRegistry.get(i.id),r=o&&o.attachers;if(!o)throw dm(n,e,i,"attachedToRef");t.host=o,r||(o.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},hm.prototype.addLabel=function(e,t){var n,i,o,r;return i=t,(n=(n=e).di.label)&&n.bounds?(n=n.bounds,r={width:Math.max(rm.width,n.width),height:n.height},o={x:n.x+n.width/2,y:n.y+n.height/2}):(o=lm(i),r=rm),n=Object(Vl.assign)({x:o.x-r.width/2,y:o.y-r.height/2},r),(i=Zl(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),o=this._elementFactory.createLabel(um(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!Zl(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(o,t.parent)},hm.prototype._getEnd=function(e,t){var n=e.$type,i=this._translate,o=e[t+"Ref"];if("source"===t&&"bpmn:DataInputAssociation"===n&&(o=o&&o[0]),n=(o="source"===t&&"bpmn:DataOutputAssociation"===n||"target"===t&&"bpmn:DataInputAssociation"===n?e.$parent:o)&&this._getElement(o))return n;throw o?dm(i,e,o,t+"Ref"):new Error(i("{semantic}#{side} Ref not specified",{semantic:Nf(e),side:t}))},hm.prototype._getSource=function(e){return this._getEnd(e,"source")},hm.prototype._getTarget=function(e){return this._getEnd(e,"target")},hm.prototype._getElement=function(e){return this._elementRegistry.get(e.id)},nr={__depends__:[zr,{__depends__:[ea],bpmnImporter:["type",hm]}]},km.$inject=["eventBus","elementRegistry","styles"],tr={__init__:["interactionEvents"],interactionEvents:["type",km]},Em.prototype.updateShapeOutline=function(e,t){ic(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Em.prototype.updateConnectionOutline=function(e,t){ic(e,{x:(t=Ru(t)).x-this.offset,y:t.y-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Em.$inject=["eventBus","styles","elementRegistry"],Wo={__init__:["outline"],outline:["type",Em]},Cm.$inject=["eventBus","canvas"],Cm.prototype.deselect=function(e){var t,n=this._selectedElements;-1!==(e=n.indexOf(e))&&(t=n.slice(),n.splice(e,1),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:n}))},Cm.prototype.get=function(){return this._selectedElements},Cm.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Cm.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice(),o=(Object(Vl.isArray)(e)||(e=e?[e]:[]),this._canvas);e=e.filter((function(e){return o.findPlane(e)===o.getActivePlane()})),t?Object(Vl.forEach)(e,(function(e){-1===n.indexOf(e)&&n.push(e)})):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})},Sm.$inject=["eventBus","canvas","selection","styles"],Tm.$inject=["eventBus","selection","canvas","elementRegistry"],ir={__init__:["selectionVisuals","selectionBehavior"],__depends__:[tr,Wo],selection:["type",Cm],selectionVisuals:["type",Sm],selectionBehavior:["type",Tm]},Om.prototype.next=function(){return this._prefix+ ++this._counter};var Mm=new Om("ov");function Dm(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Mm,this._overlayDefaults=Object(Vl.assign)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(t=n.getContainer(),i=eu('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),t.insertBefore(i,t.firstChild),i),this._init()}function $m(e,t,n){Object(Vl.assign)(e.style,{left:t+"px",top:n+"px"})}function Pm(e,t){e.style.display=!1===t?"none":""}function Rm(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}function Lm(e){Gf.call(this,e)}Dm.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Dm.prototype.get=function(e){var t;return Object(Vl.isString)(e)&&(e={id:e}),Object(Vl.isString)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element?(t=this._getOverlayContainer(e.element,!0))?e.type?Object(Vl.filter)(t.overlays,Object(Vl.matchPattern)({type:e.type})):t.overlays.slice():[]:e.type?Object(Vl.filter)(this._overlays,Object(Vl.matchPattern)({type:e.type})):e.id?this._overlays[e.id]:null},Dm.prototype.add=function(e,t,n){if(Object(Vl.isObject)(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");var i;if(e)return i=this._ids.next(),n=Object(Vl.assign)({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i;throw new Error("invalid element specified")},Dm.prototype.remove=function(e){e=this.get(e)||[];var t=(Object(Vl.isArray)(e)||(e=[e]),this);Object(Vl.forEach)(e,(function(e){var n=t._getOverlayContainer(e.element,!0);e&&(ou(e.html),ou(e.htmlContainer),delete e.htmlContainer,delete e.element,delete t._overlays[e.id]),n&&-1!==(e=n.overlays.indexOf(e))&&n.overlays.splice(e,1)}))},Dm.prototype.show=function(){Pm(this._overlayRoot)},Dm.prototype.hide=function(){Pm(this._overlayRoot,!1)},Dm.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Vc(this._overlayRoot)},Dm.prototype._updateOverlayContainer=function(e){var t,n=e.element,i=e.html,o=n.x,r=n.y;n.waypoints&&(o=(t=Ru(n)).x,r=t.y),$m(i,o,r),Ic(e.html,"data-container-id",n.id)},Dm.prototype._updateOverlay=function(e){var t,n=e.position,i=e.htmlContainer,o=(e=e.element,n.left),r=n.top;void 0!==n.right&&(t=(e.waypoints?Ru(e):e).width,o=-1*n.right+t),void 0!==n.bottom&&(t=(e.waypoints?Ru(e):e).height,r=-1*n.bottom+t),$m(i,o||0,r||0)},Dm.prototype._createOverlayContainer=function(e){var t=eu('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t),t={html:t,element:e,overlays:[]};return this._updateOverlayContainer(t),this._overlayContainers.push(t),t},Dm.prototype._updateRoot=function(e){var t=e.scale||1;e="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Rm(this._overlayRoot,e)},Dm.prototype._getOverlayContainer=function(e,t){var n=Object(Vl.find)(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Dm.prototype._addOverlay=function(e){var t,n,i=e.id,o=e.element,r=((r=e.html).get&&r.constructor.prototype.jquery&&(r=r.get(0)),Object(Vl.isString)(r)&&(r=eu(r)),n=this._getOverlayContainer(o),(t=eu('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(r),e.type&&qc(t).add("djs-overlay-"+e.type),this._canvas.findPlane(o));o=this._canvas.getActivePlane();(e.plane=r)!==o&&Pm(t,!1),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Dm.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=e.plane,o=n&&n.minZoom,r=n&&n.maxZoom,a=!0;Pm(e.htmlContainer,a=!(i!==this._canvas.getActivePlane()||n&&(Object(Vl.isDefined)(o)&&o>t.scale||Object(Vl.isDefined)(r)&&r<t.scale))&&a),this._updateOverlayScale(e,t)},Dm.prototype._updateOverlayScale=function(e,t){var n,i,o=e.scale,r=(e=e.htmlContainer,"");!0!==o&&(o=!1===o?n=1:(n=o.min,o.max),Object(Vl.isDefined)(n)&&t.scale<n&&(i=(1/t.scale||1)*n),Object(Vl.isDefined)(o))&&t.scale>o&&(i=(1/t.scale||1)*o),Rm(e,r=Object(Vl.isDefined)(i)?"scale("+i+","+i+")":r)},Dm.prototype._updateOverlaysVisibilty=function(e){var t=this;Object(Vl.forEach)(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Dm.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",(function(e){t.hide()})),e.on("canvas.viewbox.changed",(function(e){e=e.viewbox,t._updateRoot(e),t._updateOverlaysVisibilty(e),t.show()})),e.on(["shape.remove","connection.remove"],(function(e){e=e.element;var n=t.get({element:e});(n=(Object(Vl.forEach)(n,(function(e){t.remove(e.id)})),t._getOverlayContainer(e)))&&(ou(n.html),-1!==(e=t._overlayContainers.indexOf(n)))&&t._overlayContainers.splice(e,1)})),e.on("element.changed",500,(function(e){e=e.element,(e=t._getOverlayContainer(e,!0))&&(Object(Vl.forEach)(e.overlays,(function(e){t._updateOverlay(e)})),t._updateOverlayContainer(e))})),e.on("element.marker.update",(function(e){var n=t._getOverlayContainer(e.element,!0);n&&qc(n.html)[e.add?"add":"remove"](e.marker)})),e.on("plane.set",(function(e){Object(Vl.forEach)(t._overlays,(function(t){Pm(t.htmlContainer,t.plane===e.plane)}))})),e.on("diagram.clear",this.clear,this)},s={__init__:["overlays"],overlays:["type",Dm]},H()(Lm,Gf),Lm.prototype._modules=[nr,ea,ir,s],Lm.prototype._moddleExtensions={};var Im=["c","C",67],Nm=["v","V",86],Fm=["y","Y",89],jm=["z","Z",90];function Bm(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function qm(e,t){return-1!==(e=Object(Vl.isArray)(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function zm(e){return e.shiftKey}var Vm="keyboard.keydown",Wm="input-handle-modified-keys";function Hm(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",(function(){n._fire("destroy"),n.unbind()})),t.on("diagram.init",(function(){n._fire("init")})),t.on("attach",(function(){e&&e.bindTo&&n.bind(e.bindTo)})),t.on("detach",(function(){n.unbind()}))}function Um(e,t){var n=this;e.on("editorActions.init",500,(function(e){e=e.editorActions,n.registerBindings(t,e)}))}Hm.$inject=["config.keyboard","eventBus"],Hm.prototype._keydownHandler=function(e){this._keyHandler(e,Vm)},Hm.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Hm.prototype._keyHandler=function(e,t){this._isEventIgnored(e)||this._eventBus.fire(t||Vm,{keyEvent:e})&&e.preventDefault()},Hm.prototype._isEventIgnored=function(e){return(t=e.target)&&(Hc(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},Hm.prototype._isModifiedKeyIgnored=function(e){return!Bm(e)||!this._getAllowedModifiers(e.target).includes(e.key)},Hm.prototype._getAllowedModifiers=function(e){return!(e=Uc(e,"["+Wm+"]",!0))||this._node&&!this._node.contains(e)?[]:e.getAttribute(Wm).split(",")},Hm.prototype.bind=function(e){this.unbind(),this._node=e,Xc.bind(e,"keydown",this._keydownHandler,!0),Xc.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},Hm.prototype.getBinding=function(){return this._node},Hm.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Xc.unbind(e,"keydown",this._keydownHandler,!0),Xc.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},Hm.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Hm.prototype.addListener=function(e,t,n){Object(Vl.isFunction)(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Vm,e,t)},Hm.prototype.removeListener=function(e,t){this._eventBus.off(t||Vm,e)},Hm.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Hm.prototype.isCmd=Bm,Hm.prototype.isShift=zm,Hm.prototype.isKey=qm,Um.$inject=["eventBus","keyboard"],Um.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(Bm(e=e=e.keyEvent)&&!zm(e)&&qm(jm,e))return t.trigger("undo"),!0})),n("redo",(function(e){if(Bm(e=e=e.keyEvent)&&(qm(Fm,e)||qm(jm,e)&&zm(e)))return t.trigger("redo"),!0})),n("copy",(function(e){if(Bm(e=e=e.keyEvent)&&qm(Im,e))return t.trigger("copy"),!0})),n("paste",(function(e){if(Bm(e=e=e.keyEvent)&&qm(Nm,e))return t.trigger("paste"),!0})),n("stepZoom",(function(e){if(qm(["+","Add","="],e=e.keyEvent)&&Bm(e))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){if(qm(["-","Subtract"],e=e.keyEvent)&&Bm(e))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){if(qm("0",e=e.keyEvent)&&Bm(e))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(qm(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};Q={__init__:["keyboard","keyboardBindings"],keyboard:["type",Hm],keyboardBindings:["type",Um]};var Gm={moveSpeed:50,moveSpeedAccelerated:200};function Km(e,t,n){var i=this;this._config=Object(Vl.assign)({},Gm,e||{}),t.addListener((function(e){e=e.keyEvent;var n=i._config;if(t.isCmd(e)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],e)){var o;n=t.isShift(e)?n.moveSpeedAccelerated:n.moveSpeed;switch(e.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:n,direction:o}),!0}})),this.moveCanvas=function(e){var t=0,i=0,o=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=o;break;case"up":i=o;break;case"right":t=-o;break;case"down":i=-o}n.scroll({dx:t,dy:i})}}Km.$inject=["config.keyboardMove","keyboard","canvas"];qr={__depends__:[Q],__init__:["keyboardMove"],keyboardMove:["type",Km]};var Ym=/^djs-cursor-.*$/;function Xm(e){var t=qc(document.body);t.removeMatching(Ym),e&&t.add("djs-cursor-"+e)}function Jm(){Xm(null)}function Zm(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Qm(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function eg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tg(e,t){var n;function i(i){var o,r=n.start,a=n.button,s=gm(i);r=eg(s,r);!n.dragging&&(o=r,15<Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2)))&&(n.dragging=!0,0===a&&Zm(e),Xm("grab")),n.dragging&&(r=eg(s,n.last||n.start),t.scroll({dx:r.x,dy:r.y}),n.last=s),i.preventDefault()}function o(e){Xc.unbind(document,"mousemove",i),Xc.unbind(document,"mouseup",o),n=null,Jm()}e.on("element.mousedown",500,(function(e){if(!Uc((e=e.originalEvent).target,".djs-draggable")){var t=e.button;if(!(2<=t||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:gm(e)},Xc.bind(document,"mousemove",i),Xc.bind(document,"mouseup",o),!0}})),this.isActive=function(){return!!n}}function ng(e){return Math.log(e)/Math.log(10)}function ig(e,t){var n=ng(e.min);e=ng(e.max);return(Math.abs(n)+Math.abs(e))/t}tg.$inject=["eventBus","canvas"],ee={__init__:["moveCanvas"],moveCanvas:["type",tg]};var og=Math.sign||function(e){return 0<=e?1:-1},rg={min:.2,max:4};function ag(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Object(Vl.bind)(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}function sg(e){Lm.call(this,e)}ag.$inject=["config.zoomScroll","eventBus","canvas"],ag.prototype.scroll=function(e){this._canvas.scroll(e)},ag.prototype.reset=function(){this._canvas.zoom("fit-viewport")},ag.prototype.zoom=function(e,t){var n=ig(rg,20);this._totalDelta+=e,.1<Math.abs(this._totalDelta)&&(this._zoom(e,t,n),this._totalDelta=0)},ag.prototype._handleWheel=function(e){var t,n,i,o,r;Uc(e.target,".djs-scrollable",!0)||(o=this._container,e.preventDefault(),i=e.ctrlKey,t=e.shiftKey,n=-1*this._scale,n*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i?(i=o.getBoundingClientRect(),o={x:e.clientX-i.left,y:e.clientY-i.top},r=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*og(e.deltaY)*n,this.zoom(r,o)):(r=t?{dx:n*e.deltaY,dy:0}:{dx:n*e.deltaX,dy:n*e.deltaY},this.scroll(r)))},ag.prototype.stepZoom=function(e,t){var n=ig(rg,10);this._zoom(e,t,n)},ag.prototype._zoom=function(e,t,n){var i=this._canvas,o=(e=0<e?1:-1,ng(i.zoom()));o=Math.round(o/n)*n,o+=n*e,n=Math.pow(10,o);i.zoom(Math.max(rg.min,Math.min(rg.max,n)),t)},ag.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return i!==(e=void 0===e?!i:e)&&Xc[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e},ag.prototype._init=function(e){this.toggle(e)},te={__init__:["zoomScroll"],zoomScroll:["type",ag]},H()(sg,Lm),sg.prototype._modules=[].concat(Lm.prototype._modules,sg.prototype._navigationModules=[qr,ee,te]);zr=n(30);var lg=n.n(zr),cg=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ug(e,t){return t.get(e,!1)}function dg(e){e.preventDefault(),"function"==typeof e.stopPropagation?e.stopPropagation():e.srcEvent&&"function"==typeof e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation()}function hg(e){function t(t){setTimeout((function(){Object(Vl.forEach)(cg,(function(t){Xc.unbind(e,t,dg,!0)}))}),500)}Xc.bind(e,"touchstart",(function(t){Object(Vl.forEach)(cg,(function(t){Xc.bind(e,t,dg,!0)}))}),!0),Xc.bind(e,"touchend",t,!0),Xc.bind(e,"touchcancel",t,!0);var n=new lg.a.Manager(e,{inputClass:lg.a.TouchInput,recognizers:[],domEvents:!0}),i=new lg.a.Tap,o=new lg.a.Pan({threshold:10}),r=new lg.a.Press,a=new lg.a.Pinch,s=new lg.a.Tap({event:"doubletap",taps:2});return a.requireFailure(o),a.requireFailure(r),n.add([o,r,a,s,i]),n.reset=function(e){var t=this.recognizers,i=this.session;i.stopped||(n.stop(e),setTimeout((function(){for(var e,n=0;e=t[n];n++)e.reset(),e.state=8;i.curRecognizer=null}),0))},n.on("hammer.input",(function(e){e.srcEvent.defaultPrevented&&n.reset(!0)})),n}function pg(e,t,n,i,o){var r,a=ug("dragging",e),s=ug("move",e),l=ug("contextPad",e),c=ug("palette",e);function u(e,t){return function(n){var r=(r=d(n.target))&&i.get(r);return t&&(n.srcEvent.button=t),o.fire(e,n,r)}}function d(e){return Uc(e,"svg, .djs-element",!0)}a&&n.on("drag.move",(function(e){var t,n=e.originalEvent;!n||n instanceof MouseEvent||(n=gm(n),(t=(n=d(document.elementFromPoint(n.x,n.y)))&&i.get(n))!==e.hover&&(e.hover&&a.out(e),t)&&(a.hover({element:t,gfx:n}),e.hover=t,e.hoverGfx=n))})),l&&n.on("contextPad.create",(function(e){(e=hg(e.pad.html)).on("panstart",(function(e){l.trigger("dragstart",e,!0)})),e.on("press",(function(e){l.trigger("dragstart",e,!0)})),e.on("tap",(function(e){l.trigger("click",e)}))})),c&&n.on("palette.create",(function(e){(e=hg(e.container)).on("panstart",(function(e){c.trigger("dragstart",e,!0)})),e.on("press",(function(e){c.trigger("dragstart",e,!0)})),e.on("tap",(function(e){c.trigger("click",e)}))})),n.on("canvas.init",(function(e){!function(e){function n(e){var n,o,a=(a=d(e.target))&&i.get(a);if(s&&t.getRootElement()!==a)return s.start(e,a,!0);function l(e){var i=e.deltaX-n,r=e.deltaY-o;t.scroll({dx:i,dy:r}),n=e.deltaX,o=e.deltaY}function c(e){r.off("panmove",l),r.off("panend",c),r.off("pancancel",c)}o=n=0,r.on("panmove",l),r.on("panend",c),r.on("pancancel",c)}(r=hg(e)).on("tap",u("element.click")),r.on("doubletap",u("element.dblclick",1)),r.on("panstart",n),r.on("press",n),r.on("pinchstart",(function(e){var n=t.zoom(),i=e.center;function o(e){var o=1-(1-e.scale)/1.5;o=Math.max(.2,Math.min(4,o*n));t.zoom(o,i),dg(e)}function a(e){r.off("pinchmove",o),r.off("pinchend",a),r.off("pinchcancel",a),r.reset(!0)}r.on("pinchmove",o),r.on("pinchend",a),r.on("pinchcancel",a)}))}(e.svg)}))}function fg(e,t){var n=this;t.on("canvas.init",(function(e){n.addBBoxMarker(e.svg)}))}function mg(e){return e&&e[e.length-1]}function gg(e){return e.y}function vg(e){return e.x}pg.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],fg.$inject=["canvas","eventBus"],fg.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=(ic(n=gc("rect"),{x:-1e4,y:1e4,width:10,height:10}),ic(n,t),ec(e,n),gc("rect"));ic(n,{x:1e4,y:1e4,width:10,height:10}),ic(n,t),ec(e,n)},nr={__depends__:[{__depends__:[tr],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",pg],touchFix:["type",fg]}]};var bg={left:vg,center:vg,right:function(e){return e.x+e.width},top:gg,middle:gg,bottom:function(e){return e.y+e.height}};function yg(e){this._modeling=e}yg.$inject=["modeling"],yg.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},yg.prototype._isType=function(e,t){return-1!==t.indexOf(e)},yg.prototype._alignmentPosition=function(e,t){var n,i,o=(a=this._getOrientationDetails(e)).axis,r=a.dimension,a={},s={},l=!1;if(this._isType(e,["left","top"]))a[e]=t[0][o];else if(this._isType(e,["right","bottom"]))i=mg(t),a[e]=i[o]+i[r];else if(this._isType(e,["center","middle"])){if(Object(Vl.forEach)(t,(function(e){var t=e[o]+Math.round(e[r]/2);s[t]?s[t].elements.push(e):s[t]={elements:[e],center:t}})),n=Object(Vl.sortBy)(s,(function(e){return 1<e.elements.length&&(l=!0),e.elements.length})),l)return a[e]=mg(n).center,a;n=t[0],i=mg(t=Object(Vl.sortBy)(t,(function(e){return e[o]+e[r]}))),a[e]=(t=i,Math.round((n[o]+t[o]+t[r])/2))}return a},yg.prototype.trigger=function(e,t){var n,i=this._modeling;(e=Object(Vl.filter)(e,(function(e){return!(e.waypoints||e.host||e.labelTarget)}))).length<2||(n=bg[t],e=Object(Vl.sortBy)(e,n),n=this._alignmentPosition(t,e),i.alignElements(e,n))};zr={__init__:["alignElements"],alignElements:["type",yg]};function wg(e,t,n,i){for(var o;o=function(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};t=function(e){var t=_g(e);return e.host&&(t=t.concat(_g(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((function(e,t){return e.concat(_g(t))}),[]))),t}(e);return Object(Vl.find)(t,(function(e){return e!==n&&"intersect"===Au(e,i,10)}))}(e,n,t);)n=i(t,n,o);return n}function xg(e){return function(t,n,i){var o={x:n.x,y:n.y};return["x","y"].forEach((function(r){var a,s,l=e[r];l&&(a="x"===r?"width":"height",s=l.margin,l=l.minDistance,o[r]=s<0?Math.min(i[r]+s-t[a]/2,n[r]-l+s):Math.max(i[r]+i[a]+s+t[a]/2,n[r]+l+s))})),o}}function _g(e){return e.outgoing.map((function(e){return e.target})).concat(e.incoming.map((function(e){return e.source})))}function kg(){return!0}function Eg(e,t,n){e.on("autoPlace",100,(function(e){var t,n,i=e.shape;e=e.source;return i=i,t=(t=t||{}).defaultDistance||50,n=Tu(e=e),{x:Cu(e).right+t+i.width/2,y:n.y}})),e.on("autoPlace.end",(function(e){n.scrollToElement(e.shape)})),this.append=function(n,i,o){e.fire("autoPlace.start",{source:n,shape:i});var r=e.fire("autoPlace",{source:n,shape:i});i=t.appendShape(n,i,r,n.parent,o);return e.fire("autoPlace.end",{source:n,shape:i}),i}}function Cg(e,t){e.on("autoPlace.end",500,(function(e){t.select(e.shape)}))}Eg.$inject=["eventBus","modeling","canvas"],Cg.$inject=["eventBus","selection"];var Sg={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Eg],autoPlaceSelectionBehavior:["type",Cg]};function Tg(e,t){var n,i,o,r,a,s;return Hl(t,"bpmn:TextAnnotation")?wg(e,t,n={x:(n=Cu(e)).right+t.width/2,y:n.top-50-t.height/2},xg({y:{margin:-30,minDistance:20}})):Ul(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?wg(e,t,n={x:(n=Cu(e)).right-10+t.width/2,y:n.bottom+40+t.width/2},xg({x:{margin:30,minDistance:30}})):Hl(t,"bpmn:FlowNode")?(t=t,i=Cu(e=e),o=Tu(e),r=function(e,t){var n=(t=t||{}).defaultDistance||50,i=t.direction||"e",o=t.filter,r=t.getWeight||function(t){return t.source===e?1:-1},a=t.maxDistance||250,s=t.reference||"start";function l(e,t){return"n"===i?"start"===s?Cu(e).top-Cu(t).bottom:"center"===s?Cu(e).top-Tu(t).y:Cu(e).top-Cu(t).top:"w"===i?"start"===s?Cu(e).left-Cu(t).right:"center"===s?Cu(e).left-Tu(t).x:Cu(e).left-Cu(t).left:"s"===i?"start"===s?Cu(t).top-Cu(e).bottom:"center"===s?Tu(t).y-Cu(e).bottom:Cu(t).bottom-Cu(e).bottom:"start"===s?Cu(t).left-Cu(e).right:"center"===s?Tu(t).x-Cu(e).right:Cu(t).right-Cu(e).right}return o=o||kg,t=e.incoming.filter(o).map((function(t){var n=r(t),i=n<0?l(t.source,e):l(e,t.source);return{id:t.source.id,distance:i,weight:n}})),o=e.outgoing.filter(o).map((function(t){var n=r(t),i=0<n?l(e,t.target):l(t.target,e);return{id:t.target.id,distance:i,weight:n}})),t=t.concat(o).reduce((function(e,t){return e[t.id+"__weight_"+t.weight]=t,e}),{}),Object(Vl.reduce)(t,(function(e,t){var n=t.distance;t=t.weight;return n<0||a<n||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=+t,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e}),{}).distance||n}(e,{filter:function(e){return Hl(e,"bpmn:SequenceFlow")}}),a=30,s="left",Hl(e,"bpmn:BoundaryEvent")&&-1!==(s=Au(e,e.host,-25)).indexOf("top")&&(a*=-1),i={x:i.right+r+t.width/2,y:o.y+function(e,t){return-1!=e.indexOf("top")?-80:-1!=e.indexOf("bottom")?80:0}(s)},wg(e,t,i,xg({y:{margin:a,minDistance:80}}))):void 0}function Ag(e){e.on("autoPlace",(function(e){var t=e.shape;return Tg(e.source,t)}))}function Og(e){this._eventBus=e}function Mg(e,t,n,i){Og.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var o=this;this.postExecuted(["shape.create"],(function(e){var t=(e=e.context).hints||{},n=e.shape;e=e.parent||e.newParent;!1!==t.autoResize&&o._expand([n],e)})),this.postExecuted(["elements.move"],(function(e){e=e.context;var t=Object(Vl.flatten)(Object(Vl.values)(e.closure.topLevel)),n=!(e=e.hints)||e.autoResize;!1!==n&&(e=Object(Vl.groupBy)(t,(function(e){return e.parent.id})),Object(Vl.forEach)(e,(function(e,t){Object(Vl.isArray)(n)&&(e=e.filter((function(e){return Object(Vl.find)(n,Object(Vl.matchPattern)({id:e.id}))}))),o._expand(e,t)})))})),this.postExecuted(["shape.toggleCollapse"],(function(e){var t=(e=e.context).hints;e=e.shape;t&&!1===t.autoResize||e.collapsed||o._expand(e.children||[],e)})),this.postExecuted(["shape.resize"],(function(e){var t=(e=e.context).hints,n=(e=e.shape).parent;t&&!1===t.autoResize||n&&o._expand([e],n)}))}function Dg(e){e.invoke(Mg,this)}function $g(e){Og.call(this,e),this.init()}function Pg(e){$g.call(this,e);var t=this;this.addRule("element.autoResize",(function(e){return t.canResize(e.elements,e.target)}))}function Rg(e,t){Pg.call(this,e),this._modeling=t}Ag.$inject=["eventBus"],Sg={__depends__:[Sg],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Ag]},Og.$inject=["eventBus"],Og.prototype.on=function(e,t,n,i,o,r){if((Object(Vl.isFunction)(t)||Object(Vl.isNumber)(t))&&(r=o,o=i,i=n,n=t,t=null),Object(Vl.isFunction)(n)&&(r=o,o=i,i=n,n=1e3),Object(Vl.isObject)(o)&&(r=o,o=!1),!Object(Vl.isFunction)(i))throw new Error("handlerFn must be a function");Object(Vl.isArray)(e)||(e=[e]);var a=this._eventBus;Object(Vl.forEach)(e,(function(e){var s,l;e=["commandStack",e,t].filter((function(e){return e})).join(".");a.on(e,n,o?(s=i,l=r,function(e){return s.call(l||null,e.context,e.command,e)}):i,r)}))},Object(Vl.forEach)(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){Og.prototype[e]=function(t,n,i,o,r){(Object(Vl.isFunction)(t)||Object(Vl.isNumber)(t))&&(r=o,o=i,i=n,n=t,t=null),this.on(t,e,n,i,o,r)}})),Mg.$inject=["eventBus","elementRegistry","modeling","rules"],H()(Mg,Og),Mg.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),o=(e=Cu(Ru(e)),t=Cu(t),{});return e.top-t.top<i.top&&(o.top=e.top-n.top),e.left-t.left<i.left&&(o.left=e.left-n.left),t.right-e.right<i.right&&(o.right=e.right+n.right),t.bottom-e.bottom<i.bottom&&(o.bottom=e.bottom+n.bottom),Su(Object(Vl.assign)({},t,o))},Mg.prototype._expand=function(e,t){var n,i;"string"==typeof t&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})&&(i=t,(n=e=this._getOptimalBounds(e,t)).x!==i.x||n.y!==i.y||n.width!==i.width||n.height!==i.height)&&(n=function(e,t){var n="";return e=Cu(e),t=Cu(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}(Object(Vl.pick)(t,["x","y","width","height"]),e),this.resize(t,e,{autoResize:n}),i=t.parent)&&this._expand([t],i)},Mg.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Mg.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Mg.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},Dg.$inject=["injector"],H()(Dg,Mg),Dg.prototype.resize=function(e,t,n){Hl(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},$g.$inject=["eventBus"],H()($g,Og),$g.prototype.addRule=function(e,t,n){var i=this;(e="string"==typeof e?[e]:e).forEach((function(e){i.canExecute(e,t,(function(e,t,i){return n(e)}),!0)}))},$g.prototype.init=function(){},Pg.$inject=["eventBus"],H()(Pg,$g),Pg.prototype.canResize=function(e,t){return!1},H()(Rg,Pg),Rg.$inject=["eventBus","modeling"],Rg.prototype.canResize=function(e,t){var n;return!!(Hl(t,"bpmn:Participant")||Hl(t,"bpmn:Lane")||Hl(t,"bpmn:SubProcess"))&&(n=!0,Object(Vl.forEach)(e,(function(e){(Hl(e,"bpmn:Lane")||e.labelTarget)&&(n=!1)})),n)};var Lg={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Dg],bpmnAutoResizeProvider:["type",Rg]};function Ig(e,t,n){var i,o,r=this,a=n.get("dragging",!1);a&&t.on("drag.start",(function(n){t.once("drag.move",1500,(function(t){var n,i,o;(t=t).hover||(n=t.originalEvent,o=(i=r._findTargetGfx(n))&&e.get(i),i&&o&&(t.stopPropagation(),a.hover({element:o,gfx:i}),a.move(n)))}))})),t.on("element.hover",(function(e){i=e.gfx,o=e.element})),t.on("element.hover",1500,(function(e){o&&t.fire("element.out",{element:o,gfx:i})})),t.on("element.out",(function(){o=i=null})),this._findTargetGfx=function(e){if(e instanceof MouseEvent)return e=gm(e),Uc(document.elementFromPoint(e.x,e.y),"svg, .djs-element",!0)}}Ig.$inject=["elementRegistry","eventBus","injector"];var Ng={__init__:["hoverFix"],hoverFix:["type",Ig]},Fg=Math.round,jg="djs-drag-active";function Bg(e){e.preventDefault()}function qg(e,t,n,i){var o,r={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||o;var i=e.createEvent(Object(Vl.assign)({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function l(e,i){var r,l=o.payload,c=o.displacement,u=o.globalStart,d=(u=eg(r=gm(e),u),o.localStart),h=eg(r=a(r),d);if(!o.active&&(i||(i=u,Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))>o.threshold))){if(Object(Vl.assign)(l,{x:Fg(d.x+c.x),y:Fg(d.y+c.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return m();o.active=!0,o.keepSelection||(l.previousSelection=n.get(),n.select(null)),o.cursor&&Xm(o.cursor),t.addMarker(t.getRootElement(),jg)}mm(e),o.active&&(Object(Vl.assign)(l,{x:Fg(r.x+c.x),y:Fg(r.y+c.y),dx:Fg(h.x),dy:Fg(h.y)},{originalEvent:e}),s("move"))}function c(e){var t=!0;o.active&&(e&&mm(o.payload.originalEvent=e),t=s("end")),!1===t&&s("rejected"),s("ended",g(!0!==t))}function u(e){27===e.which&&(Bg(e),m())}function d(t){var n;o.active&&(n=Zm(e),setTimeout(n,400),Bg(t)),c(t)}function h(e){l(e)}function p(e){var t=o.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function f(e){s("out");var t=o.payload;t.hoverGfx=null,t.hover=null}function m(e){var t;o&&((t=o.active)&&s("cancel"),e=g(e),t)&&s("canceled",e)}function g(r){s("cleanup"),Jm(),a=o.trapClick?d:c,Xc.unbind(document,"mousemove",l),Xc.unbind(document,"dragstart",Bg),Xc.unbind(document,"selectstart",Bg),Xc.unbind(document,"mousedown",a,!0),Xc.unbind(document,"mouseup",a,!0),Xc.unbind(document,"keyup",u),Xc.unbind(document,"touchstart",h,!0),Xc.unbind(document,"touchcancel",m,!0),Xc.unbind(document,"touchmove",l,!0),Xc.unbind(document,"touchend",c,!0),e.off("element.hover",p),e.off("element.out",f),t.removeMarker(t.getRootElement(),jg);var a=o.payload.previousSelection;return!1!==r&&a&&!n.get().length&&(r=(r=a).filter((function(e){return i.get(e.id)}))).length&&n.select(r),a=o,o=null,a}e.on("diagram.destroy",m),this.init=function(t,n,i,g){o&&m(!1),"string"==typeof n&&(g=i,i=n,n=null);var v,b,y,w,x=(g=Object(Vl.assign)({},r,g||{})).data||{},_=g.trapClick?d:c;t?(w=fm(t)||t,v=gm(t),mm(t),"dragstart"===w.type&&Bg(w)):(w=null,v={x:0,y:0}),b=a(v),n=n||b,w=w,y="undefined"!=typeof TouchEvent&&w instanceof TouchEvent,o=Object(Vl.assign)({prefix:i,data:x,payload:{},globalStart:v,displacement:eg(n,b),localStart:b,isTouch:y},g),g.manual||(y?(Xc.bind(document,"touchstart",h,!0),Xc.bind(document,"touchcancel",m,!0),Xc.bind(document,"touchmove",l,!0),Xc.bind(document,"touchend",c,!0)):(Xc.bind(document,"mousemove",l),Xc.bind(document,"dragstart",Bg),Xc.bind(document,"selectstart",Bg),Xc.bind(document,"mousedown",_,!0),Xc.bind(document,"mouseup",_,!0)),Xc.bind(document,"keyup",u),e.on("element.hover",p),e.on("element.out",f)),s("init"),g.autoActivate&&l(t,!0)},this.move=l,this.hover=p,this.out=f,this.end=c,this.cancel=m,this.context=function(){return o},this.setOptions=function(e){Object(Vl.assign)(r,e)}}function zg(e,t,n){this._canvas=n,this._opts=Object(Vl.assign)({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",(function(e){e=i._toBorderPoint(e),i.startScroll(e)})),t.on(["drag.cleanup"],(function(){i.stopScroll()}))}qg.$inject=["eventBus","canvas","selection","elementRegistry"],Ng={__depends__:[Ng,ir],dragging:["type",qg]},zg.$inject=["config.autoScroll","eventBus","canvas"],zg.prototype.startScroll=function(e){for(var t=this._canvas,n=this._opts,i=this,o=t.getContainer().getBoundingClientRect(),r=[e.x,e.y,o.width-e.x,o.height-e.y],a=(this.stopScroll(),0),s=0,l=0;l<4;l++)!function(e,t,n){if(t<e&&e<n)return 1}(r[l],n.scrollThresholdOut[l],n.scrollThresholdIn[l])||(0===l?a=n.scrollStep:1==l?s=n.scrollStep:2==l?a=-n.scrollStep:3==l&&(s=-n.scrollStep));0===a&&0===s||(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout((function(){i.startScroll(e)}),n.scrollRepeatTimeout))},zg.prototype.stopScroll=function(){clearTimeout(this._scrolling)},zg.prototype.setOptions=function(e){this._opts=Object(Vl.assign)({},this._opts,e)},zg.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect();return{x:(e=gm(e.originalEvent)).x-t.left,y:e.y-t.top}};var Vg={__depends__:[Ng],__init__:["autoScroll"],autoScroll:["type",zg]};function Wg(e){this._commandStack=e.get("commandStack",!1)}Wg.$inject=["injector"],Wg.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return void 0===(n=i?i.canExecute(e,t):n)||n};var Hg={__init__:["rules"],rules:["type",Wg]},Ug=Math.round,Gg=Math.max;function Kg(e,t){return function(e,t){for(var n,i=0;n=e[i];i++)if(vu(n,t)<=10)return{point:e[i],bendpoint:!0,index:i};return null}(e,t)||(e=e,t=t,i=(t=_u()([["M",t.x,t.y],["m",0,-10],["a",10,10,0,1,1,0,20],["a",10,10,0,1,1,0,-20],["z"]],(n=[],e.forEach((function(e,t){n.push([0===t?"M":"L",e.x,e.y])})),n)))[0],t=t[t.length-1],i?i!==t?i.segment2!==t.segment2?{point:e[e=Gg(i.segment2,t.segment2)-1],bendpoint:!0,index:e}:{point:{x:Ug(i.x+t.x)/2,y:Ug(i.y+t.y)/2},index:i.segment2}:{point:{x:Ug(i.x),y:Ug(i.y)},index:i.segment2}:null);var n,i}var Yg="djs-bendpoint",Xg="djs-segment-dragger";function Jg(e,t,n){var i;return e=e,n=gm(n=n),i={x:(i=e._container.getBoundingClientRect()).left,y:i.top},Kg(t,{x:(e=e.viewbox()).x+(n.x-i.x)/e.scale,y:e.y+(n.y-i.y)/e.scale})}function Zg(e,t){var n=gc("g");ic(e=(lc(n).add(Yg),ec(e,n),gc("circle")),{cx:0,cy:0,r:4}),lc(e).add("djs-visual"),ec(n,e),e=gc("circle");return ic(e,{cx:0,cy:0,r:10}),lc(e).add("djs-hit"),ec(n,e),t&&lc(n).add(t),n}function Qg(e,t,n){var i=gc("g"),o=xu(t,n),r=yu(t,n);return ec(e,i),function(e,t,n,i){var o=gc("g"),r=(n=(ec(e,o),r=(e=n).x-t.x,e=n.y-t.y,ev("h"===i?r:e)),ic(t=gc("rect"),{x:-7,y:-1.5,width:14,height:3}),lc(t).add("djs-visual"),ec(o,t),gc("rect"));ic(r,{x:-n/2,y:-7,width:n,height:14}),lc(r).add("djs-hit"),ec(o,r),su(o,"v"===i?90:0)}(i,t,n,r),lc(i).add(Xg),lc(i).add("h"===r?"horizontal":"vertical"),au(i,o.x,o.y),i}function ev(e){return Math.abs(Math.round(2*e/3))}function tv(e,t,n,i,o){function r(e,t,i){Xc.bind(e,t,(function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()}))}function a(e,n){var i=t.getLayer("overlays"),o=nu('.djs-bendpoints[data-element-id="'+Eh()(e.id)+'"]',i);return!o&&n&&(ic(o=gc("g"),{"data-element-id":e.id}),lc(o).add("djs-bendpoints"),ec(i,o),r(o,"mousedown",e),r(o,"click",e),r(o,"dblclick",e)),o}function s(e,t){return nu('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function l(e,t){t.waypoints.forEach((function(t,n){var i=Zg(e);ec(e,i),au(i,t.x,t.y)})),Zg(e,"floating")}function c(e,t){for(var n,i,o=t.waypoints,a=1;a<o.length;a++)yu(i=o[a-1],n=o[a])&&(ic(i=Qg(e,i,n),{"data-segment-idx":a}),r(i,"mousemove",t))}function u(e){var t=a(e);return t||(l(t=a(e,!0),e),c(t,e)),t}function d(e){var t,n=a(e);n&&(t=n,Object(Vl.forEach)(iu("."+Xg,t),(function(e){uc(e)})),t=n,Object(Vl.forEach)(iu("."+Yg,t),(function(e){uc(e)})),c(n,e),l(n,e))}e.on("connection.changed",(function(e){d(e.element)})),e.on("connection.remove",(function(e){(e=a(e.element))&&uc(e)})),e.on("element.marker.update",(function(e){var t=e.element;t.waypoints&&(t=u(t),e.add?lc(t).add(e.marker):lc(t).remove(e.marker))})),e.on("element.mousemove",(function(e){var n,i,o=e.element,r=o.waypoints;r&&(o=a(o,!0),e=Jg(t,r,e.originalEvent))&&(i=e,n=nu(".floating",n=o),i=i.point,n&&au(n,i.x,i.y),e.bendpoint||function(e,t,n){e=s(t.index,e);var i=n[t.index-1],o=(n=n[t.index],t=t.point,xu(i,n));i=yu(i,n),e&&(n=nu(".djs-visual",e),e={x:t.x-o.x,y:t.y-o.y},au(n,(e="v"===i?{x:e.y,y:e.x}:e).x,e.y))}(o,e,r))})),e.on("element.mousedown",(function(e){if(bm(e)){var n=e.originalEvent;if((e=e.element).waypoints)return function(e,n){var r,a,s,l,c=n.waypoints,u=Jg(t,c,e);if(u)return r=u,a=(a=n).waypoints,r=r.index<=0||r.bendpoint||!(r=yu((a={start:a[r.index-1],end:a[r.index]}).start,a.end))?null:ev("h"===r?a.end.x-a.start.x:a.end.y-a.start.y)/2,a=c,c=r,s=(r=u).index,l=r.point,!(s<=0||r.bendpoint)&&(s=xu(r=a[s-1],a=a[s]),r=yu(r,a),a=Math.abs(l.x-s.x),l=Math.abs(l.y-s.y),r)&&a<=c&&l<=c?o.start(e,n,u.index):i.start(e,n,u.index,!u.bendpoint),!0}(n,e)}})),e.on("selection.changed",(function(e){(e=e.newSelection[0])&&e.waypoints&&u(e)})),e.on("element.hover",(function(e){var t=e.element;t.waypoints&&(u(t),n.registerEvent(e.gfx,"mousemove","element.mousemove"))})),e.on("element.out",(function(e){n.unregisterEvent(e.gfx,"mousemove","element.mousemove")})),e.on("element.updateId",(function(e){var t=e.element;e=e.newId;t.waypoints&&(t=a(t))&&ic(t,{"data-element-id":e})})),this.addHandles=u,this.updateHandles=d,this.getBendpointsContainer=a,this.getSegmentDragger=s}tv.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var nv=Math.round,iv="reconnectStart",ov="reconnectEnd",rv="updateWaypoints";function av(e,t,n,i,o,r){this._injector=e,this.start=function(e,t,r,a){var s=n.getGraphics(t),l=t.source,c=t.target,u=t.waypoints,d=(u=a||0!==r?a||r!==u.length-1?rv:ov:iv)===rv?"connection.updateWaypoints":"connection.reconnect",h=o.allowed(d,{connection:t,source:l,target:c});!1!==(h=!1===h?o.allowed(d,{connection:t,source:c,target:l}):h)&&i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:s,context:{allowed:h,bendpointIndex:r,connection:t,source:l,target:c,insert:a,type:u}}})},t.on("bendpoint.move.hover",(function(e){var t,n,i=e.context,r=i.connection,a=r.source,s=r.target,l=(e=e.hover,i.type);(i.hover=e)&&((n=i.allowed=o.allowed(t=l===rv?"connection.updateWaypoints":"connection.reconnect",{connection:r,source:l===iv?e:a,target:l===ov?e:s}))?(i.source=l===iv?e:a,i.target=l===ov?e:s):(n=!1===n?i.allowed=o.allowed(t,{connection:r,source:l===ov?e:s,target:l===iv?e:a}):n)&&(i.source=l===ov?e:s,i.target=l===iv?e:a))})),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],(function(e){var t=(e=e.context).type;e.hover=null,e.source=null,e.target=null,t!==rv&&(e.allowed=!1)})),t.on("bendpoint.move.end",(function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,o=t.connection,a=t.insert,s=o.waypoints.slice(),l=t.source,c=t.target,u=t.type,d=t.hints||{};e={x:nv(e.x),y:nv(e.y)};if(!n)return!1;u===rv?(a?s.splice(i,0,e):s[i]=e,d.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(o,s),r.updateWaypoints(o,function(e){e=e.slice();for(var t,n,i,o=0;e[o];)t=e[o],n=e[o-1],0===vu(t,i=e[o+1])||bu(n,i,t)?e.splice(o,1):o++;return e}(s),d)):(u===iv?(d.docking="source",sv(t)&&(d.docking="target",d.newWaypoints=s.reverse())):u===ov&&(d.docking="target",sv(t))&&(d.docking="source",d.newWaypoints=s.reverse()),r.reconnect(o,l,c,e,d))}),this)}function sv(e){var t=e.hover,n=e.source,i=e.target;return(e=e.type)===iv?t&&i&&t===i&&n!==i:e===ov&&t&&n&&t===n&&n!==i}av.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],av.prototype.cropWaypoints=function(e,t){var n,i=this._injector.get("connectionDocking",!1);return i&&(n=e.waypoints,e.waypoints=t,e.waypoints=i.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=n),t};var lv="updateWaypoints",cv="connect-ok",uv="connect-not-ok",dv="connect-hover",hv="djs-updating",pv="djs-element-hidden";function fv(e,t,n,i){var o=(this._injector=t).get("connectionPreview",!1);n.on("bendpoint.move.start",(function(e){var t=e.context,n=t.bendpointIndex,o=t.connection,r=t.insert,a=o.waypoints,s=a.slice();t.waypoints=a,r&&s.splice(n,0,{x:e.x,y:e.y}),o.waypoints=s,lc(t.draggerGfx=Zg(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(o,pv),i.addMarker(o,hv)})),n.on("bendpoint.move.hover",(function(e){var t=(e=e.context).allowed,n=e.hover;e=e.type;n&&(i.addMarker(n,dv),e!==lv)&&(t?(i.removeMarker(n,uv),i.addMarker(n,cv)):!1===t&&(i.removeMarker(n,cv),i.addMarker(n,uv)))})),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,(function(e){var t=(e=e.context).hover;e=e.target;t&&(i.removeMarker(t,dv),i.removeMarker(t,e?cv:uv))})),n.on("bendpoint.move.move",(function(t){var n=t.context,i=n.allowed,r=n.bendpointIndex,a=n.draggerGfx,s=n.hover,l=n.type,c=n.connection,u=c.source,d=c.target,h=c.waypoints.slice(),p={x:t.x,y:t.y},f=n.hints||{},m={};o&&(f.connectionStart&&(m.connectionStart=f.connectionStart),f.connectionEnd&&(m.connectionEnd=f.connectionEnd),"reconnectStart"===l?sv(n)?(m.connectionEnd=m.connectionEnd||p,m.source=d,m.target=s||u,h=h.reverse()):(m.connectionStart=m.connectionStart||p,m.source=s||u,m.target=d):"reconnectEnd"===l?sv(n)?(m.connectionStart=m.connectionStart||p,m.source=s||d,m.target=u,h=h.reverse()):(m.connectionEnd=m.connectionEnd||p,m.source=u,m.target=s||d):(m.noCropping=!0,m.noLayout=!0,h[r]=p),l===lv&&(h=e.cropWaypoints(c,h)),m.waypoints=h,o.drawPreview(n,i,m)),au(a,t.x,t.y)}),this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,(function(e){var t=(e=e.context).connection,n=e.draggerGfx,r=e.hover,a=e.target,s=e.waypoints;t.waypoints=s,uc(n),i.removeMarker(t,hv),i.removeMarker(t,pv),r&&(i.removeMarker(r,cv),i.removeMarker(r,a?cv:uv)),o&&o.cleanUp(e)}))}fv.$inject=["bendpointMove","injector","eventBus","canvas"];var mv="connect-hover",gv="djs-updating";function vv(e,t,n){return bv(e,t,e[t]+n)}function bv(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function yv(e){return"x"===e?"y":"x"}function wv(e,t,n){return e.original||(t=Tu(t),bv(e,e=yv(n),t[e]))}function xv(e,t,n,i,o,r){var a=e.get("connectionDocking",!1);function s(e,t){var n,i;return a?(n=e.waypoints,e.waypoints=t,i=a.getCroppedWaypoints(e),e.waypoints=n,i):t}function l(e){o.update("connection",e.connection,e.connectionGfx)}this.start=function(e,t,o){var r=n.getGraphics(t),a=o-1,s=t.waypoints,l=s[a],c=s[o],u=Jg(n,s,e),d=yu(l,c);d&&(d="v"===d?"x":"y",0==a&&(l=wv(l,t.source,d)),o===s.length-1&&(c=wv(c,t.target,d)),s=u?u.point:{x:(l.x+c.x)/2,y:(l.y+c.y)/2},i.init(e,s,"connectionSegment.move",{cursor:"x"==d?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:r,context:{connection:t,segmentStartIndex:a,segmentEndIndex:o,segmentStart:l,segmentEnd:c,axis:d,dragPosition:s}}}))},t.on("connectionSegment.move.start",(function(e){var t=e.context,i=(e=e.connection,n.getLayer("overlays"));t.originalWaypoints=e.waypoints.slice(),t.draggerGfx=Qg(i,t.segmentStart,t.segmentEnd),lc(t.draggerGfx).add("djs-dragging"),n.addMarker(e,gv)})),t.on("connectionSegment.move.move",(function(e){var t,n=e.context,i=n.connection,o=n.segmentStartIndex,r=n.segmentEndIndex,a=n.segmentStart,c=n.segmentEnd,u=n.axis,d=n.originalWaypoints.slice(),h=vv(a,u,e["d"+u]),p=(u=vv(c,u,e["d"+u]),d.length),f=0;d[o]=h,d[r]=u,o<2&&(t=Au(i.source,h),1===o?"intersect"===t&&(d.shift(),d[0]=h,f--):"intersect"!==t&&(d.unshift(a),f++)),p-3<r&&(h=Au(i.target,u),r===p-2?"intersect"===h&&(d.pop(),d[d.length-1]=u):"intersect"!==h&&d.push(c)),n.newWaypoints=i.waypoints=s(i,d),function(e,t,n){var i,o,r=(n=n,r=r=(o=e.newWaypoints)[e.segmentStartIndex+t],o=o=o[e.segmentEndIndex+t],t=t=yv(e.axis),i=Math.max(r[t],o[t]),o=Math.min(r[t],o[t]),bv(r,t,Math.min(Math.max(o+20,n[t]),i-20)));au(e.draggerGfx,r.x,r.y)}(n,f,e),n.newSegmentStartIndex=o+f,l(e)})),t.on("connectionSegment.move.hover",(function(e){e.context.hover=e.hover,n.addMarker(e.hover,mv)})),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],(function(e){(e=e.context.hover)&&n.removeMarker(e,mv)})),t.on("connectionSegment.move.cleanup",(function(e){var t=(e=e.context).connection;e.draggerGfx&&uc(e.draggerGfx),n.removeMarker(t,gv)})),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],(function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,l(e)})),t.on("connectionSegment.move.end",(function(e){var t,n,i,o=(e=e.context).connection,a=e.newWaypoints,l=e.newSegmentStartIndex,c=(a=a.map((function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}})),s(o,(a=(n=l,i=0,{waypoints:(t=a).filter((function(e,o){return!bu(t[o-1],t[o+1],e)||(i=o<=n?i-1:i,!1)})),segmentOffset:i})).waypoints));e={segmentMove:{segmentStartIndex:e.segmentStartIndex,newSegmentStartIndex:l+a.segmentOffset}};r.updateWaypoints(o,c,e)}))}xv.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var _v=Math.abs,kv=Math.round;function Ev(e){return{x:e.x,y:e.y}}function Cv(e){return{x:e.x+e.width,y:e.y+e.height}}function Sv(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:kv(e.x+e.width/2),y:kv(e.y+e.height/2)}}function Tv(e,t){return!!(e=e.snapped)&&("string"==typeof t?e[t]:e.x&&e.y)}function Av(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i=e[t],o=e.snapped=e.snapped||{};!1===n?o[t]=!1:(o[t]=!0,e[t]+=o=n-i,e["d"+t]+=o)}function Ov(e){return e.children||[]}var Mv=Math.abs,Dv=Math.round;function $v(e){function t(e,t){if(Object(Vl.isArray)(e)){for(var n=e.length;n--;)if(Mv(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(e-10<i)return t-i+e}return t}function n(e){if(e.width)return{x:Dv(e.width/2+e.x),y:Dv(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,(function(e){var i,o,r,a,s,l=e.context,c=(i=(l=l).snapPoints,r=(a=l.connection).waypoints,s=l.segmentStart,u=l.segmentStartIndex,c=l.segmentEnd,d=l.segmentEndIndex,o=l.axis,i||(s=[r[u-1],s,c,r[d+1]],u<2&&s.unshift(n(a.source)),d>r.length-3&&s.unshift(n(a.target)),l.snapPoints=i={horizontal:[],vertical:[]},Object(Vl.forEach)(s,(function(e){e&&(e=e.original||e,"y"===o&&i.horizontal.push(e.y),"x"===o)&&i.vertical.push(e.x)}))),i),u=e.x,d=e.y;c&&(a=u-(r=t(c.vertical,u)),s=d-(l=t(c.horizontal,d)),Object(Vl.assign)(e,{dx:e.dx-a,dy:e.dy-s,x:r,y:l}),!a&&-1===c.vertical.indexOf(u)||Av(e,"x",r),!s&&-1===c.horizontal.indexOf(d)||Av(e,"y",l))})),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,(function(e){var i,o,r,a,s=e.context,l=(i=(u=s).snapPoints,c=u.connection.waypoints,l=u.bendpointIndex,i||(c=[c[l-1],c[l+1]],u.snapPoints=i={horizontal:[],vertical:[]},Object(Vl.forEach)(c,(function(e){e&&(e=e.original||e,i.horizontal.push(e.y),i.vertical.push(e.x))}))),i),c=(u=s.hover)&&n(u),u=(s=e.x,e.y);l&&(r=s-(o=t(c?l.vertical.concat([c.x]):l.vertical,s)),a=u-(c=t(c?l.horizontal.concat([c.y]):l.horizontal,u)),Object(Vl.assign)(e,{dx:e.dx-r,dy:e.dy-a,x:e.x-r,y:e.y-a}),!r&&-1===l.vertical.indexOf(s)||Av(e,"x",o),!a&&-1===l.horizontal.indexOf(u)||Av(e,"y",c))}))}$v.$inject=["eventBus"];var Pv={__depends__:[Ng,Hg],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",tv],bendpointMove:["type",av],bendpointMovePreview:["type",fv],connectionSegmentMove:["type",xv],bendpointSnapping:["type",$v]};function Rv(e,t,n,i){function o(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",(function(e){var t,n=e.context,i=n.start;e=e.hover;n.hover=e,t=n.canExecute=o(i,e),Object(Vl.isNil)(t)||(!1!==t?(n.source=i,n.target=e):(t=n.canExecute=o(e,i),Object(Vl.isNil)(t)||!1!==t&&(n.source=e,n.target=i)))})),e.on(["connect.out","connect.cleanup"],(function(e){(e=e.context).hover=null,e.source=null,e.target=null,e.canExecute=!1})),e.on("connect.end",(function(e){var t=(s=e.context).canExecute,i=s.connectionStart,o=(e={x:e.x,y:e.y},s.source),r=s.target;if(!t)return!1;var a=null,s={connectionStart:Lv(s)?e:i,connectionEnd:Lv(s)?i:e};Object(Vl.isObject)(t)&&(a=t),n.connect(o,r,a,s)})),this.start=function(e,n,i,o){Object(Vl.isObject)(i)||(o=i,i=Tu(n)),t.init(e,"connect",{autoActivate:o,data:{shape:n,context:{start:n,connectionStart:i}}})}}function Lv(e){var t=e.hover,n=e.source;e=e.target;return t&&n&&t===n&&n!==e}Rv.$inject=["eventBus","dragging","modeling","rules"];var Iv="connect-ok",Nv="connect-not-ok";function Fv(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",(function(e){var t=e.context,n=t.canExecute,o=t.hover,r=t.source,a=t.start,s=t.startPosition,l=t.target,c=s=t.connectionStart||s,u=e=t.connectionEnd||{x:e.x,y:e.y};Lv(t)&&(c=e,u=s),i.drawPreview(t,n,{source:r||a,target:l||o,connectionStart:c,connectionEnd:u})})),t.on("connect.hover",900,(function(e){var t=e.context;e=e.hover;null!==(t=t.canExecute)&&n.addMarker(e,t?Iv:Nv)})),t.on(["connect.out","connect.cleanup"],1100,(function(e){(e=e.hover)&&(n.removeMarker(e,Iv),n.removeMarker(e,Nv))})),i&&t.on("connect.cleanup",(function(e){i.cleanUp(e.context)}))}Fv.$inject=["injector","eventBus","canvas"];var jv={__depends__:[ir,Hg,Ng],__init__:["connectPreview"],connect:["type",Rv],connectPreview:["type",Fv]};function Bv(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Bv.$inject=["injector","canvas","graphicsFactory","elementFactory"],Bv.prototype.drawPreview=function(e,t,n){var i,o,r,a=e.connectionPreviewGfx,s=e.getConnection,l=(n=n||{}).source,c=n.target,u=n.waypoints,d=n.connectionStart,h=n.connectionEnd,p=n.noLayout,f=n.noCropping,m=n.noNoop,g=this;dc(a=a||(e.connectionPreviewGfx=this.createConnectionPreviewGfx())),s=s||(e.getConnection=(o=function(e,t,n){return g.getConnection(e,t,n)},r={},function(e){return e=JSON.stringify(e),r[e]||(r[e]=o.apply(null,arguments))})),(i=t?s(t,l,c):i)?(i.waypoints=u||[],this._layouter&&!p&&(i.waypoints=this._layouter.layoutConnection(i,{source:l,target:c,connectionStart:d,connectionEnd:h,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[l?Tu(l):d,c?Tu(c):h]),this._connectionDocking&&(l||c)&&!f&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,l,c)),this._graphicsFactory.drawConnection(a,i)):m||this.drawNoopPreview(a,n)},Bv.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,o=t.connectionStart||Tu(n);t=t.connectionEnd||Tu(i),o=this.cropWaypoints(o,t,n,i);ec(e,this.createNoopConnection(o[0],o[1]))},Bv.prototype.cropWaypoints=function(e,t,n,i){var o=this._graphicsFactory,r=n&&o.getShapePath(n),a=i&&o.getShapePath(i);o=o.getConnectionPath({waypoints:[e,t]});return[e=n&&Ou(r,o,!0)||e,t=i&&Ou(a,o,!1)||t]},Bv.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&uc(e.connectionPreviewGfx)},Bv.prototype.getConnection=function(e){return e=e,e=Object(Vl.isObject)(e)?e:{},this._elementFactory.createConnection(e)},Bv.prototype.createConnectionPreviewGfx=function(){var e=gc("g");return ic(e,{pointerEvents:"none"}),lc(e).add("djs-connection-preview"),ec(this._canvas.getActiveLayer(),e),e},Bv.prototype.createNoopConnection=function(e,t){var n=gc("polyline");return ic(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),ic(n,{points:[e.x,e.y,t.x,t.y]}),n};var qv={__init__:["connectionPreview"],connectionPreview:["type",Bv]};function zv(e,t){return e&&"function"==typeof e.matches&&e.matches(t)}Object.prototype.toString,Object.prototype.hasOwnProperty,Object.prototype.toString;var Vv={},Wv=window.addEventListener?"addEventListener":"attachEvent",Hv=window.removeEventListener?"removeEventListener":"detachEvent",Uv="addEventListener"!=Wv?"on":"",Gv=function(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){var i;"default"===n||n in e||(i=Object.getOwnPropertyDescriptor(t,n),Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}}))}))})),Object.freeze(e)}({__proto__:null,bind:Vv.bind=function(e,t,n,i){return e[Wv](Uv+t,n,i||!1),n},unbind:Vv.unbind=function(e,t,n,i){return e[Hv](Uv+t,n,i||!1),n},default:Vv},[Vv]),Kv=["focus","blur"],Yv=function(e,t,n,i,o){return-1!==Kv.indexOf(n)&&(o=!0),Gv.bind(e,n,(function(n){var o=n.target||n.srcElement;n.delegateTarget=function(e,t,n){for(var i=e;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(zv(i,t))return i;i=i.parentNode}return zv(i,t)?i:null}(o,t),n.delegateTarget&&i.call(e,n)}),o)},Xv=function(e,t,n,i){return-1!==Kv.indexOf(t)&&(i=!0),Gv.unbind(e,t,n,i)};Vv=!1;(sw=("undefined"!=typeof document&&((sw=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Vv=!sw.getElementsByTagName("link").length,sw=void 0),{legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Vv?[1,"X<div>","</div>"]:[0,"",""]})).td=sw.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],sw.option=sw.optgroup=[1,'<select multiple="multiple">',"</select>"],sw.thead=sw.tbody=sw.colgroup=sw.caption=sw.tfoot=[1,"<table>","</table>"],sw.polyline=sw.ellipse=sw.polygon=sw.circle=sw.text=sw.line=sw.path=sw.rect=sw.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Jv={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Zv(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=Jv[i];o?(2===o&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function Qv(e,t,n){if("string"==typeof t){if(void 0===n)return l=e,Jv[c=t]?l.style[c]:l.getAttributeNS(null,c);Zv(e,t,n)}else for(var i,o=e,r=t,a=Object.keys(r),s=0;i=a[s];s++)Zv(o,i,r[i]);var l,c}function eb(e){var t=e.parentNode;return t&&t.removeChild(e),e}Object.prototype.toString;var tb="http://www.w3.org/2000/svg",nb='<svg xmlns="'+tb+'"';function ib(e,t){var n="<"===e.charAt(0)?(n=function(e){var t=!1,n=("<svg"===e.substring(0,4)?-1===e.indexOf(tb)&&(e=nb+e.substring(4)):(e=nb+">"+e+"</svg>",t=!0),e=e,(n=new DOMParser).async=!1,n.parseFromString(e,"text/xml"));if(!t)return n;for(var i=document.createDocumentFragment(),o=n.firstChild;o.firstChild;)i.appendChild(o.firstChild);return i}(e).firstChild,document.importNode(n,!0)):document.createElementNS(tb,e);return t&&Qv(n,t),n}function ob(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function rb(e){return!0}function ab(e){return Zu(e)||Ju(e,1)}function sb(e,t,n){var i=this;function o(n,i,o){var r,a;(l[n]||Zu)(i)&&(o?a=t.getGraphics(o):(r=i.delegateTarget||i.target)&&(o=t.get(a=r)),a)&&o&&!1===e.fire(n,{element:o,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault())}var r={};function a(e){return r[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":rb,"element.mousedown":ab,"element.mouseup":ab,"element.click":ab,"element.dblclick":ab};function c(e,t,n,i){var a=r[n]=function(e){o(n,e)};i&&(l[n]=i),a.$delegate=Yv(e,"svg, .djs-element",t,a)}function u(e,t,n){(n=a(n))&&Xv(e,t,n.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,fd(s,(function(e,n){u(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,fd(s,(function(e,n){c(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element;t=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:t})})),e.on(["shape.changed","connection.changed"],500,(function(t){var n=t.element;t=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:t})})),e.on("interactionEvents.createHit",500,(function(e){var t=e.element;e=e.gfx;i.createDefaultHit(t,e)})),e.on("interactionEvents.updateHit",(function(e){var t=e.element;e=e.gfx;i.updateDefaultHit(t,e)}));var d=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),p={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:d,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=vd({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=p[t];if(!n)throw new Error("invalid hit type <"+t+">");Qv(e,n)}function g(e,t){!function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e)}this.removeHits=function(e){fd((e||document).querySelectorAll(".djs-hit"),eb)},this.createDefaultHit=function(e,t){var n=e.waypoints,i=e.isFrame;return n?this.createWaypointsHit(t,n):this.createBoxHit(t,i?"stroke":"all",{width:e.width,height:e.height})},this.createWaypointsHit=function(e,t){var n;return t=t,Qv(n=ib("polyline"),{points:ob(t)}),m(t=n,"stroke"),g(e,t),t},this.createBoxHit=function(e,t,n){n=vd({x:0,y:0},n);var i=ib("rect");return m(i,t),Qv(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n;if(n=".djs-hit",t=(t||document).querySelector(n))return e.waypoints?Qv(n=t,{points:ob(e.waypoints)}):Qv(t,{width:e.width,height:e.height}),t},this.fire=o,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(i)return o(i,t,n);throw new Error("unmapped DOM event name <"+e+">")},this.mouseHandler=a,this.registerEvent=c,this.unregisterEvent=u}sb.$inject=["eventBus","elementRegistry","styles"];Vv={__init__:["interactionEvents"],interactionEvents:["type",sb]};var lb=Math.min,cb=Math.max;function ub(e){e.preventDefault()}function db(e){e.stopPropagation()}function hb(e){this.container=e.container,this.parent=eu('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=nu("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Object(Vl.bind)(this.autoResize,this),this.handlePaste=Object(Vl.bind)(this.handlePaste,this)}function pb(e,t){this._eventBus=e,this._providers=[],this._textbox=new hb({container:t.getContainer(),keyHandler:Object(Vl.bind)(this._handleKey,this),resizeHandler:Object(Vl.bind)(this._handleResize,this)})}function fb(e,t,n){this._eventBus=t,this._overlays=n,t=Object(Vl.isDefined)(e&&e.scale)?e.scale:{min:1,max:1.5},this._overlaysConfig={position:{right:-9,top:-6},scale:t},this._current=null,this._init()}hb.prototype.create=function(e,t,n,i){var o=this.parent,r=this.content,a=this.container,s=(i=this.options=i||{},t=this.style=t||{},Object(Vl.pick)(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]));Object(Vl.assign)(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},s),e=Object(Vl.pick)(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return Object(Vl.assign)(r.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},e),i.centerVertically&&Object(Vl.assign)(r.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},e),r.innerText=n,Xc.bind(r,"keydown",this.keyHandler),Xc.bind(r,"mousedown",db),Xc.bind(r,"paste",this.handlePaste),i.autoResize&&Xc.bind(r,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(o),this.setSelection(r.lastChild,r.lastChild&&r.lastChild.length),o},hb.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault(),e=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(e),t.autoResize&&(e=this.autoResize(n))&&this.resizeHandler(e)},hb.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,"\n"),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},hb.prototype._insertTextIE=function(e){var t,n,i,o,r=(o=this.getSelection()).startContainer,a=o.endContainer,s=o.startOffset,l=o.endOffset,c=(c=(o=o.commonAncestorContainer).childNodes,[].slice.call(c)),u=o.nodeType===Node.TEXT_NODE?(o=r.textContent,r.textContent=o.substring(0,s)+e+o.substring(l),t=r,s+e.length):r===this.content&&a===this.content?(o=document.createTextNode(e),this.content.insertBefore(o,c[s]),(t=o).textContent.length):(n=c.indexOf(r),i=c.indexOf(a),c.forEach((function(t,o){o===n?t.textContent=r.textContent.substring(0,s)+e+a.textContent.substring(l):n<o&&o<=i&&ou(t)})),t=r,s+e.length);t&&void 0!==u&&setTimeout((function(){self.setSelection(t,u)}))},hb.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n)&&(n=e.getBoundingClientRect(),t=t.scrollHeight,e.style.height=t+"px",this.resizeHandler({width:n.width,height:n.height,dx:0,dy:t-n.height}))},hb.prototype.resizable=function(){var e,t,n,i,o,r,a=this,s=this.parent,l=this.resizeHandle,c=parseInt(this.style.minWidth)||0,u=parseInt(this.style.minHeight)||0,d=parseInt(this.style.maxWidth)||1/0,h=parseInt(this.style.maxHeight)||1/0;l||(l=this.resizeHandle=eu('<div class="djs-direct-editing-resize-handle"></div>'),o=function(o){ub(o),db(o);var r=lb(cb(n+o.clientX-e,c),d),l=lb(cb(i+o.clientY-t,u),h);s.style.width=r+"px",s.style.height=l+"px",a.resizeHandler({width:n,height:i,dx:o.clientX-e,dy:o.clientY-t})},r=function(e){ub(e),db(e),Xc.unbind(document,"mousemove",o,!1),Xc.unbind(document,"mouseup",r,!1)},Xc.bind(l,"mousedown",(function(a){ub(a),db(a),e=a.clientX,t=a.clientY,a=s.getBoundingClientRect(),n=a.width,i=a.height,Xc.bind(document,"mousemove",o),Xc.bind(document,"mouseup",r)}))),Object(Vl.assign)(l.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),s.appendChild(l)},hb.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),Xc.unbind(t,"keydown",this.keyHandler),Xc.unbind(t,"mousedown",db),Xc.unbind(t,"input",this.autoResize),Xc.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),ou(n)),ou(e)},hb.prototype.getValue=function(){return this.content.innerText.trim()},hb.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},hb.prototype.setSelection=function(e,t){var n=document.createRange();(e=(null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t)),window.getSelection())).removeAllRanges(),e.addRange(n)},pb.$inject=["eventBus","canvas"],pb.prototype.registerProvider=function(e){this._providers.push(e)},pb.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},pb.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},pb.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},pb.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},pb.prototype.complete=function(){var e,t,n,i=this._active;i&&(e=i.context.bounds,t=this.$textbox.getBoundingClientRect(),(n=this.getValue())===i.context.text&&t.height===e.height&&t.width===e.width||(e=this._textbox.container.getBoundingClientRect(),i.provider.update(i.element,n,i.context.text,{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height})),this._fire("complete"),this.close())},pb.prototype.getValue=function(){return this._textbox.getValue()},pb.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},pb.prototype._handleResize=function(e){this._fire("resize",e)},pb.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=Object(Vl.find)(this._providers,(function(n){return(t=n.activate(e))?n:null}));return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t},sw={__depends__:[Vv],__init__:["directEditing"],directEditing:["type",pb]},fb.$inject=["config.contextPad","eventBus","overlays"],fb.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",(function(e){1===(e=e.newSelection).length?t.open(e[0]):t.close()})),e.on("elements.delete",(function(e){e=e.elements,Object(Vl.forEach)(e,(function(e){t.isOpen(e)&&t.close()}))})),e.on("element.changed",(function(e){e=e.element;var n=t._current;n&&n.element===e&&t.open(e,!0)}))},fb.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,(function(e){e.providers.push(t)}))},fb.prototype.getEntries=function(e){var t=this._getProviders(),n={};return Object(Vl.forEach)(t,(function(t){t=t.getContextPadEntries(e),Object(Vl.isFunction)(t)?n=t(n):Object(Vl.forEach)(t,(function(e,t){n[t]=e}))})),n},fb.prototype.trigger=function(e,t,n){var i=this._current.element,o=this._current.entries,r=t.delegateTarget||t.target;if(!r)return t.preventDefault();if(o=o[Ic(r,"data-action")].action,r=t.originalEvent||t,Object(Vl.isFunction)(o)){if("click"===e)return o(r,i,n)}else if(o[e])return o[e](r,i,n);t.preventDefault()},fb.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},fb.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},fb.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;Object(Vl.forEach)(t,(function(e,t){var n,o=e.group||"default",r=eu(e.html||'<div class="entry" draggable="true"></div>');Ic(r,"data-action",t),(t=nu("[data-group="+o+"]",i))||(t=eu('<div class="group" data-group="'+o+'"></div>'),i.appendChild(t)),t.appendChild(r),e.className&&(o=e.className,n=qc(r),(Object(Vl.isArray)(o)?o:o.split(/\s+/g)).forEach((function(e){n.add(e)}))),e.title&&Ic(r,"title",e.title),e.imageUrl&&r.appendChild(eu('<img src="'+e.imageUrl+'">'))})),qc(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},fb.prototype.getPad=function(e){var t,n,i,o;return this.isOpen()?this._current.pad:(n=(t=this)._overlays,o=eu('<div class="djs-context-pad"></div>'),i=Object(Vl.assign)({html:o},this._overlaysConfig),Zc(o,".entry","click",(function(e){t.trigger("click",e)})),Zc(o,".entry","dragstart",(function(e){t.trigger("dragstart",e)})),Xc.bind(o,"mousedown",(function(e){e.stopPropagation()})),this._overlayId=n.add(e,"context-pad",i),o=n.get(this._overlayId),this._eventBus.fire("contextPad.create",{element:e,pad:o}),o)},fb.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},fb.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};Vv={__depends__:[tr,s],contextPad:["type",fb]};var mb=["marker-start","marker-mid","marker-end"],gb=["circle","ellipse","line","path","polygon","polyline","rect"];function vb(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var o=this;t.on("drag.cleanup",(function(){Object(Vl.forEach)(o._clonedMarkers,(function(e){uc(e)})),o._clonedMarkers={}}))}vb.$inject=["elementRegistry","eventBus","canvas","styles"],vb.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},vb.prototype.addDragger=function(e,t,n){return e=hc(n=n||this.getGfx(e)),n=n.getBoundingClientRect(),this._cloneMarkers(wp(e)),ic(e,this._styles.cls("djs-dragger",[],{x:n.top,y:n.left})),ec(t,e),e},vb.prototype.addFrame=function(e,t){return ec(t,e=gc("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y})),e},vb.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);-1!==gb.indexOf(e.nodeName)&&mb.forEach((function(n){var i,o,r;ic(e,n)&&(i=e,o=n,r=t._canvas.getContainer(),i=nu("marker#"+ic(i,o).match(/url\(['"]?#([^'"]*)['"]?\)/)[1],r||document),t._cloneMarker(e,i,n))}))},vb.prototype._cloneMarker=function(e,t,n){var i=t.id,o=this._clonedMarkers[i];o||((o=hc(t)).id=i+"-clone",lc(o).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=o,(t=nu("defs",this._canvas._svg))||(t=gc("defs"),ec(this._canvas._svg,t)),ec(t,o)),ic(e,n,"url(#"+this._clonedMarkers[i].id+")")};var bb={__init__:["previewSupport"],previewSupport:["type",vb]},yb="drop-not-ok",wb="new-parent";function xb(e,t,n,i,o){function r(t,n){["attach-ok","drop-ok",yb,wb].forEach((function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)}))}function a(){var e=t.context();e&&"create"===e.prefix&&t.cancel()}n.on(["create.move","create.hover"],(function(e){var t=e.context,n=t.elements,i=e.hover,a=t.source,s=t.hints||{};i?(_b(e),e={x:e.x,y:e.y},n=t.canExecute=i&&function(e,t,n,i,r){if(!t)return!1;e=Object(Vl.filter)(e,(function(t){var n=t.labelTarget;return!(t.parent||t.labelTarget&&-1!==e.indexOf(n))}));var a=Object(Vl.find)(e,(function(e){return!kb(e)})),s=!1,l=!1,c=!1;(s=Eb(e)?o.allowed("shape.attach",{position:n,shape:a,target:t}):s)||(c=Eb(e)?o.allowed("shape.create",{position:n,shape:a,source:i,target:t}):o.allowed("elements.create",{elements:e,position:n,target:t})),n=r.connectionTarget;return c||s?{attach:s,connect:l=a&&i?o.allowed("connection.create",{source:n===i?a:i,target:n===i?i:a,hints:{targetParent:t,targetAttach:s}}):l}:(null===c||null===s)&&null}(n,i,e,a,s),i&&null!==n&&(t.target=i,n&&n.attach?r(i,"attach-ok"):r(i,n?wb:yb))):(t.canExecute=!1,t.target=null)})),n.on(["create.end","create.out","create.cleanup"],(function(e){(e=e.hover)&&r(e,null)})),n.on("create.end",(function(e){var t=e.context,n=t.source,o=t.shape,r=t.elements,a=t.target,s=t.canExecute,l=s&&s.attach,c=s&&s.connect,u=t.hints||{};if(!1===s||!a)return!1;_b(e),s={x:e.x,y:e.y},o=c?i.appendShape(n,o,s,a,{attach:l,connection:!0===c?{}:c,connectionTarget:u.connectionTarget}):(r=i.createElements(r,s,a,Object(Vl.assign)({},u,{attach:l})),Object(Vl.find)(r,(function(e){return!kb(e)}))),Object(Vl.assign)(t,{elements:r,shape:o}),Object(Vl.assign)(e,{elements:r,shape:o})})),n.on("create.init",(function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,(function(){n.off("elements.changed",a)}))})),this.start=function(e,n,i){Object(Vl.isArray)(n)||(n=[n]);var o,r=Object(Vl.find)(n,(function(e){return!kb(e)}));r&&(i=Object(Vl.assign)({elements:n,hints:{},shape:r},i||{}),Object(Vl.forEach)(n,(function(e){Object(Vl.isNumber)(e.x)||(e.x=0),Object(Vl.isNumber)(e.y)||(e.y=0)})),o=Ru(n),Object(Vl.forEach)(n,(function(e){kb(e)&&(e.waypoints=Object(Vl.map)(e.waypoints,(function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}}))),Object(Vl.assign)(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})})),t.init(e,"create",{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}}))}}function _b(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom)&&(e.y=Math.min(e.y,t.bottom))}function kb(e){return e.waypoints}function Eb(e){return e&&1===e.length&&!kb(e[0])}function Cb(e,t,n,i,o){t.on("create.move",750,(function(t){var r,a,s=t.hover,l=t.context,c=l.elements,u=(u=l.dragGroup)||(l.dragGroup=(l=c,ic(r=gc("g"),o.cls("djs-drag-group",["no-events"])),a=gc("g"),l.forEach((function(e){var t;e.hidden||(e.waypoints?(t=n._createContainer("connection",a),n.drawConnection(wp(t),e)):(t=n._createContainer("shape",a),n.drawShape(wp(t),e),au(t,e.x,e.y)),i.addDragger(e,r,t))})),r));s?(u.parentNode||ec(e.getActiveLayer(),u),au(u,t.x,t.y)):uc(u)})),t.on("create.cleanup",(function(e){(e=e.context.dragGroup)&&uc(e)}))}xb.$inject=["canvas","dragging","eventBus","modeling","rules"],Cb.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Sb={__depends__:[Ng,bb,Hg,ir],__init__:["create","createPreview"],create:["type",xb],createPreview:["type",Cb]},Tb=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Ab(e,t,n){e=Object(Vl.isDefined)(e&&e.scale)?e.scale:{min:1,max:1.5},this._config={scale:e},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}Ab.$inject=["config.popupMenu","eventBus","canvas"],Ab.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,(function(e){e.providers.push(n)}))},Ab.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");var n;if(t)return!(t=this._getProviders(t))||(n=this._getEntries(e,t),e=this._getHeaderEntries(e,t),t=0<Object(Vl.size)(n),n=e&&0<Object(Vl.size)(e),!t&&!n);throw new Error("providerId parameter is missing")},Ab.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");t=this._current={className:t,element:e,position:n};var o=this._getEntries(e,i);e=this._getHeaderEntries(e,i);t.entries=Object(Vl.assign)({},o,e),t.container=this._createContainer(),Object(Vl.size)(e)&&t.container.appendChild(this._createEntries(e,"djs-popup-header")),Object(Vl.size)(o)&&t.container.appendChild(this._createEntries(o,"djs-popup-body")),i=this._canvas.getContainer(),this._attachContainer(t.container,i,n.cursor),this._bindAutoClose()},Ab.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),ou(this._current.container),this._current.container=null)},Ab.prototype.isOpen=function(){return!!this._current.container},Ab.prototype.trigger=function(e){e.preventDefault();var t=Ic(e.delegateTarget||e.target,"data-id");if((t=this._getEntry(t)).action)return t.action.call(null,e,t)},Ab.prototype._getProviders=function(e){return e=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]}),this._eventBus.fire(e),e.providers},Ab.prototype._getEntries=function(e,t){var n={};return Object(Vl.forEach)(t,(function(t){var i;t.getPopupMenuEntries?(i=t.getPopupMenuEntries(e),Object(Vl.isFunction)(i)?n=i(n):Object(Vl.forEach)(i,(function(e,t){n[t]=e}))):Object(Vl.forEach)(t.getEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=Object(Vl.omit)(e,["id"])}))})),n},Ab.prototype._getHeaderEntries=function(e,t){var n={};return Object(Vl.forEach)(t,(function(t){if(!t.getPopupMenuHeaderEntries)return t.getHeaderEntries?void Object(Vl.forEach)(t.getHeaderEntries(e),(function(e){var t=e.id;if(!t)throw new Error("every entry must have the id property set");n[t]=Object(Vl.omit)(e,["id"])})):void 0;t=t.getPopupMenuHeaderEntries(e),Object(Vl.isFunction)(t)?n=t(n):Object(Vl.forEach)(t,(function(e,t){n[t]=e}))})),n},Ab.prototype._getEntry=function(e){if(e=this._current.entries[e])return e;throw new Error("entry not found")},Ab.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},Ab.prototype._createContainer=function(){var e=eu('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return Object(Vl.assign)(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),qc(e).add(n),e},Ab.prototype._attachContainer=function(e,t,n){var i=this;Zc(e,".entry","click",(function(e){i.trigger(e)})),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},Ab.prototype._updateScale=function(e){var t,n,i,o=this._canvas.zoom(),r=this._config.scale,a=o;!0!==r&&(r=!1===r?t=1:(t=r.min,r.max),Object(Vl.isDefined)(t)&&o<t&&(a=t),Object(Vl.isDefined)(r))&&r<o&&(a=r),i="scale("+a+")",(n=e).style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(e){n.style[e+"transform"]=i}))},Ab.prototype._assureIsInbounds=function(e,t){var n,i,o=this._canvas._container.getBoundingClientRect(),r=e.offsetLeft,a=e.offsetTop,s=e.scrollWidth,l=e.scrollHeight,c={},u=t.x-o.left;t=t.y-o.top;r+s>o.width&&(c.x=!0),a+l>o.height&&(c.y=!0),c.x&&c.y?(n=u-s+"px",i=t-l+"px"):c.x?(n=u-s+"px",i=t+"px"):c.y&&t<l?(n=u+"px",i="10px"):c.y&&(n=u+"px",i=t-l+"px"),Object(Vl.assign)(e.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},Ab.prototype._createEntries=function(e,t){var n=eu("<div>"),i=this;return qc(n).add(t),Object(Vl.forEach)(e,(function(e,t){e=i._createEntry(e,t),n.appendChild(e)})),n},Ab.prototype._createEntry=function(e,t){var n=eu("<div>"),i=qc(n);return i.add("entry"),e.className&&e.className.split(" ").forEach((function(e){i.add(e)})),Ic(n,"data-id",t),e.label&&((t=eu("<span>")).textContent=e.label,n.appendChild(t)),e.imageUrl&&n.appendChild(eu('<img src="'+e.imageUrl+'" />')),!0===e.active&&i.add("active"),!0===e.disabled&&i.add("disabled"),e.title&&(n.title=e.title),n},Ab.prototype._bindAutoClose=function(){this._eventBus.once(Tb,this.close,this)},Ab.prototype._unbindAutoClose=function(){this._eventBus.off(Tb,this.close,this)};var Ob={__init__:["popupMenu"],popupMenu:["type",Ab]};function Mb(){}Mb.prototype.get=function(){return this._data},Mb.prototype.set=function(e){this._data=e},Mb.prototype.clear=function(){var e=this._data;return delete this._data,e},Mb.prototype.isEmpty=function(){return!this._data};var Db={clipboard:["type",Mb]};function $b(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",(function(e){(t._svg=e.svg).addEventListener("mousemove",n)})),e.on("canvas.destroy",(function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)}))}$b.$inject=["eventBus"],$b.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent");return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n}()};var Pb={__init__:["mouse"],mouse:["type",$b]};function Rb(e,t,n,i,o,r,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=o,this._modeling=r,this._mouse=a,this._rules=s,o.on("copyPaste.copyElement",(function(e){var t=e.descriptor,n=e.element;e=e.elements;t.priority=1,t.id=n.id,Object(Vl.find)(e,(function(e){return e===n.parent}))&&(t.parent=n.parent.id),n.host&&(t.priority=2,t.host=n.host.id),Lb(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=(e=n,Object(Vl.map)(e.waypoints,(function(e){return(e=Nb(e)).original&&(e.original=Nb(e.original)),e})))),Ib(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),Object(Vl.forEach)(["x","y","width","height"],(function(e){Object(Vl.isNumber)(n[e])&&(t[e]=n[e])})),t.hidden=n.hidden,t.collapsed=n.collapsed})),o.on("copyPaste.pasteElements",(function(e){e=e.hints,Object(Vl.assign)(e,{createElementsBehavior:!1})}))}function Lb(e){return e.waypoints}function Ib(e){return e.labelTarget}function Nb(e){return Object(Vl.assign)({},e)}function Fb(e,t,n){Object(Vl.isArray)(n)||(n=[n]),Object(Vl.forEach)(n,(function(n){Object(Vl.isUndefined)(e[n])||(t[n]=e[n])}))}function jb(e,t,n){var i;t.on("copyPaste.copyElement",750,(function(e){var t=e.descriptor,n=(e=e.element,t.oldBusinessObject=Gl(e));if(t.type=e.type,Fb(n,t,"name"),t.di={},Fb(n.di,t.di,["fill","stroke","background-color","border-color","color"]),Fb(n.di,t,"isExpanded"),Bb(t))return t;n.default&&(t.default=n.default.id)})),t.on("moddleCopy.canCopyProperty",(function(t){var i=t.parent,o=t.property;if("processRef"===t.propertyName&&Hl(i,"bpmn:Participant")&&Hl(o,"bpmn:Process"))return t=e.create("bpmn:Process"),n.copyElement(o,t)})),t.on("copyPaste.pasteElements",(function(){i={}})),t.on("copyPaste.pasteElement",(function(t){var o,r,a,s,l=t.cache,c=(t=t.descriptor).oldBusinessObject;Bb(t)?t.businessObject=Gl(l[t.labelTarget]):(s=e.create(c.$type),t.businessObject=n.copyElement(c,s),c=l,r=Gl(o=t),o.default&&(i[o.default]={element:r,property:"default"}),o.host&&(Gl(o).attachedToRef=Gl(c[o.host])),i=Object(Vl.omit)(i,Object(Vl.reduce)(i,(function(e,t,n){var i=t.element;t=t.property;return n===o.id&&(i[t]=r,e.push(o.id)),e}),[])),Fb(t,s,["isExpanded","name"]),a=t,l="oldBusinessObject",Object(Vl.isArray)(l)||(l=[l]),Object(Vl.forEach)(l,(function(e){a[e]&&delete a[e]})))}))}function Bb(e){return e.labelTarget}Rb.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],Rb.prototype.copy=function(e){var t;return Object(Vl.isArray)(e)||(e=e?[e]:[]),t=!1===(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(Object(Vl.isArray)(t)?t:e),this._clipboard.set(t),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:t}),t},Rb.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};t=(this._eventBus.fire("copyPaste.pasteElements",{hints:n}),this._createElements(t));if(e&&e.element&&e.point)return this._paste(t,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),t,{hints:n||{}})}},Rb.prototype._paste=function(e,t,n,i){Object(Vl.forEach)(e,(function(e){Object(Vl.isNumber)(e.x)||(e.x=0),Object(Vl.isNumber)(e.y)||(e.y=0)}));var o=Ru(e);return Object(Vl.forEach)(e,(function(e){Lb(e)&&(e.waypoints=Object(Vl.map)(e.waypoints,(function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}}))),Object(Vl.assign)(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})})),this._modeling.createElements(e,n,t,Object(Vl.assign)({},i))},Rb.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},o=[];return Object(Vl.forEach)(e,(function(e,r){r=parseInt(r,10),e=Object(Vl.sortBy)(e,"priority"),Object(Vl.forEach)(e,(function(e){var r,a=Object(Vl.assign)({},Object(Vl.omit)(e,["priority"]));i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),r=Lb(a)?(a.source=i[e.source],a.target=i[e.target],i[e.id]=t.createConnection(a)):Ib(a)?(a.labelTarget=i[a.labelTarget],i[e.id]=t.createLabel(a)):(a.host&&(a.host=i[a.host]),i[e.id]=t.createShape(a)),o.push(r)}))})),o},Rb.prototype.createConnection=function(e){return this._elementFactory.createConnection(Object(Vl.omit)(e,["id"]))},Rb.prototype.createLabel=function(e){return this._elementFactory.createLabel(Object(Vl.omit)(e,["id"]))},Rb.prototype.createShape=function(e){return this._elementFactory.createShape(Object(Vl.omit)(e,["id"]))},Rb.prototype.hasRelations=function(e,t){var n,i;return!(Lb(e)&&(n=Object(Vl.find)(t,Object(Vl.matchPattern)({id:e.source.id})),i=Object(Vl.find)(t,Object(Vl.matchPattern)({id:e.target.id})),!n||!i)||Ib(e)&&!Object(Vl.find)(t,Object(Vl.matchPattern)({id:e.labelTarget.id})))},Rb.prototype.createTree=function(e){var t=this._rules,n=this,i={},o=[];function r(e,t){var n=Object(Vl.find)(o,(function(t){return e===t.element}));n?n.depth<t&&(o=function(e,t){return-1!==(e=t.indexOf(e))&&t.splice(e,1),t}(n,o)).push({element:n.element,depth:t}):o.push({element:e,depth:t})}return $u(Mu(e),(function(e,t,n){if(!Ib(e))return Object(Vl.forEach)(e.labels,(function(e){r(e,n)})),Object(Vl.forEach)([e.attachers,e.incoming,e.outgoing],(function(e){e&&e.length&&Object(Vl.forEach)(e,(function(e){Object(Vl.forEach)(e.labels,(function(e){r(e,n)})),r(e,n)}))})),r(e,n),e.children})),e=Object(Vl.map)(o,(function(e){return e.element})),o=Object(Vl.map)(o,(function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e}),t})),o=Object(Vl.sortBy)(o,(function(e){return e.descriptor.priority})),e=Object(Vl.map)(o,(function(e){return e.element})),Object(Vl.forEach)(o,(function(o){var r,a,s=o.depth;n.hasRelations(o.element,e)&&(r=o.element,a=e,t.allowed("element.copy",{element:r,elements:a}))?(i[s]||(i[s]=[]),i[s].push(o.descriptor)):function(e,t){-1!==(e=t.indexOf(e))&&t.splice(e,1)}(o.element,e)})),i},Db={__depends__:[Db,Sb,Pb,Hg],__init__:["copyPaste"],copyPaste:["type",Rb]},jb.$inject=["bpmnFactory","eventBus","moddleCopy"];var qb=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function zb(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",(function(e){if((e=e.propertyNames)&&e.length)return Object(Vl.sortBy)(e,(function(e){return"extensionElements"===e}))})),e.on("moddleCopy.canCopyProperty",(function(e){var t=e.parent;t=Object(Vl.isObject)(t)&&t.$descriptor;return!((e=e.propertyName)&&-1!==qb.indexOf(e)||e&&t&&!Object(Vl.find)(t.properties,Object(Vl.matchPattern)({name:e})))&&void 0})),e.on("moddleCopy.canSetCopiedProperty",(function(e){var t;if("bpmn:ExtensionElements",(t=e=e.property)&&"function"==typeof t.$instanceOf&&t.$instanceOf("bpmn:ExtensionElements")&&(!e.values||!e.values.length))return!1}))}function Vb(e,t){return Object(Vl.reduce)(e.properties,(function(e,n){return t&&n.default?e:e.concat(n.name)}),[])}zb.$inject=["eventBus","bpmnFactory","moddle"],zb.prototype.copyElement=function(e,t,n){var i=this,o=(n=(n=n&&!Object(Vl.isArray)(n)?[n]:n)||Vb(e.$descriptor),this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t}));return!1!==o&&(Object(Vl.isArray)(o)&&(n=o),Object(Vl.forEach)(n,(function(n){Object(Vl.has)(e,n)&&(o=e.get(n));var o=i.copyProperty(o,t,n);!1!==i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:o,propertyName:n})&&Object(Vl.isDefined)(o)&&t.set(n,o)}))),t},zb.prototype.copyProperty=function(e,t,n){var i,o=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n});if(!1!==r)return r?(Object(Vl.isObject)(r)&&r.$type&&!r.$parent&&(r.$parent=t),r):(i=this._moddle.getPropertyDescriptor(t,n)).isReference?void 0:i.isId?this._copyId(e,t):Object(Vl.isArray)(e)?Object(Vl.reduce)(e,(function(e,i){return(r=o.copyProperty(i,t,n))?(r.$parent=t,e.concat(r)):e}),[]):Object(Vl.isObject)(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:((r=o._bpmnFactory.create(e.$type)).$parent=t,r=o.copyElement(e,r)):e},zb.prototype._copyId=function(e,t){if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};Db={__depends__:[Db],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",jb],moddleCopy:["type",zb]};var Wb=Math.round;function Hb(e){this._modeling=e}Hb.$inject=["modeling"],Hb.prototype.replaceElement=function(e,t,n){var i,o,r,a,s;return e.waypoints?null:(i=this._modeling,o=t.width||e.width,r=t.height||e.height,a=t.x||e.x,s=t.y||e.y,a=Wb(a+o/2),s=Wb(s+r/2),i.replaceShape(e,Object(Vl.assign)({},t,{x:a,y:s,width:o,height:r}),n))};var Ub={__init__:["replace"],replace:["type",Hb]},Gb=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function Kb(e,t,n,i,o,r,a){this.replaceElement=function(s,l,c){c=c||{};var u,d,h,p,f,m,g,v=l.type,b=s.businessObject;return Yb(b)&&"bpmn:SubProcess"===v&&(u=l,(h=(d=s)&&Object(Vl.has)(d,"collapsed")?d.collapsed:!Kl(d))!==(u=u&&(Object(Vl.has)(u,"collapsed")||Object(Vl.has)(u,"isExpanded"))?Object(Vl.has)(u,"collapsed")?u.collapsed:!u.isExpanded:h))&&(d.collapsed=h,1)?(i.toggleCollapse(s),s):(u={type:v,businessObject:g=e.create(v)},d=Vb(b.$descriptor),h=Vb(g.$descriptor,!0),p=h,v=d.filter((function(e){return-1!==p.indexOf(e)})),Object(Vl.assign)(g,Object(Vl.pick)(l,Gb)),v=Object(Vl.filter)(v,(function(e){return"eventDefinitions"===e?Xb(s,l.eventDefinitionType):"loopCharacteristics"===e?!Yl(g):!Object(Vl.has)(g,e)&&("processRef"!==e||!1!==l.isExpanded)&&"triggeredByEvent"!==e})),g=n.copyElement(b,g,v),l.eventDefinitionType&&!Xb(g,l.eventDefinitionType)&&(u.eventDefinitionType=l.eventDefinitionType,u.eventDefinitionAttrs=l.eventDefinitionAttrs),Hl(b,"bpmn:Activity")&&(Yb(b)?u.isExpanded=Kl(b):l&&Object(Vl.has)(l,"isExpanded")&&(u.isExpanded=l.isExpanded),Kl(b))&&!Hl(b,"bpmn:Task")&&u.isExpanded&&(u.width=s.width,u.height=s.height),Yb(b)&&!Yb(g)&&(c.moveChildren=!1),Hl(b,"bpmn:Participant")&&(!0===l.isExpanded?g.processRef=e.create("bpmn:Process"):c.moveChildren=!1,u.width=s.width,u.height=t._getDefaultSize(g).height),r.allowed("shape.resize",{shape:g})||(u.height=t._getDefaultSize(g).height,u.width=t._getDefaultSize(g).width),g.name=b.name,Ul(b,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Ul(g,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(g.default=b.default),l.host&&!Hl(b,"bpmn:BoundaryEvent")&&Hl(g,"bpmn:BoundaryEvent")&&(u.host=l.host),"bpmn:DataStoreReference"!==u.type&&"bpmn:DataObjectReference"!==u.type||(u.x=s.x+(s.width-u.width)/2),u.di={},f=b.di,m=u.di,v=["fill","stroke","background-color","border-color","color"],Object(Vl.isArray)(v)||(v=[v]),Object(Vl.forEach)(v,(function(e){Object(Vl.isUndefined)(f[e])||(m[e]=f[e])})),u=o.replaceElement(s,u,c),!1!==c.select&&a.select(u),u)}}function Yb(e){return Hl(e,"bpmn:SubProcess")}function Xb(e,t){return e=Gl(e),t&&e.get("eventDefinitions").some((function(e){return Hl(e,t)}))}function Jb(e){return function(t){t=t.target;var n=Gl(e),i=n.eventDefinitions&&n.eventDefinitions[0],o=n.$type===t.type,r=(i=(i&&i.$type)===t.eventDefinitionType,n.triggeredByEvent===t.triggeredByEvent);t=void 0===t.isExpanded||t.isExpanded===Kl(n);return!(o&&i&&r&&t)}}Kb.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"],Ub={__depends__:[Db,Ub,ir],bpmnReplace:["type",Kb]};var Zb=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Qb=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],ey=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Throw Event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal Intermediate Catch Event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],ty=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],ny=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],iy=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],oy=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],ry=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],ay=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call Activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub Process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],sy=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],ly=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],cy=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],uy=[{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],dy=[{label:"Sequence Flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default Flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional Flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],hy=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function py(e,t,n,i,o,r,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=o,this._rules=r,this._translate=a,this.register()}function fy(e,t,n,i,o,r,a,s,l,c,u,d){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=o,this._elementFactory=r,this._connect=a,this._create=s,this._popupMenu=l,this._canvas=c,this._rules=u,this._translate=d,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,(function(e){var t,n=e.context.shape;ym(e)&&i.isOpen(n)&&(t=i.getEntries(n)).replace&&t.replace.action.click(e,n)}))}function my(e,t,n){t=e.$instanceOf(t);var i=!1;e=e.eventDefinitions||[];return Object(Vl.forEach)(e,(function(e){e.$type===n&&(i=!0)})),t&&i}py.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],py.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},py.prototype.getEntries=function(e){var t,n,i=e.businessObject;return this._rules.allowed("shape.replace",{element:e})?(n=Jb(e),Hl(i,"bpmn:DataObjectReference")?this._createEntries(e,sy):Hl(i,"bpmn:DataStoreReference")&&!Hl(e.parent,"bpmn:Collaboration")?this._createEntries(e,ly):Hl(i,"bpmn:StartEvent")&&!Hl(i.$parent,"bpmn:SubProcess")?(t=Object(Vl.filter)(Zb,n),this._createEntries(e,t)):Hl(i,"bpmn:Participant")?(t=Object(Vl.filter)(hy,(function(e){return Kl(i)!==e.target.isExpanded})),this._createEntries(e,t)):Hl(i,"bpmn:StartEvent")&&Yl(i.$parent)?(t=Object(Vl.filter)(uy,(function(t){var i=!1!==t.target.isInterrupting;i=Gl(e).isInterrupting===i;return n(t)||!n(t)&&!i})),this._createEntries(e,t)):Hl(i,"bpmn:StartEvent")&&!Yl(i.$parent)&&Hl(i.$parent,"bpmn:SubProcess")?(t=Object(Vl.filter)(Qb,n),this._createEntries(e,t)):Hl(i,"bpmn:EndEvent")?(t=Object(Vl.filter)(ty,(function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!Hl(i.$parent,"bpmn:Transaction"))&&n(e)})),this._createEntries(e,t)):Hl(i,"bpmn:BoundaryEvent")?(t=Object(Vl.filter)(cy,(function(e){var t=e.target;return!("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!Hl(i.attachedToRef,"bpmn:Transaction"))&&(t=!1!==t.cancelActivity,t=i.cancelActivity==t,n(e)||!n(e)&&!t)})),this._createEntries(e,t)):Hl(i,"bpmn:IntermediateCatchEvent")||Hl(i,"bpmn:IntermediateThrowEvent")?(t=Object(Vl.filter)(ey,n),this._createEntries(e,t)):Hl(i,"bpmn:Gateway")?(t=Object(Vl.filter)(ny,n),this._createEntries(e,t)):Hl(i,"bpmn:Transaction")?(t=Object(Vl.filter)(oy,n),this._createEntries(e,t)):Yl(i)&&Kl(i)?(t=Object(Vl.filter)(ry,n),this._createEntries(e,t)):Hl(i,"bpmn:SubProcess")&&Kl(i)?(t=Object(Vl.filter)(iy,n),this._createEntries(e,t)):Hl(i,"bpmn:AdHocSubProcess")&&!Kl(i)?(t=Object(Vl.filter)(ay,(function(t){var n="bpmn:SubProcess"===(t=t.target).type;t=!0===t.isExpanded;return Jb(e)&&(!n||t)})),this._createEntries(e,t)):Hl(i,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,dy):Hl(i,"bpmn:FlowNode")?(t=Object(Vl.filter)(ay,n),Hl(i,"bpmn:SubProcess")&&!Kl(i)&&(t=Object(Vl.filter)(t,(function(e){return"Sub Process (collapsed)"!==e.label}))),this._createEntries(e,t)):[]):[]},py.prototype.getHeaderEntries=function(e){var t=[];return Hl(e,"bpmn:Activity")&&!Yl(e)&&(t=t.concat(this._getLoopEntries(e))),Hl(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),Hl(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!Hl(e,"bpmn:SubProcess")||Hl(e,"bpmn:Transaction")||Yl(e)||t.push(this._getAdHocEntry(e)),t},py.prototype._createEntries=function(e,t){var n=[],i=this;return Object(Vl.forEach)(t,(function(t){t=i._createMenuEntry(t,e),n.push(t)})),n},py.prototype._createSequenceFlowEntries=function(e,t){var n=Gl(e),i=[],o=this._modeling,r=this._moddle,a=this;return Object(Vl.forEach)(t,(function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(Hl(n.sourceRef,"bpmn:ExclusiveGateway")||Hl(n.sourceRef,"bpmn:InclusiveGateway")||Hl(n.sourceRef,"bpmn:ComplexGateway")||Hl(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(t,e,(function(){o.updateProperties(e.source,{default:n})})));break;case"replace-with-conditional-flow":!n.conditionExpression&&Hl(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(t,e,(function(){var t=r.create("bpmn:FormalExpression",{body:""});o.updateProperties(e,{conditionExpression:t})})));break;default:return Hl(n.sourceRef,"bpmn:Activity")&&n.conditionExpression?i.push(a._createMenuEntry(t,e,(function(){o.updateProperties(e,{conditionExpression:void 0})}))):(Hl(n.sourceRef,"bpmn:ExclusiveGateway")||Hl(n.sourceRef,"bpmn:InclusiveGateway")||Hl(n.sourceRef,"bpmn:ComplexGateway")||Hl(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n?i.push(a._createMenuEntry(t,e,(function(){o.updateProperties(e.source,{default:void 0})}))):void 0}})),i},py.prototype._createMenuEntry=function(e,t,n){var i=this._translate,o=this._bpmnReplace.replaceElement,r=e.label;return n=n||function(){return o(t,e.target)},{label:i(r=r&&"function"==typeof r?r(t):r),className:e.className,id:e.actionName,action:n}},py.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(n,i){var o;i.active?o=void 0:(o=t._moddle.create(i.options.loopCharacteristics),i.options.isSequential&&(o.isSequential=i.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:o})}var o,r,a,s=Gl(e).loopCharacteristics;return s&&(o=s.isSequential,r=void 0===s.isSequential,a=void 0!==s.isSequential&&!s.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:o,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:r,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},py.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef,o=i.isCollection;return[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:function(n,o){t._modeling.updateModdleProperties(e,i,{isCollection:!o.active})}}]},py.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate,o=e.businessObject.participantMultiplicity;return[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!o,action:function(i,o){var r;o.active||(r=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:r})}}]},py.prototype._getAdHocEntry=function(e){var t=this._translate,n=Hl(Gl(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(t,o){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}},Ob={__depends__:[Ob,Ub],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",py]},fy.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],fy.prototype.getContextPadEntries=function(e){var t,n,i=this._contextPad,o=this._modeling,r=this._elementFactory,a=this._connect,s=this._create,l=this._popupMenu,c=this._canvas,u=this._rules,d=this._autoPlace,h=this._translate,p={};return"label"!==e.type&&(Ul(t=e.businessObject,["bpmn:Lane","bpmn:Participant"])&&Kl(t)&&(n=Ku(e),Object(Vl.assign)(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:h("Add Lane above"),action:{click:function(e,t){o.addLane(t,"top")}}}}),n.length<2&&(120<=e.height&&Object(Vl.assign)(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:h("Divide into two Lanes"),action:{click:g(2)}}}),180<=e.height)&&Object(Vl.assign)(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:h("Divide into three Lanes"),action:{click:g(3)}}}),Object(Vl.assign)(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:h("Add Lane below"),action:{click:function(e,t){o.addLane(t,"bottom")}}}})),Hl(t,"bpmn:FlowNode")&&(Hl(t,"bpmn:EventBasedGateway")?Object(Vl.assign)(p,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",h("Append ReceiveTask")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",h("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",h("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",h("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",h("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):my(t,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?Object(Vl.assign)(p,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",h("Append compensation activity"),{isForCompensation:!0})}):Hl(t,"bpmn:EndEvent")||t.isForCompensation||my(t,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Yl(t)||Object(Vl.assign)(p,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",h("Append EndEvent")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",h("Append Gateway")),"append.append-task":m("bpmn:Task","bpmn-icon-task",h("Append Task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",h("Append Intermediate/Boundary Event"))})),l.isEmpty(e,"bpmn-replace")||Object(Vl.assign)(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:h("Change type"),action:{click:function(e,t){var n,o,r=Object(Vl.assign)((n=t,r=c.getContainer(),n=i.getPad(n).html,r=r.getBoundingClientRect(),o=(n=n.getBoundingClientRect()).top-r.top,{x:n.left-r.left,y:o+n.height+5}),{cursor:{x:e.x,y:e.y}});l.open(t,"bpmn-replace",r)}}}}),Ul(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Object(Vl.assign)(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:h("Connect using "+(t.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),Hl(t,"bpmn:TextAnnotation")&&Object(Vl.assign)(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:h("Connect using Association"),action:{click:f,dragstart:f}}}),Ul(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Object(Vl.assign)(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:h("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),Hl(t,"bpmn:Group")&&Object(Vl.assign)(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation")}),n=u.allowed("elements.delete",{elements:[e]}),n=Object(Vl.isArray)(n)?n[0]===e:n)&&Object(Vl.assign)(p,{delete:{group:"edit",className:"bpmn-icon-trash",title:h("Remove"),action:{click:function(t){o.removeElements([e])}}}}),p;function f(e,t){a.start(e,t)}function m(e,t,n,i){function o(t,n){var o=r.createShape(Object(Vl.assign)({type:e},i));s.start(t,o,{source:n})}return"string"!=typeof n&&(i=n,n=h("Append {type}",{type:e.replace(/^bpmn:/,"")})),{group:"model",className:t,title:n,action:{dragstart:o,click:d?function(t,n){var o=r.createShape(Object(Vl.assign)({type:e},i));d.append(n,o)}:o}}}function g(e){return function(t,n){o.splitLane(n,e),i.open(n,!0)}}};Vv={__depends__:[sw,Vv,ir,jv,Sb,Ob],__init__:["contextPadProvider"],contextPadProvider:["type",fy]};var gy={horizontal:["x","width"],vertical:["y","height"]};function vy(e){this._modeling=e,this._filters=[],this.registerFilter((function(e,t,n){var i,o=0,r=0;return Object(Vl.forEach)(e,(function(e){e.waypoints||e.labelTarget||(o+=e[n],r+=1)})),i=Math.round(o/r),Object(Vl.filter)(e,(function(e){return e[n]<i+50}))}))}function by(e){e.registerFilter((function(e){return Object(Vl.filter)(e,(function(e){var t=Ul(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)}))}))}vy.$inject=["modeling"],vy.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},vy.prototype.trigger=function(e,t){var n=this._modeling;if(!(e.length<3||(this._setOrientation(t),t=this._filterElements(e),(e=this._createGroups(t)).length<=2)))return n.distributeElements(e,this._axis,this._dimension),e},vy.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,o=[].concat(e);return t.length?(Object(Vl.forEach)(t,(function(e){o=e(o,n,i)})),o):e},vy.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,o=this._dimension;if(i)return e=Object(Vl.sortBy)(e,i),Object(Vl.forEach)(e,(function(e,r){var a=n._findRange(e,i,o),s=t[t.length-1];s&&n._hasIntersection(s.range,a)?t[t.length-1].elements.push(e):t.push({range:a,elements:[e]})})),t;throw new Error('must have a defined "axis" and "dimension"')},vy.prototype._setOrientation=function(e){e=gy[e],this._axis=e[0],this._dimension=e[1]},vy.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},vy.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}},Ob={__init__:["distributeElements"],distributeElements:["type",vy]},by.$inject=["distributeElements"];Ob={__depends__:[Ob],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",by]};var yy="is not a registered action";function wy(e,t){this._actions={};var n=this;e.on("diagram.init",(function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})}))}function xy(e,t){return new Error(e+" "+t)}wy.$inject=["eventBus","injector"],wy.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),o=e.get("zoomScroll",!1),r=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),l=e.get("keyboardMove",!1),c=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",(function(){t.undo()})),this.register("redo",(function(){t.redo()}))),r&&i&&this.register("copy",(function(){var e=i.get();r.copy(e)})),r&&this.register("paste",(function(){r.paste()})),o&&this.register("stepZoom",(function(e){o.stepZoom(e.value)})),a&&this.register("zoom",(function(e){a.zoom(e.value)})),n&&i&&s&&this.register("removeSelection",(function(){var e,t=i.get();t.length&&!1!==(e=s.allowed("elements.delete",{elements:t}))&&(e=Object(Vl.isArray)(e)?e:t).length&&n.removeElements(e.slice())})),l&&this.register("moveCanvas",(function(e){l.moveCanvas(e)})),c&&this.register("moveSelection",(function(e){c.moveSelection(e.direction,e.accelerated)}))},wy.prototype.trigger=function(e,t){if(this._actions[e])return this._actions[e](t);throw xy(e,yy)},wy.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);Object(Vl.forEach)(e,(function(e,t){n._registerAction(t,e)}))},wy.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw xy(e,"is already registered");this._actions[e]=t},wy.prototype.unregister=function(e){if(!this.isRegistered(e))throw xy(e,yy);this._actions[e]=void 0},wy.prototype.getActions=function(){return Object.keys(this._actions)},wy.prototype.isRegistered=function(e){return!!this._actions[e]};var _y={__init__:["editorActions"],editorActions:["type",wy]};function ky(e){e.invoke(wy,this)}function Ey(e){e.on(["create.init","shape.move.init"],(function(e){var t=e.context;Ul(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")}))}function Cy(e,t,n){return n=n||"round",Math[n](e/t)*t}function Sy(e,t,n){var i=!n||!1!==n.active,o=(this._eventBus=t,this);t.on("diagram.init",800,(function(){o.setActive(i)})),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,(function(t){var n=t.originalEvent;!o.active||n&&Bm(n)||((n=t.context).gridSnappingContext||(n.gridSnappingContext={}),["x","y"].forEach((function(n){var i,r,a,s,l={},c=(s=n,r=e,c=(a=t).context,a=a.shape,i=(c=c.gridSnappingContext).snapLocation,(u=c.snapOffset)&&Object(Vl.isNumber)(u[s])||(u=u||(c.snapOffset={}),Object(Vl.isNumber)(u[s])||(u[s]=0),a&&(r.get(a.id)||(Ty(s)?u[s]+=a[s]+a.width/2:u[s]+=a[s]+a.height/2),i)&&("x"===s?/left/.test(i)?u[s]-=a.width/2:/right/.test(i)&&(u[s]+=a.width/2):/top/.test(i)?u[s]-=a.height/2:/bottom/.test(i)&&(u[s]+=a.height/2))),u[s]),u=(c&&(l.offset=c),r=n,a=(i=(i=t).context).createConstraints,u=i.resizeConstraints||{},(c=(s=i.gridSnappingContext).snapConstraints)&&c[r]||((c=c||(s.snapConstraints={}))[r]||(c[r]={}),s=i.direction,a&&(Ty(r)?(c.x.min=a.left,c.x.max=a.right):(c.y.min=a.top,c.y.max=a.bottom)),i=u.min,a=u.max,i&&(Ty(r)?Oy(s)?c.x.max=i.left:c.x.min=i.right:Ay(s)?c.y.max=i.top:c.y.min=i.bottom),a&&(Ty(r)?Oy(s)?c.x.min=a.left:c.x.max=a.right:Ay(s)?c.y.min=a.top:c.y.max=a.bottom)),c[r]);u&&Object(Vl.assign)(l,u),Tv(t,n)||o.snapEvent(t,n,l)})))}))}function Ty(e){return"x"===e}function Ay(e){return-1!==e.indexOf("n")}function Oy(e){return-1!==e.indexOf("w")}function My(e,t){Og.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",(function(e){var t,i,o=((e=e.context).hints||{}).autoResize;o&&(t=e.shape,i=e.newBounds,Object(Vl.isString)(o)?e.newBounds=n.snapComplex(i,o):e.newBounds=n.snapSimple(t,i))}))}function Dy(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,(function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))}))}H()(ky,wy),ky.$inject=["injector"],ky.prototype._registerDefaultActions=function(e){wy.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),o=e.get("spaceTool",!1),r=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),l=e.get("distributeElements",!1),c=e.get("alignElements",!1),u=e.get("directEditing",!1),d=e.get("searchPad",!1),h=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",(function(){var e=t.getRootElement(),o=n.filter((function(t){return t!==e}));return i.select(o),o})),o&&this._registerAction("spaceTool",(function(){o.toggle()})),r&&this._registerAction("lassoTool",(function(){r.toggle()})),a&&this._registerAction("handTool",(function(){a.toggle()})),s&&this._registerAction("globalConnectTool",(function(){s.toggle()})),i&&l&&this._registerAction("distributeElements",(function(e){var t=i.get();e=e.type;t.length&&l.trigger(t,e)})),i&&c&&this._registerAction("alignElements",(function(e){var t=i.get();e=e.type;t.length&&(t=Object(Vl.filter)(t,(function(e){return!Hl(e,"bpmn:Lane")})),c.trigger(t,e))})),i&&h&&this._registerAction("setColor",(function(e){var t=i.get();t.length&&h.setColor(t,e)})),i&&u&&this._registerAction("directEditing",(function(){var e=i.get();e.length&&u.activate(e[0])})),d&&this._registerAction("find",(function(){d.toggle()})),t&&h&&this._registerAction("moveToOrigin",(function(){var e=t.getRootElement(),i=Hl(e,"bpmn:Collaboration")?n.filter((function(e){return Hl(e.parent,"bpmn:Collaboration")})):n.filter((function(t){return t!==e&&!Hl(t.parent,"bpmn:SubProcess")})),o=Ru(i);h.moveElements(i,{x:-o.x,y:-o.y},e)}))},_y={__depends__:[_y],editorActions:["type",ky]},Ey.$inject=["eventBus"],Sy.prototype.snapEvent=function(e,t,n){Av(e,t,this.snapValue(e[t],n))},Sy.prototype.getGridSpacing=function(){return 10},Sy.prototype.snapValue=function(e,t){var n,i=0;return e=Cy(e+=i=t&&t.offset?t.offset:i,10),t&&t.min&&(n=t.min,Object(Vl.isNumber)(n))&&(n=Cy(n+i,10,"ceil"),e=Math.max(e,n)),t&&t.max&&(n=t.max,Object(Vl.isNumber)(n))&&(n=Cy(n+i,10,"floor"),e=Math.min(e,n)),e-i},Sy.prototype.isActive=function(){return this.active},Sy.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Sy.prototype.toggleActive=function(){this.setActive(!this.active)},Sy.$inject=["elementRegistry","eventBus","config.gridSnapping"],My.$inject=["eventBus","gridSnapping","modeling"],H()(My,Og),My.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},My.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)?this.snapVertically(e,t):e},My.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),o=(t=/e/.test(t),{});return o.width=n.snapValue(e.width,{min:e.width}),t&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),Object(Vl.assign)(e,o),e},My.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),o=(t=/s/.test(t),{});return o.height=n.snapValue(e.height,{min:e.height}),i&&(t?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),Object(Vl.assign)(e,o),e},Dy.$inject=["eventBus","gridSnapping"];var $y={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",My],gridSnappingSpaceToolBehavior:["type",Dy]}],__init__:["gridSnapping"],gridSnapping:["type",Sy]};function Py(e,t){e.on("autoPlace",2e3,(function(e){var n=e.source,i=Tu(n),o=e.shape,r=Tg(n,o);return["x","y"].forEach((function(e){var n={};r[e]!==i[e]&&(r[e]>i[e]?n.min=r[e]:n.max=r[e],Hl(o,"bpmn:TextAnnotation")&&(n.offset="x"===e?-o.width/2:-o.height/2),r[e]=t.snapValue(r[e],n))})),r}))}function Ry(e,t,n){t.on(["create.start","shape.move.start"],1750,(function(t){var i=(t=t.context).shape,o=e.getRootElement();Hl(i,"bpmn:Participant")&&Hl(o,"bpmn:Process")&&o.children.length&&t.createConstraints&&(i.width=n.snapValue(i.width,{min:i.width}),i.height=n.snapValue(i.height,{min:i.height}))}))}function Ly(e,t,n){Og.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,(function(e){var t=(e=e.context).connection,o=(e=e.hints||{},t.waypoints);e.connectionStart||e.connectionEnd||!1===e.createElementsBehavior||3<o.length&&n.updateWaypoints(t,i.snapMiddleSegments(o))}))}function Iy(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],(function(e){var t=e.element;e=e.gfx;return Hl(t,"bpmn:Lane")?n.createParticipantHit(t,e):Hl(t,"bpmn:Participant")?Kl(t)?n.createParticipantHit(t,e):n.createDefaultHit(t,e):Hl(t,"bpmn:SubProcess")?Kl(t)?n.createSubProcessHit(t,e):n.createDefaultHit(t,e):void 0}))}Py.$inject=["eventBus","gridSnapping"],Ry.$inject=["canvas","eventBus","gridSnapping"],Ly.$inject=["eventBus","gridSnapping","modeling"],H()(Ly,Og),Ly.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=function(e,t,n){var i=yu(t,n),o={};return"h"===i&&(o.y=e.snapValue(t.y)),"v"===i&&(o.x=e.snapValue(t.x)),("x"in o||"y"in o)&&(t=Object(Vl.assign)({},t,o),n=Object(Vl.assign)({},n,o)),[t,n]}(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e},$y={__depends__:[$y,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",Py],gridSnappingCreateParticipantBehavior:["type",Ry],gridSnappingLayoutConnectionBehavior:["type",Ly]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Ey]},Iy.$inject=["eventBus","interactionEvents"],Iy.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Iy.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:30,height:e.height}),!0},Iy.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0};var Ny={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Iy]};function Fy(e){e.invoke(Um,this)}H()(Fy,Um),Fy.$inject=["injector"],Fy.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}Um.prototype.registerBindings.call(this,e,t),n("selectElements",(function(n){if(n=n.keyEvent,e.isKey(["a","A"],n)&&e.isCmd(n))return t.trigger("selectElements"),!0})),n("find",(function(n){if(n=n.keyEvent,e.isKey(["f","F"],n)&&e.isCmd(n))return t.trigger("find"),!0})),n("spaceTool",(function(n){return n=n.keyEvent,!e.hasModifier(n)&&e.isKey(["s","S"],n)?(t.trigger("spaceTool"),!0):void 0})),n("lassoTool",(function(n){return n=n.keyEvent,!e.hasModifier(n)&&e.isKey(["l","L"],n)?(t.trigger("lassoTool"),!0):void 0})),n("handTool",(function(n){return n=n.keyEvent,!e.hasModifier(n)&&e.isKey(["h","H"],n)?(t.trigger("handTool"),!0):void 0})),n("globalConnectTool",(function(n){return n=n.keyEvent,!e.hasModifier(n)&&e.isKey(["c","C"],n)?(t.trigger("globalConnectTool"),!0):void 0})),n("directEditing",(function(n){return n=n.keyEvent,!e.hasModifier(n)&&e.isKey(["e","E"],n)?(t.trigger("directEditing"),!0):void 0}))};var jy={__depends__:[Q],__init__:["keyboardBindings"],keyboardBindings:["type",Fy]},By={moveSpeed:1,moveSpeedAccelerated:10},qy={ArrowLeft:"left",Left:"left",ArrowUp:"up",Up:"up",ArrowRight:"right",Right:"right",ArrowDown:"down",Down:"down"},zy={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function Vy(e,t,n,i,o){var r=this;this._config=Object(Vl.assign)({},By,e||{}),t.addListener(1500,(function(e){e=e.keyEvent;var n=qy[e.key];if(n&&!t.isCmd(e))return e=t.isShift(e),r.moveSelection(n,e),!0})),this.moveSelection=function(e,t){var r=o.get();r.length&&(t=this._config[t?"moveSpeedAccelerated":"moveSpeed"],e=zy[e](t),i.allowed("elements.move",{shapes:r}))&&n.moveElements(r,e)}}function Wy(e,t,n,i){e.on("element.changed",(function(i){var o=i.element;!o.parent&&o!==t.getRootElement()||(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(Lu(o)+".changed",i)})),e.on("elements.changed",(function(t){(t=t.elements).forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(t)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}Vy.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"],Q={__depends__:[Q,ir],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",Vy]},Wy.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Hy={__init__:["changeSupport"],changeSupport:["type",Wy]};function Uy(e,t,n,i){this._dragging=i,this._rules=t;var o=this;e.on("resize.start",(function(e){var t,n;t=(e=e.context).resizeConstraints,n=e.minBounds,void 0===t&&(void 0===n&&(n=o.computeMinResizeBox(e)),e.resizeConstraints={min:Cu(n)})})),e.on("resize.move",(function(e){var t={x:e.dx,y:e.dy};!function(e,t){var n,i,r=e.shape,a=e.direction,s=e.resizeConstraints;e.delta=t,r=r,a=a,i=(t=t).x,t=t.y,n={x:r.x,y:r.y,width:r.width,height:r.height},-1!==a.indexOf("n")?(n.y=r.y+t,n.height=r.height-t):-1!==a.indexOf("s")&&(n.height=r.height+t),-1!==a.indexOf("e")?n.width=r.width+i:-1!==a.indexOf("w")&&(n.x=r.x+i,n.width=r.width-i),t=n,e.newBounds=(a=t,(r=s)?Su({top:qu("top",i=Cu(a),r),right:qu("right",i,r),bottom:qu("bottom",i,r),left:qu("left",i,r)}):a),e.canExecute=o.canResize(e)}(e.context,t)})),e.on("resize.end",(function(e){var t,i,o;i=(e=e.context).shape,o=e.canExecute,e=e.newBounds,o&&(o=e=ku(e),(t=i).x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height||n.resizeShape(i,e))}))}function Gy(e,t){var n=Tu(e);e=Cu(e),n={x:n.x,y:n.y};return-1!==t.indexOf("n")?n.y=e.top:-1!==t.indexOf("s")&&(n.y=e.bottom),-1!==t.indexOf("e")?n.x=e.right:-1!==t.indexOf("w")&&(n.x=e.left),n}Uy.prototype.canResize=function(e){var t=this._rules;e=Object(Vl.pick)(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",e)},Uy.prototype.activate=function(e,t,n){var i,o=this._dragging;if("string"==typeof n&&(n={direction:n}),!(i=(n=Object(Vl.assign)({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,Gy(t,i),"resize",{autoActivate:!0,cursor:(o="resize-","n"===(e=i)||"s"===e?o+"ns":"e"===e||"w"===e?o+"ew":"nw"===e||"se"===e?o+"nwse":o+"nesw"),data:{shape:t,context:n}})},Uy.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,i=e.minDimensions||{width:10,height:10};return n=n,i=i,e=e=Wu(t,e.childrenBoxPadding),t=Cu(t=t),n={top:/n/.test(n)?t.bottom-i.height:t.top,left:/w/.test(n)?t.right-i.width:t.left,bottom:/s/.test(n)?t.top+i.height:t.bottom,right:/e/.test(n)?t.left+i.width:t.right},i=e?Cu(e):n,Su({top:ju(n.top,i.top),left:ju(n.left,i.left),bottom:Fu(n.bottom,i.bottom),right:Fu(n.right,i.right)})},Uy.$inject=["eventBus","rules","modeling","dragging"];var Ky="djs-resizing",Yy="resize-not-ok";function Xy(e,t,n){e.on("resize.move",500,(function(e){var i,o,r;i=(e=e.context).shape,o=e.newBounds,(r=e.frame)||(r=e.frame=n.addFrame(i,t.getActiveLayer()),t.addMarker(i,Ky)),5<o.width&&ic(r,{x:o.x,width:o.width}),5<o.height&&ic(r,{y:o.y,height:o.height}),e.canExecute?lc(r).remove(Yy):lc(r).add(Yy)})),e.on("resize.cleanup",(function(e){var n;n=(e=e.context).shape,e.frame&&uc(e.frame),t.removeMarker(n,Ky)}))}Xy.$inject=["eventBus","canvas","previewSupport"];var Jy="djs-resizer",Zy=["n","w","s","e","nw","ne","se","sw"];function Qy(e,t,n,i){this._resize=i,this._canvas=t;var o=this;e.on("selection.changed",(function(e){e=e.newSelection,o.removeResizers(),1===e.length&&Object(Vl.forEach)(e,Object(Vl.bind)(o.addResizer,o))})),e.on("shape.changed",(function(e){e=e.element,n.isSelected(e)&&(o.removeResizers(),o.addResizer(e))}))}Qy.prototype.makeDraggable=function(e,t,n){var i=this._resize;function o(t){bm(t)&&i.activate(t,e,n)}Xc.bind(t,"mousedown",o),Xc.bind(t,"touchstart",o)},Qy.prototype._createResizer=function(e,t,n,i){var o=this._getResizersParent(),r=function(e){var t={x:0,y:0};return-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=-6),-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=-6),t}(i),a=gc("g");ic(e=(lc(a).add(Jy),lc(a).add(Jy+"-"+e.id),lc(a).add(Jy+"-"+i),ec(o,a),gc("rect")),{x:-2+r.x,y:-2+r.y,width:4,height:4}),lc(e).add(Jy+"-visual"),ec(a,e),i=gc("rect");return ic(i,{x:-10+r.x,y:-10+r.y,width:20,height:20}),lc(i).add(Jy+"-hit"),ec(a,i),ru(a,t,n),a},Qy.prototype.createResizer=function(e,t){var n=Gy(e,t);n=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,n,t)},Qy.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&Object(Vl.forEach)(Zy,(function(n){t.createResizer(e,n)}))},Qy.prototype.removeResizers=function(){dc(this._getResizersParent())},Qy.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Qy.$inject=["eventBus","canvas","selection","resize"];var ew={__depends__:[Hg,Ng,bb],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Uy],resizePreview:["type",Xy],resizeHandles:["type",Qy]};function tw(e,t){var n=t.create("bpmn:CategoryValue");t=t.create("bpmn:Category",{categoryValue:[n]});return Gh(e.get("rootElements"),t),Gl(t).$parent=e,Gl(n).$parent=t,n}function nw(e,t,n,i,o,r,a){function s(e,t){(t||Ul(e,["bpmn:Task","bpmn:TextAnnotation"])||iw(e))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=o,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",(function(e){s(e.element,!0)})),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],(function(e){i.isActive()&&i.complete()})),e.on(["commandStack.changed"],(function(e){i.isActive()&&i.cancel()})),e.on("directEditing.activate",(function(e){r.removeResizers()})),e.on("create.end",500,(function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||!i||t.hints&&!1===t.hints.createElementsBehavior||s(n)})),e.on("autoPlace.end",500,(function(e){s(e.shape)}))}function iw(e){return Hl(e,"bpmn:SubProcess")&&!Kl(e)}nw.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],nw.prototype.activate=function(e){var t,n=Zl(e);if(void 0!==n)return n={text:n},t=this.getEditingBBox(e),Object(Vl.assign)(n,t),t={},(Ul(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||iw(e))&&Object(Vl.assign)(t,{centerVertically:!0}),am(e)&&Object(Vl.assign)(t,{autoResize:!0}),Hl(e,"bpmn:TextAnnotation")&&Object(Vl.assign)(t,{resizable:!0,autoResize:!0}),Object(Vl.assign)(n,{options:t}),n},nw.prototype.getEditingBBox=function(e){var t,n=this._canvas,i=e.label||e,o=n.getAbsoluteBBox(i),r=o.x+o.width/2,a=o.y+o.height/2,s={x:o.x,y:o.y},l=n.zoom(),c=this._textRenderer.getDefaultStyle(),u=(d=this._textRenderer.getExternalStyle()).fontSize*l,d=d.lineHeight,h=c.fontSize*l,p=(c=c.lineHeight,{fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight}),f=(a=((Hl(e,"bpmn:Lane")||Hl(t=e,"bpmn:Participant")&&Kl(t))&&(Object(Vl.assign)(s,{width:o.height,height:30*l,x:o.x-o.height/2+15*l,y:a-30*l/2}),Object(Vl.assign)(p,{fontSize:h+"px",lineHeight:c,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px",transform:"rotate(-90deg)"})),(Ul(e,["bpmn:Task","bpmn:CallActivity"])||Hl(t=e,"bpmn:Participant")&&!Kl(t)||iw(e))&&(Object(Vl.assign)(s,{width:o.width,height:o.height}),Object(Vl.assign)(p,{fontSize:h+"px",lineHeight:c,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px"})),Hl(a=e,"bpmn:SubProcess")&&Kl(a)&&(Object(Vl.assign)(s,{width:o.width,x:o.x}),Object(Vl.assign)(p,{fontSize:h+"px",lineHeight:c,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px"})),90*l),7*l),m=4*l;return i.labelTarget&&(Object(Vl.assign)(s,{width:a,height:o.height+f+m,x:r-a/2,y:o.y-f}),Object(Vl.assign)(p,{fontSize:u+"px",lineHeight:d,paddingTop:f+"px",paddingBottom:m+"px"})),!am(i)||sm(i)||cm(i)||(r=lm(e),i=n.getAbsoluteBBox({x:r.x,y:r.y,width:0,height:0}),n=u+f+m,Object(Vl.assign)(s,{width:a,height:n,x:i.x-a/2,y:i.y-n/2}),Object(Vl.assign)(p,{fontSize:u+"px",lineHeight:d,paddingTop:f+"px",paddingBottom:m+"px"})),Hl(e,"bpmn:TextAnnotation")&&(Object(Vl.assign)(s,{width:o.width,height:o.height,minWidth:30*l,minHeight:10*l}),Object(Vl.assign)(p,{textAlign:"left",paddingTop:5*l+"px",paddingBottom:7*l+"px",paddingLeft:7*l+"px",paddingRight:5*l+"px",fontSize:h+"px",lineHeight:c})),{bounds:s,style:p}},nw.prototype.update=function(e,t,n,i){var o;Hl(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),o={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),Hl(e,"bpmn:Group")&&!Gl(e).categoryValueRef&&(i=tw(Gl(this._canvas.getRootElement()).$parent,this._bpmnFactory),Gl(e).categoryValueRef=i),(i=t)&&i.trim()||(t=null),this._modeling.updateLabel(e,t,o)};var ow="djs-element-hidden",rw="djs-label-hidden";function aw(e,t,n,i){var o,r,a,s=this,l=t.getDefaultLayer();e.on("directEditing.activate",(function(e){var n;e=e.active;Hl(o=e.element.label||e.element,"bpmn:TextAnnotation")&&(r=t.getAbsoluteBBox(o),a=gc("g"),e=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),ic(n=s.path=gc("path"),{d:e,strokeWidth:2,stroke:Gl(o).di.get("stroke")||"black"}),ec(a,n),ec(l,a),au(a,o.x,o.y)),Hl(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,ow):(Hl(o,"bpmn:Task")||Hl(o,"bpmn:CallActivity")||Hl(o,"bpmn:SubProcess")||Hl(o,"bpmn:Participant"))&&t.addMarker(o,rw)})),e.on("directEditing.resize",(function(e){var t;Hl(o,"bpmn:TextAnnotation")&&(t=e.height,e=e.dy,t=Math.max(o.height/r.height*(t+e),0),e=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:t,position:{mx:0,my:0}}),ic(s.path,{d:e}))})),e.on(["directEditing.complete","directEditing.cancel"],(function(e){(e=e.active)&&(t.removeMarker(e.element.label||e.element,ow),t.removeMarker(o,rw)),r=o=void 0,a&&(uc(a),a=void 0)}))}aw.$inject=["eventBus","canvas","elementRegistry","pathMap"];var sw={__depends__:[Hy,ew,sw],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",nw],labelEditingPreview:["type",aw]},lw=["top","bottom","left","right"];function cw(e,t){function n(e){if(sm(e)){var n=function(e){var t=Tu(e.label);if(function(e){return-1!==lw.indexOf(e)}(t=uw(Tu(e),t))){var n=function(e){var t=Tu(e);return[].concat(e.incoming.map((function(e){return e.waypoints[e.waypoints.length-2]})),e.outgoing.map((function(e){return e.waypoints[1]}))).map((function(e){return uw(t,e)}))}(e);if(-1===(e=(e.host&&(e=function(e){var t,n=e.host;e=Au(Tu(e),n);return t=0<=e.indexOf("-")?e.split("-"):[e],lw.filter((function(e){return-1===t.indexOf(e)}))}(e),n=n.concat(e)),lw.filter((function(e){return-1===n.indexOf(e)})))).indexOf(t))return e[0]}}(e);if(n){var i=Tu(e),o=e.label,r=Tu(o);if(o.parent){var a,s=Cu(e);switch(n){case"top":a={x:i.x,y:s.top-10-o.height/2};break;case"left":a={x:s.left-10-o.width/2,y:i.y};break;case"bottom":a={x:i.x,y:s.bottom+10+o.height/2};break;case"right":a={x:s.right+10+o.width/2,y:i.y}}e=eg(a,r),t.moveShape(o,e)}}}}Og.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],(function(e){var t=(i=(e=e.context).connection).source,i=i.target;!1!==(e.hints||{}).createElementsBehavior&&(n(t),n(i))})),this.postExecuted(["label.create"],(function(e){var t=(e=e.context).shape;!1!==(e.hints||{}).createElementsBehavior&&n(t.labelTarget)})),this.postExecuted(["elements.create"],(function(e){var t=(e=e.context).elements;!1!==(e.hints||{}).createElementsBehavior&&t.forEach((function(e){n(e)}))}))}function uw(e,t){return Au(t,e,5)}function dw(e,t,n){Og.call(this,e),this.preExecute("shape.append",(function(e){var t=e.source,n=e.shape;e.position||(Hl(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})}),!0)}function hw(e,t){e.invoke(Og,this),this.postExecute("shape.move",(function(e){var n=e.newParent;e=e.shape,e=Object(Vl.filter)(e.incoming.concat(e.outgoing),(function(e){return Hl(e,"bpmn:Association")}));Object(Vl.forEach)(e,(function(e){t.moveConnection(e,{x:0,y:0},n)}))}),!0)}function pw(e,t){t.invoke(Og,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;1===(t=t.filter((function(e){return fw(e,e.host)}))).length&&t.map((function(e){return t.indexOf(e)})).forEach((function(i){var o=t[i];e.elements[i]=n.replaceShape(t[i],o)}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;1===t.length&&fw(t=t[0],i)&&(e.shapes=[n.replaceShape(t,i)])}),!0)}function fw(e,t){return!cm(e)&&Ul(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function mw(e,t,n){function i(e){return Object(Vl.filter)(e.attachers,(function(e){return Hl(e,"bpmn:BoundaryEvent")}))}Og.call(this,e),this.postExecute("connection.create",(function(e){var t=e.context.source,o=i(e=e.context.target);Hl(t,"bpmn:EventBasedGateway")&&Hl(e,"bpmn:ReceiveTask")&&0<o.length&&n.removeElements(o)})),this.postExecute("connection.reconnect",(function(e){var t=e.context.oldSource;e=e.context.newSource;Hl(t,"bpmn:Gateway")&&Hl(e,"bpmn:EventBasedGateway")&&Object(Vl.forEach)(e.outgoing,(function(e){var t=i(e=e.target);Hl(e,"bpmn:ReceiveTask")&&0<t.length&&n.removeElements(t)}))})),e.on("moddleCopy.canCopyProperty",2e3,(function(e){var n=e.parent,i=e.property,o=(e=e.propertyName,t.getPropertyDescriptor(n,e));o&&o.isReference&&Hl(i,"bpmn:RootElement")&&n.set(e,i)}))}function gw(e,t,n,i,o){function r(e){return Ul(e,["bpmn:ReceiveTask","bpmn:SendTask"])||function(e,t){return Object(Vl.isArray)(t)||(t=[t]),Object(Vl.some)(t,(function(t){return Xl(e,t)}))}(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(t){var n=e.getDefinitions().get("rootElements");return Object(Vl.find)(n,Object(Vl.matchPattern)({id:t.id}))}function s(e){return Hl(e,"bpmn:ErrorEventDefinition")?"errorRef":Hl(e,"bpmn:EscalationEventDefinition")?"escalationRef":Hl(e,"bpmn:MessageEventDefinition")?"messageRef":Hl(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(e){return Ul(e,["bpmn:ReceiveTask","bpmn:SendTask"])?e.get("messageRef"):(e=e.get("eventDefinitions")[0]).get(s(e))}n.invoke(Og,this),this.executed("shape.create",(function(t){var n=t.shape;r(n)&&(n=l(Gl(n)))&&!a(n)&&(Gh(e.getDefinitions().get("rootElements"),n),t.addedRootElement=n)}),!0),this.reverted("shape.create",(function(t){(t=t.addedRootElement)&&Uh(e.getDefinitions().get("rootElements"),t)}),!0),t.on("copyPaste.copyElement",(function(e){var t=e.descriptor;r(e=e.element)&&(e=l(Gl(e)))&&(t.referencedRootElement=e)})),t.on("copyPaste.pasteElement",500,(function(e){var t=(e=e.descriptor).businessObject;r(t)&&(e=e.referencedRootElement)&&(a(e)||(e=i.copyElement(e,o.create(e.$type))),e=e,Ul(t=t,["bpmn:ReceiveTask","bpmn:SendTask"])?t.set("messageRef",e):(t=t.get("eventDefinitions")[0]).set(s(t),e))}))}function vw(e){e.invoke(Og,this),this.preExecute("shape.create",1500,(function(e){var t=(e=e.context).parent,n=e.shape;Hl(t,"bpmn:Lane")&&!Hl(n,"bpmn:Lane")&&(e.parent=gu(t,"bpmn:Participant"))}))}function bw(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],1500,(function(t){var i=t.context.shape||t.shape,o=t.hover,r=(Hl(o,"bpmn:Lane")&&!Ul(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=Yu(o),t.hoverGfx=e.getGraphics(t.hover)),n.getRootElement());o!==r&&(i.labelTarget||Hl(i,"bpmn:Group"))&&(t.hover=r,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],1500,(function(t){var n=t.hover;Hl(n,"bpmn:Lane")&&(t.hover=Yu(n)||n,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["bendpoint.move.hover"],1500,(function(t){var n=t.context,i=t.hover;n=n.type;Hl(i,"bpmn:Lane")&&/reconnect/.test(n)&&(t.hover=Yu(i)||i,t.hoverGfx=e.getGraphics(t.hover))})),t.on(["connect.start"],1500,(function(e){var t=(e=e.context).start;Hl(t,"bpmn:Lane")&&(e.start=Yu(t)||t)})),t.on("shape.move.start",2e3,(function(e){var t=e.shape;Hl(t,"bpmn:Lane")&&(e.shape=Yu(t)||t)}))}function yw(e,t,n){Og.call(this,e),this.preExecute("shape.create",(function(e){var n;Hl(e=e.context.shape,"bpmn:DataObjectReference")&&"label"!==e.type&&(n=t.create("bpmn:DataObject"),e.businessObject.dataObjectRef=n)}))}H()(cw,Og),cw.$inject=["eventBus","modeling"],H()(dw,Og),dw.$inject=["eventBus","elementFactory","bpmnRules"],H()(hw,Og),hw.$inject=["injector","modeling"],pw.$inject=["bpmnReplace","injector"],H()(pw,Og),pw.prototype.replaceShape=function(e,t){var n=function(e){return(e=Gl(e).eventDefinitions)&&e[0]}(e);t={type:"bpmn:BoundaryEvent",host:t};return n&&(t.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},mw.$inject=["eventBus","moddle","modeling"],H()(mw,Og),gw.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],H()(gw,Og),vw.$inject=["injector"],H()(vw,Og),bw.$inject=["elementRegistry","eventBus","canvas"],yw.$inject=["eventBus","bpmnFactory","moddle"],H()(yw,Og);function ww(e,t,n){function i(){var t=e.getRootElement();return Hl(t,"bpmn:Collaboration")?t:n.makeCollaboration()}Og.call(this,t),t.on(["create.start","shape.move.start"],2e3,(function(t){var n,i,o,r=(t=t.context).shape,a=e.getRootElement();Hl(r,"bpmn:Participant")&&Hl(a,"bpmn:Process")&&a.children.length&&(a=a.children.filter((function(e){return!Hl(e,"bpmn:Group")&&!cm(e)&&!e.waypoints}))).length&&(n=r,i={width:(i=a=Ru(a)).width+40+30,height:i.height+40},i={x:-(o=Math.max(n.width,i.width))/2,y:-(n=Math.max(n.height,i.height))/2,width:o,height:n},Object(Vl.assign)(r,i),t.createConstraints={bottom:(o=Cu(o=a)).top+r.height/2-20,left:o.right-r.width/2+20,top:o.bottom-r.height/2+20,right:o.left+r.width/2-20-30})})),t.on("create.start",2e3,(function(n){n=n.context.shape;var i=e.getRootElement(),o=e.getGraphics(i);function r(e){e.element=i,e.gfx=o}Hl(n,"bpmn:Participant")&&Hl(i,"bpmn:Process")&&(t.on("element.hover",2e3,r),t.once("create.cleanup",(function(){t.off("element.hover",r)})))})),this.preExecute("elements.create",2e3,(function(e){var t=e.elements,n=e.parent;(t=(t=t,Object(Vl.find)(t,(function(e){return Hl(e,"bpmn:Participant")}))))&&Hl(n,"bpmn:Process")&&(e.parent=i(),(e=e.hints=e.hints||{}).participant=t,e.process=n,e.processRef=Gl(t).get("processRef"))}),!0),this.preExecute("shape.create",(function(e){var t=e.parent,n=e.shape;Hl(n,"bpmn:Participant")&&Hl(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=Gl(n).get("processRef"))}),!0),this.execute("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process;e=e.shape,t=t.participant;!n||t&&e!==t||Gl(e).set("processRef",Gl(n))}),!0),this.revert("shape.create",(function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef;e=e.shape,t=t.participant;!n||t&&e!==t||Gl(e).set("processRef",i)}),!0),this.postExecute("shape.create",(function(e){var t=e.hints||{},i=e.process||e.hints.process;e=e.shape,t=t.participant;i&&(i=i.children.slice(),t?e===t&&n.moveElements(i,{x:0,y:0},t):n.moveElements(i,{x:0,y:0},e))}),!0)}ww.$inject=["canvas","eventBus","modeling"],H()(ww,Og);var xw="__targetRef_placeholder";function _w(e,t){function n(e,n){e=e.get("properties");var i=Object(Vl.find)(e,(function(e){return e.name===xw}));return!i&&n&&Gh(e,i=t.create("bpmn:Property",{name:xw})),i}function i(e,t){var i,o,r=n(e);r&&(i=r,o=t,t=(t=e).get("dataInputAssociations"),Object(Vl.find)(t,(function(e){return e!==o&&e.targetRef===i}))||Uh(e.get("properties"),r))}function o(e){var t=(a=(e=e.context).connection).businessObject,o=(o=a.target)&&o.businessObject,r=(r=e.newTarget)&&r.businessObject,a=(e=(e=e.oldTarget||e.target)&&e.businessObject,a.businessObject);e&&e!==o&&i(e,t),r&&r!==o&&i(r,t),o?(e=n(o,!0),a.targetRef=e):a.targetRef=null}Og.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],kw(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],kw(o))}function kw(e){return function(t){if(Hl(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Ew(e){this._bpmnUpdater=e}function Cw(e,t,n,i){function o(e){return e.children.filter((function(e){return Hl(e,"bpmn:DataStoreReference")&&!e.labelTarget}))}function r(e,i){e=e.businessObject||e,(i=i||n.filter((function(e){return Hl(e,"bpmn:Participant")&&Gl(e).processRef}))[0])&&(i=i.businessObject||i,t.execute("dataStore.updateContainment",{dataStoreBo:e,newSemanticParent:i.processRef||i,newDiParent:i.di}))}Og.call(this,i),t.registerHandler("dataStore.updateContainment",Ew),this.preExecute("shape.create",(function(e){var t=(e=e.context).shape;Hl(t,"bpmn:DataStoreReference")&&"label"!==t.type&&(e.hints||(e.hints={}),e.hints.autoResize=!1)})),this.preExecute("elements.move",(function(e){var t=(e=e.context).shapes;t.filter((function(e){return Hl(e,"bpmn:DataStoreReference")})).length&&(e.hints||(e.hints={}),e.hints.autoResize=t.filter((function(e){return!Hl(e,"bpmn:DataStoreReference")})))})),this.postExecute("shape.create",(function(e){var t=(e=e.context.shape).parent;Hl(e,"bpmn:DataStoreReference")&&"label"!==e.type&&Hl(t,"bpmn:Collaboration")&&r(e)})),this.postExecute("shape.move",(function(e){var t=(e=e.context).shape,n=(e=e.oldParent,t.parent);Hl(e,"bpmn:Collaboration")||Hl(t,"bpmn:DataStoreReference")&&"label"!==t.type&&Hl(n,"bpmn:Collaboration")&&r(t,Hl(e,"bpmn:Participant")?e:function(e,t){for(;e.parent;){if(Hl(e.parent,"bpmn:Participant"))return e.parent;e=e.parent}}(e))})),this.postExecute("shape.delete",(function(t){var n=t.context.shape;t=e.getRootElement();Ul(n,["bpmn:Participant","bpmn:SubProcess"])&&Hl(t,"bpmn:Collaboration")&&o(t).filter((function(e){for(var t=n,i=e.businessObject||e,o=t.businessObject||t;i.$parent;){if(i.$parent===o.processRef||o)return!0;i=i.$parent}return!1})).forEach((function(e){r(e)}))})),this.postExecute("canvas.updateRoot",(function(e){var t=(e=e.context).oldRoot,n=e.newRoot;o(t).forEach((function(e){Hl(n,"bpmn:Process")&&r(e,n)}))}))}function Sw(e,t,n){Og.call(this,e),this.postExecuted("shape.delete",500,(function(e){var t,i,o,r,a=(e=e.context).hints,s=e.shape;e=e.oldParent;!Hl(s,"bpmn:Lane")||a&&a.nested||(t=s,a=Ku(a=e),o=[],r=[],$u(a,(function(e){return(e.y>t.y?r:o).push(e),e.children})),a.length&&(a=r.length&&o.length?t.height/2:t.height,o.length&&(i=n.calculateAdjustments(o,"y",a,t.y-10),n.makeSpace(i.movingShapes,i.resizingShapes,{x:0,y:a},"s")),r.length)&&(i=n.calculateAdjustments(r,"y",-a,t.y+t.height+10),n.makeSpace(i.movingShapes,i.resizingShapes,{x:0,y:-a},"n")))}))}function Tw(e,t){t.invoke(Og,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,(function(e){var t=e.elements;t.filter((function(e){return Aw(e,e.host)})).map((function(e){return t.indexOf(e)})).forEach((function(i){e.elements[i]=n.replaceShape(t[i])}))}),!0),this.preExecute("elements.move",500,(function(e){var t=e.shapes,i=e.newHost;t.forEach((function(e,o){var r=e.host;Aw(e,-1!==t.indexOf(r)?r:i)&&(t[o]=n.replaceShape(e))}))}),!0)}function Aw(e,t){return!cm(e)&&Hl(e,"bpmn:BoundaryEvent")&&!t}function Ow(e,t,n){function i(e,i,o){var r,a,s,l,c=i.waypoints,u=e.outgoing.slice(),d=e.incoming.slice(),h=Kg(c,o=Object(Vl.isNumber)(o.width)?Tu(o):o);if(h){if(r=c.slice(0,h.index),a=c.slice(h.index+(h.bendpoint?1:0)),!r.length||!a.length)return;c=h.bendpoint?c[h.index]:o,1!==r.length&&Mw(e,r[r.length-1])||r.push(Dw(c)),1!==a.length&&Mw(e,a[0])||a.unshift(Dw(c))}h=i.source,c=i.target,t.canConnect(h,e,i)&&(n.reconnectEnd(i,e,r||o),s=i),t.canConnect(e,c,i)&&(l=s?n.connect(e,c,{type:i.type,waypoints:a}):(n.reconnectStart(i,e,a||o),i)),(h=[].concat(s&&Object(Vl.filter)(d,(function(e){return e.source===s.source}))||[],l&&Object(Vl.filter)(u,(function(e){return e.target===l.target}))||[])).length&&n.removeElements(h)}Og.call(this,e),this.preExecute("elements.move",(function(e){var n,i=e.newParent,o=e.shapes,r=e.delta,a=o[0];a&&i&&(i&&i.waypoints&&(e.newParent=i=i.parent),a=Tu(a),n={x:a.x+r.x,y:a.y+r.y},a=Object(Vl.find)(i.children,(function(e){return t.canInsert(o,e)&&Kg(e.waypoints,n)})))&&(e.targetFlow=a,e.position=n)}),!0),this.postExecuted("elements.move",(function(e){var t=e.shapes,n=e.targetFlow;e=e.position;n&&i(t[0],n,e)}),!0),this.preExecute("shape.create",(function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)}),!0),this.postExecuted("shape.create",(function(e){var t=e.shape,n=e.targetFlow;e=e.position;n&&i(t,n,e)}),!0)}function Mw(e,t){var n=t.x;t=t.y;return n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function Dw(e){return Object(Vl.assign)({},e)}function $w(e,t){Og.call(this,e),this.preExecuted("connection.create",(function(e){var n=(e=e.context).source,i=e.target,o=i.incoming.slice();e.hints&&!1===e.hints.createElementsBehavior||Hl(n,"bpmn:EventBasedGateway")&&i.incoming.length&&o.filter(Pw).forEach((function(e){t.removeConnection(e)}))})),this.preExecuted("shape.replace",(function(e){var n=e.context.newShape;Hl(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(Pw).map((function(e){return e.target})).reduce((function(e,t){return t=t.incoming.filter(Pw),e.concat(t)}),[]).forEach((function(e){e.source!==n&&t.removeConnection(e)}))}))}function Pw(e){return Hl(e,"bpmn:SequenceFlow")}function Rw(e,t,n,i,o,r){function a(){return Gl(t.getRootElement()).$parent}function s(e){var t;(e=Gl(e).categoryValueRef)&&(t=e.$parent,e)&&(Uh(t.categoryValue,e),t)&&!t.categoryValue.length&&(e=t,Uh(a().get("rootElements"),e))}o.invoke(Og,this),this.executed("shape.delete",(function(e){var t,i,o;Hl(e=e.context.shape,"bpmn:Group")&&(t=Gl(e).categoryValueRef,i=n.filter((function(e){return Hl(e,"bpmn:Group")})),o=t,i.some((function(e){return(e=Gl(e)).categoryValueRef&&e.categoryValueRef===o}))||s(e))})),this.reverted("shape.delete",(function(e){var t,n;Hl(e=e.context.shape,"bpmn:Group")&&(e=Gl(e).categoryValueRef,t=a(),Gh((n=e?e.$parent:null).get("categoryValue"),e),Gh(t.get("rootElements"),n))})),this.execute("shape.create",(function(t){var n;Hl(t=Gl(t.context.shape),"bpmn:Group")&&!t.categoryValueRef&&(n=tw(a(),e),t.categoryValueRef=n)})),this.revert("shape.create",(function(e){Hl(e=e.context.shape,"bpmn:Group")&&(s(e),delete Gl(e).categoryValueRef)})),i.on("moddleCopy.canCopyProperty",2e3,(function(t){var n;if(Hl(t=t.property,"bpmn:CategoryValue"))return n=tw(a(),e),r.copyElement(t,n)}))}function Lw(e,t,n,i){var o,r,a=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y);return 0==a?null:(r=e.y-n.y,o=e.x-n.x,r=((i.x-n.x)*r-(i.y-n.y)*o)/a,{x:Math.round(e.x+r*(t.x-e.x)),y:Math.round(e.y+r*(t.y-e.y))})}function Iw(e){function t(e,t,n){var i={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y};i=Lw(e,t,n,i),t=Lw(e,t,n,o),o=i&&t?Nw(i,n)>Nw(t,n)?t:i:i||t;e.original=o}e.on("bpmnElement.added",(function(e){var n;(e=e.element).waypoints&&(t((n=(e=e).waypoints)[0],n[1],Tu(e.source)),t(n[n.length-1],n[n.length-2],Tu(e.target)))}))}function Nw(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Fw(e){Og.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],(function(e){Ul(e=Gl(e.context.shape),t)&&!e.di.get("isHorizontal")&&e.di.set("isHorizontal",!0)}))}function jw(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Bw(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function qw(e,t){var n,i,o=t[0];t={x:(t=t[1]).x-o.x,y:t.y-o.y},n=[o.x,o.y],i=[t.x,t.y],e=[e.x,e.y],e=-((n=[{n:n[0]-e[0],lambda:i[0]},{n:n[1]-e[1],lambda:i[1]}])[0].n*i[0]+n[1].n*i[1])/(n[0].lambda*i[0]+n[1].lambda*i[1]);return{x:o.x+e*t.x,y:o.y+e*t.y}}function zw(e,t){return jw({x:e.x-t.x,y:e.y-t.y})}_w.$inject=["eventBus","bpmnFactory"],H()(_w,Og),Ew.$inject=["bpmnUpdater"],Ew.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Ew.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent;e=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,e)},Cw.$inject=["canvas","commandStack","elementRegistry","eventBus"],H()(Cw,Og),Sw.$inject=["eventBus","modeling","spaceTool"],H()(Sw,Og),Tw.$inject=["bpmnReplace","injector"],H()(Tw,Og),Tw.prototype.replaceShape=function(e){var t=(t=function(e){return(e=Gl(e).eventDefinitions)&&e[0]}(e))?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:{type:"bpmn:IntermediateThrowEvent"};return this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},H()(Ow,Og),Ow.$inject=["eventBus","bpmnRules","modeling"],$w.$inject=["eventBus","modeling"],H()($w,Og),Rw.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],H()(Rw,Og),Iw.$inject=["eventBus"],Fw.$inject=["eventBus"],H()(Fw,Og);var Vw=Math.sqrt,Ww=Math.min,Hw=Math.max,Uw=Math.abs;function Gw(e){return Math.pow(e,2)}function Kw(e,t){return Vw(Gw(e.x-t.x)+Gw(e.y-t.y))}function Yw(e,t,n){return e>=Ww(t,n)-Xw&&e<=Hw(t,n)+Xw}var Xw=.1;function Jw(e,t){return Uw(e.x-t.x)<=Xw&&Uw(e.y-t.y)<=Xw}function Zw(e,t,n,i){var o=function(e,t){var n,i,o,r,a,s,l,c,u=0;for(u=0;u<t.length-1;u++){if((o=Jw(n=t[u],i=t[u+1])?[n]:(o=Kw(e,n),l=Kw(e,i),function(e,t,n,i){var o,r=t.x-e.x,a=t.y-e.y,s=r*r+a*a,l=(r*(o=n.x-e.x)+a*(n=n.y-e.y))/s;return(o=l*l-(o*o+n*n-i*i)/s)<0&&-1e-6<o&&(o=0),o<0?[]:(i=-l+(n=Vw(o)),s=-l-n,l={x:e.x-r*i,y:e.y-a*i},0===o?[l]:[l,n={x:e.x-r*s,y:e.y-a*s}].filter((function(n){return i=e,o=t,Yw((n=n).x,i.x,o.x)&&Yw(n.y,i.y,o.y);var i,o})))}(n,i,e,Ww(o,l)))).length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===o.length&&(r={type:"bendpoint",position:o[0],segmentIndex:u,bendpointIndex:Jw(n,o[0])?u:u+1}),2===o.length&&(l=o[0],c=o[1],r={type:"segment",position:c={x:(l.x+c.x)/2,y:(l.y+c.y)/2},segmentIndex:u,relativeLocation:Kw(n,c)/Kw(n,i)}),c=Kw(r.position,e),(!s||c<a)&&(s=r,a=c)}return s}(e={x:e.x+e.width/2,y:e.y+e.height/2},n),r=o.segmentIndex,a=(u=n,d=t,i=i,p=(l=o).segmentIndex,h=d.length-u.length,i.segmentMove?(a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex,p===a?s:s<=p?p+h<s?s:p+h:p):i.bendpointMove?(a=i.bendpointMove.insert,s=i.bendpointMove.bendpointIndex,0==h?p:(s<=p&&(c=a?p+1:p-1),p<s&&(c=p,a)&&"bendpoint"!==l.type&&s-1===p&&Qw(d,s)<l.relativeLocation&&c++,c)):0==h?p:i.connectionStart?0===p?0:null:i.connectionEnd&&p===u.length-2?d.length-2:null);if(null===a)return{x:0,y:0};if(a<0||a>t.length-2)return{x:0,y:0};var s=ex(n,r),l=ex(t,a),c=o.position,u=(h=c,p=zw((i=s)[0],i[1]),i=zw(i[0],h),0===p?0:i/p),d=function(e,t){return e=Bw(e),Bw(t)-e}(s,l);if("bendpoint"===o.type){r=t.length-n.length;var h=o.bendpointIndex;i=n[h];if(-1!==t.indexOf(i))return{x:0,y:0};if(0==r)return{x:(p=t[h]).x-o.position.x,y:p.y-o.position.y};r<0&&0!==h&&h<n.length-1&&(u=Qw(n,h))}var p;i=(l[1].x-l[0].x)*u+l[0].x,t=(l[1].y-l[0].y)*u+l[0].y;return Eu({x:i+(r=(p={x:e.x-c.x,y:e.y-c.y},(o=d)?{x:Math.cos(o)*p.x-Math.sin(o)*p.y,y:Math.sin(o)*p.x+Math.cos(o)*p.y}:p)).x-e.x,y:t+r.y-e.y})}function Qw(e,t){var n=zw(e[t-1],e[t]);return n/(n+zw(e[t],e[t+1]))}function ex(e,t){return[e[t],e[t+1]]}function tx(e,t,n){var i=Qm(t),o=Qm(n);i=(e=eg(e,i)).x*(n.width/t.width),e=e.y*(n.height/t.height);return Eu({x:o.x+i,y:o.y+e})}function nx(e,t,n){var i=Qm(e),o=Qm(t),r=Qm(n),a=eg(e,i);o=eg(i,o);return(i=function(e,t,n){var i,o=Cu(t),r=Cu(n);if(function(e,t){return function(e,t){return e.right!==t.right&&e.left!==t.left}(e,t)||function(e,t){return e.top!==t.top&&e.bottom!==t.bottom}(e,t)}(o,r))return null;if("top"===(t=Au(t,e)))i={x:0,y:r.bottom-o.bottom};else if("bottom"===t)i={x:0,y:r.top-o.top};else if("right"===t)i={x:r.left-o.left,y:0};else{if("left"!==t)return null;i={x:r.right-o.right,y:0}}return Au(n,r={x:e.x+i.x,y:e.y+i.y})===t?i:null}(i,t,n))||(i=o.x*(n.width/t.width),o=o.y*(n.height/t.height),n=r.x+i,t=r.y+o,Eu({x:n+a.x-e.x,y:t+a.y-e.y}))}var ix={width:90,height:20};function ox(e,t,n,i){Og.call(this,e),this.postExecute("element.updateProperties",(function(e){var n,o=(e=e.context).element;"name"in(e=e.properties)&&t.updateLabel(o,e.name),"text"in e&&Hl(o,"bpmn:TextAnnotation")&&(n=i.getTextAnnotationBounds({x:o.x,y:o.y,width:o.width,height:o.height},e.text||""),t.updateLabel(o,e.text,n))})),this.postExecute(["shape.create","connection.create"],(function(e){var n,o,r;!1!==((e=e.context).hints||{}).createElementsBehavior&&(n=(e=e.shape||e.connection).businessObject,!cm(e))&&am(e)&&Zl(e)&&(o=lm(e),r=i.getExternalLabelBounds(ix,Zl(e)),t.createLabel(e,o,{id:n.id+"_label",businessObject:n,width:r.width,height:r.height}))})),this.postExecute("shape.delete",(function(e){var n=(e=e.context).labelTarget;e=e.hints||{};n&&!1!==e.unsetLabel&&t.updateLabel(n,null,null,{removeShape:!1})})),this.postExecute(["label.create"],(function(e){var t;(e=e.context.shape).labelTarget&&Hl(e.labelTarget||e,"bpmn:BaseElement")&&((t=e.businessObject.di).label||(t.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),Object(Vl.assign)(t.label.bounds,{x:e.x,y:e.y,width:e.width,height:e.height}))})),this.postExecute(["connection.layout","connection.updateWaypoints"],(function(e){var n,i,o,r=e.context;!1!==(r.hints||{}).labelBehavior&&(r=r.connection.label)&&r.parent&&(n=(o=(e=(e=e).context).connection).label,i=Object(Vl.assign)({},e.hints),o=e.newWaypoints||o.waypoints,e=e.oldWaypoints,void 0===i.startChanged&&(i.startChanged=!!i.connectionStart),void 0===i.endChanged&&(i.endChanged=!!i.connectionEnd),n=Zw(n,o,e,i),t.moveShape(r,n))})),this.postExecute(["shape.replace"],(function(e){var t=(e=e.context).newShape,n=(e=e.oldShape,Gl(t));n&&am(n)&&e.label&&t.label&&(t.label.x=e.label.x,t.label.y=e.label.y)})),this.postExecute("shape.resize",(function(e){var n,i=(e=e.context).shape,o=e.newBounds;e=e.oldBounds;sm(i)&&(n=function(e,t){if(t.length)return t=function(e,t){return t=t.map((function(t){return{line:t,distance:jw({x:(t=qw(e,t=t)).x-e.x,y:t.y-e.y})}})),Object(Vl.sortBy)(t,"distance")[0].line}(e,t),qw(e,t)}(Tu(i=i.label),[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]),e=Eu(eg(tx(n=n,e,o),n)),t.moveShape(i,e))}))}function rx(e,t,n){var i=dx(e=ux(e),t);e=e[0];return i.length?i[i.length-1]:tx(e.original||e,n,t)}function ax(e,t,n){var i=dx(e=ux(e),t);e=e[e.length-1];return i.length?i[0]:tx(e.original||e,n,t)}function sx(e,t,n){return e=ux(e),n=cx(t,n),tx((e=e[0]).original||e,n,t)}function lx(e,t,n){return e=ux(e),n=cx(t,n),tx((e=e[e.length-1]).original||e,n,t)}function cx(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ux(e){var t=e.waypoints;if(t.length)return t;throw new Error("connection#"+e.id+": no waypoints")}function dx(e,t){return e=Object(Vl.map)(e,hx),Object(Vl.filter)(e,(function(e){return"intersect"===Au(t,e,1)}))}function hx(e){return e.original||e}function px(e,t){Og.call(this,e),this.postExecute("shape.replace",(function(e){var n,i,o,r,a=e.oldShape,s=e.newShape;e=s,Hl(i=a,"bpmn:Participant")&&Kl(i)&&Hl(e,"bpmn:Participant")&&!Kl(e)&&(i=Pu([n=a],!1),o=[],r=[],i.forEach((function(e){e!==n&&(e.incoming.forEach((function(e){Hl(e,"bpmn:MessageFlow")&&o.push(e)})),e.outgoing.forEach((function(e){Hl(e,"bpmn:MessageFlow")&&r.push(e)})))}),[]),(e={incoming:o,outgoing:r}).incoming.forEach((function(e){var n=ax(e,s,a);t.reconnectEnd(e,s,n)})),e.outgoing.forEach((function(e){var n=rx(e,s,a);t.reconnectStart(e,s,n)})))}),!0)}function fx(e,t,n){e.on(["shape.move.rejected","create.rejected"],(function(e){var i=e.context,o=i.shape;Hl(i.target,"bpmn:Collaboration")&&Hl(o,"bpmn:FlowNode")&&(i=e,o=n("flow elements must be children of pools/participants"),t.add({position:{x:i.x+5,y:i.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"}))}))}function mx(e,t,n,i){Og.call(this,e);var o=i.get("dragging",!1);function r(e){var i,o,r=e.source,a=e.target;e.parent&&(Hl(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(r,a)||(o=!0),n.canConnectMessageFlow(r,a))&&(i="bpmn:MessageFlow"),Hl(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(r,a)||(o=!0),n.canConnectSequenceFlow(r,a))&&(i="bpmn:SequenceFlow"),(o=!(!Hl(e,"bpmn:Association")||n.canConnectAssociation(r,a))||o)&&t.removeConnection(e),i)&&t.connect(r,a,{type:i,waypoints:e.waypoints.slice()})}this.postExecuted("elements.move",(function(e){e=e.closure.allConnections,Object(Vl.forEach)(e,r)}),!0),this.preExecute("connection.reconnect",(function(e){var i=(e=e.context).connection,r=e.newSource||i.source,a=e.newTarget||i.target,s=n.canConnect(r,a);s&&s.type!==i.type&&(r=t.connect(r,a,{type:s.type,waypoints:i.waypoints.slice()}),t.removeConnection(i),e.connection=r,o)&&(a=i,s=r,e=(e=o.context())&&e.payload.previousSelection)&&e.length&&-1!==(a=e.indexOf(a))&&e.splice(a,1,s)})),this.postExecuted("element.updateProperties",(function(e){var n,i=(e=e.context).properties,o=(e=e.element).businessObject;i.default&&(n=Object(Vl.find)(e.outgoing,Object(Vl.matchPattern)({id:e.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),i.conditionExpression&&o.sourceRef.default===o&&t.updateProperties(e.source,{default:void 0})}))}function gx(e,t){Og.call(this,e),this.preExecute("shape.delete",(function(e){var t=e.shape,n=t.parent;Hl(t,"bpmn:Participant")&&(e.collaborationRoot=n)}),!0),this.postExecute("shape.delete",(function(e){(e=e.collaborationRoot)&&!e.businessObject.participants.length&&t.makeProcess()}),!0)}function vx(e,t,n,i,o,r){i.invoke(Og,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=r,this.postExecuted(["elements.create"],500,(function(e){var n=(e=e.context).parent;e=e.elements;(n=t.canReplace(e,n))&&this.replaceElements(e,n.replacements)}),this),this.postExecuted(["elements.move"],500,(function(e){var n=(e=e.context).newParent,i=e.newHost,o=[];(e=(Object(Vl.forEach)(e.closure.topLevel,(function(e){o=Yl(e)?o.concat(e.children):o.concat(e)})),1===o.length&&i&&(n=i),t.canReplace(o,n)))&&this.replaceElements(o,e.replacements,i)}),this),this.postExecute(["shape.replace"],1500,(function(e){var n=(e=e.context).oldShape;e=e.newShape;(n=n.attachers)&&n.length&&(e=t.canReplace(n,e),this.replaceElements(n,e.replacements))}),this),this.postExecuted(["shape.replace"],1500,(function(e){var t=(e=e.context).oldShape;e=e.newShape;o.unclaimId(t.businessObject.id,t.businessObject),o.updateProperties(e,{id:t.id})}))}H()(ox,Og),ox.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],px.$inject=["eventBus","modeling"],H()(px,Og),fx.$inject=["eventBus","tooltips","translate"],H()(mx,Og),mx.$inject=["eventBus","modeling","bpmnRules","injector"],gx.$inject=["eventBus","modeling"],H()(gx,Og),H()(vx,Og),vx.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,o=this._selection;Object(Vl.forEach)(t,(function(t){var o={type:t.newElementType},r=(t=n.get(t.oldElementId),e.indexOf(t));e[r]=i.replaceElement(t,o,{select:!1})})),t&&o.select(e)},vx.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var bx=300,yx=60,wx={width:300,height:150},xx={width:140,height:120},_x={width:50,height:30};function kx(e){e.on("resize.start",1500,(function(e){var t=(e=e.context).shape,n=e.direction,i=e.balanced;(Hl(t,"bpmn:Lane")||Hl(t,"bpmn:Participant"))&&(e.resizeConstraints=function(e,t,n){var i=Yu(e),o=!0,r=!0,a=Gu(i,[i]),s=Cu(e),l={},c={};return/e/.test(t)?c.right=s.left+bx:/w/.test(t)&&(c.left=s.right-bx),a.forEach((function(e){e=Cu(e),/n/.test(t)&&(e.top<s.top-10&&(o=!1),n&&Ex(s.top-e.bottom)<10&&Ox(l,"top",e.top+yx),Ex(s.top-e.top)<5)&&Ax(c,"top",e.bottom-yx),/s/.test(t)&&(e.bottom>s.bottom+10&&(r=!1),n&&Ex(s.bottom-e.top)<10&&Ax(l,"bottom",e.bottom-yx),Ex(s.bottom-e.bottom)<5)&&Ox(c,"bottom",e.top+yx)})),i.children.filter((function(e){return!e.hidden&&!e.waypoints&&(Hl(e,"bpmn:FlowElement")||Hl(e,"bpmn:Artifact"))})).forEach((function(e){e=Cu(e),o&&/n/.test(t)&&Ax(c,"top",e.top-$x),/e/.test(t)&&Ox(c,"right",e.right+Mx),r&&/s/.test(t)&&Ox(c,"bottom",e.bottom+Px),/w/.test(t)&&Ax(c,"left",e.left-Dx)})),{min:c,max:l}}(t,n,i)),Hl(t,"bpmn:Participant")&&(e.minDimensions=wx),Hl(t,"bpmn:SubProcess")&&Kl(t)&&(e.minDimensions=xx),Hl(t,"bpmn:TextAnnotation")&&(e.minDimensions=_x)}))}kx.$inject=["eventBus"];var Ex=Math.abs,Cx=Math.min,Sx=Math.max;function Tx(e,t,n,i){var o=e[t];e[t]=void 0===o?n:i(n,o)}function Ax(e,t,n){Tx(e,t,n,Cx)}function Ox(e,t,n){Tx(e,t,n,Sx)}var Mx=20,Dx=50,$x=20,Px=20;function Rx(e,t){e.on("resize.start",1501,(function(e){var t=e.context,n=t.shape;(Hl(n,"bpmn:Lane")||Hl(n,"bpmn:Participant"))&&(t.balanced=!ym(e))})),e.on("resize.end",1001,(function(e){var n=(e=e.context).shape,i=e.canExecute,o=e.newBounds;if(Hl(n,"bpmn:Lane")||Hl(n,"bpmn:Participant"))return i&&(o=ku(o),t.resizeLane(n,o,e.balanced)),!1}))}function Lx(e,t,n){Og.call(this,e),this.preExecute("shape.delete",(function(e){var i,o,r,a;1===(e=e.context.shape).incoming.length&&1===e.outgoing.length&&(i=e.incoming[0],e=e.outgoing[0],Hl(i,"bpmn:SequenceFlow"))&&Hl(e,"bpmn:SequenceFlow")&&t.canConnect(i.source,e.target,i)&&(o=i.waypoints,r=e.waypoints,a=(a=Lw(Ix(o[o.length-2]),Ix(o[o.length-1]),Ix(r[1]),Ix(r[0])))?[].concat(o.slice(0,o.length-1),[a],r.slice(1)):[Ix(o[0]),Ix(r[r.length-1])],n.reconnectEnd(i,e.target,a))}))}function Ix(e){return e.original||e}Rx.$inject=["eventBus","modeling"],H()(Lx,Og),Lx.$inject=["eventBus","bpmnRules","modeling"];var Nx=Math.max;function Fx(e){e.on("spaceTool.getMinDimensions",(function(e){var t=e.shapes,n=e.axis,i=e.start,o={};return Object(Vl.forEach)(t,(function(e){var t,r,a=e.id;Hl(e,"bpmn:Participant")&&(o[a]="x"===n?wx:{width:wx.width,height:(r=i,function(e){return Ku(e).length}(t=e)?(t=function(e,t){var n=Ku(e);return n=function e(t,n){var i,o,r;for(i=0;i<t.length;i++)if(n>=(o=t[i]).y&&n<=o.y+o.height)return(r=Ku(o)).length?e(r,n):o}(n,t),e.height-n.height+yx}(t,r),Nx(wx.height,t)):wx.height)}),Hl(e,"bpmn:SubProcess")&&Kl(e)&&(o[a]=xx),Hl(e,"bpmn:TextAnnotation")&&(o[a]=_x)})),o}))}function jx(e,t){e.invoke(Og,this),this.postExecuted("shape.replace",(function(e){var n=e.context.oldShape;Hl(e=e.context.newShape,"bpmn:SubProcess")&&Hl(n,"bpmn:Task")&&Kl(e)&&(n={x:e.x+e.width/6,y:e.y+e.height/2},t.createShape({type:"bpmn:StartEvent"},n,e))}))}function Bx(e,t,n,i){Og.call(this,e),this.executed(["shape.toggleCollapse"],500,(function(e){var t;Hl(e=e.context.shape,"bpmn:SubProcess")&&(e.collapsed?Gl(e).di.isExpanded=!1:((t=e.children).length&&t.forEach((function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})),Gl(e).di.isExpanded=!0))})),this.reverted(["shape.toggleCollapse"],500,(function(e){(e=e.context.shape).collapsed?Gl(e).di.isExpanded=!1:Gl(e).di.isExpanded=!0})),this.postExecuted(["shape.toggleCollapse"],500,(function(e){e=e.context.shape;var i,o=t._getDefaultSize(e),r=e.collapsed?{x:e.x+(e.width-o.width)/2,y:e.y+(e.height-o.height)/2,width:o.width,height:o.height}:(o=o,(r=Wu((i=e).children.filter((function(e){return!e.hidden})).concat([i])))?(o.width=Math.max(r.width,o.width),o.height=Math.max(r.height,o.height),o.x=r.x+(r.width-o.width)/2,o.y=r.y+(r.height-o.height)/2):(o.x=i.x+(i.width-o.width)/2,o.y=i.y+(i.height-o.height)/2),o);n.resizeShape(e,r,null,{autoResize:!e.collapsed&&"nwse"})}))}function qx(e,t,n,i){t.invoke(Og,this),this.preExecute("shape.delete",(function(e){var t=(e=e.context.shape).businessObject;cm(e)||(Hl(e,"bpmn:Participant")&&Kl(e)&&n.ids.unclaim(t.processRef.id),i.unclaimId(t.id,t))})),this.preExecute("connection.delete",(function(e){e=e.context.connection.businessObject,i.unclaimId(e.id,e)})),this.preExecute("canvas.updateRoot",(function(){var t=e.getRootElement(),i=t.businessObject;Hl(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)}))}function zx(e,t,n){var i;Og.call(this,e),e=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"],this.preExecute(e,5e3,(function(e){(i=i||new Vx).enter()})),this.postExecuted(e,500,(function(e){if(!i)throw new Error(n("out of bounds release"));i.leave()&&(t.updateLaneRefs(i.flowNodes,i.lanes),i=null)})),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],(function(e){e=e.context.shape;var t=function(){if(i)return i;throw new Error(n("out of bounds release"))}();e.labelTarget||(Hl(e,"bpmn:Lane")&&t.addLane(e),Hl(e,"bpmn:FlowNode")&&t.addFlowNode(e))}))}function Vx(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Wx(e,t){Og.call(this,e),this.preExecute("connection.delete",(function(e){var n,i=(e=e.context.connection).source;n=i,Hl(e=e,"bpmn:SequenceFlow")&&(n=Gl(n),e=Gl(e),n.get("default")===e)&&t.updateProperties(i,{default:null})}))}Fx.$inject=["eventBus"],jx.$inject=["injector","modeling"],H()(jx,Og),H()(Bx,Og),Bx.$inject=["eventBus","elementFactory","modeling"],H()(qx,Og),qx.$inject=["canvas","injector","moddle","modeling"],zx.$inject=["eventBus","modeling","translate"],H()(zx,Og),H()(Wx,Og),Wx.$inject=["eventBus","modeling"];var Hx={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",cw],appendBehavior:["type",dw],associationBehavior:["type",hw],attachEventBehavior:["type",pw],boundaryEventBehavior:["type",mw],rootElementReferenceBehavior:["type",gw],createBehavior:["type",vw],fixHoverBehavior:["type",bw],createDataObjectBehavior:["type",yw],createParticipantBehavior:["type",ww],dataInputAssociationBehavior:["type",_w],dataStoreBehavior:["type",Cw],deleteLaneBehavior:["type",Sw],detachEventBehavior:["type",Tw],dropOnFlowBehavior:["type",Ow],eventBasedGatewayBehavior:["type",$w],groupBehavior:["type",Rw],importDockingFix:["type",Iw],isHorizontalFix:["type",Fw],labelBehavior:["type",ox],messageFlowBehavior:["type",px],modelingFeedback:["type",fx],replaceConnectionBehavior:["type",mx],removeParticipantBehavior:["type",gx],replaceElementBehaviour:["type",vx],resizeBehavior:["type",kx],resizeLaneBehavior:["type",Rx],removeElementBehavior:["type",Lx],toggleElementCollapseBehaviour:["type",Bx],spaceToolBehavior:["type",Fx],subProcessStartEventBehavior:["type",jx],unclaimIdBehavior:["type",qx],updateFlowNodeRefsBehavior:["type",zx],unsetDefaultFlowBehavior:["type",Wx]};function Ux(e,t){return"intersect"!==(e=Au(e,t,-15))?e:null}function Gx(e){$g.call(this,e)}function Kx(e){return!e||cm(e)}function Yx(e){do{if(Hl(e,"bpmn:Process"))return Gl(e);if(Hl(e,"bpmn:Participant"))return Gl(e).processRef||Gl(e)}while(e=e.parent)}function Xx(e){return Hl(e,"bpmn:TextAnnotation")}function Jx(e){return Hl(e,"bpmn:Group")&&!e.labelTarget}function Zx(e){return Hl(e,"bpmn:BoundaryEvent")&&t_(e,"bpmn:CompensateEventDefinition")}function Qx(e){return Gl(e).isForCompensation}function e_(e){for(var t=e;t=t.parent;){if(Hl(t,"bpmn:FlowElementsContainer"))return Gl(t);if(Hl(t,"bpmn:Participant"))return Gl(t).processRef}return null}function t_(e,t){return e=Gl(e),!!Object(Vl.find)(e.eventDefinitions||[],(function(e){return Hl(e,t)}))}function n_(e,t){return(Gl(e).eventDefinitions||[]).every((function(e){return Hl(e,t)}))}function i_(e){return Hl(e,"bpmn:ReceiveTask")||Hl(e,"bpmn:IntermediateCatchEvent")&&(t_(e,"bpmn:MessageEventDefinition")||t_(e,"bpmn:TimerEventDefinition")||t_(e,"bpmn:ConditionalEventDefinition")||t_(e,"bpmn:SignalEventDefinition"))}function o_(e){return e.waypoints}function r_(e,t){return-1!==function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t).indexOf(e)}function a_(e,t,n){if(Kx(e)||Kx(t))return null;if(!Hl(n,"bpmn:DataAssociation")){if(b_(e,t))return{type:"bpmn:MessageFlow"};if(y_(e,t))return{type:"bpmn:SequenceFlow"}}return(n=w_(e,t))||(Zx(e)&&Qx(t)?{type:"bpmn:Association",associationDirection:"One"}:!!v_(e,t)&&{type:"bpmn:Association"})}function s_(e,t,n){var i;return!(!cm(e)&&!Jx(e))||!(Hl(t,"bpmn:Participant")&&!Kl(t))&&(Hl(e,"bpmn:Participant")?Hl(t,"bpmn:Process")||Hl(t,"bpmn:Collaboration"):Ul(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:Hl(e,"bpmn:Lane")?Hl(t,"bpmn:Participant")||Hl(t,"bpmn:Lane"):!(Hl(e,"bpmn:BoundaryEvent")&&(!Gl(i=e).cancelActivity||!c_(i)&&!u_(i)))&&(Hl(e,"bpmn:FlowElement")&&!Hl(e,"bpmn:DataStoreReference")?Hl(t,"bpmn:FlowElementsContainer")?Kl(t):Ul(t,["bpmn:Participant","bpmn:Lane"]):Hl(e,"bpmn:DataStoreReference")&&Hl(t,"bpmn:Collaboration")?Object(Vl.some)(Gl(t).get("participants"),(function(e){return!!e.get("processRef")})):Ul(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Ul(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!Hl(e,"bpmn:MessageFlow")&&(Hl(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function l_(e){return Hl(e,"bpmn:Lane")}function c_(e){return(e=Gl(e))&&!(e.eventDefinitions&&e.eventDefinitions.length)}function u_(e){return d_(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function d_(e,t){return t.some((function(t){return t_(e,t)}))}function h_(e,t,n,i){return 1===(e=Array.isArray(e)?e:[e]).length&&!(cm(e=e[0])||!function(e){var t;return!cm(t=e)&&Hl(t,"bpmn:BoundaryEvent")||Hl(e,"bpmn:IntermediateThrowEvent")&&c_(e)||Hl(e,"bpmn:IntermediateCatchEvent")&&u_(e)}(e)||Yl(t)||!Hl(t,"bpmn:Activity")||Qx(t)||i&&!Ux(i,t)||Hl(e=t,"bpmn:ReceiveTask")&&Object(Vl.find)(e.incoming,(function(e){return Hl(e.source,"bpmn:EventBasedGateway")})))&&"attach"}function p_(e,t,n){var i;return!!t&&(i={replacements:[]},Object(Vl.forEach)(e,(function(e){var o;Yl(t)||Hl(e,"bpmn:StartEvent")&&"label"!==e.type&&s_(e,t)&&((o=e)&&!1!==Gl(o).isInterrupting||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(Xl(e,"bpmn:ErrorEventDefinition")||Xl(e,"bpmn:EscalationEventDefinition")||Xl(e,"bpmn:CompensateEventDefinition"))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),d_(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"]))&&Hl(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),Hl(t,"bpmn:Transaction")||t_(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(Hl(e,"bpmn:EndEvent")&&s_(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),Hl(e,"bpmn:BoundaryEvent"))&&h_(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"})})),!!i.replacements.length)&&i}function f_(e,t){return!Object(Vl.some)(e,l_)&&(!t||e.every((function(e){return s_(e,t)})))}function m_(e,t,n,i){return!!t&&(!(!cm(e)&&!Jx(e))||!(n===t||n&&r_(n,t))&&(s_(e,t)||x_(e,t)))}function g_(e,t){return Hl(e,"bpmn:SubProcess")?Kl(e)&&(!t||100<=t.width&&80<=t.height):Hl(e,"bpmn:Lane")?!t||130<=t.width&&60<=t.height:Hl(e,"bpmn:Participant")?!t||250<=t.width&&50<=t.height:!!Xx(e)||!!Jx(e)}function v_(e,t){var n,i;return!(o_(e)||o_(t)||(!Zx(e)||!Qx(t))&&(r_(t,e)||r_(e,t)||(i=t,n=Xx(n=e),i=Xx(i),(!n&&!i||n===i)&&!w_(e,t))))}function b_(e,t){return!(E_(e)&&!E_(t))&&Hl(n=e,"bpmn:InteractionNode")&&!Hl(n,"bpmn:BoundaryEvent")&&(!Hl(n,"bpmn:Event")||Hl(n,"bpmn:ThrowEvent")&&n_(n,"bpmn:MessageEventDefinition"))&&Hl(n=t,"bpmn:InteractionNode")&&!Qx(n)&&(!Hl(n,"bpmn:Event")||Hl(n,"bpmn:CatchEvent")&&n_(n,"bpmn:MessageEventDefinition"))&&!(Hl(n,"bpmn:BoundaryEvent")&&!t_(n,"bpmn:MessageEventDefinition"))&&(n=t,!(Yx(e)===Yx(n)));var n}function y_(e,t){var n;return!(i_(t)&&0<t.incoming.length&&(t.incoming||[]).some(k_)&&!Hl(e,"bpmn:EventBasedGateway"))&&Hl(n=e,"bpmn:FlowNode")&&!Hl(n,"bpmn:EndEvent")&&!Yl(n)&&!(Hl(n,"bpmn:IntermediateThrowEvent")&&t_(n,"bpmn:LinkEventDefinition"))&&!Zx(n)&&!Qx(n)&&Hl(n=t,"bpmn:FlowNode")&&!Hl(n,"bpmn:StartEvent")&&!Hl(n,"bpmn:BoundaryEvent")&&!Yl(n)&&!(Hl(n,"bpmn:IntermediateCatchEvent")&&t_(n,"bpmn:LinkEventDefinition"))&&!Qx(n)&&(n=t,e_(e)===e_(n))&&!(Hl(e,"bpmn:EventBasedGateway")&&!i_(t))}function w_(e,t){return Ul(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Ul(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Ul(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Ul(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function x_(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&Ul(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!cm(t)&&Hl(e,"bpmn:FlowNode")&&!Hl(e,"bpmn:BoundaryEvent")&&s_(e,t.parent)}function __(e,t){return!!cm(t)||!(Hl(t,"bpmn:Lane")&&(e=e,t=t.parent,!e||!t||-1===e.indexOf(t)))}function k_(e){if(e&&e.source)return Hl(e.source,"bpmn:EventBasedGateway")}function E_(e){return gu(e,"bpmn:Process")||gu(e,"bpmn:Collaboration")}H()(Gx,$g),Gx.$inject=["eventBus"],Gx.prototype.init=function(){this.addRule("connection.start",(function(e){return Kx(e=e.source)?null:Ul(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])})),this.addRule("connection.create",(function(e){var t=e.source,n=e.target,i=(e=e.hints||{}).targetParent;if(e.targetAttach)return!1;i&&(n.parent=i);try{return a_(t,n)}finally{i&&(n.parent=null)}})),this.addRule("connection.reconnect",(function(e){var t=e.connection;return a_(e.source,e.target,t)})),this.addRule("connection.updateWaypoints",(function(e){return{type:e.connection.type}})),this.addRule("shape.resize",(function(e){return g_(e.shape,e.newBounds)})),this.addRule("elements.create",(function(e){var t=e.elements,n=e.position,i=e.target;return!(o_(i)&&!x_(t,i))&&Object(Vl.every)(t,(function(e){return o_(e)?a_(e.source,e.target,e):e.host?h_(e,e.host,0,n):m_(e,i,null)}))})),this.addRule("elements.move",(function(e){var t=e.target,n=e.shapes;return h_(n,t,0,e=e.position)||p_(n,t,e)||f_(n,t)||x_(n,t)})),this.addRule("shape.create",(function(e){return m_(e.shape,e.target,e.source,e.position)})),this.addRule("shape.attach",(function(e){return h_(e.shape,e.target,0,e.position)})),this.addRule("element.copy",(function(e){var t=e.element;return __(e.elements,t)}))},Gx.prototype.canConnectMessageFlow=b_,Gx.prototype.canConnectSequenceFlow=y_,Gx.prototype.canConnectDataAssociation=w_,Gx.prototype.canConnectAssociation=v_,Gx.prototype.canMove=f_,Gx.prototype.canAttach=h_,Gx.prototype.canReplace=p_,Gx.prototype.canDrop=s_,Gx.prototype.canInsert=x_,Gx.prototype.canCreate=m_,Gx.prototype.canConnect=a_,Gx.prototype.canResize=g_,Gx.prototype.canCopy=__;var C_={__depends__:[Hg],__init__:["bpmnRules"],bpmnRules:["type",Gx]};function S_(e,t){e.on("saveXML.start",2e3,(function(){var e,n=t.getRootElement(),i=Gl(n).di;e=Pu([n],!1),e=Object(Vl.filter)(e,(function(e){return e!==n&&!e.labelTarget})),e=Object(Vl.map)(e,Dc),i.set("planeElement",e)}))}S_.$inject=["eventBus","canvas"];var T_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",S_]};function A_(e){Og.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],(function(e){var n=(e=e.context).shape||e.connection,i=e.parent;(n=t.getOrdering(n,i))&&(void 0!==n.parent&&(e.parent=n.parent),e.parentIndex=n.index)})),this.preExecute(["shape.move","connection.move"],(function(e){var n=(e=e.context).shape||e.connection,i=e.newParent||n.parent;(n=t.getOrdering(n,i))&&(void 0!==n.parent&&(e.newParent=n.parent),e.newParentIndex=n.index)}))}function O_(e,t,n){A_.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function o(e){var t,n,o=e.order;if(o||(e.order=o=(t=e).labelTarget?{level:10}:(n=Object(Vl.find)(i,(function(e){return Ul(t,[e.type])})))&&n.order||{level:1}),o)return o;throw new Error("no order for <"+e.id+">")}this.getOrdering=function(e,n){var i,r,a;return e.labelTarget?{parent:t.getRootElement(),index:-1}:(r=(n=(i=o(e)).containers?function(e,t,n){for(var i=t;i&&!Ul(i,n);)i=i.parent;if(i)return i;throw new Error("no parent for <"+e.id+"> in <"+(t&&t.id)+">")}(e,n,i.containers):n).children.indexOf(e),-1!==(a=Object(Vl.findIndex)(n.children,(function(t){return!(!e.labelTarget&&t.labelTarget)&&i.level<o(t).level})))&&-1!==r&&r<a&&--a,{index:a,parent:n})}}A_.prototype.getOrdering=function(e,t){return null},H()(A_,Og),O_.$inject=["eventBus","canvas","translate"],H()(O_,A_);var M_={__depends__:[ea],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",O_]};function D_(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],(function(){this.clear(!1)}),this)}D_.$inject=["eventBus","injector"],D_.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute",e={command:e,context:t},this._pushAction(e),this._internalExecute(e),this._popAction(e)},D_.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e);if(void 0===(e=this._fire(e,"canExecute",n))){if(!i)return!1;i.canExecute&&(e=i.canExecute(t))}return e},D_.prototype.clear=function(e){this._stack.length=0,!(this._stackIdx=-1)!==e&&this._fire("changed",{trigger:"clear"})},D_.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction())&&e.id===t.id;)t=e;this._popAction()}},D_.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction())&&e.id===t.id;)t=e;this._popAction()}},D_.prototype.register=function(e,t){this._setHandler(e,t)},D_.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");t=this._injector.instantiate(t),this.register(e,t)},D_.prototype.canUndo=function(){return!!this._getUndoAction()},D_.prototype.canRedo=function(){return!!this._getRedoAction()},D_.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},D_.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},D_.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,o=this._getHandler(n);this._atomicDo((function(){t._fire(n,"revert",e),o.revert&&t._markDirty(o.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)}))},D_.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,o,r,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;(o=a[i])&&(r=this._eventBus.fire("commandStack."+o,n),!n.cancelBubble);i++);return r},D_.prototype._createId=function(){return this._uid++},D_.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},D_.prototype._internalExecute=function(e,t){var n=this,i=e.command,o=e.context,r=this._getHandler(i);if(!r)throw new Error("no command handler registered for <"+i+">");this._pushAction(e),t||(this._fire(i,"preExecute",e),r.preExecute&&r.preExecute(o),this._fire(i,"preExecuted",e)),this._atomicDo((function(){n._fire(i,"execute",e),r.execute&&n._markDirty(r.execute(o)),n._executedAction(e,t),n._fire(i,"executed",e)})),t||(this._fire(i,"postExecute",e),r.postExecute&&r.postExecute(o),this._fire(i,"postExecuted",e)),this._popAction(e)},D_.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},D_.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:Object(Vl.uniqueBy)("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},D_.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=Object(Vl.isArray)(e)?e:[e],t.dirty=t.dirty.concat(e))},D_.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},D_.prototype._revertedAction=function(e){this._stackIdx--},D_.prototype._getHandler=function(e){return this._handlerMap[e]},D_.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var $_={commandStack:["type",D_]},P_=new Om("tt");function R_(e,t){e.style.display=!1===t?"none":""}var L_="djs-tooltip",I_="."+L_;function N_(e,t){this._eventBus=e,this._canvas=t,this._ids=P_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(e=t.getContainer(),t=eu('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />'),e.insertBefore(t,e.firstChild),t);var n=this;Zc(this._tooltipRoot,I_,"mousedown",(function(e){e.stopPropagation()})),Zc(this._tooltipRoot,I_,"mouseover",(function(e){n.trigger("mouseover",e)})),Zc(this._tooltipRoot,I_,"mouseout",(function(e){n.trigger("mouseout",e)})),this._init()}N_.$inject=["eventBus","canvas"],N_.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");var t;if(e.html)return t=this._ids.next(),e=Object(Vl.assign)({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t;throw new Error("must specifiy tooltip html")},N_.prototype.trigger=function(e,t){t=t.delegateTarget||t.target,(t=this.get(Ic(t,"data-tooltip-id")))&&("mouseover"===e&&t.timeout&&this.clearTimeout(t),"mouseout"===e)&&t.timeout&&(t.timeout=1e3,this.setTimeout(t))},N_.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},N_.prototype.clearTimeout=function(e){var t;(e=this.get(e))&&(t=e.removeTimer)&&(clearTimeout(t),e.removeTimer=null)},N_.prototype.setTimeout=function(e){var t;(e=this.get(e))&&(this.clearTimeout(e),t=this,e.removeTimer=setTimeout((function(){t.remove(e)}),e.timeout))},N_.prototype.remove=function(e){(e=this.get(e))&&(ou(e.html),ou(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},N_.prototype.show=function(){R_(this._tooltipRoot)},N_.prototype.hide=function(){R_(this._tooltipRoot,!1)},N_.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1;t="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=t,this._tooltipRoot.style["-ms-transform"]=t},N_.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,o=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Object(Vl.isString)(i)&&(i=eu(i)),(t=eu('<div data-tooltip-id="'+n+'" class="'+L_+'" style="position: absolute">')).appendChild(i),e.type&&qc(t).add("djs-tooltip-"+e.type),e.className&&qc(t).add(e.className),e.htmlContainer=t,o.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},N_.prototype._updateTooltip=function(e){var t,n=e.position;e=e=e.htmlContainer,t=n.x,n=n.y,Object(Vl.assign)(e.style,{left:t+"px",top:n+"px"})},N_.prototype._updateTooltipVisibilty=function(e){Object(Vl.forEach)(this._tooltips,(function(t){var n=t.show,i=(t=t.htmlContainer,!0);n&&R_(t,i=!(n.minZoom>e.scale||n.maxZoom<e.scale)&&i)}))},N_.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",(function(t){e.hide()})),this._eventBus.on("canvas.viewbox.changed",(function(t){t=t.viewbox,e._updateRoot(t),e._updateTooltipVisibilty(t),e.show()}))};var F_={__init__:["tooltips"],tooltips:["type",N_]};function j_(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(e)for(var n;n=e[0];)t(n)}function B_(e,t,n){Og.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,(function(e){var t=(e=e.context).shapes,n=e.validatedShapes;e.shapes=q_(t),e.validatedShapes=q_(n)})),i&&t.on("shape.move.start",250,(function(e){var t=e.context,n=(e=t.shapes,[]);Object(Vl.forEach)(e,(function(e){Object(Vl.forEach)(e.labels,(function(i){i.hidden||-1!==t.shapes.indexOf(i)||n.push(i),e.labelTarget&&n.push(e)}))})),Object(Vl.forEach)(n,(function(e){i.makeDraggable(t,e,!0)}))})),this.preExecuted("elements.move",1400,(function(e){var t=(e=e.context.closure).enclosedElements,n=[];Object(Vl.forEach)(t,(function(e){Object(Vl.forEach)(e.labels,(function(e){t[e.id]||n.push(e)}))})),e.addAll(n)})),this.preExecute(["connection.delete","shape.delete"],(function(e){j_(((e=e.context).connection||e.shape).labels,(function(e){n.removeShape(e,{nested:!0})}))})),this.execute("shape.delete",(function(e){var t=(e=e.context).shape,n=t.labelTarget;n&&(e.labelTargetIndex=Kh(n.labels,t),e.labelTarget=n,t.labelTarget=null)})),this.revert("shape.delete",(function(e){var t=(e=e.context).shape,n=e.labelTarget;e=e.labelTargetIndex;n&&(Gh(n.labels,t,e),t.labelTarget=n)}))}function q_(e){return Object(Vl.filter)(e,(function(t){return-1===e.indexOf(t.labelTarget)}))}H()(B_,Og),B_.$inject=["injector","eventBus","modeling"];var z_={__init__:["labelSupport"],labelSupport:["type",B_]};function V_(e,t,n,i,o){Og.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",1401,(function(e){var t,n,i=(e=e.context).shapes,o=e.validatedShapes;e.shapes=(t=W_(i=i),Object(Vl.unionBy)("id",i,t)),e.validatedShapes=(i=o,n=Object(Vl.groupBy)(i,"id"),Object(Vl.filter)(i,(function(e){for(;e;){if(e.host&&n[e.host.id])return!1;e=e.parent}return!0})))})),r&&t.on("shape.move.start",251,(function(e){var t=e.context;e=W_(t.shapes);Object(Vl.forEach)(e,(function(e){r.makeDraggable(t,e,!0),Object(Vl.forEach)(e.labels,(function(e){r.makeDraggable(t,e,!0)}))}))})),r&&t.on("shape.move.start",(function(e){var i;1===(e=e.context.shapes).length&&(i=e[0].host)&&(n.addMarker(i,"attach-ok"),t.once(["shape.move.out","shape.move.cleanup"],(function(){n.removeMarker(i,"attach-ok")})))})),this.preExecuted("elements.move",1401,(function(e){var t=(e=e.context).closure;e=W_(e.shapes);Object(Vl.forEach)(e,(function(e){t.add(e,t.topLevel[e.host.id])}))})),this.postExecuted("elements.move",(function(e){var t=(e=e.context).shapes,n=e.newHost;n&&1!==t.length||(e=n?t:Object(Vl.filter)(t,(function(e){var n=e.host;return!(!e.host||-1!==t.indexOf(n))})),Object(Vl.forEach)(e,(function(e){o.updateAttachment(e,n)})))})),this.postExecuted("elements.move",(function(e){e=e.context.shapes,Object(Vl.forEach)(e,(function(e){Object(Vl.forEach)(e.attachers,(function(e){Object(Vl.forEach)(e.outgoing.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||o.removeConnection(e)})),Object(Vl.forEach)(e.incoming.slice(),(function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||o.removeConnection(e)}))}))}))})),this.postExecute("shape.create",(function(e){var t=(e=e.context).shape;(e=e.host)&&o.updateAttachment(t,e)})),this.postExecute("shape.replace",(function(e){var t=(e=e.context).oldShape,n=e.newShape;j_(t.attachers,(function(e){"attach"===i.allowed("elements.move",{target:n,shapes:[e]})?o.updateAttachment(e,n):o.removeShape(e)})),n.attachers.length&&Object(Vl.forEach)(n.attachers,(function(e){var i=nx(e,t,n);o.moveShape(e,i,e.parent)}))})),this.postExecute("shape.resize",(function(e){var t=(e=e.context).shape,n=e.oldBounds,i=e.newBounds;t=t.attachers;!1!==(e.hints||{}).attachSupport&&Object(Vl.forEach)(t,(function(e){var t=nx(e,n,i);o.moveShape(e,t,e.parent),Object(Vl.forEach)(e.labels,(function(e){o.moveShape(e,t,e.parent)}))}))})),this.preExecute("shape.delete",(function(e){j_((e=e.context.shape).attachers,(function(e){o.removeShape(e)})),e.host&&o.updateAttachment(e,null)}))}function W_(e){return Object(Vl.flatten)(Object(Vl.map)(e,(function(e){return e.attachers||[]})))}H()(V_,Og),V_.$inject=["injector","eventBus","canvas","rules","modeling"];var H_={__depends__:[Hg],__init__:["attachSupport"],attachSupport:["type",V_]};function U_(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}U_.$inject=["eventBus","dragging"],U_.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},U_.prototype.isActive=function(e){return e&&this._active===e},U_.prototype.length=function(e){return this._tools.length},U_.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},U_.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,o=[];n.on(t.tool+".init",(function(t){!t.context.reactivate&&this.isActive(e)?(this.setActive(null),i.cancel()):this.setActive(e)}),this),Object(Vl.forEach)(t,(function(e){o.push(e+".ended"),o.push(e+".canceled")})),n.on(o,250,(function(e){this._active&&!function(e){return(e=e.originalEvent&&e.originalEvent.target)&&Uc(e,'.group[data-group="tools"]')}(e)&&this.setActive(null)}),this)};var G_={__depends__:[Ng],__init__:["toolManager"],toolManager:["type",U_]};function K_(e,t){return-1!==e.indexOf(t)}var Y_=Math.abs,X_=Math.round,J_={x:"width",y:"height"},Z_={n:"top",w:"left",s:"bottom",e:"right"},Q_={n:"s",w:"e",s:"n",e:"w"};function ek(e,t,n,i,o,r,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=o,this._toolManager=r,this._mouse=a;var s=this;r.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",(function(e){n.once("spaceTool.selection.ended",(function(){s.activateMakeSpace(e.originalEvent)}))})),n.on("spaceTool.move",1500,(function(e){var t=e.context;(t.initialized||(t.initialized=s.init(e,t)))&&nk(e)})),n.on("spaceTool.end",(function(e){var t=e.context,i=t.axis,o=t.direction,r=t.movingShapes,a=t.resizingShapes,l=t.start;t.initialized&&(nk(e),(t={x:0,y:0})[i]=X_(e["d"+i]),s.makeSpace(r,a,t,o,l),n.once("spaceTool.ended",(function(e){s.activateSelection(e.originalEvent,!0,!0)})))}))}function tk(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function nk(e){var t,n,i=e.context.spaceToolConstraints;i&&(Object(Vl.isNumber)(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),Object(Vl.isNumber)(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),Object(Vl.isNumber)(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),Object(Vl.isNumber)(i.bottom))&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n)}function ik(e,t){return-1!==e.indexOf(t)}function ok(e){return e.waypoints}function rk(e){return e.labelTarget}ek.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],ek.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:"crosshair",data:{context:{reactivate:n}},trapClick:!1})},ek.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:"crosshair",data:{context:{}}})},ek.prototype.makeSpace=function(e,t,n,i,o){return this._modeling.createSpace(e,t,n,i,o)},ek.prototype.init=function(e,t){var n=Y_(e.dx)>Y_(e.dy)?"x":"y",i=e["d"+n],o=e[n]-i;if(Y_(i)<5)return!1;i<0&&(i*=-1),ym(e)&&(i*=-1);e=function(e,t){if("x"===e){if(0<t)return"e";if(t<0)return"w"}if("y"===e){if(0<t)return"s";if(t<0)return"n"}return null}(n,i);var r=Pu(this._canvas.getRootElement(),!0);i=function(e,t,n,i,o){var r,a,s,l=e.movingShapes,c=e.resizingShapes;if(c.length)return r={},Object(Vl.forEach)(c,(function(e){var u,d=Cu(e),h=Object(Vl.filter)(e.children,(function(e){return!(ok(e)||rk(e)||ik(l,e)||ik(c,e))})),p=Object(Vl.filter)(e.children,(function(e){return!ok(e)&&!rk(e)&&ik(l,e)}));(p=(h.length&&(h=tk(Cu(Ru(h))),u=i-d[Z_[n]]+h[Z_[n]],"n"===n?r.bottom=s=Object(Vl.isNumber)(s)?Math.min(s,u):u:"w"===n?r.right=s=Object(Vl.isNumber)(s)?Math.min(s,u):u:"s"===n?r.top=a=Object(Vl.isNumber)(a)?Math.max(a,u):u:"e"===n&&(r.left=a=Object(Vl.isNumber)(a)?Math.max(a,u):u)),p.length&&(h=tk(Cu(Ru(p))),u=i-h[Z_[Q_[n]]]+d[Z_[Q_[n]]],"n"===n?r.bottom=s=Object(Vl.isNumber)(s)?Math.min(s,u):u:"w"===n?r.right=s=Object(Vl.isNumber)(s)?Math.min(s,u):u:"s"===n?r.top=a=Object(Vl.isNumber)(a)?Math.max(a,u):u:"e"===n&&(r.left=a=Object(Vl.isNumber)(a)?Math.max(a,u):u)),o&&o[e.id]))&&("n"===n?(u=i+e[J_[t]]-p[J_[t]],r.bottom=s=Object(Vl.isNumber)(s)?Math.min(s,u):u):"w"===n?(u=i+e[J_[t]]-p[J_[t]],r.right=s=Object(Vl.isNumber)(s)?Math.min(s,u):u):"s"===n?(u=i-e[J_[t]]+p[J_[t]],r.top=a=Object(Vl.isNumber)(a)?Math.max(a,u):u):"e"===n&&(u=i-e[J_[t]]+p[J_[t]],r.left=a=Object(Vl.isNumber)(a)?Math.max(a,u):u))})),r}(r=this.calculateAdjustments(r,n,i,o),n,e,o,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:e,shapes:r.resizingShapes,start:o}));return Object(Vl.assign)(t,r,{axis:n,direction:e,spaceToolConstraints:i,start:o}),Xm("resize-"+("x"==n?"ew":"ns")),!0},ek.prototype.calculateAdjustments=function(e,t,n,i){var o=this._rules,r=[],a=[];return Object(Vl.forEach)(e,(function(e){var s,l;if(e.parent&&!ok(e))return l=(s=e[t])+e[J_[t]],0<n&&i<s||n<0&&l<i?r.push(e):s<i&&i<l&&o.allowed("shape.resize",{shape:e})?a.push(e):void 0})),{movingShapes:r,resizingShapes:a}},ek.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},ek.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var ak="djs-dragging",sk="djs-resizing",lk=Math.max;function ck(e,t,n,i,o){function r(e,t){Object(Vl.forEach)(e,(function(e){o.addDragger(e,t),n.addMarker(e,ak)}))}e.on("spaceTool.selection.start",(function(e){var t=n.getLayer("space"),o=(e=e.context,"M 0,-10000 L 0,10000"),r=gc("g");ic(r,i.cls("djs-crosshair-group",["no-events"])),ec(t,r),t=gc("path"),ic(t,"d",o),lc(t).add("djs-crosshair"),ec(r,t),o=gc("path");ic(o,"d","M -10000,0 L 10000,0"),lc(o).add("djs-crosshair"),ec(r,o),e.crosshairGroup=r})),e.on("spaceTool.selection.move",(function(e){au(e.context.crosshairGroup,e.x,e.y)})),e.on("spaceTool.selection.cleanup",(function(e){(e=e.context.crosshairGroup)&&uc(e)})),e.on("spaceTool.move",250,(function(e){var a,s,l,c,u=e.context,d=u.line,h=u.axis,p=u.movingShapes,f=u.resizingShapes;u.initialized&&(u.dragGroup||(a=n.getLayer("space"),ic(d=gc("path"),"d","M0,0 L0,0"),lc(d).add("djs-crosshair"),ec(a,d),u.line=d,ic(a=gc("g"),i.cls("djs-drag-group",["no-events"])),ec(n.getActiveLayer(),a),r(p,a),r(u.movingConnections=t.filter((function(e){var t=!1,n=(Object(Vl.forEach)(p,(function(n){Object(Vl.forEach)(n.outgoing,(function(n){e===n&&(t=!0)}))})),!1),i=(Object(Vl.forEach)(p,(function(t){Object(Vl.forEach)(t.incoming,(function(t){e===t&&(n=!0)}))})),!1),o=(Object(Vl.forEach)(f,(function(t){Object(Vl.forEach)(t.outgoing,(function(t){e===t&&(i=!0)}))})),!1);return Object(Vl.forEach)(f,(function(t){Object(Vl.forEach)(t.incoming,(function(t){e===t&&(o=!0)}))})),e.waypoints&&(t||i)&&(n||o)})),a),u.dragGroup=a),u.frameGroup||(ic(s=gc("g"),i.cls("djs-frame-group",["no-events"])),ec(n.getActiveLayer(),s),l=[],Object(Vl.forEach)(f,(function(e){var t=o.addFrame(e,s),i=t.getBBox();l.push({element:t,initialBounds:i}),n.addMarker(e,sk)})),u.frameGroup=s,u.frames=l),ic(d,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[h]}),(c={x:e.dx,y:e.dy})[{x:"y",y:"x"}[u.axis]]=0,au(u.dragGroup,c.x,c.y),Object(Vl.forEach)(u.frames,(function(e){var t,n=e.element;e=e.initialBounds;"e"===u.direction?ic(n,{width:lk(e.width+c.x,5)}):ic(n,{width:t=lk(e.width-c.x,5),x:e.x+e.width-t}),"s"===u.direction?ic(n,{height:lk(e.height+c.y,5)}):ic(n,{height:t=lk(e.height-c.y,5),y:e.y+e.height-t})})))})),e.on("spaceTool.cleanup",(function(e){var t=(e=e.context).movingShapes,i=e.movingConnections,o=e.resizingShapes,r=e.line,a=e.dragGroup;e=e.frameGroup;Object(Vl.forEach)(t,(function(e){n.removeMarker(e,ak)})),Object(Vl.forEach)(i,(function(e){n.removeMarker(e,ak)})),a&&(uc(r),uc(a)),Object(Vl.forEach)(o,(function(e){n.removeMarker(e,sk)})),e&&uc(e)}))}ck.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var uk={__init__:["spaceToolPreview"],__depends__:[Ng,Hg,G_,bb,Pb],spaceTool:["type",ek],spaceToolPreview:["type",ck]};function dk(e){this._model=e}function hk(e,t,n,i){Og.call(this,e),this._bpmnFactory=t,this._translate=i;var o=this;function r(e){e=e.context.oldRoot.children,Object(Vl.forEach)(e,(function(e){Hl(e,"bpmn:BaseElement")&&o.updateParent(e)}))}function a(e){Hl(e=e.context.shape,"bpmn:BaseElement")&&o.updateBounds(e)}function s(e){o.updateConnection(e.context)}function l(e){o.updateConnectionWaypoints(e.context.connection)}function c(e){o.updateAttachment(e.context)}this.executed(["connection.layout","connection.create"],(function(e){var t=(e=e.context).hints||{};e.cropped||!1===t.createElementsBehavior||((t=e.connection).waypoints=n.getCroppedWaypoints(t),e.cropped=!0)})),this.reverted(["connection.layout"],(function(e){delete e.context.cropped})),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],pk((function(e){e=e.context,o.updateParent(e.shape||e.connection,e.oldParent)}))),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],pk((function(e){var t=(e=e.context).shape||e.connection;e=e.parent||e.newParent;o.updateParent(t,e)}))),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],pk((function(e){"label"!==e.context.shape.type&&a(e)}))),this.reverted(["shape.move","shape.create","shape.resize"],pk((function(e){"label"!==e.context.shape.type&&a(e)}))),e.on("shape.changed",(function(e){"label"===e.element.type&&a({context:{shape:e.element}})})),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],pk(s)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],pk(s)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],pk(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],pk(l)),this.executed("connection.reconnect",pk((function(e){var t=(e=e.context).connection,n=e.oldSource,i=e.newSource,o=(t=Gl(t),Gl(n)),r=Gl(i);t.conditionExpression&&!Ul(r,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(e.oldConditionExpression=t.conditionExpression,delete t.conditionExpression),n!==i&&o.default===t&&(e.oldDefault=o.default,delete o.default)}))),this.reverted("connection.reconnect",pk((function(e){var t=(e=e.context).connection,n=e.oldSource,i=e.newSource;t=Gl(t),n=Gl(n),i=Gl(i);e.oldConditionExpression&&(t.conditionExpression=e.oldConditionExpression),e.oldDefault&&(n.default=e.oldDefault,delete i.default)}))),this.executed(["element.updateAttachment"],pk(c)),this.reverted(["element.updateAttachment"],pk(c))}function pk(e){return function(t){var n=t.context;Hl(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function fk(e,t,n){gp.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function mk(e,t,n){e[n]=t[n],delete t[n]}function gk(e,t){this._modeling=e,this._canvas=t}function vk(e){this._modeling=e}function bk(e,t){this._canvas=e,this._layouter=t}dk.$inject=["moddle"],dk.prototype._needsId=function(e){return Ul(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},dk.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=Hl(e,"bpmn:Activity")?"Activity":Hl(e,"bpmn:Event")?"Event":Hl(e,"bpmn:Gateway")?"Gateway":Ul(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},dk.prototype.create=function(e,t){return e=this._model.create(e,t||{}),this._ensureId(e),e},dk.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},dk.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",Object(Vl.assign)({bpmnElement:e,bounds:this.createDiBounds(t)},n))},dk.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},dk.prototype.createDiWaypoints=function(e){var t=this;return Object(Vl.map)(e,(function(e){return t.createDiWaypoint(e)}))},dk.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Object(Vl.pick)(e,["x","y"]))},dk.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",Object(Vl.assign)({bpmnElement:e,waypoint:this.createDiWaypoints(t)},n))},dk.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},H()(hk,Og),hk.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],hk.prototype.updateAttachment=function(e){var t=(e=e.shape).businessObject;e=e.host;t.attachedToRef=e&&e.businessObject},hk.prototype.updateParent=function(e,t){var n,i,o;e instanceof pp||Hl(e,"bpmn:DataStoreReference")&&e.parent&&Hl(e.parent,"bpmn:Collaboration")||(i=e.parent,n=e.businessObject,o=(i=i&&i.businessObject)&&i.di,Hl(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(n,i,t&&t.businessObject),Hl(e,"bpmn:DataOutputAssociation")&&(i=e.source?e.source.businessObject:null),Hl(e,"bpmn:DataInputAssociation")&&(i=e.target?e.target.businessObject:null),this.updateSemanticParent(n,i),Hl(e,"bpmn:DataObjectReference")&&n.dataObjectRef&&this.updateSemanticParent(n.dataObjectRef,i),this.updateDiParent(n.di,o))},hk.prototype.updateBounds=function(e){var t=e.businessObject.di,n=(t=e instanceof pp?this._getLabel(t):t).bounds;n||(n=this._bpmnFactory.createDiBounds(),t.set("bounds",n)),Object(Vl.assign)(n,{x:e.x,y:e.y,width:e.width,height:e.height})},hk.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(Hl(n,"bpmn:Lane")&&Uh(n.get("flowNodeRef"),e),Hl(t,"bpmn:Lane"))&&Gh(t.get("flowNodeRef"),e)},hk.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},hk.prototype.updateDiParent=function(e,t){var n;t&&!Hl(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t&&(n=(t||e.$parent).get("planeElement"),t?(n.push(e),e.$parent=t):(Uh(n,e),e.$parent=null))},hk.prototype.getLaneSet=function(e){var t,n;return Hl(e,"bpmn:Lane")?(t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),(e.childLaneSet=t).$parent=e):(t=(n=(e=Hl(e,"bpmn:Participant")?e.processRef:e).get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t},hk.prototype.updateSemanticParent=function(e,t,n){var i,o,r,a,s=this._translate;if(e.$parent!==t&&(!Hl(e,"bpmn:DataInput")&&!Hl(e,"bpmn:DataOutput")||!("ioSpecification"in(t=Hl(t,"bpmn:Participant")&&"processRef"in t?t.processRef:t))||t.ioSpecification!==e.$parent)){if(Hl(e,"bpmn:Lane"))t=t&&this.getLaneSet(t),i="lanes";else if(Hl(e,"bpmn:FlowElement")){if(t)if(Hl(t,"bpmn:Participant"))t=t.processRef;else if(Hl(t,"bpmn:Lane"))for(;Hl(t=t.$parent.$parent,"bpmn:Lane"););i="flowElements"}else if(Hl(e,"bpmn:Artifact")){for(;t&&!Hl(t,"bpmn:Process")&&!Hl(t,"bpmn:SubProcess")&&!Hl(t,"bpmn:Collaboration");){if(Hl(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else Hl(e,"bpmn:MessageFlow")?i="messageFlows":Hl(e,"bpmn:Participant")?(i="participants",(a=e.processRef)&&(o=function(e){for(;e&&!Hl(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(Uh(o.get("rootElements"),a),a.$parent=null),t)&&(Gh(o.get("rootElements"),a),a.$parent=o)):Hl(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":Hl(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(s("no parent for {element} in {parent}",{element:e.id,parent:t.id}));e.$parent&&Uh(r=e.$parent.get(i),e),t?((r=t.get(i)).push(e),e.$parent=t):e.$parent=null,n&&(a=n.get(i),Uh(r,e),t)&&(a||t.set(i,a=[]),a.push(e))}},hk.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},hk.prototype.updateConnection=function(e){var t,n=e.connection,i=Gl(n),o=Gl(n.source),r=Gl(n.target);Hl(i,"bpmn:DataAssociation")?Hl(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t)):Hl(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=r):(e=Hl(i,"bpmn:SequenceFlow"),i.sourceRef!==o&&(e&&(Uh(i.sourceRef&&i.sourceRef.get("outgoing"),i),o)&&o.get("outgoing")&&o.get("outgoing").push(i),i.sourceRef=o),i.targetRef!==r&&(e&&(Uh(i.targetRef&&i.targetRef.get("incoming"),i),r)&&r.get("incoming")&&r.get("incoming").push(i),i.targetRef=r)),this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,o,r)},hk.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},H()(fk,gp),fk.$inject=["bpmnFactory","moddle","translate"],fk.prototype.baseCreate=gp.prototype.create,fk.prototype.create=function(e,t){return"label"===e?this.baseCreate(e,Object(Vl.assign)({type:"label"},rm,t)):this.createBpmnElement(e,t)},fk.prototype.createBpmnElement=function(e,t){var n,i,o,r=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(r("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di="root"===e?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):"connection"===e?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),(t=Hl(a,"bpmn:Group")?Object(Vl.assign)({isFrame:!0},t):t).di&&(Object(Vl.assign)(a.di,t.di),delete t.di),n=a,i=t,r=["processRef","isInterrupting","associationDirection","isForCompensation"],Object(Vl.forEach)(r,(function(e){void 0!==i[e]&&mk(n,i,e)})),t.isExpanded&&mk(a.di,t,"isExpanded"),Hl(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(r=a.get("eventDefinitions")||[],o=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(o.condition=this._bpmnFactory.create("bpmn:FormalExpression")),r.push(o),(o.$parent=a).eventDefinitions=r,delete t.eventDefinitionType),o=this._getDefaultSize(a),t=Object(Vl.assign)({businessObject:a,id:a.id},o,t),this.baseCreate(e,t)},fk.prototype._getDefaultSize=function(e){return Hl(e,"bpmn:SubProcess")?Kl(e)?{width:350,height:200}:{width:100,height:80}:Hl(e,"bpmn:Task")?{width:100,height:80}:Hl(e,"bpmn:Gateway")?{width:50,height:50}:Hl(e,"bpmn:Event")?{width:36,height:36}:Hl(e,"bpmn:Participant")?Kl(e)?{width:600,height:250}:{width:400,height:60}:Hl(e,"bpmn:Lane")?{width:400,height:100}:Hl(e,"bpmn:DataObjectReference")?{width:36,height:50}:Hl(e,"bpmn:DataStoreReference")?{width:50,height:50}:Hl(e,"bpmn:TextAnnotation")?{width:100,height:30}:Hl(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},fk.prototype.createParticipantShape=function(e){return Object(Vl.isObject)(e)||(e={isExpanded:e}),!1!==(e=Object(Vl.assign)({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},gk.$inject=["modeling","canvas"],gk.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;Object(Vl.forEach)(n,(function(e){var n={x:0,y:0};i.left?n.x=i.left-e.x:i.right?n.x=i.right-e.width-e.x:i.center?n.x=i.center-Math.round(e.width/2)-e.x:i.top?n.y=i.top-e.y:i.bottom?n.y=i.bottom-e.height-e.y:i.middle&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)}))},gk.prototype.postExecute=function(e){},vk.$inject=["modeling"],vk.prototype.preExecute=function(e){if(!(t=e.source))throw new Error("source required");var t=e.target||t.parent,n=e.shape,i=e.hints||{};n=e.shape=this._modeling.createShape(n,e.position,t,{attach:i.attach});e.shape=n},vk.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,Object(Vl.some)(t.outgoing,(function(e){return e.target===n}))||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},bk.$inject=["canvas","layouter"],bk.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,o=e.parent,r=e.parentIndex;e=e.hints;if(!n||!i)throw new Error("source and target required");if(o)return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,e)),this._canvas.addConnection(t,o,r),t;throw new Error("parent required")},bk.prototype.revert=function(e){return e=e.connection,this._canvas.removeConnection(e),e.source=null,e.target=null,e};var yk=Math.round;function wk(e){this._modeling=e}function xk(e){return e.waypoints}wk.$inject=["modeling"],wk.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,o=e.position,r=e.hints,a=this._modeling,s=(Object(Vl.forEach)(t,(function(e){Object(Vl.isNumber)(e.x)||(e.x=0),Object(Vl.isNumber)(e.y)||(e.y=0)})),Ru(t)),l=(Object(Vl.forEach)(t,(function(e){xk(e)&&(e.waypoints=Object(Vl.map)(e.waypoints,(function(e){return{x:yk(e.x-s.x-s.width/2+o.x),y:yk(e.y-s.y-s.height/2+o.y)}}))),Object(Vl.assign)(e,{x:yk(e.x-s.x-s.width/2+o.x),y:yk(e.y-s.y-s.height/2+o.y)})})),Mu(t)),c={};Object(Vl.forEach)(t,(function(e){var t;xk(e)?c[e.id]=Object(Vl.isNumber)(i)?a.createConnection(c[e.source.id],c[e.target.id],i,e,e.parent||n,r):a.createConnection(c[e.source.id],c[e.target.id],e,e.parent||n,r):(t=Object(Vl.assign)({},r),-1===l.indexOf(e)&&(t.autoResize=!1),c[e.id]=Object(Vl.isNumber)(i)?a.createShape(e,Object(Vl.pick)(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,Object(Vl.pick)(e,["x","y","width","height"]),e.parent||n,t))})),e.elements=Object(Vl.values)(c)};var _k=Math.round;function kk(e){this._canvas=e}function Ek(e){kk.call(this,e)}kk.$inject=["canvas"],kk.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent;e=e.parentIndex;if(!i)throw new Error("parent required");if(n)return void 0!==n.width?Object(Vl.assign)(t,n):Object(Vl.assign)(t,{x:n.x-_k(t.width/2),y:n.y-_k(t.height/2)}),this._canvas.addShape(t,i,e),t;throw new Error("position required")},kk.prototype.revert=function(e){return e=e.shape,this._canvas.removeShape(e),e},H()(Ek,kk),Ek.$inject=["canvas"];var Ck=kk.prototype.execute,Sk=(Ek.prototype.execute=function(e){var t,n=e.shape;return t=n,["width","height"].forEach((function(e){void 0===t[e]&&(t[e]=0)})),n.labelTarget=e.labelTarget,Ck.call(this,e)},kk.prototype.revert);function Tk(e,t){this._canvas=e,this._modeling=t}function Ak(e,t){this._modeling=e,this._elementRegistry=t}function Ok(e,t){this._canvas=e,this._modeling=t}function Mk(e){this._modeling=e}Ek.prototype.revert=function(e){return e.shape.labelTarget=null,Sk.call(this,e)},Tk.$inject=["canvas","modeling"],Tk.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Kh(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Tk.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Gh(n.children,t,i),this._canvas.addConnection(t,n),t},Ak.$inject=["modeling","elementRegistry"],Ak.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;e=e.elements;Object(Vl.forEach)(e,(function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))}))},Ok.$inject=["canvas","modeling"],Ok.prototype.preExecute=function(e){var t=this._modeling;j_((e=e.shape).incoming,(function(e){t.removeConnection(e,{nested:!0})})),j_(e.outgoing,(function(e){t.removeConnection(e,{nested:!0})})),j_(e.children,(function(e){e.waypoints?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})}))},Ok.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Kh(i.children,n),t.removeShape(n),n},Ok.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent;e=e.oldParentIndex;return Gh(i.children,n,e),t.addShape(n,i),n},Mk.$inject=["modeling"];var Dk={x:"y",y:"x"};function $k(e,t){this._layouter=e,this._canvas=t}function Pk(){}function Rk(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Lk(e){this._modeling=e}function Ik(e){this._helper=new Lk(e)}function Nk(e){this._modeling=e,this._helper=new Lk(e)}function Fk(e){this._modeling=e}function jk(e){return e.original||e}function Bk(e,t){this._modeling=e,this._rules=t}function qk(e){this._modeling=e}function zk(e){this._modeling=e}function Vk(e){return Object(Vl.assign)({},e)}function Wk(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function Hk(e,t,n){var i=Wk(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)&&e[i]<t}function Uk(e,t){return-1!==e.indexOf(t)}function Gk(e){this._modeling=e}function Kk(e){this._modeling=e}function Yk(e,t){return Uh(e&&e.attachers,t)}function Xk(e,t,n){var i;e&&((i=e.attachers)||(e.attachers=i=[]),Gh(i,t,n))}function Jk(){}function Zk(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",(function(){i.registerHandlers(n)}))}function Qk(e){this._elementRegistry=e}function eE(e,t){Object(Vl.forEach)(t,(function(t,n){e.set(n,t)}))}Mk.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,o=e.dimension;function r(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[o],e.range.max)}function a(e){return e[i]+e[o]/2}function s(e){return e.length-1}function l(e){return e.max-e.min}var c,u=n[0],d=s(n),h=n[d],p=0;Object(Vl.forEach)(n,(function(e,c){var u,h,f;e.elements.length<2?c&&c!==n.length-1&&(r(e,e.elements[0]),p+=l(e.range)):(h=(u=Object(Vl.sortBy)(e.elements,i))[0],c===d&&(h=u[s(u)]),f=a(h),e.range=null,Object(Vl.forEach)(u,(function(n){var s,l;(l={y:0})[i]=f-a(s=n),l[i]&&(l[Dk[i]]=0,t.moveElements([s],l,s.parent)),null===e.range?e.range={min:n[i],max:n[i]+n[o]}:r(e,n)})),c&&c!==n.length-1&&(p+=l(e.range)))})),e=Math.abs(h.range.min-u.range.max),(c=Math.round((e-p)/(n.length-1)))<n.length-1||Object(Vl.forEach)(n,(function(e,r){var a,s={};e!==u&&e!==h&&(a=n[r-1],e.range.max=0,Object(Vl.forEach)(e.elements,(function(n,r){s[Dk[i]]=0,s[i]=a.range.max-n[i]+c,e.range.min!==n[i]&&(s[i]+=n[i]-e.range.min),s[i]&&t.moveElements([n],s,n.parent),e.range.max=Math.max(n[i]+n[o],r?e.range.max:0)})))}))},Mk.prototype.postExecute=function(e){},$k.$inject=["layouter","canvas"],$k.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return Object(Vl.assign)(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},$k.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},Pk.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,o=e.newParentIndex,r=t.parent;return e.oldParent=r,e.oldParentIndex=Uh(r.children,t),Gh(i.children,t,o),t.parent=i,Object(Vl.forEach)(t.waypoints,(function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)})),t},Pk.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,o=e.oldParentIndex,r=e.delta;return Uh(n.children,t),Gh(i.children,t,o),t.parent=i,Object(Vl.forEach)(t.waypoints,(function(e){e.x-=r.x,e.y-=r.y,e.original&&(e.original.x-=r.x,e.original.y-=r.y)})),t},Rk.prototype.add=function(e,t){return this.addAll([e],t)},Rk.prototype.addAll=function(e,t){return e=function(e,t,n){Object(Vl.isUndefined)(t)&&(t=!0),Object(Vl.isObject)(t)&&(n=t,t=!0);var i=Nu((n=n||{}).allShapes),o=Nu(n.allConnections),r=Nu(n.enclosedElements),a=Nu(n.enclosedConnections),s=Nu(n.topLevel,t&&Object(Vl.groupBy)(e,(function(e){return e.id})));function l(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=r[e.id]=e),o[e.id]=e}return $u(e,(function(e){if(!(r[e.id]=e).waypoints)return i[e.id]=e,Object(Vl.forEach)(e.incoming,l),Object(Vl.forEach)(e.outgoing,l),e.children;a[e.id]=o[e.id]=e})),{allShapes:i,allConnections:o,topLevel:s,enclosedConnections:a,enclosedElements:r}}(e,!!t,this),Object(Vl.assign)(this,e),this},Lk.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Lk.prototype.moveClosure=function(e,t,n,i,o){var r=this._modeling,a=e.allShapes,s=e.allConnections,l=e.enclosedConnections,c=e.topLevel,u=!1;o&&o.parent===n&&(u=!0),Object(Vl.forEach)(a,(function(e){r.moveShape(e,t,c[e.id]&&!u&&n,{recurse:!1,layout:!1})})),Object(Vl.forEach)(s,(function(e){var i=!!a[e.source.id],o=!!a[e.target.id];l[e.id]&&i&&o?r.moveConnection(e,t,c[e.id]&&!u&&n):r.layoutConnection(e,{connectionStart:i&&sx(e,e.source,t),connectionEnd:o&&lx(e,e.target,t)})}))},Lk.prototype.getClosure=function(e){return(new Rk).addAll(e,!0)},Ik.$inject=["modeling"],Ik.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Ik.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},Nk.$inject=["modeling"],Nk.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,o=e.newParentIndex,r=t.parent;return e.oldBounds=Object(Vl.pick)(t,["x","y","width","height"]),e.oldParent=r,e.oldParentIndex=Uh(r.children,t),Gh(i.children,t,o),Object(Vl.assign)(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Nk.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,o=this._modeling;!1!==i.layout&&(Object(Vl.forEach)(t.incoming,(function(e){o.layoutConnection(e,{connectionEnd:lx(e,t,n)})})),Object(Vl.forEach)(t.outgoing,(function(e){o.layoutConnection(e,{connectionStart:sx(e,t,n)})}))),!1!==i.recurse&&this.moveChildren(e)},Nk.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex;e=e.delta;return Gh(n.children,t,i),Object(Vl.assign)(t,{parent:n,x:t.x-e.x,y:t.y-e.y}),t},Nk.prototype.moveChildren=function(e){var t=e.delta;e=e.shape;this._helper.moveRecursive(e.children,t,null)},Nk.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Fk.$inject=["modeling"],Fk.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,o=e.dockingOrPoints;if(t||n)return Object(Vl.isArray)(o)&&(e.oldWaypoints=i.waypoints,i.waypoints=o),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i;throw new Error("newSource or newTarget required")},Fk.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,o=e.dockingOrPoints,r={};(e=e.hints||{}).connectionStart&&(r.connectionStart=e.connectionStart),e.connectionEnd&&(r.connectionEnd=e.connectionEnd),!1!==e.layoutConnection&&(!n||i&&"source"!==e.docking||(r.connectionStart=r.connectionStart||jk(Object(Vl.isArray)(o)?o[0]:o)),!i||n&&"target"!==e.docking||(r.connectionEnd=r.connectionEnd||jk(Object(Vl.isArray)(o)?o[o.length-1]:o)),e.newWaypoints&&(r.waypoints=e.newWaypoints),this._modeling.layoutConnection(t,r))},Fk.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints;e=e.connection;return t&&(e.source=t),n&&(e.target=n),i&&(e.waypoints=i),e},Bk.$inject=["modeling","rules"],Bk.prototype.preExecute=function(e){var t=this,n=this._modeling,i=this._rules,o=e.oldShape,r=e.newData,a=e.hints||{};function s(e,t,n){return i.allowed("connection.reconnect",{connection:n,source:e,target:t})}var l={x:r.x,y:r.y},c={x:o.x,y:o.y,width:o.width,height:o.height},u=e.newShape=e.newShape||t.createShape(r,l,o.parent,a);o.host&&n.updateAttachment(u,o.host),!1!==a.moveChildren&&(e=o.children.slice(),n.moveElements(e,{x:0,y:0},u,a)),r=o.incoming.slice(),l=o.outgoing.slice();Object(Vl.forEach)(r,(function(e){s(e.source,u,e)&&t.reconnectEnd(e,u,ax(e,u,c),a)})),Object(Vl.forEach)(l,(function(e){var n=e.target;s(u,n,e)&&t.reconnectStart(e,u,rx(e,u,c),a)}))},Bk.prototype.postExecute=function(e){e=e.oldShape,this._modeling.removeShape(e)},Bk.prototype.execute=function(e){},Bk.prototype.revert=function(e){},Bk.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Bk.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Bk.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},qk.$inject=["modeling"],qk.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},Object(Vl.assign)(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},qk.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(Object(Vl.forEach)(n.incoming,(function(e){t.layoutConnection(e,{connectionEnd:ax(e,n,i)})})),Object(Vl.forEach)(n.outgoing,(function(e){t.layoutConnection(e,{connectionStart:rx(e,n,i)})})))},qk.prototype.revert=function(e){var t=e.shape;e=e.oldBounds;return Object(Vl.assign)(t,{width:e.width,height:e.height,x:e.x,y:e.y}),t},zk.$inject=["modeling"],zk.prototype.preExecute=function(e){var t,n,i,o=e.delta,r=e.direction,a=e.movingShapes,s=e.resizingShapes,l=(e=e.start,{});this.moveShapes(a,o),Object(Vl.forEach)(s,(function(e){l[e.id]={x:e.x,y:e.y,height:e.height,width:e.width}})),this.resizeShapes(s,o,r),this.updateConnectionWaypoints((t=a,n=s,i=[],Object(Vl.forEach)(t.concat(n),(function(e){var o=e.incoming;e=e.outgoing;Object(Vl.forEach)(o.concat(e),(function(e){var o=e.source,r=e.target;(K_(t,o)||K_(t,r)||K_(n,o)||K_(n,r))&&!K_(i,e)&&i.push(e)}))})),i),o,r,e,a,s,l)},zk.prototype.execute=function(){},zk.prototype.revert=function(){},zk.prototype.moveShapes=function(e,t){var n=this;Object(Vl.forEach)(e,(function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})}))},zk.prototype.resizeShapes=function(e,t,n){var i=this;Object(Vl.forEach)(e,(function(e){var o=function(e,t,n){var i=e.x,o=e.y,r=e.width,a=e.height,s=n.x,l=n.y;switch(t){case"n":return{x:i,y:o+l,width:r,height:a-l};case"s":return{x:i,y:o,width:r,height:a+l};case"w":return{x:i+s,y:o,width:r-s,height:a};case"e":return{x:i,y:o,width:r+s,height:a};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,o,null,{attachSupport:!1,autoResize:!1,layout:!1})}))},zk.prototype.updateConnectionWaypoints=function(e,t,n,i,o,r,a){var s=this,l=o.concat(r);Object(Vl.forEach)(e,(function(e){var c=e.source,u=e.target,d=(d=e,Object(Vl.map)(d.waypoints,(function(e){return(e=Vk(e)).original&&(e.original=Vk(e.original)),e}))),h=Wk(n),p={labelBehavior:!1};Uk(l,c)&&Uk(l,u)?(d=Object(Vl.map)(d,(function(e){return Hk(e,i,n)&&(e[h]=e[h]+t[h]),e.original&&Hk(e.original,i,n)&&(e.original[h]=e.original[h]+t[h]),e})),s._modeling.updateWaypoints(e,d,{labelBehavior:!1})):(Uk(l,c)||Uk(l,u))&&(Uk(o,c)?p.connectionStart=sx(e,c,t):Uk(o,u)?p.connectionEnd=lx(e,u,t):Uk(r,c)?p.connectionStart=rx(e,c,a[c.id]):Uk(r,u)&&(p.connectionEnd=ax(e,u,a[u.id])),s._modeling.layoutConnection(e,p))}))},Gk.$inject=["modeling"],Gk.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=function e(t){var n={};return Object(Vl.forEach)(t,(function(t){n[t.id]=t.hidden,t.children&&(n=Object(Vl.assign)({},n,e(t.children)))})),n}(n),t.collapsed=!t.collapsed,e=function e(t,n){var i=[];return Object(Vl.forEach)(t,(function(t){t.hidden=n,i=i.concat(t),t.children&&(i=i.concat(e(t.children,t.collapsed||n)))})),i}(n,t.collapsed);return[t].concat(e)},Gk.prototype.revert=function(e){var t=e.shape;e=e.oldChildrenVisibility,e=function e(t,n){var i=[];return Object(Vl.forEach)(t,(function(t){t.hidden=n[t.id],i=i.concat(t),t.children&&(i=i.concat(e(t.children,n)))})),i}(t.children,e);return t.collapsed=!t.collapsed,[t].concat(e)},Kk.$inject=["modeling"],Kk.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Yk(i,t),Xk(n,t),t.host=n,t},Kk.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost;e=e.attacherIdx;return t.host=i,Yk(n,t),Xk(i,t,e),t},Jk.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},Jk.prototype.revert=function(e){var t=e.connection;e=e.oldWaypoints;return t.waypoints=e,t},Zk.$inject=["eventBus","elementFactory","commandStack"],Zk.prototype.getHandlers=function(){return{"shape.append":vk,"shape.create":kk,"shape.delete":Ok,"shape.move":Nk,"shape.resize":qk,"shape.replace":Bk,"shape.toggleCollapse":Gk,spaceTool:zk,"label.create":Ek,"connection.create":bk,"connection.delete":Tk,"connection.move":Pk,"connection.layout":$k,"connection.updateWaypoints":Jk,"connection.reconnect":Fk,"elements.create":wk,"elements.move":Ik,"elements.delete":Ak,"elements.distribute":Mk,"elements.align":gk,"element.updateAttachment":Kk}},Zk.prototype.registerHandlers=function(e){Object(Vl.forEach)(this.getHandlers(),(function(t,n){e.registerHandler(n,t)}))},Zk.prototype.moveShape=function(e,t,n,i,o){"object"==typeof i&&(o=i,i=null),this._commandStack.execute("shape.move",{shape:e,delta:t,newParent:n,newParentIndex:i,hints:o||{}})},Zk.prototype.updateAttachment=function(e,t){this._commandStack.execute("element.updateAttachment",{shape:e,newHost:t})},Zk.prototype.moveElements=function(e,t,n,i){var o,r=(i=i||{}).attach,a=n;!0===r?a=(o=n).parent:!1===r&&(o=null),this._commandStack.execute("elements.move",{shapes:e,delta:t,newParent:a,newHost:o,hints:i})},Zk.prototype.moveConnection=function(e,t,n,i,o){"object"==typeof i&&(o=i,i=void 0),this._commandStack.execute("connection.move",{connection:e,delta:t,newParent:n,newParentIndex:i,hints:o||{}})},Zk.prototype.layoutConnection=function(e,t){this._commandStack.execute("connection.layout",{connection:e,hints:t||{}})},Zk.prototype.createConnection=function(e,t,n,i,o,r){return"object"==typeof n&&(r=o,o=i,i=n,n=void 0),e={source:e,target:t,parent:o,parentIndex:n,connection:i=this._create("connection",i),hints:r},this._commandStack.execute("connection.create",e),e.connection},Zk.prototype.createShape=function(e,t,n,i,o){"number"!=typeof i&&(o=i,i=void 0);var r,a,s=(o=o||{}).attach;e=this._create("shape",e),s?(r=n.parent,a=n):r=n,s={position:t,shape:e,parent:r,parentIndex:i,host:a,hints:o};return this._commandStack.execute("shape.create",s),s.shape},Zk.prototype.createElements=function(e,t,n,i,o){return"number"!=typeof i&&(o=i,i=void 0),t={position:t,elements:e=Object(Vl.isArray)(e)?e:[e],parent:n,parentIndex:i,hints:o=o||{}},this._commandStack.execute("elements.create",t),t.elements},Zk.prototype.createLabel=function(e,t,n,i){return n=this._create("label",n),t={labelTarget:e,position:t,parent:i||e.parent,shape:n},this._commandStack.execute("label.create",t),t.shape},Zk.prototype.appendShape=function(e,t,n,i,o){return o=o||{},e={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:o.connection,connectionParent:o.connectionParent,hints:o},this._commandStack.execute("shape.append",e),e.shape},Zk.prototype.removeElements=function(e){this._commandStack.execute("elements.delete",{elements:e})},Zk.prototype.distributeElements=function(e,t,n){this._commandStack.execute("elements.distribute",{groups:e,axis:t,dimension:n})},Zk.prototype.removeShape=function(e,t){this._commandStack.execute("shape.delete",{shape:e,hints:t||{}})},Zk.prototype.removeConnection=function(e,t){this._commandStack.execute("connection.delete",{connection:e,hints:t||{}})},Zk.prototype.replaceShape=function(e,t,n){return e={oldShape:e,newData:t,hints:n||{}},this._commandStack.execute("shape.replace",e),e.newShape},Zk.prototype.alignElements=function(e,t){this._commandStack.execute("elements.align",{elements:e,alignment:t})},Zk.prototype.resizeShape=function(e,t,n,i){this._commandStack.execute("shape.resize",{shape:e,newBounds:t,minBounds:n,hints:i})},Zk.prototype.createSpace=function(e,t,n,i,o){this._commandStack.execute("spaceTool",{delta:n,direction:i,movingShapes:e,resizingShapes:t,start:o})},Zk.prototype.updateWaypoints=function(e,t,n){this._commandStack.execute("connection.updateWaypoints",{connection:e,newWaypoints:t,hints:n||{}})},Zk.prototype.reconnect=function(e,t,n,i,o){this._commandStack.execute("connection.reconnect",{connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:o||{}})},Zk.prototype.reconnectStart=function(e,t,n,i){i=i||{},this.reconnect(e,t,e.target,n,Object(Vl.assign)(i,{docking:"source"}))},Zk.prototype.reconnectEnd=function(e,t,n,i){i=i||{},this.reconnect(e,e.source,t,n,Object(Vl.assign)(i,{docking:"target"}))},Zk.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Zk.prototype._create=function(e,t){return t instanceof up?t:this._elementFactory.create(e,t)},Zk.prototype.toggleCollapse=function(e,t){this._commandStack.execute("shape.toggleCollapse",{shape:e,hints:t||{}})},Qk.$inject=["elementRegistry"],Qk.prototype.execute=function(e){var t,n,i=e.element,o=e.moddleElement,r=e.properties;if(o)return i=e.changed||this.getVisualReferences(o).concat(i),n=e.oldProperties||(t=o,n=Object(Vl.keys)(r),Object(Vl.reduce)(n,(function(e,n){return e[n]=t.get(n),e}),{})),eE(o,r),e.oldProperties=n,e.changed=i;throw new Error("<moddleElement> required")},Qk.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement;e=e.changed;return eE(n,t),e},Qk.prototype.getVisualReferences=function(e){var t,n=this._elementRegistry;return Hl(e,"bpmn:DataObject")?(t=e,n.filter((function(e){return Hl(e,"bpmn:DataObjectReference")&&Gl(e).dataObjectRef===t}))):[]};var tE="default",nE={width:0,height:0};function iE(e,t,n,i,o){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=o}function oE(e,t){return"id"in e&&e.id!==t.id}function rE(e,t){Object(Vl.forEach)(t,(function(t,n){var i;"di"!==n?e.set(n,t):e.di&&(i=e.di,n=t,Object(Vl.forEach)(n,(function(e,t){i.set(t,e)})))}))}iE.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],iE.prototype.execute=function(e){var t,n,i,o,r,a,s,l,c,u=e.element,d=[u],h=this._translate;if(u)return t=this._elementRegistry,n=this._moddle.ids,i=u.businessObject,l=e.properties,c=Object(Vl.assign)({},l),aE.forEach((function(e){e in l&&(c[e]=Gl(c[e]))})),o=c,s=e.oldProperties||(r=i,a=o,s=Object(Vl.keys)(a),Object(Vl.reduce)(s,(function(e,t){var n;return e[t]="di"!==t?r.get(t):(n=r.di,t=Object(Vl.keys)(a.di),Object(Vl.reduce)(t,(function(e,t){return e[t]=n.get(t),e}),{})),e}),{})),oE(o,i)&&(n.unclaim(i.id),t.updateId(u,o.id),n.claim(o.id,i)),tE in o&&(o[tE]&&d.push(t.get(o[tE].id)),i[tE])&&d.push(t.get(i[tE].id)),rE(i,o),e.oldProperties=s,e.changed=d;throw new Error(h("element required"))},iE.prototype.postExecute=function(e){var t=(e=e.element.label)&&Gl(e).name;t&&(t=this._textRenderer.getExternalLabelBounds(e,t),this._modeling.resizeShape(e,t,nE))},iE.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,o=t.businessObject,r=this._elementRegistry,a=this._moddle.ids;return rE(o,i),oE(n,o)&&(a.unclaim(n.id),r.updateId(t,i.id),a.claim(i.id,o)),e.changed};var aE=["default"];function sE(e,t){this._canvas=e,this._modeling=t}function lE(e,t){this._modeling=e,this._spaceTool=t}function cE(e,t){this._modeling=e,this._translate=t}function uE(e,t){this._modeling=e,this._spaceTool=t}sE.$inject=["canvas","modeling"],sE.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,o=t.getRootElement(),r=o.businessObject,a=r.$parent,s=r.di;t.setRootElement(n,!0),Gh(a.rootElements,i),Uh((i.$parent=a).rootElements,r),r.$parent=null,r.di=null,(s.bpmnElement=i).di=s,e.oldRoot=o},sE.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=(e=e.oldRoot).businessObject,o=n.$parent,r=n.di;t.setRootElement(e,!0),Uh(o.rootElements,n),n.$parent=null,Gh(o.rootElements,i),i.$parent=o,n.di=null,(r.bpmnElement=i).di=r},lE.$inject=["modeling","spaceTool"],lE.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,o=e.location,r=(l=Yu(i))===i,a=r?i:i.parent,s=(Ku(a).length||n.createShape({type:"bpmn:Lane"},{x:i.x+30,y:i.y,width:i.width-30,height:i.height},a),[]),l=($u(l,(function(e){return s.push(e),e.label&&s.push(e.label),e===i?[]:Object(Vl.filter)(e.children,(function(e){return e!==i}))})),"top"===o?-120:120),c="top"===o?i.y:i.y+i.height,u=c+("top"===o?10:-10),d="top"===o?"n":"s",h=t.calculateAdjustments(s,"y",l,u);t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:l},d,u),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(r?30:0),y:c-("top"===o?120:0),width:i.width-(r?30:0),height:120},a)},cE.$inject=["modeling","translate"],cE.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,o=e.count,r=Ku(i),a=r.length;if(o<a)throw new Error(n("more than {count} child lanes",{count:o}));for(var s,l,c=Math.round(i.height/o),u=0;u<o;u++)l=i.y+u*c,s=u===o-1?i.height-c*u:c,l={x:i.x+30,y:l,width:i.width-30,height:s},u<a?t.resizeShape(r[u],l):t.createShape({type:"bpmn:Lane"},l,i)},uE.$inject=["modeling","spaceTool"],uE.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},uE.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=function(e,t){var n=Gu(n=Yu(e),Hl(n,"bpmn:Process")?[]:[n]),i=Cu(e),o=Cu(t),r=Bu(Cu(t),Cu(e)),a=[];return n.forEach((function(t){var n,s,l,c,u;t!==e&&(s=r.right,l=n=0,c=r.left,u=Cu(t),r.top&&(Hu(u.bottom-i.top)<10&&(l=o.top-u.bottom),Hu(u.top-i.top)<5)&&(n=o.top-u.top),r.bottom&&(Hu(u.top-i.bottom)<10&&(n=o.bottom-u.top),Hu(u.bottom-i.bottom)<5)&&(l=o.bottom-u.bottom),n||s||l||c)&&a.push({shape:t,newBounds:(u={top:n,right:s,bottom:l,left:c},{x:t.x+(u.left||0),y:t.y+(u.top||0),width:t.width-(u.left||0)+(u.right||0),height:t.height-(u.top||0)+(u.bottom||0)})})})),a}(e,t);n.resizeShape(e,t),i.forEach((function(e){n.resizeShape(e.shape,e.newBounds)}))},uE.prototype.resizeSpace=function(e,t){var n,i,o,r,a,s=this._spaceTool,l=Cu(e),c=(t=Bu(Cu(t),l),l=Yu(e),[]),u=[];$u(l,(function(e){return c.push(e),(Hl(e,"bpmn:Lane")||Hl(e,"bpmn:Participant"))&&u.push(e),e.children})),(t.bottom||t.top)&&(n=t.bottom||t.top,i=e.y+(t.bottom?e.height:0)+(t.bottom?-10:10),o=t.bottom?"s":"n",r=0<t.top||t.bottom<0?-n:n,a=s.calculateAdjustments(c,"y",r,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},o)),(t.left||t.right)&&(n=t.right||t.left,i=e.x+(t.right?e.width:0)+(t.right?-10:100),o=t.right?"e":"w",r=0<t.left||t.right<0?-n:n,a=s.calculateAdjustments(u,"x",r,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},o))};var dE="flowNodeRef";function hE(e){this._elementRegistry=e}function pE(e){this._moddle=e}hE.$inject=["elementRegistry"],hE.prototype.computeUpdates=function(e,t){var n=[],i=[],o={},r=[];function a(e){-1===n.indexOf(e)&&(r.push(e),n.push(e))}return t.forEach((function(e){(e=Yu(e))&&-1===n.indexOf(e)&&(e.children.filter((function(e){return Hl(e,"bpmn:FlowNode")})).forEach(a),n.push(e))})),e.forEach(a),r.forEach((function(e){var t=e.businessObject,n=t.get("lanes").slice();e=function(e){var t;return e.parent?(t=Yu(t=e),o[t.id]||(o[t.id]=Gu(t)),o[t.id].filter((function(t){return n=e,t=Cu(t=t),i=n.x+n.width/2,n=n.y+n.height/2,i>t.left&&i<t.right&&n>t.top&&n<t.bottom;var n,i})).map((function(e){return e.businessObject}))):[]}(e);i.push({flowNode:t,remove:n,add:e})})),t.forEach((function(e){var t=e.businessObject;e.parent||t.get(dE).forEach((function(e){i.push({flowNode:e,remove:[t],add:[]})}))})),i},hE.prototype.execute=function(e){(e.updates||(e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes))).forEach((function(e){var t=e.flowNode,n=t.get("lanes");e.remove.forEach((function(e){Uh(n,e),Uh(e.get(dE),t)})),e.add.forEach((function(e){Gh(n,e),Gh(e.get(dE),t)}))}))},hE.prototype.revert=function(e){e.updates.forEach((function(e){var t=e.flowNode,n=t.get("lanes");e.add.forEach((function(e){Uh(n,e),Uh(e.get(dE),t)})),e.remove.forEach((function(e){Gh(n,e),Gh(e.get(dE),t)}))}))},pE.$inject=["moddle"],pE.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},pE.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var fE={fill:void 0,stroke:void 0};function mE(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(Object(Vl.isString)(e)&&(t=e,(n=document.createElement("canvas").getContext("2d")).fillStyle="transparent",n.fillStyle=t,t=/^#[0-9a-fA-F]{6}$/.test(n.fillStyle)?n.fillStyle:null))return t;var t,n;throw new Error("invalid color value: "+e)}}}mE.$inject=["commandStack"],mE.prototype.postExecute=function(e){var t=e.elements,n=(e=e.colors||fE,this),i={};"fill"in e&&Object(Vl.assign)(i,{"background-color":this._normalizeColor(e.fill)}),"stroke"in e&&Object(Vl.assign)(i,{"border-color":this._normalizeColor(e.stroke)}),Object(Vl.forEach)(t,(function(e){var t=e.waypoints?Object(Vl.pick)(i,["border-color"]):i,o=t;"border-color"in o&&(o.stroke=o["border-color"]),"background-color"in o&&(o.fill=o["background-color"]),e.labelTarget?n._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:e.businessObject.di.label,properties:{color:i["background-color"]}}):n._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}))};var gE={width:0,height:0};function vE(e,t){function n(e,t){var n,i,o=e.label||e;e=e.labelTarget||e;return t=t,(i=Jl(n=(n=o).businessObject))&&("categoryValueRef"===i?n.categoryValueRef.value=t:n[i]=t),[o,e]}this.preExecute=function(t){var n=t.element,i=n.businessObject;t=t.newLabel;cm(n)||!am(n)||sm(n)||bE(t)||(t={x:(t=lm(n)).x,y:t.y+7},e.createLabel(n,t,{id:i.id+"_label",businessObject:i}))},this.execute=function(e){return e.oldLabel=Zl(e.element),n(e.element,e.newLabel)},this.revert=function(e){return n(e.element,e.oldLabel)},this.postExecute=function(n){var i=(i=n.element).label||i,o=n.newLabel,r=n.newBounds;n=n.hints||{};(cm(i)||Hl(i,"bpmn:TextAnnotation"))&&(cm(i)&&bE(o)?!1!==n.removeShape&&e.removeShape(i,{unsetLabel:!1}):(o=Zl(i),(r=void 0===r?t.getExternalLabelBounds(i,o):r)&&e.resizeShape(i,r,gE)))}}function bE(e){return!e||!e.trim()}function yE(e,t,n,i){Zk.call(this,e,t,n),this._bpmnRules=i}function wE(){}vE.$inject=["modeling","textRenderer"],H()(yE,Zk),yE.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],yE.prototype.getHandlers=function(){var e=Zk.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Qk,e["element.updateProperties"]=iE,e["canvas.updateRoot"]=sE,e["lane.add"]=lE,e["lane.resize"]=uE,e["lane.split"]=cE,e["lane.updateRefs"]=hE,e["id.updateClaim"]=pE,e["element.setColor"]=mE,e["element.updateLabel"]=vE,e},yE.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},yE.prototype.connect=function(e,t,n,i){var o=this._bpmnRules;if(n=n||o.canConnect(e,t))return this.createConnection(e,t,n,e.parent,i)},yE.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},yE.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},yE.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},yE.prototype.addLane=function(e,t){return e={shape:e,location:t},this._commandStack.execute("lane.add",e),e.newLane},yE.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},yE.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"});return this._commandStack.execute("canvas.updateRoot",{newRoot:e}),e},yE.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},yE.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"});this._commandStack.execute("canvas.updateRoot",{newRoot:e})},yE.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},yE.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},yE.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},wE.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||Tu(t.source||e.source),t.connectionEnd||Tu(t.target||e.target)]};var xE=Math.round,_E={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function kE(e,t,n){var i,o,r=Au(t,e,5),a=(n=n.split(":")[0],xE((t.x-e.x)/2+e.x)),s=(t=xE((t.y-e.y)/2+e.y),{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[n].test(r)),l=/h|r|l/.test(n),c=!1;return s?(i=l?{x:a,y:e.y}:{x:e.x,y:t},o=l?"h:h":"v:v"):(s=r,o=l?"h:v":"v:h",i={t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[n].test(s)?{x:a,y:t}:l?(c=t===e.y,{x:e.x+20*(/l/.test(n)?-1:1),y:c?t+20:t}):{x:(c=a===e.x)?a+20:a,y:e.y+20*(/t/.test(n)?-1:1)}),{waypoints:CE(e,i,o).concat(i),directions:o,turnNextDirections:c}}function EE(e){return e.split(":").reverse().join(":")}function CE(e,t,n){if(!(s=n=n||"h:h")||!/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(s))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(OE(n))return s=kE(e,t,n),r=i={waypoints:(i=kE(i=t,e,EE(n))).waypoints.slice().reverse(),directions:EE(i.directions),turnNextDirections:i.turnNextDirections},a=(o=s).directions.split(":")[1],l=r.directions.split(":")[0],a=(a=o.turnNextDirections?"h"==a?"v":"h":a)+":"+(l=r.turnNextDirections?"h"==l?"v":"h":l),l={waypoints:CE(o.waypoints[o.waypoints.length-1],r.waypoints[0],a),directions:a},[].concat(s.waypoints,l.waypoints,i.waypoints);var i,o=e,r=t,a=n,s=xE((r.x-o.x)/2+o.x),l=xE((r.y-o.y)/2+o.y);if("h:v"===a)return[{x:r.x,y:o.y}];if("v:h"===a)return[{x:o.x,y:r.y}];if("h:h"===a)return[{x:s,y:o.y},{x:s,y:r.y}];if("v:v"===a)return[{x:o.x,y:l},{x:r.x,y:l}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function SE(e,t,n,i,o,r){return Object(Vl.isArray)(n)&&(o=n,r=i,n=Tu(e),i=Tu(t)),o=o||[],-1!==(r=Object(Vl.assign)({preferredLayouts:[]},r)).preferredLayouts.indexOf("straight")&&function(e,t,n,i,o){var r,a,s={};return a=Au(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(r="x"),/left|right/.test(a)&&(r="y"),"target"===o.preserveDocking?TE(r,i,e)?(s[r]=i[r],[{x:(void 0!==s.x?s:n).x,y:(void 0!==s.y?s:n).y,original:{x:(void 0!==s.x?s:n).x,y:(void 0!==s.y?s:n).y}},{x:i.x,y:i.y}]):null:TE(r,n,t)?(s[r]=n[r],[{x:n.x,y:n.y},{x:(void 0!==s.x?s:i).x,y:(void 0!==s.y?s:i).y,original:{x:(void 0!==s.x?s:i).x,y:(void 0!==s.y?s:i).y}}]):null):null}(e,t,n,i,r)||r.connectionEnd&&function(e,t,n,i){return(i=AE(e,t,n,i=i.slice().reverse()))?i.reverse():null}(t,e,i,o)||r.connectionStart&&AE(e,t,n,o)||(!r.connectionStart&&!r.connectionEnd&&o&&o.length?o:function(e,t,n,i,o){o=o&&o.preferredLayouts||[],o=Object(Vl.without)(o,"straight")[0]||"h:h";var r=Au(e,t,_E[o]||0),a=(o=function(e,t){if(OE(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(r,o),n=n||Tu(e),i=i||Tu(t),o.split(":"));return n=ME(n,e,a[0],{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[r]),e=ME(i,t,a[1],r),(a=CE(i=n,t=e,a=o)).unshift(i),a.push(t),DE(a)}(e,t,n,i,r))}function TE(e,t,n){var i;return t=t[e],i=n[e],n=n[e]+n[{x:"width",y:"height"}[e]],i<=t&&t<=n}function AE(e,t,n,i){var o,r;return(o=i).length<3||!(4<o.length)&&Object(Vl.find)(o,(function(e,t){return(t=o[t-1])&&vu(e,t)<3}))||(r=i[0],(i=i.slice())[0]=n,i[1]=function(e,t,n){switch(yu(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(i[1],r,n),(i=(r=function(e,t,n){for(var i=e.length-2;0!==i;i--)if(wu(e[i],t,20)||wu(e[i],n,20))return e.slice(i);return e}(i,e,t))!==i?AE(e,t,n,r):i)&&yu(i))?null:i}function OE(e){return e&&/t|r|b|l/.test(e)}function ME(e,t,n,i){if("t"===(n="v"===(n="h"===n?/left/.test(i)?"l":"r":n)?/top/.test(i)?"t":"b":n))return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function DE(e){return e.reduce((function(t,n,i){return bu(t[t.length-1],e[i+1],n,0)||t.push(n),t}),[])}var $E={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},PE={top:"t",right:"r",bottom:"b",left:"l"};function RE(){}function LE(e,t){return e?e.original||e:Tu(t)}function IE(e,t){return Hl(t,"bpmn:Activity")&&Hl(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function NE(e){return Hl(e,"bpmn:SubProcess")&&Kl(e)}function FE(e){return(e=/right|left/.exec(e))&&e[0]}function jE(e){return(e=/top|bottom/.exec(e))&&e[0]}function BE(e){return"right"===e||"left"===e}function qE(e,t,n,i){return!(zE(e,i,n,40)||zE(e,i,{x:n.x+n.width,y:n.y+n.height},40)||zE(e,i,Tu(t),40))}function zE(e,t,n,i){return Math.abs(t[e]-n[e])<i}function VE(e){return Object(Vl.assign)({original:e.point.original||e.point},e.actual)}function WE(e,t){this._elementRegistry=e,this._graphicsFactory=t}H()(RE,wE),RE.prototype.layoutConnection=function(e,t){var n,i,o=(t=t||{}).source||e.source,r=t.target||e.target,a=t.waypoints||e.waypoints,s=t.connectionStart,l=t.connectionEnd;s=s||LE(a&&a[0],o),l=l||LE(a&&a[a.length-1],r);return(Hl(e,"bpmn:Association")||Hl(e,"bpmn:DataAssociation"))&&a&&!IE(o,r)?[].concat([s],a.slice(1,-1),[l]):(Hl(e,"bpmn:MessageFlow")?n={preferredLayouts:["straight","v:v"],preserveDocking:function(e,t){return Hl(t,"bpmn:Participant")?"source":Hl(e,"bpmn:Participant")?"target":NE(t)?"source":NE(e)||Hl(t,"bpmn:Event")?"target":Hl(e,"bpmn:Event")?"source":null}(o,r)}:(Hl(e,"bpmn:SequenceFlow")||IE(o,r))&&(n=o===r?{preferredLayouts:function(e,t){return"top"===(t=(t=t.waypoints)&&t.length&&Au(t[0],e))?["t:r"]:"right"===t?["r:b"]:"left"===t?["l:t"]:["b:l"]}(o,e)}:Hl(o,"bpmn:BoundaryEvent")?{preferredLayouts:function(e,t,n){var i=Tu(e),o=Tu(t),r=function(e){var t=e.host;return Au(Tu(e),t,-10)}(e),a=e.host===t,s=function(e,t){return-1!==["top","right","bottom","left"].indexOf(e)}(r);o=Au(o,i,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return a?function(e,t,n,i,o){var r=t?e:jE(e);return[(r=PE[r])+":"+(t=t?BE(e)?qE("y",n,i,o)?"h":"b":qE("x",n,i,o)?"v":"l":"v")]}(r,s,e,t,n):[(i=function(e,t,n){return n?PE[e]:jE(e)===jE(t)||function(e,t){return $E[e]===t}(FE(e),FE(t))?PE[jE(e)]:PE[FE(e)]}(r,o,s))+":"+(a=function(e,t,n){return n?BE(e)?function(e,t){return e=FE(e),e=$E[e],-1!==t.indexOf(e)}(e,t)||e===t?"h":"v":function(e,t){return e=jE(e),e=$E[e],-1!==t.indexOf(e)}(e,t)||e===t?"v":"h":BE(t)||jE(e)===jE(t)&&FE(t)?"h":"v"}(r,o,s))]}(o,r,l)}:NE(o)||NE(r)?{preferredLayouts:["straight","h:h"],preserveDocking:function(e){return NE(e)?"target":"source"}(o)}:Hl(o,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:Hl(r,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=DE(SE(o,r,s,l,a,n=Object(Vl.assign)(n,t)))),i||[s,l])},WE.$inject=["elementRegistry","graphicsFactory"],WE.prototype.getCroppedWaypoints=function(e,t,n){return t=t||e.source,n=n||e.target,t=this.getDockingPoint(e,t,!0),n=this.getDockingPoint(e,n),(e=e.waypoints.slice(t.idx+1,n.idx)).unshift(VE(t)),e.push(VE(n)),e},WE.prototype.getDockingPoint=function(e,t,n){var i=e.waypoints,o=n?0:i.length-1;return{point:i=i[o],actual:this._getIntersection(t,e,n)||i,idx:o}},WE.prototype._getIntersection=function(e,t,n){return Ou(this._getShapePath(e),this._getConnectionPath(t),n)},WE.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},WE.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},WE.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};Hx={__init__:["modeling","bpmnUpdater"],__depends__:[Hx,C_,T_,M_,Ub,$_,F_,z_,H_,ir,Hy,uk],bpmnFactory:["type",dk],bpmnUpdater:["type",hk],elementFactory:["type",fk],modeling:["type",yE],layouter:["type",RE],connectionDocking:["type",WE]};var HE=Math.round;function UE(e,t,n,i,o){function r(e,t,n,i){return o.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,o){var r;if(Object(Vl.isObject)(i)&&(o=i,i=!1),!n.waypoints&&n.parent)return r={x:(r=n).x+HE(r.width/2),y:r.y+HE(r.height/2)},t.init(e,r,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:o||{}}}),!0}e.on("shape.move.start",1500,(function(e){var t,n,o=e.context,r=(e=e.shape,i.get().slice());-1===r.indexOf(e)&&(r=[e]),t=r,n=Object(Vl.groupBy)(t,"id"),r=Object(Vl.filter)(t,(function(e){for(;e=e.parent;)if(n[e.id])return!1;return!0})),Object(Vl.assign)(o,{shapes:r,validatedShapes:r,shape:e})})),e.on("shape.move.start",1250,(function(e){var t=(e=e.context).validatedShapes;if(!(e.canExecute=r(t)))return!1})),e.on("shape.move.move",500,(function(e){var t=e.context,n=t.validatedShapes,i=e.hover,o={x:e.dx,y:e.dy};n=r(n,o,{x:e.x,y:e.y},i);t.delta=o,null===(t.canExecute=n)?t.target=null:t.target=i})),e.on("shape.move.end",(function(e){var t=(e=e.context).delta,i=e.canExecute,o="attach"===i,r=e.shapes;if(!1===i)return!1;t.x=HE(t.x),t.y=HE(t.y),0===t.x&&0===t.y||n.moveElements(r,t,e.target,{primaryShape:e.shape,attach:o})})),e.on("element.mousedown",(function(e){if(bm(e)){var t=fm(e);if(t)return a(t,e.element);throw new Error("must supply DOM mousedown event")}})),this.start=a}UE.$inject=["eventBus","dragging","modeling","selection","rules"];var GE="djs-dragging",KE="drop-not-ok",YE="new-parent";function XE(e,t,n,i){function o(e){e=Pu(e,!0);var t=Object(Vl.map)(e,(function(e){return(e.incoming||[]).concat(e.outgoing||[])}));return Object(Vl.flatten)(e.concat(t))}function r(e,n){["attach-ok","drop-ok",KE,YE].forEach((function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)}))}e.on("shape.move.start",499,(function(e){var r,a=e.context,s=(e=a.shapes,a.allDraggedElements),l=function(e){var t;return e=o(e),t=e,Object(Vl.filter)(t,(function(e){return!e.waypoints||Object(Vl.find)(t,Object(Vl.matchPattern)({id:e.source.id}))&&Object(Vl.find)(t,Object(Vl.matchPattern)({id:e.target.id}))}))}(e);a.dragGroup||(ic(r=gc("g"),n.cls("djs-drag-group",["no-events"])),ec(t.getActiveLayer(),r),a.dragGroup=r),l.forEach((function(e){i.addDragger(e,a.dragGroup)})),s=s?Object(Vl.flatten)([s,o(e)]):o(e),Object(Vl.forEach)(s,(function(e){t.addMarker(e,GE)})),a.allDraggedElements=s,a.differentParents=(r=e,1!==Object(Vl.size)(Object(Vl.groupBy)(r,(function(e){return e.parent&&e.parent.id}))))})),e.on("shape.move.move",499,(function(e){var t=e.context,n=t.dragGroup,i=t.target,o=t.shape.parent,a=t.canExecute;i&&("attach"===a?r(i,"attach-ok"):t.canExecute&&i&&i.id!==o.id?r(i,YE):r(i,t.canExecute?"drop-ok":KE)),au(n,e.dx,e.dy)})),e.on(["shape.move.out","shape.move.cleanup"],(function(e){(e=e.context.target)&&r(e,null)})),e.on("shape.move.cleanup",(function(e){var n=(e=e.context).allDraggedElements;e=e.dragGroup;Object(Vl.forEach)(n,(function(e){t.removeMarker(e,GE)})),e&&uc(e)})),this.makeDraggable=function(e,n,o){i.addDragger(n,e.dragGroup),o&&t.addMarker(n,GE),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}XE.$inject=["eventBus","canvas","styles","previewSupport"];C_={__depends__:[tr,ir,Wo,Hg,Ng,bb],__init__:["move","movePreview"],move:["type",UE],movePreview:["type",XE]};var JE="djs-palette-",ZE="two-column";function QE(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",(function(e){e=e.tool,n.updateToolHighlight(e)})),e.on("i18n.changed",(function(){n._update()})),e.on("diagram.init",(function(){n._diagramInitialized=!0,n._rebuild()}))}function eC(e,t){return t=t.getPaletteEntries(),Object(Vl.isFunction)(t)?t(e):(Object(Vl.forEach)(t,(function(t,n){e[n]=t})),e)}function tC(e,t,n,i,o,r,a){this._selection=o,this._dragging=n,this._mouse=a;var s=this;r.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",(function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",(function(){s.activateLasso(t.originalEvent,!0)}))})),e.on("lasso.end",(function(e){e=nC(e);var t=i.filter((function(e){return e}));s.select(t,e)})),e.on("lasso.start",(function(e){var n=e.context;n.bbox=nC(e),function(e){var n=t.getActiveLayer();ic(e=e.frame=gc("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ec(n,e)}(n)})),e.on("lasso.move",(function(e){var t=e.context;t.bbox=nC(e),function(e){ic(e.frame,{x:(e=e.bbox).x,y:e.y,width:e.width,height:e.height})}(t)})),e.on("lasso.cleanup",(function(e){!function(e){e.frame&&uc(e.frame)}(e=e.context)})),e.on("element.mousedown",1500,(function(e){if(wm(e))return s.activateLasso(e.originalEvent),!0}))}function nC(e){var t={x:e.x-e.dx,y:e.y-e.dy};e={x:e.x,y:e.y};return t=t.x<=e.x&&t.y<e.y||t.x<e.x&&t.y<=e.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&t.y<e.y||e.x<t.x&&t.y<=e.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:t.x<=e.x&&e.y<t.y||t.x<e.x&&e.y<=t.y?{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?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:{x:e.x,y:e.y,width:0,height:0}}function iC(e,t,n,i,o,r){this._dragging=n,this._mouse=r;var a=this;n=i.get("keyboard",!1);o.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",1500,(function(e){if(ym(e))return a.activateMove(e.originalEvent,!0),!1})),n&&n.addListener(1500,(function(e){oC(e.keyEvent)&&!a.isActive()&&(e=a._mouse.getLastMoveEvent(),a.activateMove(e,!!e))}),"keyboard.keydown"),n&&n.addListener(1500,(function(e){oC(e.keyEvent)&&a.isActive()&&a.toggle()}),"keyboard.keyup"),e.on("hand.end",(function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",(function(){a.activateMove(t.originalEvent,{reactivate:!0})}))})),e.on("hand.move.move",(function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})})),e.on("hand.move.end",(function(t){var n=t.context.reactivate;return!ym(t)&&n&&e.once("hand.move.ended",(function(e){a.activateHand(e.originalEvent,!0,!0)})),!1}))}function oC(e){return qm(" ",e)}QE.$inject=["eventBus","canvas"],QE.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,(function(e){e.providers.push(t)})),this._rebuild()},QE.prototype.getEntries=function(){return this._getProviders().reduce(eC,{})},QE.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},QE.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=eu(QE.HTML_MARKUP);n.appendChild(i),qc(n).add(JE+"shown"),Zc(i,".djs-palette-toggle, .entry","click",(function(t){var n=t.delegateTarget;if(Hc(n,".djs-palette-toggle"))return e.toggle();e.trigger("click",t)})),Xc.bind(i,"mousedown",(function(e){e.stopPropagation()})),Zc(i,".entry","dragstart",(function(t){e.trigger("dragstart",t)})),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},QE.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},QE.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,i=this._eventBus,o=(n=qc(n),qc(t));t="twoColumn"in e?e.twoColumn:this._needsCollapse(t.clientHeight,this._entries||{});n.toggle(ZE,t),o.toggle(JE+ZE,t),"open"in e&&(n.toggle("open",e.open),o.toggle(JE+"open",e.open)),i.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},QE.prototype._update=function(){var e=nu(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Vc(e),Object(Vl.forEach)(t,(function(t,n){var i,o=nu("[data-group="+(r=t.group||"default")+"]",e),r=(o||(o=eu('<div class="group" data-group="'+r+'"></div>'),e.appendChild(o)),t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'));r=eu(r);o.appendChild(r),t.separator||(Ic(r,"data-action",n),t.title&&Ic(r,"title",t.title),t.className&&(o=t.className,i=qc(r),(Object(Vl.isArray)(o)?o:o.split(/\s+/g)).forEach((function(e){i.add(e)}))),t.imageUrl&&r.appendChild(eu('<img src="'+t.imageUrl+'">')))})),this.open()},QE.prototype.trigger=function(e,t,n){var i=this._entries,o=t.delegateTarget||t.target;if(!o)return t.preventDefault();(i=i[Ic(o,"data-action")])&&(o=i.action,i=t.originalEvent||t,Object(Vl.isFunction)(o)?"click"===e&&o(i,n):o[e]&&o[e](i,n),t.preventDefault())},QE.prototype._layoutChanged=function(){this._toggleState({})},QE.prototype._needsCollapse=function(e,t){return e<50+46*Object.keys(t).length},QE.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},QE.prototype.open=function(){this._toggleState({open:!0})},QE.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},QE.prototype.isActiveTool=function(e){return e&&this._activeTool===e},QE.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=nu(".djs-palette-entries",this._container),this._toolsContainer=nu("[data-group=tools]",t)),t=this._toolsContainer,Object(Vl.forEach)(t.children,(function(t){var n=t.getAttribute("data-action");n&&(t=qc(t),n=n.replace("-tool",""),t.contains("entry")&&n===e?t.add("highlighted-entry"):t.remove("highlighted-entry"))}))},QE.prototype.isOpen=function(){return qc(this._container).has("open")},QE.prototype._getParentContainer=function(){return this._canvas.getContainer()},QE.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>',T_={__init__:["palette"],palette:["type",QE]},tC.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],tC.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:"crosshair",data:{context:{}}})},tC.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:"crosshair",data:{context:{}}})},tC.prototype.select=function(e,t){e=e,n=t,i={},Object(Vl.forEach)(e,(function(e){var t=e;t.waypoints&&(t=Ru(t)),!Object(Vl.isNumber)(n.y)&&t.x>n.x&&(i[e.id]=e),!Object(Vl.isNumber)(n.x)&&t.y>n.y&&(i[e.id]=e),t.x>n.x&&t.y>n.y&&(!(Object(Vl.isNumber)(n.width)&&Object(Vl.isNumber)(n.height)&&t.width+t.x<n.width+n.x&&t.height+t.y<n.height+n.y)&&Object(Vl.isNumber)(n.width)&&Object(Vl.isNumber)(n.height)||(i[e.id]=e))}));var n,i;t=i;this._selection.select(Object(Vl.values)(t))},tC.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},tC.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)},M_={__depends__:[G_,Pb],__init__:["lassoTool"],lassoTool:["type",tC]},iC.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],iC.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:"grab",data:{context:n||{}}})},iC.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:"grab",data:{context:{reactivate:n}}})},iC.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},iC.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};Ub={__depends__:[G_,Pb],__init__:["handTool"],handTool:["type",iC]};var rC="connect-ok",aC="connect-not-ok";function sC(e,t,n,i,o,r,a){var s=this;this._dragging=t,this._rules=r,this._mouse=a,o.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",(function(e){var t=e.context,n=(e=e.hover,t.canStartConnect=s.canStartConnect(e));null!==n&&(t.startTarget=e,i.addMarker(e,n?rC:aC))})),e.on(["global-connect.out","global-connect.cleanup"],(function(e){var t=e.context.startTarget;e=e.context.canStartConnect;t&&i.removeMarker(t,e?rC:aC)})),e.on(["global-connect.ended"],(function(t){var i=t.context.startTarget,o={x:t.x,y:t.y};if(s.canStartConnect(i))return e.once("element.out",(function(){e.once(["connect.ended","connect.canceled"],(function(){e.fire("global-connect.drag.ended")})),n.start(null,i,o)})),!1}))}function lC(e,t,n,i,o){Og.call(this,e),e.on("shape.move.move",250,(function(e){var r,a,s,l=(e=e.context).canExecute;e.visualReplacements||(e.visualReplacements={}),l&&l.replacements?(l=(s=e).canExecute.replacements,Object(Vl.forEach)(l,(function(e){var r,a=e.oldElementId;e={type:e.newElementType};s.visualReplacements[a]||(r=t.get(a),Object(Vl.assign)(e,{x:r.x,y:r.y}),e=n.createShape(e),i.addShape(e,r.parent),(r=nu('[data-element-id="'+Eh()(r.id)+'"]',s.dragGroup))&&ic(r,{display:"none"}),r=o.addDragger(e,s.dragGroup),s.visualReplacements[a]=r,i.removeShape(e))}))):(a=(r=e).visualReplacements,Object(Vl.forEach)(a,(function(e,t){var n=nu('[data-element-id="'+Eh()(t)+'"]',r.dragGroup);n&&ic(n,{display:"inline"}),e.remove(),a[t]&&delete a[t]})))}))}sC.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],sC.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},sC.prototype.toggle=function(){var e;return this.isActive()?this._dragging.cancel():(e=this._mouse.getLastMoveEvent(),this.start(e,!!e))},sC.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},sC.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})},$_={__depends__:[T_,Sb,uk,M_,Ub,{__depends__:[jv,Hg,Ng,G_,Pb],globalConnect:["type",sC]},ea],__init__:["paletteProvider"],paletteProvider:["type",nd]},lC.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],H()(lC,Og);F_={__depends__:[bb],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",lC]};var cC=["x","y"],uC=Math.abs;function dC(e){e.on(["connect.hover","connect.move","connect.end"],1250,(function(e){var t,n,i,o,r,a,s,l,c,u,d=e.context,h=d.canExecute,p=d.start,f=d.hover,m=d.source,g=d.target;e.originalEvent&&Bm(e.originalEvent)||(d.initialConnectionStart||(d.initialConnectionStart=d.connectionStart),h&&f&&(t=e,i=Hl(n=f,"bpmn:Task")?10:20,cC.forEach((function(e){var o=fC(e,n);t[e]<n[e]+i?Av(t,e,n[e]+i):t[e]>n[e]+o-i&&Av(t,e,n[e]+o-i)}))),f&&(c=h,u=["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"],Object(Vl.some)(u,(function(e){return pC(c,e)})))?(d.connectionStart=Sv(p),Ul(f,["bpmn:Event","bpmn:Gateway"])&&hC(e,Sv(f)),Ul(f,["bpmn:Task","bpmn:SubProcess"])&&(a=e,l=Sv(s=f),cC.forEach((function(e){var t,n,i;n=s,(t=a)[i=e]>n[i]+20&&t[i]<n[i]+fC(i,n)-20&&Av(a,e,l[e])}))),Hl(m,"bpmn:BoundaryEvent")&&g===m.host&&(g=(u=(o=e).context).source,m=u.target,function(e){var t=e.hover;e=e.source;return t&&e&&t===e}(u)||(u=Au(r=Sv(g),m,-10),g=[],/top|bottom/.test(u)&&g.push("x"),/left|right/.test(u)&&g.push("y"),g.forEach((function(e){var t=o[e];uC(t-r[e])<40&&(t=t>r[e]?r[e]+40:r[e]-40,Av(o,e,t))}))))):pC(h,"bpmn:MessageFlow")?(Hl(p,"bpmn:Event")&&(d.connectionStart=Sv(p)),Hl(f,"bpmn:Event")&&hC(e,Sv(f))):d.connectionStart=d.initialConnectionStart)}))}function hC(e,t){Av(e,"x",t.x),Av(e,"y",t.y)}function pC(e,t){return e&&e.type===t}function fC(e,t){return"x"===e?t.width:t.height}function mC(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function gC(e){this._snapValues={}}function vC(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],(function(e){i.initSnap(e)})),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,(function(e){var t=(r=e.context).shape,o=r.snapContext,r=r.target;e.originalEvent&&Bm(e.originalEvent)||!Tv(e)&&r&&((o=o.pointsForTarget(r)).initialized||((o=i.addSnapTargetPoints(o,t,r)).initialized=!0),n.snap(e,o))})),t.on(["create.cleanup","shape.move.cleanup"],(function(){n.hide()}))}function bC(e){return e.labelTarget}function yC(e,t){t.invoke(vC,this),e.on(["create.move","create.end"],1500,wC),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,(function(e){var t,n=(i=e.context).canExecute,i=i.target;!n||"attach"!==n&&!n.attach||Tv(e)||(n=e,i=Cu(e=i),e=Ux(n,e),t=(t=n.context.shape).parent?{x:0,y:0}:Tu(t),/top/.test(e)?Av(n,"y",i.top-t.y):/bottom/.test(e)&&Av(n,"y",i.bottom-t.y),/left/.test(e)?Av(n,"x",i.left-t.x):/right/.test(e)&&Av(n,"x",i.right-t.x))}))}function wC(e){var t,n,i,o=e.context.createConstraints;o&&(t=o.top,n=o.right,i=o.bottom,((o=o.left)&&o>=e.x||n&&n<=e.x)&&Av(e,"x",e.x),t&&t>=e.y||i&&i<=e.y)&&Av(e,"y",e.y)}function xC(e,t){return-1!==e.indexOf(t)}function _C(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}function kC(e,t){var n=this;e.on(["resize.start"],(function(e){n.initSnap(e)})),e.on(["resize.move","resize.end"],1250,(function(e){var i=(a=e.context).shape,o=i.parent,r=a.direction,a=a.snapContext;e.originalEvent&&Bm(e.originalEvent)||Tv(e)||((a=a.pointsForTarget(o)).initialized||((a=n.addSnapTargetPoints(a,i,o,r)).initialized=!0),"n"!==(i=r)&&"s"!==i||Av(e,"x",e.x),"e"!==(o=r)&&"w"!==o||Av(e,"y",e.y),t.snap(e,a))})),e.on(["resize.cleanup"],(function(){t.hide()}))}function EC(e,t){var n=Tu(e);e=Cu(e),n={x:n.x,y:n.y};return-1!==t.indexOf("n")?n.y=e.top:-1!==t.indexOf("s")&&(n.y=e.bottom),-1!==t.indexOf("e")?n.x=e.right:-1!==t.indexOf("w")&&(n.x=e.left),n}function CC(e){this._canvas=e,this._asyncHide=Object(Vl.debounce)(Object(Vl.bind)(this.hide,this),1e3)}dC.$inject=["eventBus"],mC.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},mC.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},mC.prototype.addDefaultSnap=function(e,t){(this._defaultSnaps[e]||(this._defaultSnaps[e]=[])).push(t)},mC.prototype.getSnapLocations=function(){return this._snapLocations},mC.prototype.setSnapLocations=function(e){this._snapLocations=e},mC.prototype.pointsForTarget=function(e){e=e.id||e;var t=this._targets[e];return t||(t=this._targets[e]=new gC).initDefaults(this._defaultSnaps),t},gC.prototype.add=function(e,t){var n=this._snapValues[e];-1===(n=n||(this._snapValues[e]={x:[],y:[]})).x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},gC.prototype.snap=function(e,t,n,i){return(t=this._snapValues[t])&&function(e,t,n){var i,o;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(o=t[i],_v(o-e)<=n)return o}(e[n],t[n],i)},gC.prototype.initDefaults=function(e){var t=this;Object(Vl.forEach)(e||{},(function(e,n){Object(Vl.forEach)(e,(function(e){t.add(n,e)}))}))},vC.$inject=["elementRegistry","eventBus","snapping"],vC.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=(t=e.context).shape,o=(o=t.snapContext)||(t.snapContext=new mC),r=(n=(t=n.get(i.id)?Sv(i,e):{x:e.x+Sv(i).x,y:e.y+Sv(i).y}).x-i.width/2,t.y-i.height/2),a=t.x+i.width/2,s=t.y+i.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),bC(i)||(o.setSnapOrigin("top-left",{x:n-e.x,y:r-e.y}),o.setSnapOrigin("bottom-right",{x:a-e.x,y:s-e.y})),o},vC.prototype.addSnapTargetPoints=function(e,t,n){return n=this.getSnapTargets(t,n),Object(Vl.forEach)(n,(function(n){var i;if(!bC(n))return n.waypoints?n.waypoints.length<3?void 0:(i=n.waypoints.slice(1,-1),void Object(Vl.forEach)(i,(function(t){e.add("mid",t)}))):void e.add("mid",Sv(n));bC(t)&&e.add("mid",Sv(n))})),Object(Vl.isNumber)(t.x)&&Object(Vl.isNumber)(t.y)&&this._elementRegistry.get(t.id)&&e.add("mid",Sv(t)),e},vC.prototype.getSnapTargets=function(e,t){return Ov(t).filter((function(e){return!e.hidden}))},H()(yC,vC),yC.$inject=["eventBus","injector"],yC.prototype.initSnap=function(e){var t=vC.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return Object(Vl.forEach)(n.outgoing,(function(n){var o=(o=n.waypoints[0]).original||o;t.setSnapOrigin(n.id+"-docking",_C(o,i,e))})),Object(Vl.forEach)(n.incoming,(function(n){var o=(o=n.waypoints[n.waypoints.length-1]).original||o;t.setSnapOrigin(n.id+"-docking",_C(o,i,e))})),Hl(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},yC.prototype.addSnapTargetPoints=function(e,t,n){vC.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n),o=(Object(Vl.forEach)(i,(function(n){(function(e){return Hl(e,"bpmn:SubProcess")&&Kl(e)?1:Hl(e,"bpmn:Participant")}(n)||("bpmn:TextAnnotation",[t,n].every((function(e){return Hl(e,"bpmn:TextAnnotation")}))))&&(e.add("top-left",Ev(n)),e.add("bottom-right",Cv(n)))})),this._elementRegistry);return Object(Vl.forEach)(t.incoming,(function(n){var r;o.get(t.id)&&(xC(i,n.source)||e.add("mid",Tu(n.source)),r=n.waypoints[0],e.add(n.id+"-docking",r.original||r))})),Object(Vl.forEach)(t.outgoing,(function(n){var r;o.get(t.id)&&(xC(i,n.target)||e.add("mid",Tu(n.target)),r=n.waypoints[n.waypoints.length-1],e.add(n.id+"-docking",r.original||r))})),e=Hl(n,"bpmn:SequenceFlow")?this.addSnapTargetPoints(e,t,n.parent):e},yC.prototype.getSnapTargets=function(e,t){return vC.prototype.getSnapTargets.call(this,e,t).filter((function(e){return!Hl(e,"bpmn:Lane")}))},kC.prototype.initSnap=function(e){var t=(o=e.context).shape,n=o.direction,i=(i=o.snapContext)||(o.snapContext=new mC),o=EC(t,n);return i.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),i},kC.prototype.addSnapTargetPoints=function(e,t,n,i){return n=this.getSnapTargets(t,n),Object(Vl.forEach)(n,(function(t){e.add("corner",Cv(t)),e.add("corner",Ev(t))})),e.add("corner",EC(t,i)),e},kC.$inject=["eventBus","snapping"],kC.prototype.getSnapTargets=function(e,t){return Ov(t).filter((function(t){return!(t.host===e||t.waypoints||t.hidden||t.labelTarget)}))},CC.$inject=["canvas"],CC.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),o={x:Tv(e,"x"),y:Tv(e,"y")};Object(Vl.forEach)(i,(function(i){var r=n.getSnapOrigin(i),a={x:e.x+r.x,y:e.y+r.y};if(Object(Vl.forEach)(["x","y"],(function(e){var n;o[e]||void 0!==(n=t.snap(a,i,e,7))&&(o[e]={value:n,originValue:n-r[e]})})),o.x&&o.y)return!1})),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),Object(Vl.forEach)(["x","y"],(function(t){var n=o[t];Object(Vl.isObject)(n)&&Av(e,t,n.originValue)}))},CC.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=gc("path");return ic(n,{d:"M0,0 L0,0"}),lc(n).add("djs-snap-line"),ec(t,n),{update:function(t){Object(Vl.isNumber)(t)?ic(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):ic(n,{display:"none"})}}},CC.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},CC.prototype.showSnapLine=function(e,t){(e=this.getSnapLine(e))&&e.update(t),this._asyncHide()},CC.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},CC.prototype.hide=function(){Object(Vl.forEach)(this._snapLines,(function(e){e.update()}))};z_={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",vC],resizeSnapping:["type",kC],snapping:["type",CC]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",dC],createMoveSnapping:["type",yC]};var SC={"&":"&","<":"<",">":">",'"':""","'":"'"};function TC(e){return(e=""+e)&&e.replace(/[&<>"']/g,(function(e){return SC[e]}))}function AC(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=eu(AC.BOX_HTML),this._searchInput=nu(AC.INPUT_SELECTOR,this._container),this._resultsContainer=nu(AC.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function OC(e,t,n){i="",t.forEach((function(e){e.matched?i+='<strong class="'+AC.RESULT_HIGHLIGHT_CLASS+'">'+TC(e.matched)+"</strong>":i+=TC(e.normal)}));var i;t=""!==i?i:null;(n=eu(n)).innerHTML=t,e.appendChild(n)}function MC(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function DC(e){return 0<Object(Vl.filter)(e,(function(e){return!!e.matched})).length}function $C(e,t){var n,i=[],o=e;return e&&(e=e.toLowerCase(),t=t.toLowerCase(),-1<(n=e.indexOf(t))?(0!==n&&i.push({normal:o.substr(0,n)}),i.push({matched:o.substr(n,t.length)}),t.length+n<e.length&&i.push({normal:o.substr(t.length+n,e.length)})):i.push({normal:o})),i}function PC(e){Jf.call(this,e)}AC.$inject=["canvas","eventBus","overlays","selection"],AC.prototype._bindEvents=function(){var e=this;function t(t,n,i,o){e._eventMaps.push({el:t,type:i,listener:Zc(t,n,i,o)})}t(document,"html","click",(function(t){e.close()})),t(this._container,AC.INPUT_SELECTOR,"click",(function(e){e.stopPropagation(),e.delegateTarget.focus()})),t(this._container,AC.RESULT_SELECTOR,"mouseover",(function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)})),t(this._container,AC.RESULT_SELECTOR,"click",(function(t){t.stopPropagation(),e._select(t.delegateTarget)})),t(this._container,AC.INPUT_SELECTOR,"keydown",(function(e){38===e.keyCode&&e.preventDefault(),40===e.keyCode&&e.preventDefault()})),t(this._container,AC.INPUT_SELECTOR,"keyup",(function(t){var n;return 27===t.keyCode?e.close():13===t.keyCode?(n=e._getCurrentResult())?e._select(n):e.close():38===t.keyCode?e._scrollToDirection(!0):40===t.keyCode?e._scrollToDirection():void(37!==t.keyCode&&39!==t.keyCode&&e._search(t.delegateTarget.value))}))},AC.prototype._unbindEvents=function(){this._eventMaps.forEach((function(e){Qc(e.el,e.type,e.listener)}))},AC.prototype._search=function(e){var t=this;this._clearResults(),e&&""!==e&&(e=this._searchProvider.find(e)).length&&(e.forEach((function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}})),e=nu(AC.RESULT_SELECTOR,this._resultsContainer),this._scrollToNode(e),this._preselect(e))},AC.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();t&&(e=e?t.previousElementSibling:t.nextElementSibling)&&(this._scrollToNode(e),this._preselect(e))},AC.prototype._scrollToNode=function(e){var t,n;e&&e!==this._getCurrentResult()&&(t=e.offsetTop,n=this._resultsContainer.scrollTop,e=t-this._resultsContainer.clientHeight+e.clientHeight,t<n?this._resultsContainer.scrollTop=t:n<e&&(this._resultsContainer.scrollTop=e))},AC.prototype._clearResults=function(){Vc(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},AC.prototype._getCurrentResult=function(){return nu(AC.RESULT_SELECTED_SELECTOR,this._resultsContainer)},AC.prototype._createResultNode=function(e,t){var n=eu(AC.RESULT_HTML);return 0<e.primaryTokens.length&&OC(n,e.primaryTokens,AC.RESULT_PRIMARY_HTML),OC(n,e.secondaryTokens,AC.RESULT_SECONDARY_HTML),Ic(n,AC.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},AC.prototype.registerProvider=function(e){this._searchProvider=e},AC.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,qc(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},AC.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,qc(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},AC.prototype.toggle=function(){this.isOpen()?this.close():this.open()},AC.prototype.isOpen=function(){return this._open},AC.prototype._preselect=function(e){var t=this._getCurrentResult();e!==t&&(t&&qc(t).remove(AC.RESULT_SELECTED_CLASS),t=Ic(e,AC.RESULT_ID_ATTRIBUTE),t=this._results[t].element,qc(e).add(AC.RESULT_SELECTED_CLASS),this._resetOverlay(t),this._canvas.scrollToElement(t,{top:400}),this._selection.select(t),this._eventBus.fire("searchPad.preselected",t))},AC.prototype._select=function(e){e=Ic(e,AC.RESULT_ID_ATTRIBUTE),e=this._results[e].element,this.close(),this._resetOverlay(),this._canvas.scrollToElement(e,{top:400}),this._selection.select(e),this._eventBus.fire("searchPad.selected",e)},AC.prototype._resetOverlay=function(e){var t,n,i;this._overlayId&&this._overlays.remove(this._overlayId),e&&(i=["width: "+(n=(t=t=Ru(e)).width+12)+"px","height: "+(t=t.height+12)+"px"].join("; "),this._overlayId=this._overlays.add(e,{position:{bottom:t-6,right:n-6},show:!0,html:'<div style="'+i+'" class="'+AC.OVERLAY_CLASS+'"></div>'}))},AC.CONTAINER_SELECTOR=".djs-search-container",AC.INPUT_SELECTOR=".djs-search-input input",AC.RESULTS_CONTAINER_SELECTOR=".djs-search-results",AC.RESULT_SELECTOR=".djs-search-result",AC.RESULT_SELECTED_SELECTOR="."+(AC.RESULT_SELECTED_CLASS="djs-search-result-selected"),AC.RESULT_ID_ATTRIBUTE="data-result-id",AC.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",AC.OVERLAY_CLASS="djs-search-overlay",AC.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',AC.RESULT_HTML='<div class="djs-search-result"></div>',AC.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',AC.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>',H_={__depends__:[s,ir],searchPad:["type",AC]},MC.$inject=["elementRegistry","searchPad","canvas"],MC.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter((function(e){return!e.labelTarget}));n=Object(Vl.filter)(n,(function(e){return e!==t}));return n=Object(Vl.map)(n,(function(t){return{primaryTokens:$C(Zl(t),e),secondaryTokens:$C(t.id,e),element:t}})),n=Object(Vl.filter)(n,(function(e){return DC(e.primaryTokens)||DC(e.secondaryTokens)})),Object(Vl.sortBy)(n,(function(e){return Zl(e.element)+e.element.id}))},Hy={__depends__:[H_],__init__:["bpmnSearch"],bpmnSearch:["type",MC]},H()(PC,Jf),PC.Viewer=Lm,PC.NavigatedViewer=sg,PC.prototype.createDiagram=qf((function(){return this.importXML('<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>')})),PC.prototype._modules=[].concat(Lm.prototype._modules,PC.prototype._interactionModules=[qr,ee,nr,te],PC.prototype._modelingModules=[zr,Sg,Vg,Lg,Pv,jv,qv,Vv,Db,Sb,Ob,_y,$y,Ny,jy,Q,sw,Hx,C_,$_,F_,ew,z_,Hy]);var RC={"Append EndEvent":"追加结束事件","Append Gateway":"追加网关","Append Task":"追加任务","Append Intermediate/Boundary Event":"追加中间抛出事件/边界事件","Activate the global connect tool":"激活全局连接工具","Append {type}":"添加 {type}","Add Lane above":"在上面添加道","Divide into two Lanes":"分割成两个道","Divide into three Lanes":"分割成三个道","Add Lane below":"在下面添加道","Append compensation activity":"追加补偿活动","Change type":"修改类型","Connect using Association":"使用关联连接","Connect using Sequence/MessageFlow or Association":"使用顺序/消息流或者关联连接","Connect using DataInputAssociation":"使用数据输入关联连接",Remove:"移除","Activate the hand tool":"激活抓手工具","Activate the lasso tool":"激活套索工具","Activate the create/remove space tool":"激活创建/删除空间工具","Create expanded SubProcess":"创建扩展子过程","Create IntermediateThrowEvent/BoundaryEvent":"创建中间抛出事件/边界事件","Create Pool/Participant":"创建池/参与者","Parallel Multi Instance":"并行多重事件","Sequential Multi Instance":"时序多重事件",DataObjectReference:"数据对象参考",DataStoreReference:"数据存储参考",Loop:"循环","Ad-hoc":"即席","Create {type}":"创建 {type}",Task:"任务","Send Task":"发送任务","Receive Task":"接收任务","User Task":"用户任务","Manual Task":"手工任务","Business Rule Task":"业务规则任务","Service Task":"服务任务","Script Task":"脚本任务","Call Activity":"调用活动","Sub Process (collapsed)":"子流程(折叠的)","Sub Process (expanded)":"子流程(展开的)","Start Event":"开始事件",StartEvent:"开始事件","Intermediate Throw Event":"中间事件","End Event":"结束事件",EndEvent:"结束事件","Create StartEvent":"创建开始事件","Create EndEvent":"创建结束事件","Create Task":"创建任务","Create User Task":"创建用户任务","Create Gateway":"创建网关","Create DataObjectReference":"创建数据对象","Create DataStoreReference":"创建数据存储","Create Group":"创建分组","Create Intermediate/Boundary Event":"创建中间/边界事件","Message Start Event":"消息开始事件","Timer Start Event":"定时开始事件","Conditional Start Event":"条件开始事件","Signal Start Event":"信号开始事件","Error Start Event":"错误开始事件","Escalation Start Event":"升级开始事件","Compensation Start Event":"补偿开始事件","Message Start Event (non-interrupting)":"消息开始事件(非中断)","Timer Start Event (non-interrupting)":"定时开始事件(非中断)","Conditional Start Event (non-interrupting)":"条件开始事件(非中断)","Signal Start Event (non-interrupting)":"信号开始事件(非中断)","Escalation Start Event (non-interrupting)":"升级开始事件(非中断)","Message Intermediate Catch Event":"消息中间捕获事件","Message Intermediate Throw Event":"消息中间抛出事件","Timer Intermediate Catch Event":"定时中间捕获事件","Escalation Intermediate Throw Event":"升级中间抛出事件","Conditional Intermediate Catch Event":"条件中间捕获事件","Link Intermediate Catch Event":"链接中间捕获事件","Link Intermediate Throw Event":"链接中间抛出事件","Compensation Intermediate Throw Event":"补偿中间抛出事件","Signal Intermediate Catch Event":"信号中间捕获事件","Signal Intermediate Throw Event":"信号中间抛出事件","Message End Event":"消息结束事件","Escalation End Event":"定时结束事件","Error End Event":"错误结束事件","Cancel End Event":"取消结束事件","Compensation End Event":"补偿结束事件","Signal End Event":"信号结束事件","Terminate End Event":"终止结束事件","Message Boundary Event":"消息边界事件","Message Boundary Event (non-interrupting)":"消息边界事件(非中断)","Timer Boundary Event":"定时边界事件","Timer Boundary Event (non-interrupting)":"定时边界事件(非中断)","Escalation Boundary Event":"升级边界事件","Escalation Boundary Event (non-interrupting)":"升级边界事件(非中断)","Conditional Boundary Event":"条件边界事件","Conditional Boundary Event (non-interrupting)":"条件边界事件(非中断)","Error Boundary Event":"错误边界事件","Cancel Boundary Event":"取消边界事件","Signal Boundary Event":"信号边界事件","Signal Boundary Event (non-interrupting)":"信号边界事件(非中断)","Compensation Boundary Event":"补偿边界事件","Exclusive Gateway":"互斥网关","Parallel Gateway":"并行网关","Inclusive Gateway":"相容网关","Complex Gateway":"复杂网关","Event based Gateway":"事件网关",Transaction:"转运","Sub Process":"子流程","Event Sub Process":"事件子流程","Collapsed Pool":"折叠池","Expanded Pool":"展开池","no parent for {element} in {parent}":"在{parent}里,{element}没有父类","no shape type specified":"没有指定的形状类型","flow elements must be children of pools/participants":"流元素必须是池/参与者的子类","out of bounds release":"out of bounds release","more than {count} child lanes":"子道大于{count} ","element required":"元素不能为空","diagram not part of bpmn:Definitions":"流程图不符合bpmn规范","no diagram to display":"没有可展示的流程图","no process or collaboration to display":"没有可展示的流程/协作","element {element} referenced by {referenced}#{property} not yet drawn":"由{referenced}#{property}引用的{element}元素仍未绘制","already rendered {element}":"{element} 已被渲染","failed to import {element}":"导入{element}失败",Id:"编号",Name:"名称",General:"常规",Details:"详情","Message Name":"消息名称",Message:"消息",Initiator:"创建者","Asynchronous Continuations":"持续异步","Asynchronous Before":"异步前","Asynchronous After":"异步后","Job Configuration":"工作配置",Exclusive:"排除","Job Priority":"工作优先级","Retry Time Cycle":"重试时间周期",Documentation:"文档","Element Documentation":"元素文档","History Configuration":"历史配置","History Time To Live":"历史的生存时间",Forms:"表单","Form Key":"表单key","Form Fields":"表单字段","Business Key":"业务key","Form Field":"表单字段",ID:"编号",Type:"类型",Label:"名称","Default Value":"默认值","Default Flow":"默认流转路径","Conditional Flow":"条件流转路径","Sequence Flow":"普通流转路径",Validation:"校验","Add Constraint":"添加约束",Config:"配置",Properties:"属性","Add Property":"添加属性",Value:"值",Listeners:"监听器","Execution Listener":"执行监听","Event Type":"事件类型","Listener Type":"监听器类型","Java Class":"Java类",Expression:"表达式","Must provide a value":"必须提供一个值","Delegate Expression":"代理表达式",Script:"脚本","Script Format":"脚本格式","Script Type":"脚本类型","Inline Script":"内联脚本","External Script":"外部脚本",Resource:"资源","Field Injection":"字段注入",Extensions:"扩展","Input/Output":"输入/输出","Input Parameters":"输入参数","Output Parameters":"输出参数",Parameters:"参数","Output Parameter":"输出参数","Timer Definition Type":"定时器定义类型","Timer Definition":"定时器定义",Date:"日期",Duration:"持续",Cycle:"循环",Signal:"信号","Signal Name":"信号名称",Escalation:"升级",Error:"错误","Link Name":"链接名称",Condition:"条件名称","Variable Name":"变量名称","Variable Event":"变量事件","Specify more than one variable change event as a comma separated list.":"多个变量事件以逗号隔开","Wait for Completion":"等待完成","Activity Ref":"活动参考","Version Tag":"版本标签",Executable:"可执行文件","External Task Configuration":"扩展任务配置","Task Priority":"任务优先级",External:"外部",Connector:"连接器","Must configure Connector":"必须配置连接器","Connector Id":"连接器编号",Implementation:"实现方式","Field Injections":"字段注入",Fields:"字段","Result Variable":"结果变量",Topic:"主题","Configure Connector":"配置连接器","Input Parameter":"输入参数",Assignee:"代理人","Candidate Users":"候选用户","Candidate Groups":"候选组","Due Date":"到期时间","Follow Up Date":"跟踪日期",Priority:"优先级","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00",Variables:"变量","Candidate Starter Configuration":"候选人起动器配置","Candidate Starter Groups":"候选人起动器组","This maps to the process definition key.":"这映射到流程定义键。","Candidate Starter Users":"候选人起动器的用户","Specify more than one user as a comma separated list.":"指定多个用户作为逗号分隔的列表。","Tasklist Configuration":"Tasklist配置",Startable:"启动","Specify more than one group as a comma separated list.":"指定多个组作为逗号分隔的列表。"},LC=(tr=n(209),n.n(tr)),IC=n(210),NC=n(211),FC=n(212),jC=(Wo=n(213),n.n(Wo)),BC=(T_=n(214),n.n(T_)),qC=(uk=n(215),n.n(uk)),zC=(M_=n(216),n.n(M_));function VC(e){return(VC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WC(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */WC=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=(p="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",o=p.asyncIterator||"@@asyncIterator",r=p.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(t){a=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o,r,a,s;t=t&&t.prototype instanceof u?t:u,t=Object.create(t.prototype),i=new w(i||[]);return t._invoke=(o=e,r=n,a=i,s="suspendedStart",function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return{value:void 0,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n&&(n=function e(t,n){var i=t.iterator[n.method];if(void 0===i){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=void 0,e(t,n),"throw"===n.method))return c;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}return"throw"===(i=l(i,t.iterator,n.arg)).type?(n.method="throw",n.arg=i.arg,n.delegate=null,c):(i=i.arg)?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,c):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,c)}(n,a))){if(n===c)continue;return n}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);if(s="executing","normal"===(n=l(o,r,a)).type){if(s=a.done?"completed":"suspendedYield",n.arg===c)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}}),t}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function u(){}function d(){}function h(){}var p,f,m=((f=(f=(a(p={},i,(function(){return this})),Object.getPrototypeOf))&&f(f(x([]))))&&f!==t&&n.call(f,i)&&(p=f),h.prototype=u.prototype=Object.create(p));function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var i;this._invoke=function(o,r){function a(){return new t((function(i,a){!function i(o,r,a,s){var c;if("throw"!==(o=l(e[o],e,r)).type)return(r=(c=o.arg).value)&&"object"==VC(r)&&n.call(r,"__await")?t.resolve(r.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(r).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}));s(o.arg)}(o,r,i,a)}))}return i=i?i.then(a,a):a()}}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function y(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function x(e){if(e){var t,o=e[i];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return t=-1,(o=function i(){for(;++t<e.length;)if(n.call(e,t))return i.value=e[t],i.done=!1,i;return i.value=void 0,i.done=!0,i}).next=o}return{next:_}}function _(){return{value:void 0,done:!0}}return a(m,"constructor",d.prototype=h),a(h,"constructor",d),d.displayName=a(h,r,"GeneratorFunction"),e.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a(e,r,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(v.prototype),a(v.prototype,o,(function(){return this})),e.AsyncIterator=v,e.async=function(t,n,i,o,r){void 0===r&&(r=Promise);var a=new v(s(t,n,i,o),r);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),a(m,r,"Generator"),a(m,i,(function(){return this})),a(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t,n=[];for(t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=x,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(y),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var o=this.tryEntries.length-1;0<=o;--o){var r=this.tryEntries[o],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var s=n.call(r,"catchLoc"),l=n.call(r,"finallyLoc");if(s&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}var a=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),y(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,i,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(n=o.completion).type&&(i=n.arg,y(o)),i}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function HC(e,t,n,i,o,r,a){try{var s=e[r](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,o)}function UC(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var r=e.apply(t,n);function a(e){HC(r,i,o,a,s,"next",e)}function s(e){HC(r,i,o,a,s,"throw",e)}a(void 0)}))}}function GC(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function KC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function YC(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function XC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YC(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function JC(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function ZC(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function QC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZC(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eS(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)),i}function tS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ub={name:"MyProcessDesigner",componentName:"MyProcessDesigner",props:{value:String,processId:String,processName:String,translations:Object,options:{type:Object,default:function(){return{}}},additionalModel:[Object,Array],moddleExtension:Object,onlyCustomizeAddi:{type:Boolean,default:!1},onlyCustomizeModdle:{type:Boolean,default:!1},simulation:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},prefix:{type:String,default:"camunda"},events:{type:Array,default:function(){return["element.click"]}},headerButtonSize:{type:String,default:"small",validator:function(e){return-1!==["default","medium","small","mini"].indexOf(e)}},headerButtonType:{type:String,default:"primary",validator:function(e){return-1!==["default","primary","success","warning","danger","info"].indexOf(e)}}},data:function(){return{defaultZoom:1,previewModelVisible:!1,simulationStatus:!1,previewResult:"",previewType:"xml",recoverable:!1,revocable:!1}},computed:{additionalModules:function(){var e=[];if(this.onlyCustomizeAddi)return"[object Array]"===Object.prototype.toString.call(this.additionalModel)?this.additionalModel||[]:[this.additionalModel];"[object Array]"===Object.prototype.toString.call(this.additionalModel)?e.push.apply(e,function(e){return function(e){if(Array.isArray(e))return KC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var n;if(e)return"string"==typeof e?KC(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KC(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.additionalModel)):this.additionalModel&&e.push(this.additionalModel);var t,n={translate:["value",(t=this.translations||RC,function(e,n){return n=n||{},(e=t[e]||e).replace(/{([^}]+)}/g,(function(e,i){var o=n[i];return(o=null!==t[n[i]]&&void 0!==t[n[i]]?t[n[i]]:o)||"{"+i+"}"}))})]};return e.push(n),this.simulation&&e.push(LC.a),"camunda"===this.prefix&&e.push(jC.a),"flowable"===this.prefix&&e.push(qC.a),"activiti"===this.prefix&&e.push(BC.a),e},moddleExtensions:function(){var e={};if(this.onlyCustomizeModdle)return this.moddleExtension||null;if(this.moddleExtension)for(var t in this.moddleExtension)e[t]=this.moddleExtension[t];return"activiti"===this.prefix&&(e.activiti=NC),"flowable"===this.prefix&&(e.flowable=FC),"camunda"===this.prefix&&(e.camunda=IC),e}},mounted:function(){var e=this;this.initBpmnModeler(),this.createNewDiagram(this.value),this.$once("hook:beforeDestroy",(function(){e.bpmnModeler&&e.bpmnModeler.destroy(),e.$emit("destroy",e.bpmnModeler),e.bpmnModeler=null}))},methods:{initBpmnModeler:function(){this.bpmnModeler||(this.bpmnModeler=new PC(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GC(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({container:this.$refs["bpmn-canvas"],keyboard:this.keyboard?{bindTo:document}:null,additionalModules:this.additionalModules,moddleExtensions:this.moddleExtensions},this.options)),this.$emit("init-finished",this.bpmnModeler),this.initModelListeners())},initModelListeners:function(){var e=this,t=this.bpmnModeler.get("eventBus"),n=this;this.events.forEach((function(e){t.on(e,(function(t){var i=e.replace(/\./g,"-"),o=t?t.element:null;n.$emit(i,o,t)}))})),t.on("commandStack.changed",function(){var t=UC(WC().mark((function t(n){var i;return WC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.recoverable=e.bpmnModeler.get("commandStack").canRedo(),e.revocable=e.bpmnModeler.get("commandStack").canUndo(),t.next=5,e.bpmnModeler.saveXML({format:!0});case 5:i=(i=t.sent).xml,e.$emit("commandStack-changed",n),e.$emit("input",i),e.$emit("change",i),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.error("[Process Designer Warn]: ".concat(t.t0.message||t.t0));case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}()),this.bpmnModeler.on("canvas.viewbox.changed",(function(t){t=t.viewbox,e.$emit("canvas-viewbox-changed",{viewbox:t}),t=t.scale,e.defaultZoom=Math.floor(100*t)/100}))},createNewDiagram:function(e){var t=this;return UC(WC().mark((function n(){var i,o;return WC().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.processId||"Process_".concat((new Date).getTime()),i=t.processName||"业务流程_".concat((new Date).getTime()),o=e||function(e,t,n){return n=n||"camunda",'<?xml version="1.0" encoding="UTF-8"?>\n<bpmn2:definitions \n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"\n xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"\n xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"\n xmlns:di="http://www.omg.org/spec/DD/20100524/DI"\n id="diagram_'.concat(e,'"\n targetNamespace="').concat({activiti:"http://activiti.org/bpmn",camunda:"http://bpmn.io/schema/bpmn",flowable:"http://flowable.org/bpmn"}[n],'">\n <bpmn2:process id="').concat(e,'" name="').concat(t,'" isExecutable="true">\n </bpmn2:process>\n <bpmndi:BPMNDiagram id="BPMNDiagram_1">\n <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="').concat(e,'">\n </bpmndi:BPMNPlane>\n </bpmndi:BPMNDiagram>\n</bpmn2:definitions>')}(o,i,t.prefix),n.prev=3,n.next=6,t.bpmnModeler.importXML(o);case 6:i=n.sent,(o=i.warnings)&&o.length&&o.forEach((function(e){return console.warn(e)})),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(3),console.error("[Process Designer Warn]: ".concat((null===n.t0||void 0===n.t0?void 0:n.t0.message)||n.t0));case 14:case"end":return n.stop()}}),n,null,[[3,11]])})))()},downloadProcess:function(e,t){var n=this;return UC(WC().mark((function i(){var o,r,a,s,l,c,u;return WC().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(u=function(e,t){var n;e&&t&&((n=document.createElement("a")).download=t,n.href=e,n.click(),URL.revokeObjectURL(n.href))},i.prev=1,o=n,"xml"===e||"bpmn"===e)return i.next=6,n.bpmnModeler.saveXML();i.next=14;break;case 6:r=i.sent,a=r.err,r=r.xml,a&&console.error("[Process Designer Warn ]: ".concat(a.message||a)),a=o.setEncoded(e.toUpperCase(),t,r),r=a.href,a=a.filename,u(r,a),i.next=23;break;case 14:return i.next=16,n.bpmnModeler.saveSVG();case 16:if(r=i.sent,a=r.err,s=r.svg,a)return i.abrupt("return",console.error(a));i.next=21;break;case 21:c=o.setEncoded("SVG",t,s),l=c.href,c=c.filename,u(l,c);case 23:i.next=28;break;case 25:i.prev=25,i.t0=i.catch(1),console.error("[Process Designer Warn ]: ".concat(i.t0.message||i.t0));case 28:case"end":return i.stop()}}),i,null,[[1,25]])})))()},setEncoded:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"diagram",n=2<arguments.length?arguments[2]:void 0,i=encodeURIComponent(n);return{filename:"".concat(t,".").concat(e),href:"data:application/".concat("svg"===e?"text/xml":"bpmn20-xml",";charset=UTF-8,").concat(i),data:n}},importLocalFile:function(){var e=this,t=this.$refs.refFile.files[0],n=new FileReader;n.readAsText(t),n.onload=function(){var t=this.result;e.$emit("localFile",t),e.createNewDiagram(t)}},downloadProcessAsXml:function(){this.downloadProcess("xml")},downloadProcessAsBpmn:function(){this.downloadProcess("bpmn")},downloadProcessAsSvg:function(){this.downloadProcess("svg")},saveProcess:function(){this.$emit("element-save")},processSimulation:function(){this.simulationStatus=!this.simulationStatus,this.simulation&&this.bpmnModeler.get("toggleMode").toggleMode()},processRedo:function(){this.bpmnModeler.get("commandStack").redo()},processUndo:function(){this.bpmnModeler.get("commandStack").undo()},processZoomIn:function(){var e=Math.floor(100*this.defaultZoom+100*(0<arguments.length&&void 0!==arguments[0]?arguments[0]:.1))/100;if(4<e)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");this.defaultZoom=e,this.bpmnModeler.get("canvas").zoom(this.defaultZoom)},processZoomOut:function(){var e=Math.floor(100*this.defaultZoom-100*(0<arguments.length&&void 0!==arguments[0]?arguments[0]:.1))/100;if(e<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");this.defaultZoom=e,this.bpmnModeler.get("canvas").zoom(this.defaultZoom)},processZoomTo:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;if(e<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");if(4<e)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");this.defaultZoom=e,this.bpmnModeler.get("canvas").zoom(e)},processReZoom:function(){this.defaultZoom=1,this.bpmnModeler.get("canvas").zoom("fit-viewport","auto")},processRestart:function(){this.recoverable=!1,this.revocable=!1,this.createNewDiagram(null)},elementsAlign:function(e){var t=this.bpmnModeler.get("alignElements"),n=this.bpmnModeler.get("selection").get();!n||n.length<=1?this.$message.warning("请按住 Ctrl 键选择多个元素对齐"):this.$confirm("自动对齐可能造成图形变形,是否继续?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){return t.trigger(n,e)}))},previewProcessXML:function(){var e=this;this.bpmnModeler.saveXML({format:!0}).then((function(t){t=t.xml,e.previewResult=t,e.previewType="xml",e.previewModelVisible=!0}))},previewProcessJson:function(){var e=this,t=new zC.a;this.bpmnModeler.saveXML({format:!0}).then((function(n){n=n.xml,n=t.xml2js(n).definitions,e.previewResult=n?JSON.stringify(n,null,4):"",e.previewType="json",e.previewModelVisible=!0}))}}},Hg=Object(l.a)(Ub,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"my-process-designer"},[t("div",{staticClass:"my-process-designer__header"},[e._t("control-header"),e._v(" "),e.$slots["control-header"]?e._e():[t("el-button-group",{key:"file-control"},[t("el-button",{attrs:{size:e.headerButtonSize,type:e.headerButtonType,icon:"el-icon-folder-opened"},on:{click:function(t){return e.$refs.refFile.click()}}},[e._v("打开文件")]),e._v(" "),t("el-tooltip",{attrs:{effect:"light"}},[t("div",{attrs:{slot:"content"},slot:"content"},[t("el-button",{attrs:{size:e.headerButtonSize,type:"text"},on:{click:function(t){return e.downloadProcessAsXml()}}},[e._v("下载为XML文件")]),e._v(" "),t("br"),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:"text"},on:{click:function(t){return e.downloadProcessAsSvg()}}},[e._v("下载为SVG文件")]),e._v(" "),t("br"),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:"text"},on:{click:function(t){return e.downloadProcessAsBpmn()}}},[e._v("下载为BPMN文件")])],1),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:e.headerButtonType,icon:"el-icon-download"}},[e._v("下载文件")])],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light"}},[t("div",{attrs:{slot:"content"},slot:"content"},[t("el-button",{attrs:{size:e.headerButtonSize,type:"text"},on:{click:e.previewProcessXML}},[e._v("预览XML")]),e._v(" "),t("br"),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:"text"},on:{click:e.previewProcessJson}},[e._v("预览JSON")])],1),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:e.headerButtonType,icon:"el-icon-view"}},[e._v("预览")])],1),e._v(" "),e.simulation?t("el-tooltip",{attrs:{effect:"light",content:this.simulationStatus?"退出模拟":"开启模拟"}},[t("el-button",{attrs:{size:e.headerButtonSize,type:e.headerButtonType,icon:"el-icon-cpu"},on:{click:e.processSimulation}},[e._v("\n 模拟\n ")])],1):e._e(),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize,type:e.headerButtonType,icon:"el-icon-document-checked"},on:{click:e.saveProcess}},[e._v("\n 保存\n ")])],1),e._v(" "),t("el-button-group",{key:"align-control"},[t("el-tooltip",{attrs:{effect:"light",content:"向左对齐"}},[t("el-button",{staticClass:"align align-left",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("left")}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"向右对齐"}},[t("el-button",{staticClass:"align align-right",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("right")}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"向上对齐"}},[t("el-button",{staticClass:"align align-top",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("top")}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"向下对齐"}},[t("el-button",{staticClass:"align align-bottom",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("bottom")}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"水平居中"}},[t("el-button",{staticClass:"align align-center",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("center")}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"垂直居中"}},[t("el-button",{staticClass:"align align-middle",attrs:{size:e.headerButtonSize,icon:"el-icon-s-data"},on:{click:function(t){return e.elementsAlign("middle")}}})],1)],1),e._v(" "),t("el-button-group",{key:"scale-control"},[t("el-tooltip",{attrs:{effect:"light",content:"缩小视图"}},[t("el-button",{attrs:{size:e.headerButtonSize,disabled:e.defaultZoom<.2,icon:"el-icon-zoom-out"},on:{click:function(t){return e.processZoomOut()}}})],1),e._v(" "),t("el-button",{attrs:{size:e.headerButtonSize}},[e._v(e._s(Math.floor(10*this.defaultZoom*10)+"%"))]),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"放大视图"}},[t("el-button",{attrs:{size:e.headerButtonSize,disabled:4<e.defaultZoom,icon:"el-icon-zoom-in"},on:{click:function(t){return e.processZoomIn()}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"重置视图并居中"}},[t("el-button",{attrs:{size:e.headerButtonSize,icon:"el-icon-c-scale-to-original"},on:{click:function(t){return e.processReZoom()}}})],1)],1),e._v(" "),t("el-button-group",{key:"stack-control"},[t("el-tooltip",{attrs:{effect:"light",content:"撤销"}},[t("el-button",{attrs:{size:e.headerButtonSize,disabled:!e.revocable,icon:"el-icon-refresh-left"},on:{click:function(t){return e.processUndo()}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"恢复"}},[t("el-button",{attrs:{size:e.headerButtonSize,disabled:!e.recoverable,icon:"el-icon-refresh-right"},on:{click:function(t){return e.processRedo()}}})],1),e._v(" "),t("el-tooltip",{attrs:{effect:"light",content:"重新绘制"}},[t("el-button",{attrs:{size:e.headerButtonSize,icon:"el-icon-refresh"},on:{click:e.processRestart}})],1)],1)],e._v(" "),t("input",{ref:"refFile",staticStyle:{display:"none"},attrs:{type:"file",id:"files",accept:".xml, .bpmn"},on:{change:e.importLocalFile}})],2),e._v(" "),t("div",{staticClass:"my-process-designer__container"},[t("div",{ref:"bpmn-canvas",staticClass:"my-process-designer__canvas"})]),e._v(" "),t("el-dialog",{attrs:{title:"预览",width:"60%",visible:e.previewModelVisible,"append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.previewModelVisible=t}}},[t("highlightjs",{attrs:{language:e.previewType,code:e.previewResult}})],1)],1)}),[],!1,null,null,null).exports,Ng={name:"MyProcessPalette",data:function(){return{}},mounted:function(){},methods:{createElement:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=window.bpmnInstances.elementFactory,o=window.bpmnInstances.modeler.get("create");i=i.createShape(Object(Vl.assign)({type:"bpmn:".concat(t)},n));n&&(i.businessObject.di.isExpanded=n.isExpanded),o.start(e,i)},startTool:function(e,t){"handTool"===t&&window.bpmnInstances.modeler.get("handTool").activateHand(e),"lassoTool"===t&&window.bpmnInstances.modeler.get("lassoTool").activateSelection(e),"connectTool"===t&&window.bpmnInstances.modeler.get("globalConnect").toggle(e)}}},G_=Object(l.a)(Ng,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"my-process-palette"},[t("el-collapse",[t("el-collapse-item",{attrs:{title:"任务",name:"1"}},[t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"Task")},mousedown:function(t){return e.createElement(t,"Task")}}},[e._v("\n 任务\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"UserTask")},mousedown:function(t){return e.createElement(t,"UserTask")}}},[e._v("\n 用户任务\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"SendTask")},mousedown:function(t){return e.createElement(t,"SendTask")}}},[e._v("\n 发送任务\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"ReceiveTask")},mousedown:function(t){return e.createElement(t,"ReceiveTask")}}},[e._v("\n 接收任务\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"ScriptTask")},mousedown:function(t){return e.createElement(t,"ScriptTask")}}},[e._v("\n 脚本任务\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"ServiceTask")},mousedown:function(t){return e.createElement(t,"ServiceTask")}}},[e._v("\n 服务任务\n ")])]),e._v(" "),t("el-collapse-item",{attrs:{title:"网关",name:"2"}},[t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"Gateway")},mousedown:function(t){return e.createElement(t,"Gateway")}}},[e._v("\n 网关\n ")])]),e._v(" "),t("el-collapse-item",{attrs:{title:"开始",name:"3"}},[t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"StartEvent")},mousedown:function(t){return e.createElement(t,"StartEvent")}}},[e._v("\n 开始\n ")])]),e._v(" "),t("el-collapse-item",{attrs:{title:"结束",name:"4"}},[t("div",{staticClass:"custom-button",on:{click:function(t){return e.createElement(t,"EndEvent")},mousedown:function(t){return e.createElement(t,"EndEvent")}}},[e._v("\n 结束\n ")])]),e._v(" "),t("el-collapse-item",{attrs:{title:"工具",name:"5"}},[t("div",{staticClass:"custom-button",on:{click:function(t){return e.startTool(t,"handTool")},mousedown:function(t){return e.startTool(t,"handTool")}}},[e._v("\n 手型工具\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.startTool(t,"lassoTool")},mousedown:function(t){return e.startTool(t,"lassoTool")}}},[e._v("\n 框选工具\n ")]),e._v(" "),t("div",{staticClass:"custom-button",on:{click:function(t){return e.startTool(t,"connectTool")},mousedown:function(t){return e.startTool(t,"connectTool")}}},[e._v("\n 连线工具\n ")])])],1)],1)}),[],!1,(function(e){n(542)}),"data-v-5057d9d0",null).exports,Pb={name:"ElementBaseInfo",props:{businessObject:Object,type:String,idEditDisabled:{type:Boolean,default:!0}},data:function(){return{elementBaseInfo:{}}},watch:{businessObject:{immediate:!1,handler:function(e){var t=this;e&&this.$nextTick((function(){return t.resetBaseInfo()}))}}},methods:{resetBaseInfo:function(){var e;this.bpmnElement=(null==(e=window)||null==(e=e.bpmnInstances)?void 0:e.bpmnElement)||{},this.elementBaseInfo=JSON.parse(JSON.stringify(this.bpmnElement.businessObject)),this.elementBaseInfo&&"bpmn:SubProcess"===this.elementBaseInfo.$type&&this.$set(this.elementBaseInfo,"isExpanded",null==(e=this.elementBaseInfo.di)?void 0:e.isExpanded)},updateBaseInfo:function(e){var t;"id"===e?window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{id:this.elementBaseInfo[e],di:{id:"".concat(this.elementBaseInfo[e],"_di")}}):"isExpanded"===e?null!=(t=window)&&null!=(t=t.bpmnInstances)&&t.modeling.toggleCollapse(this.bpmnElement):((t=Object.create(null))[e]=this.elementBaseInfo[e],window.bpmnInstances.modeling.updateProperties(this.bpmnElement,t))}},beforeDestroy:function(){this.bpmnElement=null}},ea=Object(l.a)(Pb,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"panel-tab__content"},[t("el-form",{attrs:{size:"mini","label-width":"90px"},nativeOn:{submit:function(e){e.preventDefault()}}},[t("el-form-item",{attrs:{label:"ID"}},[t("el-input",{attrs:{disabled:e.idEditDisabled,clearable:""},on:{change:function(t){return e.updateBaseInfo("id")}},model:{value:e.elementBaseInfo.id,callback:function(t){e.$set(e.elementBaseInfo,"id",t)},expression:"elementBaseInfo.id"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"名称"}},[t("el-input",{attrs:{clearable:""},on:{change:function(t){return e.updateBaseInfo("name")}},model:{value:e.elementBaseInfo.name,callback:function(t){e.$set(e.elementBaseInfo,"name",t)},expression:"elementBaseInfo.name"}})],1),e._v(" "),"bpmn:Process"===e.elementBaseInfo.$type?[t("el-form-item",{attrs:{label:"版本标签"}},[t("el-input",{attrs:{clearable:""},on:{change:function(t){return e.updateBaseInfo("versionTag")}},model:{value:e.elementBaseInfo.versionTag,callback:function(t){e.$set(e.elementBaseInfo,"versionTag",t)},expression:"elementBaseInfo.versionTag"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"可执行"}},[t("el-switch",{attrs:{"active-text":"是","inactive-text":"否"},on:{change:function(t){return e.updateBaseInfo("isExecutable")}},model:{value:e.elementBaseInfo.isExecutable,callback:function(t){e.$set(e.elementBaseInfo,"isExecutable",t)},expression:"elementBaseInfo.isExecutable"}})],1)]:e._e(),e._v(" "),"bpmn:SubProcess"===e.elementBaseInfo.$type?t("el-form-item",{attrs:{label:"状态"}},[t("el-switch",{attrs:{"active-text":"展开","inactive-text":"折叠"},on:{change:function(t){return e.updateBaseInfo("isExpanded")}},model:{value:e.elementBaseInfo.isExpanded,callback:function(t){e.$set(e.elementBaseInfo,"isExpanded",t)},expression:"elementBaseInfo.isExpanded"}})],1):e._e()],2)],1)}),[],!1,null,null,null).exports,bb={name:"UserTask",props:{id:String,type:String},inject:{prefix:"prefix"},data:function(){return{taskMenus:{},defaultTaskForm:{assignee:"",candidateUsers:[],candidateGroups:[]},userTaskForm:{},mockData:[1,2,3,4,5,6,7,8,9,10],taskMenusSelect:[],personOptions:[],departmentOptions:[],bpmnElement:null,otherExtensionList:null}},watch:{id:{immediate:!0,handler:function(){var e,t=this;this.bpmnElement=window.bpmnInstances.bpmnElement,this.otherExtensionList=null!=(e=null==(e=this.bpmnElement.businessObject)||null==(e=e.extensionElements)||null==(e=e.values)?void 0:e.filter((function(e){return e.$type==="".concat(t.prefix,":Property")})))?e:[],console.log(this.bpmnElement,this.otherExtensionList),this.initTaskMenus(),this.$nextTick((function(){return t.resetTaskForm()}))}}},mounted:function(){this.getData()},methods:{getData:function(){var e=this;setTimeout((function(){e.personOptions=[{label:"张三",value:"张三"},{label:"李四",value:"李四"},{label:"王武",value:"王武"}],e.departmentOptions=[{value:"事业部",label:"事业部",children:[{value:"事业1部",label:"事业1部"},{value:"事业2部",label:"事业2部"}]},{value:"综合部",label:"综合部",children:[{value:"综合1部",label:"综合1部"},{value:"综合2部",label:"综合2部"}]},{value:"研发部",label:"研发部",children:[{value:"研发1部",label:"研发1部"},{value:"研发2部",label:"研发2部"}]}]}),1e3)},initTaskMenus:function(){var e;this.taskMenus={person:{label:"指定人员",name:"person",key:"candidateUsers",value:"",disabled:!1},department:{label:"指定部门",name:"department",key:"candidateGroups",value:[],disabled:!1},leader:{label:"直属领导",name:"leader",key:"assignee",value:"${superiorLeader}",disabled:!1},leaderList:{label:"连续多级主管",name:"leaderList",key:"collection",value:"superiorLeaderList",disabled:null==(e=this.bpmnElement)||!e.businessObject.loopCharacteristics||"bpmn:MultiInstanceLoopCharacteristics"!=this.bpmnElement.businessObject.loopCharacteristics.$type},select:{label:"发起人自选",name:"select",key:"assignee",value:"${selectUser}",disabled:!0},oneself:{label:"发起人自己",name:"oneself",key:"assignee",value:"${initiator}",disabled:!1}},this.taskMenusSelect=[]},resetTaskForm:function(){var e=this,t=null==(t=this.bpmnElement)?void 0:t.businessObject;t.candidateUsers==="u_".concat(this.bpmnElement.id)&&(this.taskMenusSelect.push("person"),this.taskMenus.leaderList.disabled=!0),t.candidateGroups==="g_".concat(this.bpmnElement.id)&&(this.taskMenusSelect.push("department"),this.taskMenus.leaderList.disabled=!0),"${superiorLeader}"===t.assignee&&(this.taskMenusSelect.push("leader"),this.taskMenus.oneself.disabled=!0),"${initiator}"===t.assignee&&(this.taskMenusSelect.push("oneself"),this.taskMenus.leader.disabled=!0),this.otherExtensionList.forEach((function(t){t.name==="u_".concat(e.bpmnElement.id)?e.taskMenus.person.value.push(t.value):t.name==="g_".concat(e.bpmnElement.id)&&(e.taskMenus.department.value=t.value.split(","))})),this.taskMenusCheckboxChange()},updateElementTask:function(e,t){var n,i,o,r,a,s=this,l=this.taskMenus[e];console.log(l),0!=this.taskMenusSelect.includes(e)&&(e=l.key,n=l.value,"department"===l.name?(i="g_".concat(this.bpmnElement.id),o=window.bpmnInstances.moddle.create("".concat(this.prefix,":Property"),{name:i,value:n.join()}),t.extensionElements=t.extensionElements.concat(o),t.candidateGroups=i):"person"===l.name?(r="u_".concat(this.bpmnElement.id),a=[],n.forEach((function(e){e=window.bpmnInstances.moddle.create("".concat(s.prefix,":Property"),{name:r,value:e}),a.push(e)})),t.extensionElements=t.extensionElements.concat(a),t.candidateUsers=r):"leaderList"===l.name?window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement,this.bpmnElement.businessObject.loopCharacteristics,{collection:"superiorLeaderList",elementVariable:"ele"}):t[e]=n||null)},taskMenusCheckboxChange:function(){var e,t=this,n=(this.resetElementTask(),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{assignee:null,candidateUsers:null,candidateGroups:null,extensionElements:null}),this.bpmnElement.businessObject.loopCharacteristics&&window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement,this.bpmnElement.businessObject.loopCharacteristics,{collection:null,elementVariable:null}),{assignee:null,candidateUsers:null,candidateGroups:null,extensionElements:[]});this.taskMenusSelect.map((function(e){t.updateElementTask(e,n),"person"===e||"department"===e?t.taskMenus.leaderList.disabled=!0:"leader"===e?(t.taskMenus.oneself.disabled=!0,t.taskMenus.leaderList.disabled=!0):"leaderList"===e?(t.taskMenus.person.disabled=!0,t.taskMenus.department.disabled=!0,t.taskMenus.leader.disabled=!0,t.taskMenus.oneself.disabled=!0):"oneself"===e&&(t.taskMenus.leader.disabled=!0,t.taskMenus.leaderList.disabled=!0)})),this.taskMenusSelect.length&&(console.log(n.extensionElements),e=window.bpmnInstances.moddle.create("".concat(this.prefix,":Properties"),{values:n.extensionElements}),e=window.bpmnInstances.moddle.create("bpmn:ExtensionElements",{values:[e]}),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,XC(XC({},n),{},{extensionElements:e})))},resetElementTask:function(){var e;this.taskMenus.person.disabled=!1,this.taskMenus.department.disabled=!1,this.taskMenus.leader.disabled=!1,this.taskMenus.leaderList.disabled=null==(e=this.bpmnElement)||!e.businessObject.loopCharacteristics||"bpmn:MultiInstanceLoopCharacteristics"!=this.bpmnElement.businessObject.loopCharacteristics.$type,this.taskMenus.select.disabled=!0,this.taskMenus.oneself.disabled=!1}},beforeDestroy:function(){this.bpmnElement=null}},s=Object(l.a)(bb,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-checkbox-group",{staticClass:"taskMenus",on:{change:e.taskMenusCheckboxChange},model:{value:e.taskMenusSelect,callback:function(t){e.taskMenusSelect=t},expression:"taskMenusSelect"}},e._l(Object.values(e.taskMenus),(function(t){return n("div",{key:t.name,staticClass:"taskMenus-item"},[n("el-checkbox",{attrs:{label:t.name,disabled:t.disabled}},[e._v(e._s(t.label))]),e._v(" "),"person"===t.name?n("el-select",{attrs:{placeholder:"请选择",multiple:"",clearable:""},on:{change:e.taskMenusCheckboxChange},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"menu.value"}},e._l(e.personOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1):e._e(),e._v(" "),"role"===t.name?n("el-select",{attrs:{placeholder:"请选择",multiple:"",clearable:""},on:{change:e.taskMenusCheckboxChange},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"menu.value"}},e._l([{label:"管理员",value:"admin"}],(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1):e._e(),e._v(" "),"department"===t.name?n("el-cascader",{staticStyle:{width:"100%"},attrs:{options:e.departmentOptions,props:{checkStrictly:!0},"show-all-levels":!1,clearable:""},on:{change:e.taskMenusCheckboxChange},model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"menu.value"}}):e._e()],1)})),0)],1)}),[],!1,(function(e){n(543)}),"data-v-44afa99a",null).exports,ir={name:"ScriptTask",props:{id:String,type:String},data:function(){return{defaultTaskForm:{scriptFormat:"",script:"",resource:"",resultVariable:""},scriptTaskForm:{}}},watch:{id:{immediate:!0,handler:function(){var e=this;this.bpmnElement=window.bpmnInstances.bpmnElement,this.$nextTick((function(){return e.resetTaskForm()}))}}},methods:{resetTaskForm:function(){for(var e in this.defaultTaskForm){var t=(null==(t=this.bpmnElement)?void 0:t.businessObject[e])||this.defaultTaskForm[e];this.$set(this.scriptTaskForm,e,t)}this.$set(this.scriptTaskForm,"scriptType",this.scriptTaskForm.script?"inline":"external")},updateElementTask:function(){var e=Object.create(null);e.scriptFormat=this.scriptTaskForm.scriptFormat||null,e.resultVariable=this.scriptTaskForm.resultVariable||null,"inline"===this.scriptTaskForm.scriptType?(e.script=this.scriptTaskForm.script||null,e.resource=null):(e.resource=this.scriptTaskForm.resource||null,e.script=null),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,e)}},beforeDestroy:function(){this.bpmnElement=null}},H_=Object(l.a)(ir,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticStyle:{"margin-top":"16px"}},[t("el-form-item",{attrs:{label:"脚本格式"}},[t("el-input",{attrs:{clearable:""},on:{input:function(t){return e.updateElementTask()},change:function(t){return e.updateElementTask()}},model:{value:e.scriptTaskForm.scriptFormat,callback:function(t){e.$set(e.scriptTaskForm,"scriptFormat",t)},expression:"scriptTaskForm.scriptFormat"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"脚本类型"}},[t("el-select",{model:{value:e.scriptTaskForm.scriptType,callback:function(t){e.$set(e.scriptTaskForm,"scriptType",t)},expression:"scriptTaskForm.scriptType"}},[t("el-option",{attrs:{label:"内联脚本",value:"inline"}}),e._v(" "),t("el-option",{attrs:{label:"外部资源",value:"external"}})],1)],1),e._v(" "),t("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"inline"===e.scriptTaskForm.scriptType,expression:"scriptTaskForm.scriptType === 'inline'"}],attrs:{label:"脚本"}},[t("el-input",{attrs:{type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:""},on:{input:function(t){return e.updateElementTask()},change:function(t){return e.updateElementTask()}},model:{value:e.scriptTaskForm.script,callback:function(t){e.$set(e.scriptTaskForm,"script",t)},expression:"scriptTaskForm.script"}})],1),e._v(" "),t("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"external"===e.scriptTaskForm.scriptType,expression:"scriptTaskForm.scriptType === 'external'"}],attrs:{label:"资源地址"}},[t("el-input",{attrs:{clearable:""},on:{input:function(t){return e.updateElementTask()},change:function(t){return e.updateElementTask()}},model:{value:e.scriptTaskForm.resource,callback:function(t){e.$set(e.scriptTaskForm,"resource",t)},expression:"scriptTaskForm.resource"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"结果变量"}},[t("el-input",{attrs:{clearable:""},on:{input:function(t){return e.updateElementTask()},change:function(t){return e.updateElementTask()}},model:{value:e.scriptTaskForm.resultVariable,callback:function(t){e.$set(e.scriptTaskForm,"resultVariable",t)},expression:"scriptTaskForm.resultVariable"}})],1)],1)}),[],!1,null,null,null).exports,H={name:"ReceiveTask",props:{id:String,type:String},data:function(){return{bindMessageId:"",newMessageForm:{},messageMap:{},messageModelVisible:!1}},watch:{id:{immediate:!0,handler:function(){var e=this;this.$nextTick((function(){return e.getBindMessage()}))}}},created:function(){var e=this;this.bpmnMessageRefsMap=Object.create(null),this.bpmnRootElements=window.bpmnInstances.modeler.getDefinitions().rootElements,this.bpmnRootElements.filter((function(e){return"bpmn:Message"===e.$type})).forEach((function(t){e.bpmnMessageRefsMap[t.id]=t,e.$set(e.messageMap,t.id,t.name)})),this.$set(this.messageMap,"-1","无")},methods:{getBindMessage:function(){var e;this.bpmnElement=window.bpmnInstances.bpmnElement,this.bindMessageId=(null==(e=this.bpmnElement.businessObject)||null==(e=e.messageRef)?void 0:e.id)||"-1"},openMessageModel:function(){this.messageModelVisible=!0,this.newMessageForm={}},createNewMessage:function(){var e;this.messageMap[this.newMessageForm.id]?this.$message.error("该消息已存在,请修改id后重新保存"):(e=window.bpmnInstances.moddle.create("bpmn:Message",this.newMessageForm),this.bpmnRootElements.push(e),this.$set(this.messageMap,this.newMessageForm.id,this.newMessageForm.name),this.bpmnMessageRefsMap[this.newMessageForm.id]=e,this.messageModelVisible=!1)},updateTaskMessage:function(e){"-1"===e?window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{messageRef:null}):window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{messageRef:this.bpmnMessageRefsMap[e]})}},beforeDestroy:function(){this.bpmnElement=null}},qr={name:"ElementTaskConfig",components:{UserTask:s,ScriptTask:H_,ReceiveTask:Object(l.a)(H,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{"margin-top":"16px"}},[n("el-form-item",{attrs:{label:"消息实例"}},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},[n("el-select",{on:{change:e.updateTaskMessage},model:{value:e.bindMessageId,callback:function(t){e.bindMessageId=t},expression:"bindMessageId"}},e._l(Object.keys(e.messageMap),(function(t){return n("el-option",{key:t,attrs:{value:t,label:e.messageMap[t]}})})),1),e._v(" "),n("el-button",{staticStyle:{"margin-left":"8px"},attrs:{size:"mini",type:"primary",icon:"el-icon-plus"},on:{click:e.openMessageModel}})],1)]),e._v(" "),n("el-dialog",{attrs:{visible:e.messageModelVisible,"close-on-click-modal":!1,title:"创建新消息",width:"400px","append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.messageModelVisible=t}}},[n("el-form",{attrs:{model:e.newMessageForm,size:"mini","label-width":"90px"},nativeOn:{submit:function(e){e.preventDefault()}}},[n("el-form-item",{attrs:{label:"消息ID"}},[n("el-input",{attrs:{clearable:""},model:{value:e.newMessageForm.id,callback:function(t){e.$set(e.newMessageForm,"id",t)},expression:"newMessageForm.id"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"消息名称"}},[n("el-input",{attrs:{clearable:""},model:{value:e.newMessageForm.name,callback:function(t){e.$set(e.newMessageForm,"name",t)},expression:"newMessageForm.name"}})],1)],1),e._v(" "),n("template",{slot:"footer"},[n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.createNewMessage}},[e._v("确 认")])],1)],2)],1)}),[],!1,null,null,null).exports},props:{id:String,type:String},data:function(){return{taskConfigForm:{asyncAfter:!1,asyncBefore:!1,exclusive:!1},witchTaskComponent:"",installedComponent:{UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}}},watch:{id:{immediate:!0,handler:function(){var e;this.bpmnElement=window.bpmnInstances.bpmnElement,this.taskConfigForm.asyncBefore=null==(e=this.bpmnElement)||null==(e=e.businessObject)?void 0:e.asyncBefore,this.taskConfigForm.asyncAfter=null==(e=this.bpmnElement)||null==(e=e.businessObject)?void 0:e.asyncAfter,this.taskConfigForm.exclusive=null==(e=this.bpmnElement)||null==(e=e.businessObject)?void 0:e.exclusive}},type:{immediate:!0,handler:function(){this.witchTaskComponent=this.installedComponent[this.type]}}},methods:{changeTaskAsync:function(){this.taskConfigForm.asyncBefore||this.taskConfigForm.asyncAfter||(this.taskConfigForm.exclusive=!1),window.bpmnInstances.modeling.updateProperties(window.bpmnInstances.bpmnElement,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JC(Object(n),!0).forEach((function(t){var i,o;i=e,o=n[t=t],t in i?Object.defineProperty(i,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.taskConfigForm))}}},ee=Object(l.a)(qr,(function(){var e=this.$createElement;return(e=this._self._c||e)("div",{staticClass:"panel-tab__content"},[e("el-form",{attrs:{size:"mini","label-width":"90px"},nativeOn:{submit:function(e){e.preventDefault()}}},[e(this.witchTaskComponent,this._b({tag:"component"},"component",this.$props,!1))],1)],1)}),[],!1,null,null,null).exports,nr={name:"FlowCondition",props:{businessObject:Object,type:String},data:function(){return{flowConditionForm:{}}},watch:{businessObject:{immediate:!0,handler:function(){var e=this;this.$nextTick((function(){return e.resetFlowCondition()}))}}},methods:{resetFlowCondition:function(){var e;this.bpmnElement=window.bpmnInstances.bpmnElement,this.bpmnElementSource=this.bpmnElement.source,this.bpmnElementSourceRef=this.bpmnElement.businessObject.sourceRef,this.bpmnElementSourceRef&&this.bpmnElementSourceRef.default&&this.bpmnElementSourceRef.default.id===this.bpmnElement.id?this.flowConditionForm={type:"default"}:this.bpmnElement.businessObject.conditionExpression?(e=this.bpmnElement.businessObject.conditionExpression,this.flowConditionForm=QC(QC({},e),{},{type:"condition"}),this.flowConditionForm.resource?(this.$set(this.flowConditionForm,"conditionType","script"),this.$set(this.flowConditionForm,"scriptType","externalScript")):e.language?(this.$set(this.flowConditionForm,"conditionType","script"),this.$set(this.flowConditionForm,"scriptType","inlineScript")):this.$set(this.flowConditionForm,"conditionType","expression")):this.flowConditionForm={type:"normal"}},updateFlowType:function(e){"condition"===e?(this.flowConditionRef=window.bpmnInstances.moddle.create("bpmn:FormalExpression"),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{conditionExpression:this.flowConditionRef})):"default"===e?(window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{conditionExpression:null}),window.bpmnInstances.modeling.updateProperties(this.bpmnElementSource,{default:this.bpmnElement})):(this.bpmnElementSourceRef.default&&this.bpmnElementSourceRef.default.id===this.bpmnElement.id&&window.bpmnInstances.modeling.updateProperties(this.bpmnElementSource,{default:null}),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{conditionExpression:null}))},updateFlowCondition:function(){var e,t=(r=this.flowConditionForm).conditionType,n=r.scriptType,i=r.body,o=r.resource,r=r.language;"expression"===t?e=window.bpmnInstances.moddle.create("bpmn:FormalExpression",{body:i}):"inlineScript"===n?(e=window.bpmnInstances.moddle.create("bpmn:FormalExpression",{body:i,language:r}),this.$set(this.flowConditionForm,"resource","")):(this.$set(this.flowConditionForm,"body",""),e=window.bpmnInstances.moddle.create("bpmn:FormalExpression",{resource:o,language:r})),window.bpmnInstances.modeling.updateProperties(this.bpmnElement,{conditionExpression:e})}},beforeDestroy:function(){this.bpmnElement=null,this.bpmnElementSource=null,this.bpmnElementSourceRef=null}},te=Object(l.a)(nr,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"panel-tab__content"},[t("el-form",{attrs:{model:e.flowConditionForm,"label-width":"90px",size:"mini"},nativeOn:{submit:function(e){e.preventDefault()}}},[t("el-form-item",{attrs:{label:"流转类型"}},[t("el-select",{on:{change:e.updateFlowType},model:{value:e.flowConditionForm.type,callback:function(t){e.$set(e.flowConditionForm,"type",t)},expression:"flowConditionForm.type"}},[t("el-option",{attrs:{label:"普通流转路径",value:"normal"}}),e._v(" "),t("el-option",{attrs:{label:"默认流转路径",value:"default"}}),e._v(" "),t("el-option",{attrs:{label:"条件流转路径",value:"condition"}})],1)],1),e._v(" "),"condition"===e.flowConditionForm.type?t("el-form-item",{key:"condition",attrs:{label:"条件格式"}},[t("el-select",{model:{value:e.flowConditionForm.conditionType,callback:function(t){e.$set(e.flowConditionForm,"conditionType",t)},expression:"flowConditionForm.conditionType"}},[t("el-option",{attrs:{label:"表达式",value:"expression"}}),e._v(" "),t("el-option",{attrs:{label:"脚本",value:"script"}})],1)],1):e._e(),e._v(" "),e.flowConditionForm.conditionType&&"expression"===e.flowConditionForm.conditionType?t("el-form-item",{key:"express",attrs:{label:"表达式"}},[t("el-input",{attrs:{clearable:""},on:{change:e.updateFlowCondition},model:{value:e.flowConditionForm.body,callback:function(t){e.$set(e.flowConditionForm,"body",t)},expression:"flowConditionForm.body"}})],1):e._e(),e._v(" "),e.flowConditionForm.conditionType&&"script"===e.flowConditionForm.conditionType?[t("el-form-item",{key:"language",attrs:{label:"脚本语言"}},[t("el-input",{attrs:{clearable:""},on:{change:e.updateFlowCondition},model:{value:e.flowConditionForm.language,callback:function(t){e.$set(e.flowConditionForm,"language",t)},expression:"flowConditionForm.language"}})],1),e._v(" "),t("el-form-item",{key:"scriptType",attrs:{label:"脚本类型"}},[t("el-select",{model:{value:e.flowConditionForm.scriptType,callback:function(t){e.$set(e.flowConditionForm,"scriptType",t)},expression:"flowConditionForm.scriptType"}},[t("el-option",{attrs:{label:"内联脚本",value:"inlineScript"}}),e._v(" "),t("el-option",{attrs:{label:"外部脚本",value:"externalScript"}})],1)],1),e._v(" "),"inlineScript"===e.flowConditionForm.scriptType?t("el-form-item",{key:"body",attrs:{label:"脚本"}},[t("el-input",{attrs:{type:"textarea",clearable:""},on:{change:e.updateFlowCondition},model:{value:e.flowConditionForm.body,callback:function(t){e.$set(e.flowConditionForm,"body",t)},expression:"flowConditionForm.body"}})],1):e._e(),e._v(" "),"externalScript"===e.flowConditionForm.scriptType?t("el-form-item",{key:"resource",attrs:{label:"资源地址"}},[t("el-input",{attrs:{clearable:""},on:{change:e.updateFlowCondition},model:{value:e.flowConditionForm.resource,callback:function(t){e.$set(e.flowConditionForm,"resource",t)},expression:"flowConditionForm.resource"}})],1):e._e()]:e._e()],2)],1)}),[],!1,null,null,null).exports,zr={name:"SignalAndMassage",data:function(){return{signalList:[],messageList:[],modelVisible:!1,modelType:"",modelObjectForm:{}}},computed:{modelConfig:function(){return"message"===this.modelType?{title:"创建消息",idLabel:"消息ID",nameLabel:"消息名称"}:{title:"创建信号",idLabel:"信号ID",nameLabel:"信号名称"}}},mounted:function(){this.initDataList()},methods:{initDataList:function(){var e=this;this.rootElements=window.bpmnInstances.modeler.getDefinitions().rootElements,this.messageIdMap={},this.signalIdMap={},this.messageList=[],this.signalList=[],this.rootElements.forEach((function(t){"bpmn:Message"===t.$type&&(e.messageIdMap[t.id]=!0,e.messageList.push(tS({},t))),"bpmn:Signal"===t.$type&&(e.signalIdMap[t.id]=!0,e.signalList.push(tS({},t)))}))},openModel:function(e){this.modelType=e,this.modelObjectForm={},this.modelVisible=!0},addNewObject:function(){if("message"===this.modelType){if(this.messageIdMap[this.modelObjectForm.id])return this.$message.error("该消息已存在,请修改id后重新保存");var e=window.bpmnInstances.moddle.create("bpmn:Message",this.modelObjectForm);this.rootElements.push(e)}else{if(this.signalIdMap[this.modelObjectForm.id])return this.$message.error("该信号已存在,请修改id后重新保存");e=window.bpmnInstances.moddle.create("bpmn:Signal",this.modelObjectForm),this.rootElements.push(e)}this.modelVisible=!1,this.initDataList()}}},Sg={components:{SignalAndMassage:Object(l.a)(zr,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"panel-tab__content"},[t("div",{staticClass:"panel-tab__content--title"},[e._m(0),e._v(" "),t("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.openModel("message")}}},[e._v("创建新消息")])],1),e._v(" "),t("el-table",{attrs:{data:e.messageList,size:"mini",border:""}},[t("el-table-column",{attrs:{type:"index",label:"序号",width:"60px"}}),e._v(" "),t("el-table-column",{attrs:{label:"消息ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}}),e._v(" "),t("el-table-column",{attrs:{label:"消息名称",prop:"name","max-width":"300px","show-overflow-tooltip":""}})],1),e._v(" "),t("div",{staticClass:"panel-tab__content--title",staticStyle:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eeeeee"}},[e._m(1),e._v(" "),t("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.openModel("signal")}}},[e._v("创建新信号")])],1),e._v(" "),t("el-table",{attrs:{data:e.signalList,size:"mini",border:""}},[t("el-table-column",{attrs:{type:"index",label:"序号",width:"60px"}}),e._v(" "),t("el-table-column",{attrs:{label:"信号ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}}),e._v(" "),t("el-table-column",{attrs:{label:"信号名称",prop:"name","max-width":"300px","show-overflow-tooltip":""}})],1),e._v(" "),t("el-dialog",{attrs:{visible:e.modelVisible,title:e.modelConfig.title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.modelVisible=t}}},[t("el-form",{attrs:{model:e.modelObjectForm,size:"mini","label-width":"90px"},nativeOn:{submit:function(e){e.preventDefault()}}},[t("el-form-item",{attrs:{label:e.modelConfig.idLabel}},[t("el-input",{attrs:{clearable:""},model:{value:e.modelObjectForm.id,callback:function(t){e.$set(e.modelObjectForm,"id",t)},expression:"modelObjectForm.id"}})],1),e._v(" "),t("el-form-item",{attrs:{label:e.modelConfig.nameLabel}},[t("el-input",{attrs:{clearable:""},model:{value:e.modelObjectForm.name,callback:function(t){e.$set(e.modelObjectForm,"name",t)},expression:"modelObjectForm.name"}})],1)],1),e._v(" "),t("template",{slot:"footer"},[t("el-button",{attrs:{size:"mini"},on:{click:function(t){e.modelVisible=!1}}},[e._v("取 消")]),e._v(" "),t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.addNewObject}},[e._v("保 存")])],1)],2)],1)}),[function(){var e=this.$createElement;return(e=this._self._c||e)("span",[e("i",{staticClass:"el-icon-menu",staticStyle:{"margin-right":"8px",color:"#555555"}}),this._v("消息列表")])},function(){var e=this.$createElement;return(e=this._self._c||e)("span",[e("i",{staticClass:"el-icon-menu",staticStyle:{"margin-right":"8px",color:"#555555"}}),this._v("信号列表")])}],!1,null,null,null).exports,FlowCondition:te,ElementTask:ee,ElementBaseInfo:ea},props:{bpmnModeler:Object,prefix:{type:String,default:"camunda"},width:{type:Number,default:400},idEditDisabled:{type:Boolean,default:!1}},provide:function(){return{prefix:this.prefix,width:this.width}},data:function(){return{activeTab:"base",elementId:"",elementType:"",elementBusinessObject:{},conditionFormVisible:!1,formVisible:!1}},watch:{elementId:{handler:function(){this.activeTab="base"}}},created:function(){this.initModels()},methods:{initModels:function(){var e=this;this.bpmnModeler?(this.timer&&clearTimeout(this.timer),window.bpmnInstances={modeler:this.bpmnModeler,modeling:this.bpmnModeler.get("modeling"),moddle:this.bpmnModeler.get("moddle"),eventBus:this.bpmnModeler.get("eventBus"),bpmnFactory:this.bpmnModeler.get("bpmnFactory"),elementFactory:this.bpmnModeler.get("elementFactory"),elementRegistry:this.bpmnModeler.get("elementRegistry"),replace:this.bpmnModeler.get("replace"),selection:this.bpmnModeler.get("selection")},this.getActiveElement()):this.timer=setTimeout((function(){return e.initModels()}),10)},getActiveElement:function(){var e=this;this.initFormOnChanged(null),this.bpmnModeler.on("import.done",(function(t){e.initFormOnChanged(null)})),this.bpmnModeler.on("selection.changed",(function(t){t=t.newSelection,e.initFormOnChanged(t[0]||null)})),this.bpmnModeler.on("element.changed",(function(t){(t=t.element)&&t.id===e.elementId&&e.initFormOnChanged(t)}))},initFormOnChanged:function(e){var t;(e=e||(null!=(t=window.bpmnInstances.elementRegistry.find((function(e){return"bpmn:Process"===e.type})))?t:window.bpmnInstances.elementRegistry.find((function(e){return"bpmn:Collaboration"===e.type}))))&&(ld.printBack("select element changed: id: ".concat(e.id," , type: ").concat(e.businessObject.$type)),ld.prettyInfo("businessObject",e.businessObject),window.bpmnInstances.bpmnElement=e,this.bpmnElement=e,this.elementId=e.id,this.elementType=e.type.split(":")[1]||"",this.elementBusinessObject=JSON.parse(JSON.stringify(e.businessObject)),this.conditionFormVisible=!("SequenceFlow"!==this.elementType||!e.source||-1!==e.source.type.indexOf("StartEvent")),this.formVisible="StartEvent"===this.elementType)},beforeDestroy:function(){window.bpmnInstances=null}}},Vg={name:"th-workflow",components:{MyProcessDesigner:Hg,MyProcessPalette:G_,MyProcessPanel:Object(l.a)(Sg,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"process-panel__container",style:{width:this.width+"px"}},[t("el-collapse",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[t("el-collapse-item",{attrs:{name:"base"}},[t("div",{staticClass:"panel-tab__title",attrs:{slot:"title"},slot:"title"},[t("i",{staticClass:"el-icon-info"}),e._v("常规\n ")]),e._v(" "),t("element-base-info",{attrs:{"id-edit-disabled":e.idEditDisabled,"business-object":e.elementBusinessObject,type:e.elementType}})],1),e._v(" "),"Process"===e.elementType?t("el-collapse-item",{key:"message",attrs:{name:"condition"}},[t("div",{staticClass:"panel-tab__title",attrs:{slot:"title"},slot:"title"},[t("i",{staticClass:"el-icon-s-comment"}),e._v("消息与信号\n ")]),e._v(" "),t("signal-and-massage")],1):e._e(),e._v(" "),e.conditionFormVisible?t("el-collapse-item",{key:"condition",attrs:{name:"condition"}},[t("div",{staticClass:"panel-tab__title",attrs:{slot:"title"},slot:"title"},[t("i",{staticClass:"el-icon-s-promotion"}),e._v("流转条件\n ")]),e._v(" "),t("flow-condition",{attrs:{"business-object":e.elementBusinessObject,type:e.elementType}})],1):e._e(),e._v(" "),-1!==e.elementType.indexOf("Task")?t("el-collapse-item",{key:"task",attrs:{name:"task"}},[t("div",{staticClass:"panel-tab__title",attrs:{slot:"title"},slot:"title"},[t("i",{staticClass:"el-icon-s-claim"}),e._v("任务\n ")]),e._v(" "),t("element-task",{attrs:{id:e.elementId,type:e.elementType}})],1):e._e()],1)],1)}),[],!1,null,null,null).exports},directives:{clickoutside:X.a},data:function(){return{xmlString:"",modeler:null,reloadIndex:0,controlDrawerVisible:!1,infoTipVisible:!1,pageMode:!1,translationsSelf:zl,controlForm:{processId:"",processName:"",simulation:!0,labelEditing:!1,labelVisible:!1,prefix:"camunda",headerButtonSize:"mini",events:["element.click","element.contextmenu"],additionalModel:[td,rd,Lh]},addis:{CustomContentPadProvider:td,CustomPaletteProvider:rd}}},created:function(){},methods:{initModeler:function(e){var t=this;setTimeout((function(){var n=(t.modeler=e).get("canvas").getRootElement();ld.prettyPrimary("Process Id:",n.id),ld.prettyPrimary("Process Name:",n.businessObject.name)}),10)},reloadProcessDesigner:function(e){for(var t in this.controlForm.additionalModel=[],this.addis)this.addis[t]&&this.controlForm.additionalModel.push(this.addis[t]);e||(this.xmlString=void 0),this.reloadIndex+=1,this.modeler=null},changeLabelEditingStatus:function(e){this.addis.labelEditing=!!e&&{labelEditingProvider:["value",""]},this.reloadProcessDesigner()},changeLabelVisibleStatus:function(e){this.addis.customRenderer=!!e&&mu,this.reloadProcessDesigner()},elementClick:function(e){console.log(e),this.element=e},elementContextmenu:function(e){console.log("elementContextmenu:",e)},changePageMode:function(e){e=e?{stroke:"#ffffff",fill:"#333333"}:{stroke:"#000000",fill:"#ffffff"};var t=this.modeler.get("elementRegistry").getAll();this.modeler.get("modeling").setColor(t,e)},elementSave:function(){console.log(this.xmlString),this.$emit("element-save",this.xmlString)}}};var nS=Object(l.a)(Vg,(function(){var e=this,t=e.$createElement;return(t=e._self._c||t)("div",{staticClass:"th-workflow"},[t("my-process-palette"),e._v(" "),t("my-process-designer",e._b({key:"designer-"+e.reloadIndex,ref:"processDesigner",attrs:{options:{taskResizingEnabled:!0,eventResizingEnabled:!0},keyboard:""},on:{"element-click":e.elementClick,"element-contextmenu":e.elementContextmenu,"element-save":e.elementSave,"init-finished":e.initModeler,localFile:function(t){e.xmlString=t}},model:{value:e.xmlString,callback:function(t){e.xmlString=t},expression:"xmlString"}},"my-process-designer",e.controlForm,!1)),e._v(" "),t("my-process-panel",{key:"penal-"+e.reloadIndex,staticClass:"process-panel",attrs:{"bpmn-modeler":e.modeler,prefix:e.controlForm.prefix}}),e._v(" "),t("div",{staticClass:"demo-control-bar"},[t("div",{staticClass:"open-model-button",on:{click:function(t){e.controlDrawerVisible=!0}}},[t("i",{staticClass:"el-icon-setting"})])]),e._v(" "),t("el-drawer",{attrs:{visible:e.controlDrawerVisible,size:"400px",title:"偏好设置","append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.controlDrawerVisible=t}}},[t("el-form",{staticClass:"control-form",attrs:{model:e.controlForm,size:"small","label-width":"100px"},nativeOn:{submit:function(e){e.preventDefault()}}},[t("el-form-item",{attrs:{label:"流程ID"}},[t("el-input",{on:{change:function(t){return e.reloadProcessDesigner(!0)}},model:{value:e.controlForm.processId,callback:function(t){e.$set(e.controlForm,"processId",t)},expression:"controlForm.processId"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"流程名称"}},[t("el-input",{on:{change:function(t){return e.reloadProcessDesigner(!0)}},model:{value:e.controlForm.processName,callback:function(t){e.$set(e.controlForm,"processName",t)},expression:"controlForm.processName"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"流转模拟"}},[t("el-switch",{attrs:{"inactive-text":"停用","active-text":"启用"},on:{change:function(t){return e.reloadProcessDesigner()}},model:{value:e.controlForm.simulation,callback:function(t){e.$set(e.controlForm,"simulation",t)},expression:"controlForm.simulation"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"禁用双击"}},[t("el-switch",{attrs:{"inactive-text":"停用","active-text":"启用"},on:{change:e.changeLabelEditingStatus},model:{value:e.controlForm.labelEditing,callback:function(t){e.$set(e.controlForm,"labelEditing",t)},expression:"controlForm.labelEditing"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"自定义渲染"}},[t("el-switch",{attrs:{"inactive-text":"停用","active-text":"启用"},on:{change:e.changeLabelVisibleStatus},model:{value:e.controlForm.labelVisible,callback:function(t){e.$set(e.controlForm,"labelVisible",t)},expression:"controlForm.labelVisible"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"工具栏"}},[t("el-radio-group",{model:{value:e.controlForm.headerButtonSize,callback:function(t){e.$set(e.controlForm,"headerButtonSize",t)},expression:"controlForm.headerButtonSize"}},[t("el-radio",{attrs:{label:"mini"}},[e._v("mini")]),e._v(" "),t("el-radio",{attrs:{label:"small"}},[e._v("small")]),e._v(" "),t("el-radio",{attrs:{label:"medium"}},[e._v("medium")])],1)],1),e._v(" "),t("el-switch",{attrs:{"active-text":"dark","inactive-text":"light"},on:{change:e.changePageMode},model:{value:e.pageMode,callback:function(t){e.pageMode=t},expression:"pageMode"}})],1)],1),e._v(" "),t("div",{staticClass:"demo-info-bar"},[t("div",{staticClass:"open-model-button",on:{click:function(t){e.infoTipVisible=!e.infoTipVisible}}},[t("i",{staticClass:"el-icon-info"})]),e._v(" "),t("transition",{attrs:{name:"zoom-in-right"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.infoTipVisible,expression:"infoTipVisible"}],staticClass:"info-tip"},[t("p",[t("strong",[e._v("该项目仅作为Bpmn.js的简单演示项目,不涉及过多的自定义Render内容。")])]),e._v(" "),t("p",[e._v("注:activiti 好像不支持表单配置,控制台可能会报错")]),e._v(" "),t("p",[t("span",[e._v("更多配置请查看源码:")]),e._v(" "),t("a",{attrs:{href:"https://github.com/miyuesc/bpmn-process-designer"}},[e._v("MiyueSC/bpmn-process-designer")])]),e._v(" "),t("p",[t("span",[e._v("bpmn 官方图标:")]),e._v(" "),t("a",{attrs:{href:"https://cdn.staticaly.com/gh/bpmn-io/bpmn-font/master/dist/demo.html"}},[e._v("bpmn-io/bpmn-font")])]),e._v(" "),t("p",[t("span",[e._v("疑问请在此留言:")]),e._v(" "),t("a",{attrs:{href:"https://github.com/miyuesc/bpmn-process-designer/issues/16"}},[e._v("MiyueSC/bpmn-process-designer/issues")])])])])],1)],1)}),[],!1,(function(e){n(469)}),null,null).exports,iS=(nS.install=function(e){e.component(nS.name,nS)},nS),oS=[o,a,d,p,m,v,y,x,k,C,T,O,D,R,I,F,B,z,Y,Cl,Sl,Ml,ql,iS],rS=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};oS.forEach((function(t){e.component(t.name,t)})),e.prototype.$TIANHENG={size:t.size||"",zIndex:t.zIndex||2e3}};"undefined"!=typeof window&&window.Vue&&rS(window.Vue),Lg=n(545).version;t.default={version:Lg,install:rS,Cell:o,Icons:a,Table:d,TableAction:p,TableSearch:m,TableTools:v,Empty:y,Dialog:x,Card:k,Grid:C,GridItem:T,CodeEditor:O,VueEditor:D,Button:R,Image:I,ImagePreview:F,Row:B,Col:z,Upload:Y,FormMaking:Cl,FormGenerate:Sl,TableMaking:Ml,TableGenerate:ql,Workflow:iS}},function(e,t,n){"use strict";n.r(t);var i=n(35),o=n.n(i),r=(i=n(16),n.n(i)),a=/%[sdj%]/g;function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=1,o=t[0],r=t.length;if("function"==typeof o)return o.apply(null,t.slice(1));if("string"!=typeof o)return o;for(var s=String(o).replace(a,(function(e){if("%%"===e)return"%";if(r<=i)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(e){return"[Circular]"}break;default:return e}})),l=t[i];i<r;l=t[++i])s+=" "+l;return s}function l(e,t){return null==e||"array"===t&&Array.isArray(e)&&!e.length||!("string"!==(t=t)&&"url"!==t&&"hex"!==t&&"email"!==t&&"pattern"!==t||"string"!=typeof e||e)}function c(e,t,n){var i=0,o=e.length;!function r(a){a&&a.length?n(a):(a=i,i+=1,a<o?t(e[a],r):n([]))}([])}function u(e,t,n,i){var o,r;if(t.first)return o=e,r=[],Object.keys(o).forEach((function(e){r.push.apply(r,o[e])})),c(r,n,i);function a(e){d.push.apply(d,e),++u===l&&i(d)}var s=t.firstFields||[],l=(t=(!0===s&&(s=Object.keys(e)),Object.keys(e))).length,u=0,d=[];t.forEach((function(t){var i,o,r,l,u,d=e[t];function h(e){r.push.apply(r,e),++l===u&&o(r)}-1!==s.indexOf(t)?c(d,n,a):(i=n,o=a,r=[],l=0,u=d.length,d.forEach((function(e){i(e,h)})))}))}function d(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:t,field:t.field||e.fullField}}}function h(e,t){if(t)for(var n in t){var i;t.hasOwnProperty(n)&&("object"===(void 0===(i=t[n])?"undefined":r()(i))&&"object"===r()(e[n])?e[n]=o()({},e[n],i):e[n]=i)}return e}var p=function(e,t,n,i,o,r){!e.required||n.hasOwnProperty(e.field)&&!l(t,r||e.type)||i.push(s(o.messages.required,e.fullField))};var f={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},m={integer:function(e){return m.number(e)&&parseInt(e,10)===e},float:function(e){return m.number(e)&&!m.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(void 0===e?"undefined":r()(e))&&!m.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.match(f.email)&&e.length<255},url:function(e){return"string"==typeof e&&!!e.match(f.url)},hex:function(e){return"string"==typeof e&&!!e.match(f.hex)}},g={required:p,whitespace:function(e,t,n,i,o){!/^\s+$/.test(t)&&""!==t||i.push(s(o.messages.whitespace,e.fullField))},type:function(e,t,n,i,o){e.required&&void 0===t?p(e,t,n,i,o):(n=e.type,-1<["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(n)?m[n](t)||i.push(s(o.messages.types[n],e.fullField,e.type)):n&&(void 0===t?"undefined":r()(t))!==e.type&&i.push(s(o.messages.types[n],e.fullField,e.type)))},range:function(e,t,n,i,o){var r="number"==typeof e.len,a="number"==typeof e.min,l="number"==typeof e.max,c=t,u=null,d="number"==typeof t,h="string"==typeof t,p=Array.isArray(t);if(d?u="number":h?u="string":p&&(u="array"),!u)return!1;p&&(c=t.length),h&&(c=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),r?c!==e.len&&i.push(s(o.messages[u].len,e.fullField,e.len)):a&&!l&&c<e.min?i.push(s(o.messages[u].min,e.fullField,e.min)):l&&!a&&c>e.max?i.push(s(o.messages[u].max,e.fullField,e.max)):a&&l&&(c<e.min||c>e.max)&&i.push(s(o.messages[u].range,e.fullField,e.min,e.max))},enum:function(e,t,n,i,o){e.enum=Array.isArray(e.enum)?e.enum:[],-1===e.enum.indexOf(t)&&i.push(s(o.messages.enum,e.fullField,e.enum.join(", ")))},pattern:function(e,t,n,i,o){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||i.push(s(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"!=typeof e.pattern||new RegExp(e.pattern).test(t)||i.push(s(o.messages.pattern.mismatch,e.fullField,t,e.pattern)))}};function v(e,t,n,i,o){var r=e.type,a=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t,r)&&!e.required)return n();g.required(e,t,i,a,o,r),l(t,r)||g.type(e,t,i,a,o)}n(a)}var b={string:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t,"string")&&!e.required)return n();g.required(e,t,i,r,o,"string"),l(t,"string")||(g.type(e,t,i,r,o),g.range(e,t,i,r,o),g.pattern(e,t,i,r,o),!0===e.whitespace&&g.whitespace(e,t,i,r,o))}n(r)},method:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&g.type(e,t,i,r,o)}n(r)},number:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&(g.type(e,t,i,r,o),g.range(e,t,i,r,o))}n(r)},boolean:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&g.type(e,t,i,r,o)}n(r)},regexp:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),l(t)||g.type(e,t,i,r,o)}n(r)},integer:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&(g.type(e,t,i,r,o),g.range(e,t,i,r,o))}n(r)},float:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&(g.type(e,t,i,r,o),g.range(e,t,i,r,o))}n(r)},array:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t,"array")&&!e.required)return n();g.required(e,t,i,r,o,"array"),l(t,"array")||(g.type(e,t,i,r,o),g.range(e,t,i,r,o))}n(r)},object:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),void 0!==t&&g.type(e,t,i,r,o)}n(r)},enum:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,r,o),t&&g.enum(e,t,i,r,o)}n(r)},pattern:function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t,"string")&&!e.required)return n();g.required(e,t,i,r,o),l(t,"string")||g.pattern(e,t,i,r,o)}n(r)},date:function(e,t,n,i,o){var r,a=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(l(t)&&!e.required)return n();g.required(e,t,i,a,o),l(t)||(r=void 0,r="number"==typeof t?new Date(t):t,g.type(e,r,i,a,o),r&&g.range(e,r.getTime(),i,a,o))}n(a)},url:v,hex:v,email:v,required:function(e,t,n,i,o){var a=[],s=Array.isArray(t)?"array":void 0===t?"undefined":r()(t);g.required(e,t,i,a,o,s),n(a)}};function y(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var w=y();function x(e){this.rules=null,this._messages=w,this.define(e)}x.prototype={messages:function(e){return e&&(this._messages=h(y(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==(void 0===e?"undefined":r()(e))||Array.isArray(e))throw new Error("Rules must be an object");this.rules={};var t,n=void 0;for(n in e)e.hasOwnProperty(n)&&(t=e[n],this.rules[n]=Array.isArray(t)?t:[t])},validate:function(e){var t,n,i,a,l=this,c=e,p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=arguments[2];function m(e){var t,n,i=void 0,o=[],r={};for(i=0;i<e.length;i++)n=e[i],Array.isArray(n)?o=o.concat.apply(o,n):o.push(n);if(o.length)for(i=0;i<o.length;i++)r[t=o[i].field]=r[t]||[],r[t].push(o[i]);else r=o=null;f(o,r)}"function"==typeof p&&(f=p,p={}),this.rules&&0!==Object.keys(this.rules).length?(n=void(p.messages?(h(t=(t=this.messages())===w?y():t,p.messages),p.messages=t):p.messages=this.messages()),i=void 0,a={},(p.keys||Object.keys(this.rules)).forEach((function(t){n=l.rules[t],i=c[t],n.forEach((function(n){"function"==typeof n.transform&&(c===e&&(c=o()({},c)),i=c[t]=n.transform(i)),(n="function"==typeof n?{validator:n}:o()({},n)).validator=l.getValidationMethod(n),n.field=t,n.fullField=n.fullField||t,n.type=l.getType(n),n.validator&&(a[t]=a[t]||[],a[t].push({rule:n,value:i,source:c,field:t}))}))})),u(a,p,(function(e,t){var n,i=e.rule;function a(e,t){return o()({},t,{fullField:i.fullField+"."+e})}function l(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];if((r=Array.isArray(r)?r:[r]).length,r=(r=r.length&&i.message?[].concat(i.message):r).map(d(i)),p.first&&r.length)return i.field,t(r);if(n){if(i.required&&!e.value)return r=i.message?[].concat(i.message).map(d(i)):p.error?[p.error(i,s(p.messages.required,i.field))]:[],t(r);var l,c,u={};if(i.defaultField)for(var h in e.value)e.value.hasOwnProperty(h)&&(u[h]=i.defaultField);for(l in u=o()({},u,e.rule.fields))u.hasOwnProperty(l)&&(c=Array.isArray(u[l])?u[l]:[u[l]],u[l]=c.map(a.bind(null,l)));var f=new x(u);f.messages(p.messages),e.rule.options&&(e.rule.options.messages=p.messages,e.rule.options.error=p.error),f.validate(e.value,e.rule.options||p,(function(e){t(e&&e.length?r.concat(e):e)}))}else t(r)}n=!("object"!==i.type&&"array"!==i.type||"object"!==r()(i.fields)&&"object"!==r()(i.defaultField))&&(i.required||!i.required&&e.value),i.field=e.field;var c=i.validator(i,e.value,l,e.source,p);c&&c.then&&c.then((function(){return l()}),(function(e){return l(e)}))}),(function(e){m(e)}))):f&&f()},getType:function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!b.hasOwnProperty(e.type))throw new Error(s("Unknown rule type %s",e.type));return e.type||"string"},getValidationMethod:function(e){var t,n;return"function"==typeof e.validator?e.validator:(-1!==(n=(t=Object.keys(e)).indexOf("message"))&&t.splice(n,1),1===t.length&&"required"===t[0]?b.required:b[this.getType(e)]||!1)}},x.register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");b[e]=t},x.messages=w,t.default=x}])}));
|