draw.io is a JavaScript, client-side editor for general diagramming.
window.PROXY_URL=window.PROXY_URL||"https://viewer.diagrams.net/proxy";window.STYLE_PATH=window.STYLE_PATH||"https://viewer.diagrams.net/styles";window.SHAPES_PATH=window.SHAPES_PATH||"https://viewer.diagrams.net/shapes";window.STENCIL_PATH=window.STENCIL_PATH||"https://viewer.diagrams.net/stencils";window.DRAW_MATH_URL=window.DRAW_MATH_URL||"https://viewer.diagrams.net/math4/es5";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"https://viewer.diagrams.net/img";
window.mxImageBasePath=window.mxImageBasePath||"https://viewer.diagrams.net/mxgraph/images";window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";window.mxLoadStylesheets=window.mxLoadStylesheets||!1;
//fgnass.github.com/spin.js#v2.0.0
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.DOMPurify=t())})(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e){if(Array.isArray(e))return e}function r(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function i(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};let c=Object.entries,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,ee=typeof Reflect<`u`&&Reflect,g=ee.apply,te=ee.construct;p||(p=function(e){return e}),m||(m=function(e){return e}),g||(g=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),te||(te=function(e){return new e(...[...arguments].slice(1))});let _=E(Array.prototype.forEach);Array.prototype.indexOf;let ne=E(Array.prototype.lastIndexOf),re=E(Array.prototype.pop),ie=E(Array.prototype.push),ae=E(Array.prototype.slice),oe=E(Array.prototype.splice),v=Array.isArray,se=D(Set),ce=E(Set.prototype.add),le=E(Set.prototype.has),y=E(String.prototype.toLowerCase),ue=E(String.prototype.toString),de=E(String.prototype.match),fe=E(String.prototype.replace),pe=E(String.prototype.indexOf),me=E(String.prototype.trim),he=E(Number.prototype.toString),b=E(Boolean.prototype.toString),x=typeof BigInt>`u`?null:E(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:E(Symbol.prototype.toString),S=E(Object.prototype.hasOwnProperty),C=E(Object.prototype.toString),w=E(RegExp.prototype.test),T=D(TypeError);function E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return g(e,t,n)}}function D(e){return function(){return te(e,[...arguments])}}function O(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;if(l&&l(e,null),!v(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function _e(e){for(let t=0;t<e.length;t++)S(e,t)||(e[t]=null);return e}function k(e){let t=h(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];S(e,i)&&(t[i]=v(o)?_e(o):o&&typeof o==`object`&&o.constructor===Object?k(o):o)}return t}function ve(e){switch(typeof e){case`string`:return e;case`number`:return he(e);case`boolean`:return b(e);case`bigint`:return x?x(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return C(e);case`function`:case`object`:{if(e===null)return C(e);let t=e,n=A(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:C(e)}return C(e)}default:return C(e)}}function A(e,t){for(;e!==null;){let n=f(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=d(e)}function n(){return null}return n}function ye(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?E(n.get):null;e=d(e)}return null}function be(e){try{return w(e,``),!0}catch(e){return!1}}let xe=p(/* @__PURE__ */ `a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Se=p(/* @__PURE__ */ `svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ce=p([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),we=p([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Te=p(/* @__PURE__ */ `math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ee=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),De=p([`#text`]),Oe=p(/* @__PURE__ */ `accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ke=p(/* @__PURE__ */ `accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ae=p(/* @__PURE__ */ `accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),je=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Me=m(/{{[\w\W]*|^[\w\W]*}}/g),Ne=m(/<%[\w\W]*|^[\w\W]*%>/g),Pe=m(/\${[\w\W]*/g),Fe=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ie=m(/^aria-[\-\w]+$/),Le=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Re=m(/^(?:\w+script|data):/i),ze=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Be=m(/^html$/i),Ve=m(/^[a-z][.\w]*(-[.\w]+)+$/i),He=m(/<[/\w!]/g),Ue=m(/<[/\w]/g),We=m(/<\/no(script|embed|frames)/i),Ge=m(/\/>/i),j={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ke=p(O({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),qe=function(){return typeof window>`u`?null:window},Je=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M=function(e,t,n,r){return S(e,t)&&v(e[t])?O(r.base?k(r.base):{},e[t],r.transform):n},Xe=function(e,t,n){let r=S(e,t)?e[t]:void 0;return r&&typeof r==`object`?k(r):n()};function Ze(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qe(),t=e=>Ze(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==j.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=A(f,`cloneNode`),g=A(f,`remove`),te=A(f,`removeAttributeNode`),he=A(f,`nextSibling`),b=A(f,`childNodes`),x=A(f,`parentNode`),ge=A(f,`shadowRoot`),C=A(f,`attributes`),E=o&&o.prototype?A(o.prototype,`nodeType`):null,D=o&&o.prototype?A(o.prototype,`nodeName`):null,_e=o&&o.prototype?A(o.prototype,`ownerDocument`):null,N=function(e){return E?E(e):e.nodeType},Qe=function(e){return D?D(e):e.nodeName},$e=ye(f,`namespaceURI`),et=function(e){return $e?$e(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let P,F=``,tt,nt=!1,rt=0,it=function(){if(rt>0)throw T(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},at=function(e){it(),rt++;try{return P.createHTML(e)}finally{rt--}},ot=function(e){it(),rt++;try{return P.createScriptURL(e)}finally{rt--}},st=function(){return nt||(tt=Je(d,i),nt=!0),tt},ct=n,lt=ct.implementation,ut=ct.createNodeIterator,dt=ct.createDocumentFragment,ft=ct.getElementsByTagName,pt=r.importNode,I=Ye();t.isSupported=typeof c==`function`&&typeof x==`function`&<&<.createHTMLDocument!==void 0;let mt=Me,ht=Ne,gt=Pe,_t=Fe,vt=Ie,yt=Re,bt=ze,xt=Ve,St=Le,L=null,Ct=O({},[...xe,...Se,...Ce,...Te,...De]),R=null,wt=O({},[...Oe,...ke,...Ae,...je]),z=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Tt=null,Et=null,B=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Dt=!0,Ot=!0,kt=!1,At=!0,V=!1,H=!0,U=!1,jt=!1,Mt=null,Nt=null,Pt=!1,W=!1,Ft=!1,It=!1,Lt=!0,Rt=!1,zt=`user-content-`,Bt=!0,Vt=!1,G=null,K={},q=null,Ht=O({},/* @__PURE__ */ `annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ut=null,Wt=O({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Gt=null,Kt=O({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),qt=`http://www.w3.org/1998/Math/MathML`,Jt=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Yt=J,Xt=!1,Zt=null,Qt=O({},[qt,Jt,J],ue),$t=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),en=O({},$t),tn=p([`annotation-xml`]),nn=O({},tn),rn=O({},[`title`,`style`,`font`,`a`,`script`]),an=null,on=[`application/xhtml+xml`,`text/html`],Y=null,sn=null,cn=n.createElement(`form`),ln=function(e){return e instanceof RegExp||e instanceof Function},un=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(sn&&sn===e)return;(!e||typeof e!=`object`)&&(e={}),e=k(e),an=on.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=an===`application/xhtml+xml`?ue:y,L=M(e,`ALLOWED_TAGS`,Ct,{transform:Y}),R=M(e,`ALLOWED_ATTR`,wt,{transform:Y}),Zt=M(e,`ALLOWED_NAMESPACES`,Qt,{transform:ue}),Gt=M(e,`ADD_URI_SAFE_ATTR`,Kt,{transform:Y,base:Kt}),Ut=M(e,`ADD_DATA_URI_TAGS`,Wt,{transform:Y,base:Wt}),q=M(e,`FORBID_CONTENTS`,Ht,{transform:Y}),Tt=M(e,`FORBID_TAGS`,k({}),{transform:Y}),Et=M(e,`FORBID_ATTR`,k({}),{transform:Y}),K=S(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?k(e.USE_PROFILES):e.USE_PROFILES:!1,Dt=e.ALLOW_ARIA_ATTR!==!1,Ot=e.ALLOW_DATA_ATTR!==!1,kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,At=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=e.SAFE_FOR_TEMPLATES||!1,H=e.SAFE_FOR_XML!==!1,U=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,Ft=e.RETURN_DOM_FRAGMENT||!1,It=e.RETURN_TRUSTED_TYPE||!1,Pt=e.FORCE_BODY||!1,Lt=e.SANITIZE_DOM!==!1,Rt=e.SANITIZE_NAMED_PROPS||!1,Bt=e.KEEP_CONTENT!==!1,Vt=e.IN_PLACE||!1,St=be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Le,Yt=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,en=Xe(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>O({},$t)),nn=Xe(e,`HTML_INTEGRATION_POINTS`,()=>O({},tn));let t=Xe(e,`CUSTOM_ELEMENT_HANDLING`,()=>h(null));if(z=h(null),S(t,`tagNameCheck`)&&ln(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),S(t,`attributeNameCheck`)&&ln(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),S(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(z),V&&(Ot=!1),Ft&&(W=!0),K&&(L=O({},De),R=h(null),K.html===!0&&(O(L,xe),O(R,Oe)),K.svg===!0&&(O(L,Se),O(R,ke),O(R,je)),K.svgFilters===!0&&(O(L,Ce),O(R,ke),O(R,je)),K.mathMl===!0&&(O(L,Te),O(R,Ae),O(R,je))),B.tagCheck=null,B.attributeCheck=null,S(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?B.tagCheck=e.ADD_TAGS:v(e.ADD_TAGS)&&(L===Ct&&(L=k(L)),O(L,e.ADD_TAGS,Y))),S(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?B.attributeCheck=e.ADD_ATTR:v(e.ADD_ATTR)&&(R===wt&&(R=k(R)),O(R,e.ADD_ATTR,Y))),S(e,`ADD_FORBID_CONTENTS`)&&v(e.ADD_FORBID_CONTENTS)&&(q===Ht&&(q=k(q)),O(q,e.ADD_FORBID_CONTENTS,Y)),Bt&&(L[`#text`]=!0),U&&O(L,[`html`,`head`,`body`]),L.table&&(O(L,[`tbody`]),delete Tt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=P;P=e.TRUSTED_TYPES_POLICY;try{F=at(``)}catch(e){throw P=t,e}}else e.TRUSTED_TYPES_POLICY===null?(P=void 0,F=``):(P===void 0&&(P=st()),P&&typeof F==`string`&&(F=at(``)));p&&p(e),sn=e},dn=O({},[...Se,...Ce,...we]),fn=O({},[...Te,...Ee]),pn=function(e,t,n){return t.namespaceURI===J?e===`svg`:t.namespaceURI===qt?e===`svg`&&(n===`annotation-xml`||en[n]):!!dn[e]},mn=function(e,t,n){return t.namespaceURI===J?e===`math`:t.namespaceURI===Jt?e===`math`&&nn[n]:!!fn[e]},hn=function(e,t,n){return t.namespaceURI===Jt&&!nn[n]||t.namespaceURI===qt&&!en[n]?!1:!fn[e]&&(rn[e]||!dn[e])},gn=function(e){let t=et(e),n=y(Qe(e)),r=x(e),i,a;return r&&N(r)===j.element?(i={namespaceURI:et(r)},a=y(Qe(r))):(i={namespaceURI:Yt},a=`template`),Zt[t]?t===Jt?pn(n,i,a):t===qt?mn(n,i,a):t===J?hn(n,i,a):!!(an===`application/xhtml+xml`&&Zt[t]):!1},X=function(e){ie(t.removed,{element:e});try{x(e).removeChild(e)}catch(t){if(g(e),!x(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_n=function(e,t,n){try{te(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},vn=function(e){Sn(e);let t=b(e);t&&_(ae(t),e=>{try{g(e)}catch(e){}});let n=N(e)===j.element?C(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_n(e,r,i)}},yn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch(e){r=null}ie(t.removed,{attribute:r||null,from:n});try{r?te(n,r):n.removeAttribute(e)}catch(t){try{n.removeAttribute(e)}catch(e){}}if(e===`is`){if(W||Ft)try{X(n)}catch(e){}else try{n.setAttribute(e,``)}catch(e){}}},bn=function(e){let t=C(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||R[Y(i)]||_n(e,r,i)}},xn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&N(e)===j.element){let t=ge(e);Z(t)&&r.push(t)}let i=b(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Sn=function(e){xn(e,e=>{N(e)===j.element&&bn(e)})},Cn=function(e){let t=[];return xn(e,e=>{t.push(e)},!0),t},wn=function(e,t){let n=se();_(Cn(e),e=>{N(e)===j.element&&ce(n,e)}),_(t,e=>{N(e)===j.element&&!le(n,e)&&bn(e)})},Tn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r=r||t.element===e,Sn(t.element))}),wn(e,n),r},En=function(e,t){let n=G,r=null,i=()=>(r||(r=se(),_(t,e=>{ce(r,e)})),r);for(let t=0;;t++){let r=Cn(e),a=[e],o=!1;if(_(r,e=>{N(e)===j.documentFragment?ie(a,e):!o&&!le(n,e)&&(o=le(i(),e))}),!o)return;if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Dn(t,n>0,e,i())})}},Dn=function(e,t,n,r){let i=Mn(e),a;for(;a=i.nextNode();)le(r,a)&&!le(G,a)&&(t&&Q(I.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Z(a.content)&&Xn(a.content))},On=function(e){G&&ce(G,e)},kn=function(e,t){return H?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},An=function(e){H&&xn(e,e=>{let t=N(e);if(t===j.processingInstruction||t===j.comment&&w(Ue,e.data)){try{g(e)}catch(e){}return!1}if(t===j.element){let t=e,n=Y(Qe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kn(`for`,n)&&t.removeAttribute(`for`)}catch(e){}}return!0})},jn=function(e){let t=null,r=null;if(Pt)e=`<remove></remove>`+e;else{let t=de(e,/^[\r\n\t ]+/);r=t&&t[0]}an===`application/xhtml+xml`&&Yt===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=P?at(e):e;if(Yt===J)try{t=new u().parseFromString(i,an)}catch(e){}if(!t||!t.documentElement){t=lt.createDocument(Yt,`template`,null);try{t.documentElement.innerHTML=Xt?F:i}catch(e){}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Yt===J?ft.call(t,U?`html`:`body`)[0]:U?t.documentElement:a},Mn=function(e){let t=_e?_e(e):e.ownerDocument;return ut.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Nn=function(e){return e=fe(e,mt,` `),e=fe(e,ht,` `),e=fe(e,gt,` `),e},Pn=function(e){var t;Fn(e);let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`template`);n&&_(n,e=>{Z(e.content)&&Pn(e.content)})},Fn=function(e){e.normalize();let t=_e?_e(e):e.ownerDocument,n=ut.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nn(r.data),r=n.nextNode()},In=function(e){let t=D?D(e):null;return typeof t!=`string`||Y(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==C(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==E(e)||e.childNodes!==b(e)},Z=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return E(e)===j.documentFragment}catch(e){return!1}},Ln=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return typeof E(e)==`number`}catch(e){return!1}};function Q(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,sn)})}let Rn=function(e,t){return!!(H&&e.hasChildNodes()&&!Ln(e.firstElementChild)&&w(He,e.textContent)&&w(He,e.innerHTML)||H&&Ke[t]&&N(e)===j.element&&et(e)===J&&(Ln(e.firstElementChild)||typeof e.textContent==`string`&&w(He,e.textContent))||e.nodeType===j.processingInstruction||H&&e.nodeType===j.comment&&w(Ue,e.data))},zn=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Bn=function(e,t,n){if(!Tt[t]&&Gn(t)&&zn(z.tagNameCheck,t))return!1;if(Bt&&!q[t]&&!q[y(t)]){let t=x(e),r=b(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,he(e))}}}return X(e),!0},Vn=function(e,t,n,r){return e.length===0?t:t===n||t===r?k(t):t},$=function(e,t){return e===t||x(e)!==null?!1:(Vt&&Sn(e),!0)},Hn=function(e,n){if(On(e),Q(I.beforeSanitizeElements,e,null),$(e,n))return!0;if(In(e))return X(e),!0;let r=Y(Qe(e));if(L=Vn(I.uponSanitizeElement,L,Ct,Mt),Q(I.uponSanitizeElement,e,{tagName:r,allowedTags:L}),$(e,n))return!0;if(Rn(e,r))return X(e),!0;if(Tt[r]||!(B.tagCheck instanceof Function&&B.tagCheck(r))&&!L[r]){let t=Bn(e,r,n);return t===!1&&(Q(I.afterSanitizeElements,e,null),$(e,n))?!0:t}if(N(e)===j.element&&!gn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(We,e.innerHTML))return X(e),!0;if(V&&e.nodeType===j.text){let n=Nn(e.textContent);e.textContent!==n&&(ie(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Q(I.afterSanitizeElements,e,null),$(e,n)},Un=function(e,t,r){if(Et[t]||kn(t,e)||Lt&&(t===`id`||t===`name`)&&(r in n||r in cn))return!1;let i=R[t]||B.attributeCheck instanceof Function&&B.attributeCheck(t,e);return Ot&&w(_t,t)||Dt&&w(vt,t)?!0:i?Gt[t]||w(St,fe(r,bt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pe(r,`data:`)===0&&Ut[e]||kt&&!w(yt,fe(r,bt,``))?!0:!r:Gn(e)&&zn(z.tagNameCheck,e)&&zn(z.attributeNameCheck,t,e)||t===`is`&&z.allowCustomizedBuiltInElements&&zn(z.tagNameCheck,r)},Wn=O({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gn=function(e){return!Wn[y(e)]&&w(xt,e)},Kn=function(e,t,n,r){if(P&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return at(r);case`TrustedScriptURL`:return ot(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!In(e)||(X(e),!1)}catch(n){return yn(t,e),!1}},Jn=function(e,t){return H&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:y(e)===`attributename`&&de(t,`href`)!==null},Yn=function(e,n){if(Q(I.beforeSanitizeAttributes,e,null),$(e,n))return;let r=e.attributes;if(!r||In(e))return;R=Vn(I.uponSanitizeAttribute,R,wt,Nt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},a=r.length,o=Y(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Y(s),d=l,f=s===`value`?d:me(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Q(I.uponSanitizeAttribute,e,i),f=i.attrValue,Rt&&(u===`id`||u===`name`)&&pe(f,zt)!==0&&(yn(s,e,n),f=zt+f,p=!0),Jn(s,f)?yn(s,e,n):i.forceKeepAttr||(i.keepAttr?!At&&w(Ge,f)?yn(s,e,n):(V&&(f=Nn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&re(t.removed)):yn(s,e,n)):yn(s,e,n))}Q(I.afterSanitizeAttributes,e,null),$(e,n)},Xn=function(e){let t=null,n=Mn(e);for(Q(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Q(I.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Z(t.content)&&Xn(t.content),N(t)===j.element){let e=ge(t);Z(e)&&(Zn(e),Xn(e))}V&&Fn(e),Q(I.afterSanitizeShadowDOM,e,null)},Zn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xn(e.shadow);continue}let n=e.node,r=N(n)===j.element,i=b(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=D?D(n):null;if(typeof e==`string`&&Y(e)===`template`){let e=n.content;Z(e)&&t.push({node:e,shadow:null})}}if(r){let e=ge(n);Z(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Xt=!e,Xt&&(e=`<!-->`),typeof e!=`string`&&!Ln(e)&&(e=ve(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;jt?(L=Mt,R=Nt):un(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(L=k(L)),I.uponSanitizeAttribute.length>0&&(R=k(R)),t.removed=[];let c=Vt&&typeof e!=`string`&&Ln(e),l=[],u=G;if(c){An(e);let t=Qe(e);if(typeof t==`string`){let n=Y(t);if(!L[n]||Tt[n])throw vn(e),T(`root node is forbidden and cannot be sanitized in-place`)}if(In(e))throw vn(e),T(`root node is clobbered and cannot be sanitized in-place`);l=Cn(e),G=se()}else if(Ln(e))i=jn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===j.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!W&&!V&&!U&&e.indexOf(`<`)===-1)return P&&It?at(e):e;if(i=jn(e),!i)return W?null:It?F:``}i&&Pt&&X(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=Mn(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Z(o.content)&&Xn(o.content);c&&En(e,l)}catch(t){throw c&&(vn(e),Tn(e,l)),t}finally{G=u}if(c){if(Tn(e,l))throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return V&&Pn(e),e}if(W){if(V&&Pn(i),Ft)for(s=dt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=pt.call(r,s,!0)),s}let f=U?i.outerHTML:i.innerHTML;return U&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Be,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+f),V&&(f=Nn(f)),P&&It?at(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};un(e),jt=!0,Mt=L,Nt=R},t.clearConfig=function(){sn=null,jt=!1,Mt=null,Nt=null,P=tt,F=``},t.isValidAttribute=function(e,t,n){sn||un({});let r=Y(e),i=Y(t);return typeof n==`string`&&(Jn(t,n)||!At&&w(Ge,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&S(I,e)&&ie(I[e],t)},t.removeHook=function(e,t){if(S(I,e)){if(t!==void 0){let n=ne(I[e],t);return n===-1?void 0:oe(I[e],n,1)[0]}return re(I[e])}},t.removeHooks=function(e){S(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=Ye()},t}return Ze()});
//# sourceMappingURL=purify.min.js.map
/*! pako 2.2.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,i=30,r=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,m,b,g=new Array(i);function p(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(g);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},z=function(t,e,a){x(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,i,s=new Array(16),o=0;for(n=1;n<=r;n++)o=o+a[n-1]<<1,s[n]=o;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Z=function(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){var i=2*e,r=2*a;return t[i]<t[r]||t[i]===t[r]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],i=a<<1;i<=t.heap_len&&(i<t.heap_len&&S(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!S(e,n,t.heap[i],t.depth));)t.heap[a]=t.heap[i],a=i,i<<=1;t.heap[a]=n},D=function(t,e,n){var i,r,l,h,d=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+d++],i+=(255&t.pending_buf[t.sym_buf+d++])<<8,r=t.pending_buf[t.sym_buf+d++],0===i?z(t,r,e):(l=u[r],z(t,l+a+1,e),0!==(h=s[l])&&(r-=c[l],x(t,r,h)),i--,l=k(i),z(t,l,n),0!==(h=o[l])&&(i-=g[l],x(t,i,h)))}while(d<t.sym_next);z(t,256,e)},T=function(t,e){var a,n,i,s=e.dyn_tree,o=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<h;a++)0!==s[2*a]?(t.heap[++t.heap_len]=d=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(i=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[i]=0,t.opt_len--,l&&(t.static_len-=o[2*i+1]);for(e.max_code=d,a=t.heap_len>>1;a>=1;a--)U(t,s,a);i=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*i]=s[2*a]+s[2*n],t.depth[i]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=i,t.heap[1]=i++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,i,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,m=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(n=t.heap[a])+1]+1]+1)>w&&(s=w,m++),h[2*n+1]=s,n>d||(t.bl_count[s]++,o=0,n>=c&&(o=u[n-c]),l=h[2*n],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*n+1]+o)));if(0!==m){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,m-=2}while(m>0);for(s=w;0!==s;s--)for(n=t.bl_count[s];0!==n;)(i=t.heap[--a])>d||(h[2*i+1]!==s&&(t.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(t,e),E(s,d,t.bl_count)},O=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)i=s,s=e[2*(n+1)+1],++o<l&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==r&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))},F=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(i=s,s=e[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{z(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==r&&(z(t,i,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}},I=!1,L=function(t,e,a,n){x(t,0+(n?1:0),3),Z(t),y(t,a),y(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a},N=function(t,e,n,i){var r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==e?L(t,e,n,i):4===t.strategy||s===r?(x(t,2+(i?1:0),3),D(t,d,_)):(x(t,4+(i?1:0),3),function(t,e,a,n){var i;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),i=0;i<n;i++)x(t,t.bl_tree[2*h[i]+1],3);F(t,t.dyn_ltree,e-1),F(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),i&&Z(t)},B={_tr_init:function(t){I||(!function(){var t,e,a,h,v,k=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<<s[h];t++)u[a++]=h;for(u[a-1]=h,v=0,h=0;h<16;h++)for(g[h]=v,t=0;t<1<<o[h];t++)f[v++]=h;for(v>>=7;h<i;h++)for(g[h]=v<<7,t=0;t<1<<o[h]-7;t++)f[256+v++]=h;for(e=0;e<=r;e++)k[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,k[8]++;for(;t<=255;)d[2*t+1]=9,t++,k[9]++;for(;t<=279;)d[2*t+1]=7,t++,k[7]++;for(;t<=287;)d[2*t+1]=8,t++,k[8]++;for(E(d,287,k),t=0;t<i;t++)_[2*t+1]=5,_[2*t]=A(t,5);w=new p(d,s,257,n,r),m=new p(_,o,0,i,r),b=new p(new Array(0),l,0,19,7)}(),I=!0),t.l_desc=new v(t.dyn_ltree,w),t.d_desc=new v(t.dyn_dtree,m),t.bl_desc=new v(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,R(t)},_tr_stored_block:L,_tr_flush_block:N,_tr_tally:function(t,e,n){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(u[n]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},C=function(t,e,a,n){for(var i=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(i=i+e[n++]|0)|0}while(--s);i%=65521,r%=65521}return i|r<<16|0},H=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),M=function(t,e,a,n){var i=H,r=n+a;t^=-1;for(var s=n;s<r;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},j={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,Y=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,it=K.Z_BUF_ERROR,rt=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,ot=K.Z_HUFFMAN_ONLY,lt=K.Z_RLE,ht=K.Z_FIXED,dt=K.Z_DEFAULT_STRATEGY,_t=K.Z_UNKNOWN,ft=K.Z_DEFLATED,ut=258,ct=262,wt=42,mt=113,bt=666,gt=function(t,e){return t.msg=j[e],e},pt=function(t){return 2*t-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},kt=function(t){var e,a,n,i=t.w_size;n=e=t.hash_size;do{a=t.head[--n],t.head[n]=a>=i?a-i:0}while(--e);n=e=i;do{a=t.prev[--n],t.prev[n]=a>=i?a-i:0}while(--e)},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},xt=function(t,e){var a;if(t.legacy_hash)a=t.ins_h=yt(t,t.ins_h,t.window[e+3-1]);else{var n=t.window,i=n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24;a=t.ins_h=Math.imul(i,66521)+66521>>>16&t.hash_mask}var r=t.prev[e&t.w_mask]=t.head[a];return t.head[a]=e,r},zt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},At=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,zt(t.strm)},Et=function(t,e){t.pending_buf[t.pending++]=e},Rt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Zt=function(t,e,a,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),a),1===t.state.wrap?t.adler=C(t.adler,e,i,a):2===t.state.wrap&&(t.adler=M(t.adler,e,i,a)),t.next_in+=i,t.total_in+=i,i)},St=function(t,e){var a,n,i=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ut,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(n=ut-(f-r),r=f-ut,n>s){if(t.match_start=e,s=n,n>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},Ut=function(t){var e,a,n,i=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-ct)&&(t.window.set(t.window.subarray(i,i+i-a),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),kt(t),a+=i),0===t.strm.avail_in)break;if(e=Zt(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=e,t.legacy_hash){if(t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=yt(t,t.ins_h,t.window[n+1]);t.insert&&(xt(t,n),n++,t.insert--,!(t.lookahead+t.insert<3)););}else if(t.lookahead+t.insert>3)for(n=t.strstart-t.insert;t.insert&&(xt(t,n),n++,t.insert--,!(t.lookahead+t.insert<=3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Dt=function(t,e){var a,n,i,r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,o=t.strm.avail_in;do{if(a=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,a>(n=t.strstart-t.block_start)+t.strm.avail_in&&(a=n+t.strm.avail_in),a>i&&(a=i),a<r&&(0===a&&e!==V||e===q||a!==n+t.strm.avail_in))break;s=e===V&&a===n+t.strm.avail_in?1:0,Y(t,0,0,s),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,zt(t.strm),n&&(n>a&&(n=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,a-=n),a&&(Zt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===s);return(o-=t.strm.avail_in)&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==q&&e!==V&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Zt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,r=(i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i)>t.w_size?t.w_size:i,((n=t.strstart-t.block_start)>=r||(n||e===V)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(a=n>i?i:n,s=e===V&&0===t.strm.avail_in&&a===n?1:0,Y(t,t.block_start,a,s),t.block_start+=a,zt(t.strm)),s?3:1)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(Ut(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(a=xt(t,t.strstart)),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=St(t,a)),t.match_length>=3)if(n=X(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,a=xt(t,t.strstart)}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.legacy_hash&&(t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]));else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(At(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(At(t,!1),0===t.strm.avail_out)?1:2},Ot=function(t,e){for(var a,n,i;;){if(t.lookahead<ct){if(Ut(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(a=xt(t,t.strstart)),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=St(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=X(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(a=xt(t,t.strstart))}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(At(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&At(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(At(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(At(t,!1),0===t.strm.avail_out)?1:2};function Ft(t,e,a,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=i}var It=[new Ft(0,0,0,0,Dt),new Ft(4,4,8,4,Tt),new Ft(4,5,16,8,Tt),new Ft(4,6,32,32,Tt),new Ft(4,4,16,16,Ot),new Ft(8,16,32,32,Ot),new Ft(8,16,128,128,Ot),new Ft(8,32,128,256,Ot),new Ft(32,128,258,1024,Ot),new Ft(32,258,258,4096,Ot)];function Lt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ft,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Nt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==wt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==mt&&e.status!==bt?1:0},Bt=function(t){if(Nt(t))return gt(t,at);t.total_in=t.total_out=0,t.data_type=_t;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?wt:mt,t.adler=2===e.wrap?0:1,e.last_flush=-2,P(e),tt},Ct=function(t){var e,a=Bt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=It[e.level].max_lazy,e.good_match=It[e.level].good_length,e.nice_match=It[e.level].nice_length,e.max_chain_length=It[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ht=function(t,e,a,n,i,r,s){if(!t)return at;var o=1;if(e===rt&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||a!==ft||n<8||n>15||e<0||e>9||r<0||r>ht||8===n&&1!==o)return gt(t,at);8===n&&(n=9);var l=new Lt;return t.state=l,l.strm=t,l.status=wt,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=s?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=e,l.strategy=r,l.method=a,Ct(t)},Mt={deflateInit:function(t,e){return Ht(t,e,ft,15,8,dt)},deflateInit2:Ht,deflateReset:Ct,deflateResetKeep:Bt,deflateSetHeader:function(t,e){return Nt(t)||2!==t.state.wrap?at:(t.state.gzhead=e,tt)},deflate:function(t,e){if(Nt(t)||e>$||e<0)return t?gt(t,at):at;var a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===bt&&e!==V)return gt(t,0===t.avail_out?it:at);var n=a.last_flush;if(a.last_flush=e,0!==a.pending){if(zt(t),0===t.avail_out)return a.last_flush=-1,tt}else if(0===t.avail_in&&pt(e)<=pt(n)&&e!==V)return gt(t,it);if(a.status===bt&&0!==t.avail_in)return gt(t,it);if(a.status===wt&&0===a.wrap&&(a.status=mt),a.status===wt){var i=ft+(a.w_bits-8<<4)<<8;if(i|=(a.strategy>=ot||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(i|=32),Rt(a,i+=31-i%31),0!==a.strstart&&(Rt(a,t.adler>>>16),Rt(a,65535&t.adler)),t.adler=1,a.status=mt,zt(t),0!==a.pending)return a.last_flush=-1,tt}if(57===a.status)if(t.adler=0,Et(a,31),Et(a,139),Et(a,8),a.gzhead)Et(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),Et(a,255&a.gzhead.time),Et(a,a.gzhead.time>>8&255),Et(a,a.gzhead.time>>16&255),Et(a,a.gzhead.time>>24&255),Et(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),Et(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(Et(a,255&a.gzhead.extra.length),Et(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=M(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(Et(a,0),Et(a,0),Et(a,0),Et(a,0),Et(a,0),Et(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),Et(a,3),a.status=mt,zt(t),0!==a.pending)return a.last_flush=-1,tt;if(69===a.status){if(a.gzhead.extra){for(var r=a.pending,s=(65535&a.gzhead.extra.length)-a.gzindex;a.pending+s>a.pending_buf_size;){var o=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+o),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>r&&(t.adler=M(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex+=o,zt(t),0!==a.pending)return a.last_flush=-1,tt;r=0,s-=o}var l=new Uint8Array(a.gzhead.extra);a.pending_buf.set(l.subarray(a.gzindex,a.gzindex+s),a.pending),a.pending+=s,a.gzhead.hcrc&&a.pending>r&&(t.adler=M(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){var h,d=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>d&&(t.adler=M(t.adler,a.pending_buf,a.pending-d,d)),zt(t),0!==a.pending)return a.last_flush=-1,tt;d=0}h=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,Et(a,h)}while(0!==h);a.gzhead.hcrc&&a.pending>d&&(t.adler=M(t.adler,a.pending_buf,a.pending-d,d)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){var _,f=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>f&&(t.adler=M(t.adler,a.pending_buf,a.pending-f,f)),zt(t),0!==a.pending)return a.last_flush=-1,tt;f=0}_=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,Et(a,_)}while(0!==_);a.gzhead.hcrc&&a.pending>f&&(t.adler=M(t.adler,a.pending_buf,a.pending-f,f))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(zt(t),0!==a.pending))return a.last_flush=-1,tt;Et(a,255&t.adler),Et(a,t.adler>>8&255),t.adler=0}if(a.status=mt,zt(t),0!==a.pending)return a.last_flush=-1,tt}if(0!==t.avail_in||0!==a.lookahead||e!==q&&a.status!==bt){var u=0===a.level?Dt(a,e):a.strategy===ot?function(t,e){for(var a;;){if(0===t.lookahead&&(Ut(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(At(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(At(t,!1),0===t.strm.avail_out)?1:2}(a,e):a.strategy===lt?function(t,e){for(var a,n,i,r,s=t.window;;){if(t.lookahead<=ut){if(Ut(t),t.lookahead<=ut&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){r=t.strstart+ut;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<r);t.match_length=ut-(r-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(At(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(At(t,!1),0===t.strm.avail_out)?1:2}(a,e):It[a.level].func(a,e);if(3!==u&&4!==u||(a.status=bt),1===u||3===u)return 0===t.avail_out&&(a.last_flush=-1),tt;if(2===u&&(e===J?W(a):e!==$&&(Y(a,0,0,!1),e===Q&&(vt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),zt(t),0===t.avail_out))return a.last_flush=-1,tt}return e!==V?tt:a.wrap<=0?et:(2===a.wrap?(Et(a,255&t.adler),Et(a,t.adler>>8&255),Et(a,t.adler>>16&255),Et(a,t.adler>>24&255),Et(a,255&t.total_in),Et(a,t.total_in>>8&255),Et(a,t.total_in>>16&255),Et(a,t.total_in>>24&255)):(Rt(a,t.adler>>>16),Rt(a,65535&t.adler)),zt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?tt:et)},deflateEnd:function(t){if(Nt(t))return at;var e=t.state.status;return t.state=null,e===mt?gt(t,nt):tt},deflateSetDictionary:function(t,e){var a=e.length;if(Nt(t))return at;var n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==wt||n.lookahead)return at;if(1===i&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===i&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var r=new Uint8Array(n.w_size);r.set(e.subarray(a-n.w_size,a),0),e=r,a=n.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Ut(n);n.lookahead>=3;){var h=n.strstart,d=n.lookahead-2;do{xt(n,h),h++}while(--d);n.strstart=h,n.lookahead=2,Ut(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,n.wrap=i,tt},deflateInfo:"pako deflate (from Nodeca project)"};function jt(t){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}var Kt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Pt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==jt(a))throw new TypeError(a+"must be non-object");for(var n in a)Kt(a,n)&&(t[n]=a[n])}}return t},Yt=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var i=new Uint8Array(e),r=0,s=0,o=t.length;r<o;r++){var l=t[r];i.set(l,s),s+=l.length}return i},Gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Gt=!1}for(var Xt=new Uint8Array(256),Wt=0;Wt<256;Wt++)Xt[Wt]=Wt>=252?6:Wt>=248?5:Wt>=240?4:Wt>=224?3:Wt>=192?2:1;Xt[254]=Xt[255]=1;var qt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,i,r,s=t.length,o=0;for(i=0;i<s;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),r=0,i=0;r<o;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),a<128?e[r++]=a:a<2048?(e[r++]=192|a>>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},Jt=function(t,e){var a,n,i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var r=new Array(2*i);for(n=0,a=0;a<i;){var s=t[a++];if(s<128)r[n++]=s;else{var o=Xt[s];if(o>4)r[n++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a<i;)s=s<<6|63&t[a++],o--;o>1?r[n++]=65533:s<65536?r[n++]=s:(s-=65536,r[n++]=55296|s>>10&1023,r[n++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Gt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",n=0;n<e;n++)a+=String.fromCharCode(t[n]);return a}(r,n)},Qt=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Xt[t[a]]>e?a:e};var Vt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$t=Object.prototype.toString,te=K.Z_NO_FLUSH,ee=K.Z_SYNC_FLUSH,ae=K.Z_FULL_FLUSH,ne=K.Z_FINISH,ie=K.Z_OK,re=K.Z_STREAM_END,se={level:K.Z_DEFAULT_COMPRESSION,method:K.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:K.Z_DEFAULT_STRATEGY,legacyHash:!0};function oe(t){this.options=Pt({},se,t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vt,this.strm.avail_out=0;var a=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash);if(a!==ie)throw new Error(j[a]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?qt(e.dictionary):"[object ArrayBuffer]"===$t.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Mt.deflateSetDictionary(this.strm,n))!==ie)throw new Error(j[a]);this._dict_set=!0}}function le(t,e){var a=new oe(e);if(a.push(t,!0),a.err)throw a.msg||j[a.err];return a.result}oe.prototype.push=function(t,e){var a,n,i=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ne:te,"string"==typeof t?i.input=qt(t):"[object ArrayBuffer]"===$t.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===ee||n===ae)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if((a=Mt.deflate(i,n))===re)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),a=Mt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ie;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},oe.prototype.onData=function(t){this.chunks.push(t)},oe.prototype.onEnd=function(t){t===ie&&(this.result=Yt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var he={Deflate:oe,deflate:le,deflateRaw:function(t,e){return(e=e||{}).raw=!0,le(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,le(t,e)},constants:K},de=16209,_e=function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,n=a+(t.avail_in-5),i=t.next_out,A=t.output,r=i-(e-t.avail_out),s=i+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=c[f&m];e:for(;;){if(f>>>=p=g>>>24,u-=p,0===(p=g>>>16&255))A[i++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=c[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=de;break t}v=65535&g,(p&=15)&&(u<p&&(f+=z[a++]<<u,u+=8),v+=f&(1<<p)-1,f>>>=p,u-=p),u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=w[f&b];a:for(;;){if(f>>>=p=g>>>24,u-=p,!(16&(p=g>>>16&255))){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=de;break t}if(k=65535&g,u<(p&=15)&&(f+=z[a++]<<u,(u+=8)<p&&(f+=z[a++]<<u,u+=8)),(k+=f&(1<<p)-1)>o){t.msg="invalid distance too far back",E.mode=de;break t}if(f>>>=p,u-=p,k>(p=i-r)){if((p=k-p)>h&&E.sane){t.msg="invalid distance too far back",E.mode=de;break t}if(y=0,x=_,0===d){if(y+=l-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}else if(d<p){if(y+=l+d-p,(p-=d)<v){v-=p;do{A[i++]=_[y++]}while(--p);if(y=0,d<v){v-=p=d;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}}else if(y+=d-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}for(;v>2;)A[i++]=x[y++],A[i++]=x[y++],A[i++]=x[y++],v-=3;v&&(A[i++]=x[y++],v>1&&(A[i++]=x[y++]))}else{y=i-k;do{A[i++]=A[y++],A[i++]=A[y++],A[i++]=A[y++],v-=3}while(v>2);v&&(A[i++]=A[y++],v>1&&(A[i++]=A[y++]))}break}}break}}while(a<n&&i<s);a-=v=u>>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=i,t.avail_in=a<n?n-a+5:5-(a-n),t.avail_out=i<s?s-i+257:257-(i-s),E.hold=f,E.bits=u},fe=15,ue=new Uint16Array([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,0,0]),ce=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),we=new Uint16Array([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,0,0]),me=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),be=function(t,e,a,n,i,r,s,o){var l,h,d,_,f,u,c,w,m,b=o.bits,g=0,p=0,v=0,k=0,y=0,x=0,z=0,A=0,E=0,R=0,Z=null,S=new Uint16Array(16),U=new Uint16Array(16),D=null;for(g=0;g<=fe;g++)S[g]=0;for(p=0;p<n;p++)S[e[a+p]]++;for(y=b,k=fe;k>=1&&0===S[k];k--);if(y>k&&(y=k),0===k)return i[r++]=20971520,i[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===S[v];v++);for(y<v&&(y=v),A=1,g=1;g<=fe;g++)if(A<<=1,(A-=S[g])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(U[1]=0,g=1;g<fe;g++)U[g+1]=U[g]+S[g];for(p=0;p<n;p++)0!==e[a+p]&&(s[U[e[a+p]]++]=p);if(0===t?(Z=D=s,u=20):1===t?(Z=ue,D=ce,u=257):(Z=we,D=me,u=0),R=0,p=0,g=v,f=r,x=y,z=0,d=-1,_=(E=1<<y)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){c=g-z,s[p]+1<u?(w=0,m=s[p]):s[p]>=u?(w=D[s[p]-u],m=Z[s[p]-u]):(w=96,m=0),l=1<<g-z,v=h=1<<x;do{i[f+(R>>z)+(h-=l)]=c<<24|w<<16|m|0}while(0!==h);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,p++,0==--S[g]){if(g===k)break;g=e[a+s[p]]}if(g>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=g-z);x+z<k&&!((A-=S[x+z])<=0);)x++,A<<=1;if(E+=1<<x,1===t&&E>852||2===t&&E>592)return 1;i[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(i[f+R]=g-z<<24|64<<16|0),o.bits=y,0},ge=K.Z_FINISH,pe=K.Z_BLOCK,ve=K.Z_TREES,ke=K.Z_OK,ye=K.Z_STREAM_END,xe=K.Z_NEED_DICT,ze=K.Z_STREAM_ERROR,Ae=K.Z_DATA_ERROR,Ee=K.Z_MEM_ERROR,Re=K.Z_BUF_ERROR,Ze=K.Z_DEFLATED,Se=16180,Ue=16190,De=16191,Te=16192,Oe=16194,Fe=16199,Ie=16200,Le=16206,Ne=16209,Be=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Ce(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var He,Me,je=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.mode<Se||e.mode>16211?1:0},Ke=function(t){if(je(t))return ze;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Se,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ke},Pe=function(t){if(je(t))return ze;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ke(t)},Ye=function(t,e){var a;if(je(t))return ze;var n=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ze:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=a,n.wbits=e,Pe(t))},Ge=function(t,e){if(!t)return ze;var a=new Ce;t.state=a,a.strm=t,a.window=null,a.mode=Se;var n=Ye(t,e);return n!==ke&&(t.state=null),n},Xe=!0,We=function(t){if(Xe){He=new Int32Array(512),Me=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(be(1,t.lens,0,288,He,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;be(2,t.lens,0,32,Me,0,t.work,{bits:5}),Xe=!1}t.lencode=He,t.lenbits=9,t.distcode=Me,t.distbits=5},qe=function(t,e,a,n){var i,r=t.state;return null===r.window&&(r.window=new Uint8Array(1<<r.wbits)),0===r.wsize&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0),n>=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((i=r.wsize-r.wnext)>n&&(i=n),r.window.set(e.subarray(a-n,a-n+i),r.wnext),(n-=i)?(r.window.set(e.subarray(a-n,a),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},Je={inflateReset:Pe,inflateReset2:Ye,inflateResetKeep:Ke,inflateInit:function(t){return Ge(t,15)},inflateInit2:Ge,inflate:function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=0,R=new Uint8Array(4),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(je(t)||!t.output||!t.input&&0!==t.avail_in)return ze;(a=t.state).mode===De&&(a.mode=Te),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=ke;t:for(;;)switch(a.mode){case Se:if(0===a.wrap){a.mode=Te;break}for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Ne;break}if((15&h)!==Ze){t.msg="unknown compression method",a.mode=Ne;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Ne;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:De,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==Ze){t.msg="unknown compression method",a.mode=Ne;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Ne;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=M(a.check,R,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=M(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(n.subarray(r,r+u),y)),512&a.flags&&4&a.wrap&&(a.check=M(a.check,n,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=M(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=M(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Ne;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=De;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}t.adler=a.check=Be(h),h=0,d=0,a.mode=Ue;case Ue:if(0===a.havedict)return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,xe;t.adler=a.check=1,a.mode=De;case De:if(e===pe||e===ve)break t;case Te:if(a.last){h>>>=7&d,d-=7&d,a.mode=Le;break}for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=16193;break;case 1:if(We(a),a.mode=Fe,e===ve){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Ne}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Ne;break}if(a.length=65535&h,h=0,d=0,a.mode=Oe,e===ve)break t;case Oe:a.mode=16195;case 16195:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;i.set(n.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=De;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Ne;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=be(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Ne;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(A=m+2;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Ne;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(A=m+3;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=3+(7&(h>>>=m)),h>>>=3,d-=3}else{for(A=m+7;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=11+(127&(h>>>=m)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Ne;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Ne)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Ne;break}if(a.lenbits=9,z={bits:a.lenbits},x=be(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Ne;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=be(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Ne;break}if(a.mode=Fe,e===ve)break t;case Fe:a.mode=Ie;case Ie:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,_e(t,f),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===De&&(a.back=-1);break}for(a.back=0;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,v=b,k=g;b=(E=a.lencode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=De;break}if(64&b){t.msg="invalid literal/length code",a.mode=Ne;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;b=(E=a.distcode[h&(1<<a.distbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(0==(240&b)){for(p=m,v=b,k=g;b=(E=a.distcode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Ne;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Ne;break}a.mode=16204;case 16204:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Ne;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=i,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{i[s++]=w[c++]}while(--u);0===a.length&&(a.mode=Ie);break;case 16205:if(0===l)break t;i[s++]=a.length,l--,a.mode=Ie;break;case Le:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=n[r++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?M(a.check,i,f,s-f):C(a.check,i,f,s-f)),f=l,4&a.wrap&&(a.flags?h:Be(h))!==a.check){t.msg="incorrect data check",a.mode=Ne;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Ne;break}h=0,d=0}a.mode=16208;case 16208:x=ye;break t;case Ne:x=Ae;break t;case 16210:return Ee;default:return ze}return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Ne&&(a.mode<Le||e!==ge))&&qe(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?M(a.check,i,f,t.next_out-f):C(a.check,i,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===De?128:0)+(a.mode===Fe||a.mode===Oe?256:0),(0===_&&0===f||e===ge)&&x===ke&&(x=Re),x},inflateEnd:function(t){if(je(t))return ze;var e=t.state;return e.window&&(e.window=null),t.state=null,ke},inflateGetHeader:function(t,e){if(je(t))return ze;var a=t.state;return 0==(2&a.wrap)?ze:(a.head=e,e.done=!1,ke)},inflateSetDictionary:function(t,e){var a,n=e.length;return je(t)||0!==(a=t.state).wrap&&a.mode!==Ue?ze:a.mode===Ue&&C(1,e,n,0)!==a.check?Ae:qe(t,e,n,n)?(a.mode=16210,Ee):(a.havedict=1,ke)},inflateInfo:"pako inflate (from Nodeca project)"};var Qe=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Ve=Object.prototype.toString,$e=K.Z_NO_FLUSH,ta=K.Z_FINISH,ea=K.Z_OK,aa=K.Z_STREAM_END,na=K.Z_NEED_DICT,ia=K.Z_STREAM_ERROR,ra=K.Z_DATA_ERROR,sa=K.Z_MEM_ERROR,oa=K.Z_BUF_ERROR,la={chunkSize:65536,windowBits:15,to:""};function ha(t){this.options=Pt({},la,t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vt,this.strm.avail_out=0;var a=Je.inflateInit2(this.strm,e.windowBits);if(a!==ea)throw new Error(j[a]);if(this.header=new Qe,Je.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=qt(e.dictionary):"[object ArrayBuffer]"===Ve.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Je.inflateSetDictionary(this.strm,e.dictionary))!==ea))throw new Error(j[a])}function da(t,e){var a=new ha(e);if(a.push(t,!0),a.err)throw a.msg||j[a.err];return a.result}ha.prototype.push=function(t,e){var a,n,i,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ta:$e,"[object ArrayBuffer]"===Ve.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Je.inflate(r,n))===na&&o&&((a=Je.inflateSetDictionary(r,o))===ea?a=Je.inflate(r,n):a===ra&&(a=na));r.avail_in>0&&a===aa&&2&r.state.wrap&&0!==r.state.flags&&0!==r.input[r.next_in];)Je.inflateReset(r),a=Je.inflate(r,n);switch(a){case ia:case ra:case na:case sa:return this.onEnd(a),this.ended=!0,!1}if(i=r.avail_out,r.next_out&&(0===r.avail_out||a===aa||n>0))if("string"===this.options.to){var l=Qt(r.output,r.next_out),h=r.next_out-l,d=Jt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out)),r.avail_out=0,r.next_out=0;if(a!==ea&&a!==oa||0!==i){if(a===aa)return a=Je.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in){if(n===ta)return a=Je.inflateEnd(this.strm),this.onEnd(a===ea?oa:a),this.ended=!0,!1;break}}}return!0},ha.prototype.onData=function(t){this.chunks.push(t)},ha.prototype.onEnd=function(t){t===ea&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Yt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var _a={Inflate:ha,inflate:da,inflateRaw:function(t,e){return(e=e||{}).raw=!0,da(t,e)},ungzip:da,constants:K},fa=he.Deflate,ua=he.deflate,ca=he.deflateRaw,wa=he.gzip,ma=_a.Inflate,ba=_a.inflate,ga=_a.inflateRaw,pa=_a.ungzip,va=K,ka={Deflate:fa,deflate:ua,deflateRaw:ca,gzip:wa,Inflate:ma,inflate:ba,inflateRaw:ga,ungzip:pa,constants:va};t.Deflate=fa,t.Inflate=ma,t.constants=va,t.default=ka,t.deflate=ua,t.deflateRaw=ca,t.gzip=wa,t.inflate=ba,t.inflateRaw=ga,t.ungzip=pa,Object.defineProperty(t,"__esModule",{value:!0})}));
var rough=function(){"use strict";function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&"number"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;e<t.length-1;e++){const s=t[e],n=t[e+1];if(s[1]!==n[1]){const t=Math.min(s[1],n[1]);h.push({ymin:t,ymax:Math.max(s[1],n[1]),x:t===s[1]?s[0]:n[0],islope:(n[0]-s[0])/(n[1]-s[1])})}}if(h.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;e<h.length&&!(h[e].ymin>i);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t<r.length;t+=2){const e=t+1;if(e>=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t<c;t++){const a=p+l+t*n,r=u-h+2*Math.random()*h,i=a-h+2*Math.random()*h,c=this.helper.ellipse(r,i,o,o,e);s.push(...c.ops)}}return{type:"fillSketch",ops:s}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.dashedLine(s,e)}}dashedLine(t,e){const s=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach((t=>{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t<r;t++){const a=t*(s+n),h=a+s,r=[c[0]+a*Math.cos(u)+i*Math.cos(u),c[1]+a*Math.sin(u)+i*Math.sin(u)],l=[c[0]+h*Math.cos(u)+i*Math.cos(u),c[1]+h*Math.sin(u)+i*Math.sin(u)];o.push(...this.helper.doubleLineOps(r[0],r[1],l[0],l[1],e))}})),o}}class l{constructor(t){this.helper=t}fillPolygons(t,e){const s=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,o=e.zigzagOffset<0?s:e.zigzagOffset,a=n(t,e=Object.assign({},e,{hachureGap:s+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,e)}}zigzagLines(t,e,s){const n=[];return t.forEach((t=>{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;t<h;t++){const o=2*t*e,a=2*(t+1)*e,h=Math.sqrt(2*Math.pow(e,2)),i=[r[0]+o*Math.cos(c),r[1]+o*Math.sin(c)],l=[r[0]+a*Math.cos(c),r[1]+a*Math.sin(c)],u=[i[0]+h*Math.cos(c+Math.PI/4),i[1]+h*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(i[0],i[1],u[0],u[1],s),...this.helper.doubleLineOps(u[0],u[1],l[0],l[1],s))}})),n}}const u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const f=0,d=1,g=2,M={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:2,t:2,V:1,v:1,Z:0,z:0};function k(t,e){return t.type===e}function b(t){const e=[],s=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:f,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:d,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:g,text:""},e}(t);let n="BOD",o=0,a=s[o];for(;!k(a,g);){let h=0;const r=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return b("M0,0"+t);o++,h=M[a.text],n=a.text}else k(a,d)?h=M[n]:(o++,h=M[a.text],n=a.text);if(!(o+h<s.length))throw new Error("Path data ended short");for(let t=o;t<o+h;t++){const e=s[t];if(!k(e,d))throw new Error("Param not a number: "+n+","+e.text);r[r.length]=+e.text}if("number"!=typeof M[n])throw new Error("Bad segment: "+n);{const t={key:n,data:r};e.push(t),o+=h,a=s[o],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function y(t){let e=0,s=0,n=0,o=0;const a=[];for(const{key:h,data:r}of t)switch(h){case"M":a.push({key:"M",data:[...r]}),[e,s]=r,[n,o]=r;break;case"m":e+=r[0],s+=r[1],a.push({key:"M",data:[e,s]}),n=e,o=s;break;case"L":a.push({key:"L",data:[...r]}),[e,s]=r;break;case"l":e+=r[0],s+=r[1],a.push({key:"L",data:[e,s]});break;case"C":a.push({key:"C",data:[...r]}),e=r[4],s=r[5];break;case"c":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"C",data:t}),e=t[4],s=t[5];break}case"Q":a.push({key:"Q",data:[...r]}),e=r[2],s=r[3];break;case"q":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"Q",data:t}),e=t[2],s=t[3];break}case"A":a.push({key:"A",data:[...r]}),e=r[5],s=r[6];break;case"a":e+=r[5],s+=r[6],a.push({key:"A",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case"H":a.push({key:"H",data:[...r]}),e=r[0];break;case"h":e+=r[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...r]}),s=r[0];break;case"v":s+=r[0],a.push({key:"V",data:[s]});break;case"S":a.push({key:"S",data:[...r]}),e=r[2],s=r[3];break;case"s":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"S",data:t}),e=t[2],s=t[3];break}case"T":a.push({key:"T",data:[...r]}),e=r[0],s=r[1];break;case"t":e+=r[0],s+=r[1],a.push({key:"T",data:[e,s]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s="",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case"M":e.push({key:"M",data:[...l]}),[n,o]=l,[a,h]=l;break;case"C":e.push({key:"C",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case"L":e.push({key:"L",data:[...l]}),[n,o]=l;break;case"H":n=l[0],e.push({key:"L",data:[n,o]});break;case"V":o=l[0],e.push({key:"L",data:[n,o]});break;case"S":{let t=0,a=0;"C"===s||"S"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:"C",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case"T":{const[t,a]=l;let h=0,c=0;"Q"===s||"T"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:"C",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case"Q":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:"C",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case"A":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:"C",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:"C",data:t})})),n=i,o=c}break}case"Z":e.push({key:"Z",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),t<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e<p.length;e+=3){const s=w(p[e][0],p[e][1],l),n=w(p[e+1][0],p[e+1][1],l),o=w(p[e+2][0],p[e+2][1],l);t.push([s[0],s[1],n[0],n[1],o[0],o[1]])}return t}}const P={randOffset:function(t,e){return G(t,e)},randOffsetWithRange:function(t,e,s){return E(t,e,s)},ellipse:function(t,e,s,n,o){const a=T(s,n,o);return D(t,e,o,a).opset},doubleLineOps:function(t,e,s,n,o){return $(t,e,s,n,o,!0)}};function v(t,e,s,n,o){return{type:"path",ops:$(t,e,s,n,o)}}function S(t,e,s){const n=(t||[]).length;if(n>2){const o=[];for(let e=0;e<n-1;e++)o.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&o.push(...$(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:o}}return 2===n?v(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function O(t,e,s,n,o){return function(t,e){return S(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],o)}function L(t,e){if(t.length){const s="number"==typeof t[0][0]?[t]:t,n=j(s[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:j(s[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<s.length;t++){const a=s[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),s=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of s)"move"!==t.op&&o.push(t)}}return{type:"path",ops:n.concat(o)}}return{type:"path",ops:[]}}function T(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/o;let h=Math.abs(t/2),r=Math.abs(e/2);const i=1-s.curveFitting;return h+=G(h*i,s),r+=G(r*i,s),{increment:a,rx:h,ry:r}}function D(t,e,s,n){const[o,a]=F(n.increment,t,e,n.rx,n.ry,1,n.increment*E(.1,E(.4,1,s),s),s);let h=q(o,null,s);if(!s.disableMultiStroke&&0!==s.roughness){const[o]=F(n.increment,t,e,n.rx,n.ry,1.5,0,s),a=q(o,null,s);h=h.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:h}}}function A(t,e,s,n,o,a,h,r,i){const c=t,l=e;let u=Math.abs(s/2),p=Math.abs(n/2);u+=G(.01*u,i),p+=G(.01*p,i);let f=o,d=a;for(;f<0;)f+=2*Math.PI,d+=2*Math.PI;d-f>2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:"path",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case"M":a=[h[0],h[1]],o=[h[0],h[1]];break;case"L":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case"C":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case"Z":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:"move",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a<o;a++)s.push({op:"lineTo",data:[n[a][0]+G(t,e),n[a][1]+G(t,e)]})}}return{type:"fillPath",ops:s}}function C(t,e){return function(t,e){let s=t.fillStyle||"hachure";if(!u[s])switch(s){case"zigzag":u[s]||(u[s]=new h(e));break;case"cross-hatch":u[s]||(u[s]=new r(e));break;case"dots":u[s]||(u[s]=new i(e));break;case"dashed":u[s]||(u[s]=new c(e));break;case"zigzag-line":u[s]||(u[s]=new l(e));break;default:s="hachure",u[s]||(u[s]=new o(e))}return u[s]}(e,P).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function W(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function E(t,e,s,n=1){return s.roughness*n*(W(s)*(e-t)+t)}function G(t,e,s=1){return E(-t,t,e,s)}function $(t,e,s,n,o,a=!1){const h=a?o.disableMultiStrokeFill:o.disableMultiStroke,r=R(t,e,s,n,o,!0,!1);if(h)return r;const i=R(t,e,s,n,o,!0,!0);return r.concat(i)}function R(t,e,s,n,o,a,h){const r=Math.pow(t-s,2)+Math.pow(e-n,2),i=Math.sqrt(r);let c=1;c=i<200?1:i>500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:"move",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:"move",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:"bcurveTo",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:"bcurveTo",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o<t.length;o++)n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]),o===t.length-1&&n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]);return q(n,null,s)}function q(t,e,s){const n=t.length,o=[];if(n>3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];a[0]=[s[0],s[1]],a[1]=[s[0]+(h*t[e+1][0]-h*t[e-1][0])/6,s[1]+(h*t[e+1][1]-h*t[e-1][1])/6],a[2]=[t[e+1][0]+(h*t[e][0]-h*t[e+2][0])/6,t[e+1][1]+(h*t[e][1]-h*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+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]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+G(t,s),e[1]+G(t,s)]})}}else 3===n?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&o.push(...R(t[0][0],t[0][1],t[1][0],t[1][1],s,!0,!0));return o}function F(t,e,s,n,o,a,h,r){const i=[],c=[];if(0===r.roughness){t/=4,c.push([e+n*Math.cos(-t),s+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),s+o*Math.sin(a)];i.push(t),c.push(t)}c.push([e+n*Math.cos(0),s+o*Math.sin(0)]),c.push([e+n*Math.cos(t),s+o*Math.sin(t)])}else{const l=G(.5,r)-Math.PI/2;c.push([G(a,r)+e+.9*n*Math.cos(l-t),G(a,r)+s+.9*o*Math.sin(l-t)]);const u=2*Math.PI+l-.01;for(let h=l;h<u;h+=t){const t=[G(a,r)+e+n*Math.cos(h),G(a,r)+s+o*Math.sin(h)];i.push(t),c.push(t)}c.push([G(a,r)+e+n*Math.cos(l+2*Math.PI+.5*h),G(a,r)+s+o*Math.sin(l+2*Math.PI+.5*h)]),c.push([G(a,r)+e+.98*n*Math.cos(l+h),G(a,r)+s+.98*o*Math.sin(l+h)]),c.push([G(a,r)+e+.9*n*Math.cos(l+.5*h),G(a,r)+s+.9*o*Math.sin(l+.5*h)])}return[c,i]}function V(t,e,s,n,o,a,h,r,i){const c=a+G(.1,i),l=[];l.push([G(r,i)+e+.9*n*Math.cos(c-t),G(r,i)+s+.9*o*Math.sin(c-t)]);for(let a=c;a<=h;a+=t)l.push([G(r,i)+e+n*Math.cos(a),G(r,i)+s+o*Math.sin(a)]);return l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),q(l,null,i)}function Z(t,e,s,n,o,a,h,r){const i=[],c=[r.maxRandomnessOffset||1,(r.maxRandomnessOffset||1)+.3];let l=[0,0];const u=r.disableMultiStroke?1:2,p=r.preserveVertices;for(let f=0;f<u;f++)0===f?i.push({op:"move",data:[h[0],h[1]]}):i.push({op:"move",data:[h[0]+(p?0:G(c[0],r)),h[1]+(p?0:G(c[0],r))]}),l=p?[o,a]:[o+G(c[f],r),a+G(c[f],r)],i.push({op:"bcurveTo",data:[t+G(c[f],r),e+G(c[f],r),s+G(c[f],r),n+G(c[f],r),l[0],l[1]]});return i}function Q(t){return[...t]}function H(t,e=0){const s=t.length;if(s<3)throw new Error("A curve must have at least three points.");const n=[];if(3===s)n.push(Q(t[0]),Q(t[1]),Q(t[2]),Q(t[2]));else{const s=[];s.push(t[0],t[0]);for(let e=1;e<t.length;e++)s.push(t[e]),e===t.length-1&&s.push(t[e]);const o=[],a=1-e;n.push(Q(s[0]));for(let t=1;t+2<s.length;t++){const e=s[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*s[t+1][0]-a*s[t-1][0])/6,e[1]+(a*s[t+1][1]-a*s[t-1][1])/6],o[2]=[s[t+1][0]+(a*s[t][0]-a*s[t+2][0])/6,s[t+1][1]+(a*s[t][1]-a*s[t+2][1])/6],o[3]=[s[t+1][0],s[t+1][1]],n.push(o[1],o[2],o[3])}}return n}function N(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function B(t,e,s){const n=N(e,s);if(0===n)return N(t,e);let o=((t[0]-e[0])*(s[0]-e[0])+(t[1]-e[1])*(s[1]-e[1]))/n;return o=Math.max(0,Math.min(1,o)),N(t,J(e,s,o))}function J(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function K(t,e,s,n){const o=n||[];if(function(t,e){const s=t[e+0],n=t[e+1],o=t[e+2],a=t[e+3];let h=3*n[0]-2*s[0]-a[0];h*=h;let r=3*n[1]-2*s[1]-a[1];r*=r;let i=3*o[0]-2*a[0]-s[0];i*=i;let c=3*o[1]-2*a[1]-s[1];return c*=c,h<i&&(h=i),r<c&&(r=c),h+r}(t,e)<s){const s=t[e+0];if(o.length){(a=o[o.length-1],h=s,Math.sqrt(N(a,h)))>1&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;n<s-1;++n){const e=B(t[n],h,r);e>i&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s<o;s++){K(t,3*s,e,n)}return s&&s>0?X(n,0,n.length,s):n}const tt="none";class et{constructor(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,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d("line",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];"solid"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d("rectangle",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if("solid"===a.fillStyle){const s=D(t,e,a,r).opset;s.type="fillPath",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d("ellipse",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape="circle",o}linearPath(t,e){const s=this._o(e);return this._d("linearPath",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if("solid"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type="fillPath",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d("arc",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if("solid"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t="number"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d("curve",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&("solid"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d("polygon",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d("path",n,s);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=s.fill&&"transparent"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case"M":c(),h=[e[0],e[1]],a.push(h);break;case"L":i(),a.push([e[0],e[1]]);break;case"C":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case"Z":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if("solid"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d("path",n,s)}opsToPath(t,e){let s="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":s+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case"fillPath":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case"fillSketch":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===s.stroke?"transparent":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=s.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,o,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||"",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt="http://www.w3.org/2000/svg";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case"path":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke",s.stroke),e.setAttribute("stroke-width",s.strokeWidth+""),e.setAttribute("fill","none"),s.strokeLineDash&&e.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",s.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,"path");return o.setAttribute("d",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute("stroke",s.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),s.fillLineDash&&o.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}return{canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()}}();
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d=0;for(null!=b&&b||(a=Base64._utf8_encode(a));d<a.length;){var e=a.charCodeAt(d++);b=a.charCodeAt(d++);var f=a.charCodeAt(d++);var g=e>>2;e=(e&3)<<4|b>>4;var h=(b&15)<<2|f>>6;var k=f&63;isNaN(b)?h=k=64:isNaN(f)&&(k=64);c=c+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(h)+this._keyStr.charAt(k)}return c},decode:function(a,b){b=null!=b?b:!1;var c="",d=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,
"");d<a.length;){var e=this._keyStr.indexOf(a.charAt(d++));var f=this._keyStr.indexOf(a.charAt(d++));var g=this._keyStr.indexOf(a.charAt(d++));var h=this._keyStr.indexOf(a.charAt(d++));e=e<<2|f>>4;f=(f&15)<<4|g>>2;var k=(g&3)<<6|h;c+=String.fromCharCode(e);64!=g&&(c+=String.fromCharCode(f));64!=h&&(c+=String.fromCharCode(k))}b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(55296<=d&&56319>=d){var e=
a.charCodeAt(c+1);56320<=e&&57343>=e&&(d=((d&1023)<<10)+(e&1023)+65536,c++)}128>d?b+=String.fromCharCode(d):(2048>d?b+=String.fromCharCode(d>>6|192):(65536>d?b+=String.fromCharCode(d>>12|224):(b+=String.fromCharCode(d>>18|240),b+=String.fromCharCode(d>>12&63|128)),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0;for(c1=c2=0;c<a.length;){var d=a.charCodeAt(c);if(128>d)b+=String.fromCharCode(d),c++;else if(191<d&&224>d)c2=a.charCodeAt(c+
1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2;else if(240>d)c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3;else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);var e=a.charCodeAt(c+3);d=(d&7)<<18|(c2&63)<<12|(c3&63)<<6|e&63;b+=1114111>=d?String.fromCodePoint(d):"�";c+=4}}return b}};window.urlParams=window.urlParams||{};if(null==window.mxIsElectron||"1"==urlParams.embed)window.mxIsElectron=!1;window.isLocalStorage=window.isLocalStorage||!1;window.isSvgBrowser=!0;window.isMermaidEnabled="function"===typeof structuredClone;window.DRAWIO_BASE_URL=window.DRAWIO_BASE_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.location.protocol+"//"+window.location.hostname:"https://app.diagrams.net");
window.DRAWIO_SERVER_URL=window.DRAWIO_SERVER_URL||window.location.origin+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/";window.DRAWIO_LIGHTBOX_URL=window.DRAWIO_LIGHTBOX_URL||"https://viewer.diagrams.net";window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"https://convert.diagrams.net/node/export":window.EXPORT_URL;window.DRAW_MATH_URL=window.DRAW_MATH_URL||"math4/es5";window.REALTIME_URL=window.REALTIME_URL||window.DRAWIO_SERVER_URL+"cache";
window.DRAWIO_GITLAB_URL=window.DRAWIO_GITLAB_URL||"https://gitlab.com";window.DRAWIO_GITLAB_ID=window.DRAWIO_GITLAB_ID||"2b14debc5feeb18ba65358d863ec870e4cc9294b28c3c941cb3014eb4af9a9b4";window.DRAWIO_GITHUB_URL=window.DRAWIO_GITHUB_URL||"https://github.com";window.DRAWIO_GITHUB_API_URL=window.DRAWIO_GITHUB_API_URL||"https://api.github.com";window.DRAWIO_GITHUB_ID=window.DRAWIO_GITHUB_ID||"Iv1.98d62f0431e40543";window.SAVE_URL=window.SAVE_URL||window.DRAWIO_SERVER_URL+"save";
window.PROXY_URL=window.PROXY_URL||window.DRAWIO_SERVER_URL+"proxy";window.DRAWIO_VIEWER_URL=window.DRAWIO_VIEWER_URL||null;window.NOTIFICATIONS_URL=window.NOTIFICATIONS_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.DRAWIO_SERVER_URL+"notifications":null);window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt";
window.GENERATE_URL=window.GENERATE_URL||(/^(www|ac|aj)\.draw\.io$/.test(window.location.hostname)||"app.diagrams.net"==window.location.hostname?window.location.origin:"https://www.draw.io")+"/generate/v3";window.DRAWIO_ATLASSIAN_PROMPT_LENGTH=null!=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH?window.DRAWIO_ATLASSIAN_PROMPT_LENGTH:1E5;window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";
window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"iconSearch2":window.DRAWIO_SERVER_URL+"iconSearch2");window.ICON_SERVICE_PATH=window.ICON_SERVICE_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"api/icons":window.DRAWIO_SERVER_URL+"api/icons");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.NEW_DIAGRAM_CATS_PATH=window.NEW_DIAGRAM_CATS_PATH||"newDiagramCats";window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";
window.ALLOW_CUSTOM_PLUGINS=window.ALLOW_CUSTOM_PLUGINS||!1;window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1;
window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null);if(!a&&window.mxIsElectron&&(a=urlParams.appLang,null!=a)){var c=a.indexOf("-");0<=c&&(a=a.substring(0,c));a=a.toLowerCase()}}catch(d){isLocalStorage=!1}return a}();
window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",eu:"Euskara",fil:"Filipino",fr:"Français",gl:"Galego",it:"Italiano",hu:"Magyar",kl:"Kalaallisut",lt:"Lietuvių",lv:"Latviešu",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",
ru:"Русский",sr:"Српски",uk:"Українська",he:"עברית",ar:"العربية",fa:"فارسی",th:"ไทย",ta:"தமிழ்",ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph",window.mxImageBasePath="mxgraph/images");
if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang);if(null==window.mxLanguage&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"viewer.diagrams.net"==window.location.hostname||"embed.diagrams.net"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)&&(lang=navigator.language,null!=lang)){var dash=lang.indexOf("-");0<dash&&(lang=
lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0");
"1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));"1"==urlParams.configure&&"1"!=urlParams.embed&&(delete urlParams.configure,null!=window.console&&console.log("Ignored configure=1 without embed=1"));window.mxLoadSettings=window.mxLoadSettings||"1"!=urlParams.configure;
function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}();
(function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,
8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");
if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.ms365="0";"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");
(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],FORBID_ATTR:["data-icon","data-icon-content"],ALLOWED_URI_REGEXP:/^(?!.*javascript:).*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ALLOW_DATA_ATTR:!1,ADD_ATTR:"target content pointer-events requiredFeatures data-font-src data-action data-title data-message data-link data-effect data-lucid-type data-lucid-content".split(" ")};
window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL="undefined"===typeof window.EXPORT_URL?"/export":window.EXPORT_URL;window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"32.6.9",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&
0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),
IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&
0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),
IS_LINUX:/\bLinux\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_SVG},link:function(a,b,c,d){c=c||document;var e=c.createElement("link");e.setAttribute("rel",a);e.setAttribute("href",b);e.setAttribute("charset","UTF-8");e.setAttribute("type",
"text/css");d&&e.setAttribute("id",d);c.getElementsByTagName("head")[0].appendChild(e)},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);
"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath="images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:navigator.language;mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";
mxLoadStylesheets&&mxClient.link("stylesheet","mxgraph/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var a=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,b=document.createElement("table");b.setAttribute("width","100%");b.setAttribute("height","100%");var c=document.createElement("tbody"),d=document.createElement("tr"),e=document.createElement("td");e.style.verticalAlign="top";mxLog.textarea=document.createElement("textarea");mxLog.textarea.setAttribute("wrap","off");
mxLog.textarea.setAttribute("readOnly","true");mxLog.textarea.style.height="100%";mxLog.textarea.style.resize="none";mxLog.textarea.value=mxLog.buffer;mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%";e.appendChild(mxLog.textarea);d.appendChild(e);c.appendChild(d);d=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");d.appendChild(mxLog.td);c.appendChild(d);b.appendChild(c);
mxLog.addButton("Info",function(g){mxLog.info()});mxLog.addButton("DOM",function(g){g=mxUtils.getInnerHtml(document.body);mxLog.debug(g)});mxLog.addButton("Trace",function(g){mxLog.TRACE=!mxLog.TRACE;mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")});mxLog.addButton("Show",function(g){try{mxUtils.popup(mxLog.textarea.value)}catch(h){mxUtils.alert(h)}});mxLog.addButton("Clear",function(g){mxLog.textarea.value=""});d=c=0;"number"===typeof window.innerWidth?(c=window.innerHeight,
d=window.innerWidth):(c=document.documentElement.clientHeight||document.body.clientHeight,d=document.body.clientWidth);mxLog.window=new mxWindow(a,b,Math.max(0,d-320),Math.max(0,c-210),300,160);mxLog.window.setMaximizable(!0);mxLog.window.setScrollable(!1);mxLog.window.setResizable(!0);mxLog.window.setClosable(!0);mxLog.window.destroyOnClose=!1;mxLog.window.title.style.paddingRight="80px";mxLog.window.title.setAttribute("title",a);if(mxClient.IS_NS&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=
document.compatMode||11==document.documentMode){var f=mxLog.window.getElement();a=function(g,h){mxLog.textarea.style.height=Math.max(0,f.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a);mxLog.window.addListener(mxEvent.MAXIMIZE,a);mxLog.window.addListener(mxEvent.NORMALIZE,a);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(a,b){var c=document.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",
b);mxLog.td.appendChild(c)},isVisible:function(){return null!=mxLog.window?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(a){null==mxLog.window&&mxLog.init();null!=mxLog.window&&mxLog.window.setVisible(a)},enter:function(a){if(mxLog.TRACE)return mxLog.writeln("Entering "+a),(new Date).getTime()},leave:function(a,b){mxLog.TRACE&&(b=0!=b?" ("+((new Date).getTime()-b)+" ms)":"",mxLog.writeln("Leaving "+a+b))},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,
arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=a},writeln:function(){for(var a="",b=0;b<arguments.length;b++)a+=
arguments[b],b<arguments.length-1&&(a+=" ");mxLog.write(a+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(a){if(null!=a){if(null==a[mxObjectIdentity.FIELD_NAME])if("object"===typeof a){var b=mxUtils.getFunctionName(a.constructor);a[mxObjectIdentity.FIELD_NAME]=b+"#"+mxObjectIdentity.counter++}else"function"===typeof a&&(a[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return a[mxObjectIdentity.FIELD_NAME]}return null},clear:function(a){"object"!==typeof a&&
"function"!==typeof a||delete a[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(a){a=mxObjectIdentity.get(a);return this.map[a]};mxDictionary.prototype.put=function(a,b){a=mxObjectIdentity.get(a);var c=this.map[a];this.map[a]=b;return c};mxDictionary.prototype.remove=function(a){a=mxObjectIdentity.get(a);var b=this.map[a];delete this.map[a];return b};
mxDictionary.prototype.getCount=function(){var a=0,b;for(b in this.map)a++;return a};mxDictionary.prototype.getKeys=function(){var a=[],b;for(b in this.map)a.push(b);return a};mxDictionary.prototype.getValues=function(){var a=[],b;for(b in this.map)a.push(this.map[b]);return a};mxDictionary.prototype.visit=function(a){for(var b in this.map)a(b,this.map[b])};
var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(a){return null!=mxClient.languages?0<=mxUtils.indexOf(mxClient.languages,a):!0},getDefaultBundle:function(a,b){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(b)?a+mxResources.extension:null},getSpecialBundle:function(a,b){if(null==mxClient.languages||!this.isLanguageSupported(b)){var c=b.indexOf("-");0<c&&(b=b.substring(0,c))}return mxResources.loadSpecialBundle&&
mxResources.isLanguageSupported(b)&&b!=mxClient.defaultLanguage?a+"_"+b+mxResources.extension:null},add:function(a,b,c){b=null!=b?b:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE;if(b!=mxConstants.NONE){var d=mxResources.getDefaultBundle(a,b),e=mxResources.getSpecialBundle(a,b),f=function(){if(null!=e)if(c)mxUtils.get(e,function(k){mxResources.parse(k.getText());c()},function(){c()});else try{var h=mxUtils.load(e);h.isReady()&&mxResources.parse(h.getText())}catch(k){}else null!=
c&&c()};if(null!=d)if(c)mxUtils.get(d,function(h){mxResources.parse(h.getText());f()},function(){f()});else try{var g=mxUtils.load(d);g.isReady()&&mxResources.parse(g.getText());f()}catch(h){}else f()}},parse:function(a){if(null!=a){a=a.split("\n");for(var b=0;b<a.length;b++)if("#"!=a[b].charAt(0)){var c=a[b].indexOf("=");if(0<c){var d=a[b].substring(0,c),e=a[b].length;13==a[b].charCodeAt(e-1)&&e--;c=a[b].substring(c+1,e);this.resourcesEncoded?(c=c.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[d]=
unescape(c)):mxResources.resources[d]=c}}}},containsKey:function(a){return null!=mxResources.resources[a]},get:function(a,b,c){a=mxResources.resources[a];null==a&&(a=c);null!=a&&null!=b&&(a=mxResources.replacePlaceholders(a,b));return a},replacePlaceholders:function(a,b){for(var c=[],d=null,e=0;e<a.length;e++){var f=a.charAt(e);"{"==f?d="":null!=d&&"}"==f?(d=parseInt(d)-1,0<=d&&d<b.length&&c.push(b[d]),d=null):null!=d?d+=f:c.push(f)}return c.join("")},loadResources:function(a){mxResources.add(mxClient.basePath+
"/resources/editor",null,function(){mxResources.add(mxClient.basePath+"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint;
mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2};
mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}};
mxRectangle.prototype.intersectsPoint=function(a,b){return a>=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height};mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};
mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};mxRectangle.fromPoint=function(a){return new mxRectangle(a.x,a.y,0,0)};mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)};
var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,h=0;h<b.length;h++){var k=b[h];if(k instanceof mxGeometryChange||k instanceof mxTerminalChange||k instanceof mxValueChange||k instanceof mxChildChange||k instanceof mxStyleChange){var l=a.getView().getState(k.cell||k.child,!1);if(null!=l)if(g=!0,k.constructor!=mxGeometryChange||a.model.isEdge(k.cell))mxUtils.setOpacity(l.shape.node,100*d/10);else{var m=a.getView().scale,n=(k.geometry.x-k.previous.x)*m,p=(k.geometry.y-
k.previous.y)*m,q=(k.geometry.width-k.previous.width)*m;m*=k.geometry.height-k.previous.height;0==d?(l.x-=n,l.y-=p,l.width-=q,l.height-=m):(l.x+=n/10,l.y+=p/10,l.width+=q/10,l.height+=m/10);a.cellRenderer.redraw(l);mxEffects.cascadeOpacity(a,k.cell,100*d/10)}}}10>d&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;e<d;e++){var f=a.model.getChildAt(b,e),g=a.getView().getState(f);null!=g&&(mxUtils.setOpacity(g.shape.node,c),
mxEffects.cascadeOpacity(a,f,c))}b=a.model.getEdges(b);if(null!=b)for(e=0;e<b.length;e++)d=a.getView().getState(b[e]),null!=d&&mxUtils.setOpacity(d.shape.node,c)},fadeOut:function(a,b,c,d,e,f){d=d||40;e=e||30;var g=b||100;mxUtils.setOpacity(a,g);if(f||null==f){var h=function(){g=Math.max(g-d,0);mxUtils.setOpacity(a,g);0<g?window.setTimeout(h,e):(a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a))};window.setTimeout(h,e)}else a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a)}},
mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",lightDarkColorSupported:function(){var a=document.createElement("div");a.style.color="light-dark(white, black)";a=a.style.color;null!=a&&"generic-light-dark("===a.substring(0,19)&&(a=a.replace("generic-light-dark","light-dark"));return"light-dark(white, black)"===a}(),preferDarkColor:!1,lightDarkColorRegex:/light-dark\(\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*,\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*\)/,
varColorRegex:/^var\([^)]+\)/,systemColorRegex:/^\s*(AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText)\s*$/i,hexColorRegex:/(^#[a-zA-Z0-9]*$)/,rgbaColorRegex:/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i,canvasContext:function(){var a=null;try{a=document.createElement("canvas").getContext("2d")}catch(b){}return a}(),validInvalidColor:"rgba(0, 0, 0, 0)",
normalizedValidInvalidColor:"rgba(0,0,0,0)",removeCursors:function(a){null!=a.style&&(a.style.cursor="");a=a.childNodes;if(null!=a)for(var b=a.length,c=0;c<b;c+=1)mxUtils.removeCursors(a[c])},getCurrentStyle:function(a){return null!=a?window.getComputedStyle(a,""):null},getCssFontFamily:function(a){if("string"===typeof a){a=a.split(",");for(var b=0;b<a.length;b++)a[b]=mxUtils.trim(a[b]),'"'==a[b].charAt(0)&&'"'==a[b].charAt(a[b].length-1)&&(a[b]=a[b].substring(1,a[b].length-1));a=a.join(", ")}return a},
parseCssFontFamily:function(a,b){if("string"===typeof a){a=a.split(",");for(var c=0;c<a.length;c++){a[c]=mxUtils.trim(a[c]);var d=2<a[c].length&&('"'==a[c].charAt(a[c].length-1)&&'"'==a[c].charAt(0)||"'"==a[c].charAt(a[c].length-1)&&"'"==a[c].charAt(0));d&&(a[c]=a[c].substring(1,a[c].length-1));d=d||!/^-?[A-Za-z_\u00A0-\uFFFF][\w\u00A0-\uFFFF-]*$/.test(a[c]);b&&(a[c]=mxUtils.htmlEntities(a[c]));d&&(a[c]="'"+a[c].replace(/'/g,"\\'")+"'")}a=a.join(", ")}return a},parseCssNumber:function(a){"thin"==
a?a="2":"medium"==a?a="4":"thick"==a&&(a="6");a=parseFloat(a);isNaN(a)&&(a=0);return a},parseCssSpacing:function(a){var b=null;if(null!=a&&""!==a){var c=String(a).split(/\s+/);a=[];for(var d=0;d<c.length&&4>a.length;d++)if(0<c[d].length){var e=parseFloat(c[d]);a.push(isFinite(e)?Math.max(0,e):0)}0<a.length&&(c=a[0],d=1<a.length?a[1]:c,e=2<a.length?a[2]:c,a=3<a.length?a[3]:d,0<c||0<d||0<e||0<a)&&(b={top:c,right:d,bottom:e,left:a})}return b},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":
mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT&&(a="Moz");return function(b,c,d){b[c]=d;null!=a&&0<c.length&&(c=a+c.substring(0,1).toUpperCase()+c.substring(1),b[c]=d)}}(),hasScrollbars:function(a){a=mxUtils.getCurrentStyle(a);return null!=a&&("scroll"==a.overflow||"auto"==a.overflow)},bind:function(a,b){return function(){return b.apply(a,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=
null}catch(c){mxLog.warn(c.message+" while evaluating "+a)}else try{b=eval(a)}catch(c){mxLog.warn(c.message+" while evaluating "+a)}return b},findNode:function(a,b,c){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=a.getAttribute(b);if(null!=d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),
a=b.indexOf("("),0<a&&(b=b.substring(0,a)))));return b},indexOf:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1},lastIndexOf:function(a,b){if(null!=a&&null!=b)for(var c=a.length-1;0<=c;c--)if(a[c]==b)return c;return-1},forEach:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)b(a[c]);return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==
a&&(delete b[e],c=a);return c},addItems:function(a,b){for(var c=0;c<b.length;c++)null!=b[c]&&(b[c].constructor==Array?mxUtils.addItems(a,b[c]):0>mxUtils.indexOf(a,b[c])&&a.push(b[c]));return a},isNode:function(a,b,c,d){return null==a||a.constructor!==Element||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.getAttribute(c)==d},isAncestorNode:function(a,b){for(;null!=b;){if(b==a)return!0;b=b.parentNode}return!1},visitNodes:function(a,b){if(a.nodeType==mxConstants.NODETYPE_ELEMENT)for(b(a),
a=a.firstChild;null!=a;)mxUtils.visitNodes(a,b),a=a.nextSibling},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;var c=[];for(a=a.firstChild;null!=a;)a.nodeType==b&&c.push(a),a=a.nextSibling;return c},removeChildNodes:function(a){for(;null!=a.lastChild;)a.removeChild(a.lastChild)},importNode:function(a,b,c){return a.importNode(b,c)},importNodeImplementation:function(a,b,c){switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length)for(var e=0;e<
b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));if(c&&b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d;case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));
return a},parseXml:function(a){var b=new DOMParser,c=b.parseFromString(a,"text/xml"),d=null!=c?c.getElementsByTagName("parsererror"):null;null!=d&&0<d.length&&(c=b.parseFromString(mxUtils.repairXml(a),"text/xml"));return c},htmlEntityCodes:{nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,
frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,
iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,
beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,
rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,
sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},repairXml:function(a){a=mxUtils.zapGremlins(a);a=a.split(/(<!\[CDATA\[[\s\S]*?\]\]>)/);for(var b=0;b<a.length;b+=2)a[b]=a[b].replace(/&(?:#([0-9]+);|#[xX]([0-9a-fA-F]+);|([a-zA-Z][a-zA-Z0-9]*);)?/g,function(c,d,e,f){if(null!=d||null!=e)return d=null!=d?parseInt(d,10):parseInt(e,16),(32<=
d||9==d||10==d||13==d)&&(55296>d||57343<d)&&65534!=d&&65535!=d&&1114111>=d?c:"";if(null!=f){if("amp"==f||"lt"==f||"gt"==f||"quot"==f||"apos"==f)return c;d=mxUtils.htmlEntityCodes[f];return null!=d?"&#"+d+";":"&"+f+";"}return"&"});return a.join("")},getSvgDefs:function(a){var b=a.ownerDocument,c=a.getElementsByTagName("defs");0==c.length||c[0].parentNode!=a?(b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"defs"):b.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):
a.appendChild(b)):b=c[0];return b},clearSelection:function(){return document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){}}(),removeWhitespace:function(a,b){for(a=b?a.previousSibling:a.nextSibling;null!=a&&a.nodeType==mxConstants.NODETYPE_TEXT;){var c=b?a.previousSibling:a.nextSibling,d=mxUtils.getTextContent(a);0==
mxUtils.trim(d).length&&a.parentNode.removeChild(a);a=c}},htmlEntities:function(a,b,c,d){a=String(null!=a?a:"");a=a.replace(/&/g,"&");a=a.replace(/</g,"<");a=a.replace(/>/g,">");if(null==c||c)a=a.replace(/"/g,"""),a=a.replace(/'/g,"'");if(null==b||b)a=a.replace(/\n/g,"
");if(null==d||d)a=a.replace(/\t/g,"	");return a},decodeHtml:function(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value},safeDecodeURIComponent:function(a){try{return decodeURIComponent(a)}catch(b){return a}},
getXml:function(a,b){a=mxUtils.zapGremlins((new XMLSerializer).serializeToString(a));return a.replace(/\n/g,b||"
")},getPrettyXml:function(a,b,c,d,e){var f=[];if(null!=a)if(b=null!=b?b:" ",c=null!=c?c:"",d=null!=d?d:"\n",null!=a.namespaceURI&&a.namespaceURI!=e&&(e=a.namespaceURI,null==a.getAttribute("xmlns")&&a.setAttribute("xmlns",a.namespaceURI)),a.nodeType==mxConstants.NODETYPE_DOCUMENT)f.push(mxUtils.getPrettyXml(a.documentElement,b,c,d,e));else if(a.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var g=
a.firstChild;if(null!=g)for(;null!=g;)f.push(mxUtils.getPrettyXml(g,b,c,d,e)),g=g.nextSibling}else if(a.nodeType==mxConstants.NODETYPE_COMMENT)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&f.push(c+"\x3c!--"+a+"--\x3e"+d);else if(a.nodeType==mxConstants.NODETYPE_TEXT)a=mxUtils.zapGremlins(mxUtils.trim(mxUtils.getTextContent(a))),0<a.length&&f.push(c+mxUtils.htmlEntities(a,!1,!1)+d);else if(a.nodeType==mxConstants.NODETYPE_CDATA)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&
f.push(c+"<![CDATA["+a+"]]\x3e"+d);else{f.push(c+"<"+a.nodeName);g=a.attributes;if(null!=g)for(var h=0;h<g.length;h++){var k=mxUtils.htmlEntities(mxUtils.zapGremlins(g[h].value)).replace(/\r/g,"
");f.push(" "+g[h].nodeName+'="'+k+'"')}g=a.firstChild;if(null!=g){for(f.push(">"+d);null!=g;)f.push(mxUtils.getPrettyXml(g,b,c+b,d,e)),g=g.nextSibling;f.push(c+"</"+a.nodeName+">"+d)}else f.push(" />"+d)}return f.join("")},extractTextWithWhitespace:function(a){function b(e){if(1!=e.length||"BR"!=e[0].nodeName&&
"\n"!=e[0].innerHTML)for(var f=0;f<e.length;f++){var g=e[f];"BR"==g.nodeName||"\n"==g.innerHTML||(1==e.length||0==f)&&"DIV"==g.nodeName&&"<br>"==g.innerHTML.toLowerCase()?d.push("\n"):(3===g.nodeType||4===g.nodeType?0<g.nodeValue.length&&d.push(g.nodeValue):8!==g.nodeType&&0<g.childNodes.length&&b(g.childNodes),f<e.length-1&&0<=mxUtils.indexOf(c,e[f+1].nodeName)&&d.push("\n"))}}var c="BLOCKQUOTE DIV H1 H2 H3 H4 H5 H6 OL P PRE TABLE UL".split(" "),d=[];b(a);return d.join("")},replaceTrailingNewlines:function(a,
b){for(var c="";0<a.length&&"\n"==a.charAt(a.length-1);)a=a.substring(0,a.length-1),c+=b;return a+c},getNodeValue:function(a){a=a.firstChild;for(var b=[];null!=a;)a.nodeType!=mxConstants.NODETYPE_TEXT&&a.nodeType!=mxConstants.NODETYPE_CDATA||null==a.nodeValue||b.push(mxUtils.trim(a.nodeValue)),a=a.nextSibling;return 0<b.length?b.join(""):""},getTextContent:function(a){return null!=a?a[void 0===a.textContent?"text":"textContent"]:""},setTextContent:function(a,b){void 0!==a.innerText?a.innerText=b:
a[void 0===a.textContent?"text":"textContent"]=b},getInnerHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},getOuterHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},write:function(a,b){b=a.ownerDocument.createTextNode(b);null!=a&&a.appendChild(b);return b},writeln:function(a,b){b=a.ownerDocument.createTextNode(b);null!=a&&(a.appendChild(b),a.appendChild(document.createElement("br")));return b},br:function(a,b){b=b||1;for(var c=null,d=0;d<b;d++)null!=
a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c,d){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.className=d);return c},para:function(a,b){var c=document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},
linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;
try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth),f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var h=g+c.width-b;d+e>h&&(a.style.left=Math.max(g+b,h-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=
new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var h=a.setRequestHeaders;g&&(a.setRequestHeaders=function(k,l){h.apply(this,arguments);for(var m in g)k.setRequestHeader(m,g[m])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},h=0;h<a.length;h++)(function(k,l){mxUtils.get(k,function(m){var n=m.getStatus();200>n||299<n?g():(e[l]=m,d--,0==d&&b(e))},
g)})(a[h],h);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,d)},loadInto:function(a,b,c){b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},compareNumbers:function(a,b){a=Number(a);
b=Number(b);var c=isNaN(a),d=isNaN(b);return c||d?(c?1:0)-(d?1:0):a<b?-1:a>b?1:0},parsePadding:function(a){a=null!=a?String(a):"";try{a=decodeURIComponent(a)}catch(b){}a=a.trim().split(/\s+/).map(function(b){b=parseFloat(b);return isNaN(b)?0:b});return 1===a.length?{n:a[0],e:a[0],s:a[0],w:a[0]}:2===a.length?{n:a[0],e:a[1],s:a[0],w:a[1]}:3===a.length?{n:a[0],e:a[1],s:a[2],w:a[1]}:{n:a[0],e:a[1],s:a[2],w:a[3]}},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,
10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isSystemColor:function(a){return"string"===typeof a&&mxUtils.systemColorRegex.test(a)},isVarOrSystemColor:function(a){return mxUtils.isVarColor(a)||mxUtils.isSystemColor(a)},getInverseSystemColor:function(a){a="string"===typeof a?mxUtils.trim(a).toLowerCase():null;return"canvas"==a?"CanvasText":"canvastext"==a?"Canvas":null},hasResourceReference:function(a){return"string"===typeof a&&/url\(|src\(|\\/i.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},
isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;if(null==mxUtils.canvasContext)return/^(#[0-9a-f]+|(rgb|hsl)a?\([\w.,%\/+-]*\)|[a-z]+)$/i.test(a)&&!/^(transparent|inherit|initial|unset|revert)$/i.test(a)&&null!=window.CSS&&"function"===typeof CSS.supports&&CSS.supports("color",a);mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=
a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?.3<a.a&&128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarOrSystemColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/
100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,h=0,k=1;if("transparent"==a.toLowerCase())return a;f=mxUtils.getInverseSystemColor(a);if(null!=f)return f;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;h=k.b;k=k.a;f=d(f);g=d(g);h=d(h);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+
.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*h);l=e(a[3]*f+a[4]*g+a[5]*h);f=e(a[6]*f+a[7]*g+a[8]*h);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)+(1>k?("0"+Math.round(255*k).toString(16)).slice(-2):"")},addAlphaToColor:function(a,b,c){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a.a=c?b:a.a*b,a="rgba("+a.r+","+a.g+","+a.b+","+a.a+")");return a},getLightDarkColor:function(a,
b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},getOtherSchemeColor:function(a){var b=mxUtils.getInverseSystemColor(a);
if(null!=b)return b;var c="string"===typeof a?/^(var\([^,()]+,\s*)([a-zA-Z]+)(\s*\))$/.exec(a):null;b=null!=c?mxUtils.getInverseSystemColor(c[2]):null;return null!=b?c[1]+b+c[3]:a},invertLightDarkColor:function(a){var b={};b.light=mxUtils.getOtherSchemeColor(a.dark);b.dark=mxUtils.getOtherSchemeColor(a.light);b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;
return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&
null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},
isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/
180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,h,k){h-=a;k-=b;if(0==h&&0==k)return[];if(0==c||0==d)return[a,b,h+a,k+b,h+a,k+b];c=Math.abs(c);d=Math.abs(d);var l=-h/2,m=-k/2,n=Math.cos(e*Math.PI/180);e=Math.sin(e*Math.PI/180);var p=n*l+e*m;l=-1*e*l+n*m;m=p*p;var q=l*l,r=c*c,t=d*d,v=m/r+q/t;1<v?(c*=Math.sqrt(v),d*=Math.sqrt(v),f=0):(v=1,f===g&&(v=-1),f=v*Math.sqrt(Math.max(0,(r*t-r*q-t*m)/(r*q+t*m))));m=f*c*l/d;q=-1*f*d*p/c;h=n*m-e*q+h/2;k=e*m+n*q+k/2;r=Math.atan2((l-
q)/d,(p-m)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-l-q)/d,(-p-m)/c)-Math.atan2((l-q)/d,(p-m)/c);p=0<=r?r:2*Math.PI+r;0==g&&0<p?p-=2*Math.PI:0!=g&&0>p&&(p+=2*Math.PI);g=2*p/Math.PI;g=Math.ceil(0>g?-1*g:g);p/=g;l=8/3*Math.sin(p/4)*Math.sin(p/4)/Math.sin(p/2);m=n*c;n*=d;c*=e;d*=e;var u=Math.cos(f),x=Math.sin(f);e=-l*(m*x+d*u);q=-l*(c*x-n*u);v=[];for(var y=0;y<g;++y){f+=p;u=Math.cos(f);x=Math.sin(f);r=m*u-d*x+h;t=c*u+n*x+k;var w=-l*(m*x+d*u);u=-l*(c*x-n*u);x=6*y;v[x]=Number(e+a);v[x+1]=
Number(q+b);v[x+2]=Number(r-w+a);v[x+3]=Number(t-u+b);v[x+4]=Number(r+a);v[x+5]=Number(t+b);e=r+w;q=t+u}return v},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,
d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,
null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=
d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=
mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],
f=null,g=1;g<a.absolutePoints.length;g++){var h=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,b,c);if(null==f||e<f)f=e,d=g-1;e=h}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,
Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,
d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,h=c.y-f.y;f={p:f,distSq:h*h+g*g};null!=f&&(null==
d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var h=c.x;b.x>c.x&&(a=c.x,h=b.x);h>g&&(h=g);a<e&&(a=e);if(a>h)return!1;e=b.y;g=c.y;var k=c.x-b.x;1E-7<Math.abs(k)&&(c=(c.y-b.y)/k,b=b.y-c*b.x,e=c*a+b,g=c*h+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,
b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var h=b.x;b=b.y;f+=h;g+=b;d+=c;e+=a;return(f<h||f>c)&&(g<b||g>a)&&(d<c||d>h)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),h=a.getCenterY(),k=a.width,l=a.height,m=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<m&&(mxUtils.getValue(a.style,
mxConstants.STYLE_HORIZONTAL,!0)?(h=a.y+m/2,l=m):(g=a.x+m/2,k=m));k=Math.max(e,k*d);l=Math.max(e,l*d);0<f&&(k=Math.min(k,f),l=Math.min(l,f));d=new mxRectangle(g-k/2,h-l/2,k,l);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){var c=0,d=0;if(!b&&(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),
0!=b.x||0!=b.y)){for(var e=!1,f=a,g=document.body,h=document.documentElement;null!=f&&f!=g&&f!=h&&!e;){var k=mxUtils.getCurrentStyle(f);null!=k&&(e="fixed"==k.position);f=f.parentNode}e||(c+=b.x,d+=b.y)}a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,
null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint;c=c?mxUtils.getDocumentScrollOrigin(d):null;d=null!=c&&(0!=c.x||0!=c.y);for(var h=!1;null!=a&&a!=e&&a!=f;)isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop),d&&!h&&(h=mxUtils.getCurrentStyle(a),
h=null!=h&&"fixed"==h.position),a=b?a.parentNode:null;d&&!h&&(g.x+=c.x,g.y+=c.y);return g},convertPoint:function(a,b,c){var d=a.getBoundingClientRect();return new mxPoint(b-d.left+a.scrollLeft,c-d.top+a.scrollTop)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a).replace(/[\t\n\r]/g,""):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=
a.charCodeAt(d),f=(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e;f&&55296<=e&&57343>=e&&(56319>=e?(e=d+1<a.length?a.charCodeAt(d+1):0,f=56320<=e&&57343>=e):(e=0<d?a.charCodeAt(d-1):0,f=55296<=e&&56319>=e));f||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,b){b=b?new RegExp("^["+b+"]+","g"):mxUtils.ltrimExpression;return null!=a?a.replace(b,""):null},ltrimExpression:RegExp("^[\\s|\\0]+","g"),rtrimExpression:RegExp("[\\s|\\0]"),
rtrim:function(a,b){if(null!=a){b=b?new RegExp("["+b+"]"):mxUtils.rtrimExpression;for(var c=a.length;0<c&&b.test(a.charAt(c-1));)c--;return a.substring(0,c)}return null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},hashCode:function(a){for(var b=5381,c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return(b>>>0).toString(36)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===
String(a)},mod:function(a,b){return(a%b+b)%b},unscale:function(a,b,c){return Math.round(1E6*(a/b-(null!=c?c:0)))/1E6},intersection:function(a,b,c,d,e,f,g,h){var k=(h-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(h-f)*(a-e))/k;e=((c-a)*(b-f)-(d-b)*(a-e))/k;return-1E-6<=g&&1.000001>=g&&-1E-6<=e&&1.000001>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,
b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){a.style.opacity=b/100},
createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;if(1<a.length){for(var c={children:null},d=new mxDictionary,e=new mxDictionary,f=function(n){for(var p=null!=n?d.get(n):c,q=[];null==p;)p=n.getParent(),null==p?p=c:(q.push(n),n=
p,p=d.get(n));null!=n&&d.put(n,p);for(n=q.length-1;0<=n;n--){var r=q[n].getParent(),t=q[n],v=e.get(r);null==v&&(v={count:0,lookup:null},e.put(r,v));if(null==v.lookup&&8<++v.count){v.lookup=new mxDictionary;for(var u=r.getChildCount()-1;0<=u;u--)v.lookup.put(r.getChildAt(u),u)}r=null!=v.lookup?v.lookup.get(t):r.getIndex(t);r=null!=r?r:-1;null==p.children&&(p.children={});t=p.children[r];null==t&&(t={index:r,children:null},p.children[r]=t);p=t;d.put(q[n],p)}return p},g=0;g<a.length;g++)f(a[g]);for(var h=
[c],k=0;0<h.length;)if(g=h.pop(),g.rank=k++,null!=g.children){var l=[],m;for(m in g.children)l.push(g.children[m]);l.sort(function(n,p){return p.index-n.index});for(g=0;g<l.length;g++)h.push(l[g])}a.sort(function(n,p){n=f(n).rank-f(p).rank;return 0==n?0:0<n==b?1:-1})}return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,
b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&
b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColorList:function(a){var b=[],c=a.match(/var\([^)]+\)|light-dark\([^)]+\)|(?:rgba?|hsla?|hwb|lab|lch|color)\([^)]+\)|#[0-9a-f]{3,8}|[a-z-]+/gi);if(c)return c;""!==a.trim()&&b.push(a.trim());return b},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=
a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,.]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=(parseInt(a.substr(6,2),16)/255).toFixed(3));c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+
", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2)+(1>b.a?("0"+Math.round(255*b.a).toString(16)).slice(-2):""):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?
b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor?(b=mxUtils.canvasContext.fillStyle,mxUtils.isRgbColor(b)&&(b=mxUtils.rgba2hex(b))):1<a.length&&"#"==a.charAt(0)&&(mxUtils.canvasContext.fillStyle=a.substring(1),mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle))))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||
0<c.length);null!=a&&"string"!==typeof a&&(a=""+a);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");if(d)a=b+"="+c+(0>e?";":a.substring(e));else{for(;0<=e&&";"==a.charAt(e+1);)e++;a=0>e||e==a.length-1?"":a.substring(e+1)}}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},
setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||"string"!==typeof a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+
b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},_measureDiv:null,_measureCache:null,getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;e=null!=
e?e:0;if(null==mxUtils._measureDiv){var f=document.createElement("div");f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";document.body.appendChild(f);mxUtils._measureDiv=f;mxUtils._measureCache={}}f=mxUtils._measureDiv;var g=mxUtils._measureCache,h=Math.round(b)+"px";b=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;var k=(e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?
"bold":"",l=(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",m="";(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(m="underline");(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&(m=0<m.length?m+" line-through":"line-through");e=null!=d?"normal":"nowrap";d=null!=d?d+"px":"";g.fontFamily!==c&&(f.style.fontFamily=c,g.fontFamily=c);g.fontSizePx!==h&&(f.style.fontSize=h,g.fontSizePx=h);g.lineHeight!==b&&(f.style.lineHeight=b,g.lineHeight=b);g.fontWeight!==
k&&(f.style.fontWeight=k,g.fontWeight=k);g.fontStyleCss!==l&&(f.style.fontStyle=l,g.fontStyleCss=l);g.txtDecor!==m&&(f.style.textDecoration=m,g.txtDecor=m);g.whiteSpace!==e&&(f.style.whiteSpace=e,g.whiteSpace=e);g.widthPx!==d&&(f.style.width=d,g.widthPx=d);g.text!==a&&(f.innerHTML=a,g.text=a);c=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);"string"===typeof a&&0<=a.indexOf("<")&&(f.innerHTML="",g.text=null);return c},deprecated:function(a){null==mxUtils.deprecatedCalls&&(mxUtils.deprecatedCalls=
{});mxUtils.deprecatedCalls[a]||"undefined"===typeof console||(mxUtils.deprecatedCalls[a]=!0,console.warn(a+" is deprecated and will be removed in a later release"))},getViewXml:function(a,b,c,d,e){mxUtils.deprecated("mxUtils.getViewXml");d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,h=f.isEventsEnabled();f.setEventsEnabled(!1);var k=f.drawPane,l=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,
"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var m=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=m,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=
k,f.overlayPane=l,f.setEventsEnabled(h)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var h=Math.floor(d)/
d;1==g&&(g=Math.floor(c-1)/c);1==h&&(h=Math.floor(d-1)/d);g=g>h?g:h;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();var g=a.getGraphBounds(),h=Math.ceil(c-g.x),k=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));b.writeln("<html><head>");d=document.getElementsByTagName("base");for(c=
0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=
h+"px";e.style.top=k+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+h+","+k+")"));mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();
b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?
(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");
f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=
document.createElement("p"),c=document.createElement("button"),c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(h){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,h,k,l){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);
null!=k&&(a.highlightDropTargets=k);null!=l&&(a.getDropTarget=l);a.getGraphForEvent=function(m){return"function"==typeof b?b(m):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},h&&(a.createPreviewElement=function(m){var n=d.cloneNode(!0),p=parseInt(n.style.width),q=parseInt(n.style.height);n.style.width=Math.round(p*m.view.scale)+"px";n.style.height=Math.round(q*m.view.scale)+"px";return n}));return a},isVerticalTextDirection:function(a){return null!=a&&"string"===typeof a&&"vertical-"==
a.substring(0,9)},canConvertHtmlToSvg:function(a,b){var c=document.createElement("div");c.innerHTML=null!=a?a:"";return mxUtils.convertHtmlToSvg(c,null,null,b)},convertHtmlToSvg:function(a,b,c,d){d={dir:null!=d?d.dir:null,fontScale:null!=d?d.fontScale:null,fontSize:null!=d&&null!=d.fontSize?d.fontSize:mxConstants.DEFAULT_FONTSIZE,createElement:null!=d&&null!=d.createElement?d.createElement:function(f){return document.createElementNS(mxConstants.NS_SVG,f)}};if(mxUtils.isVerticalTextDirection(d.dir))return!1;
b=null!=b?b:d.createElement("text");c=null!=c?c:new mxPoint(0,0);var e=!0;null!=a&&(e=mxUtils.containsBlockChild(a)?mxUtils.convertHtmlBlocksToSvg(a,b,c,d):mxUtils.containsBrElement(a)?mxUtils.convertHtmlWithBreaksToSvg(a,b,c,d.fontScale,d):mxUtils.convertHtmlInlineToSvg(a,b,c,d.fontScale,null,d));return e},getBlockElementStyle:function(a){switch(a){case "H1":return{sizeFactor:2,weight:"bold",family:null,marginTop:.67,marginBottom:.67,indent:0};case "H2":return{sizeFactor:1.5,weight:"bold",family:null,
marginTop:.83,marginBottom:.83,indent:0};case "H3":return{sizeFactor:1.17,weight:"bold",family:null,marginTop:1,marginBottom:1,indent:0};case "H4":return{sizeFactor:1,weight:"bold",family:null,marginTop:1.33,marginBottom:1.33,indent:0};case "H5":return{sizeFactor:.83,weight:"bold",family:null,marginTop:1.67,marginBottom:1.67,indent:0};case "H6":return{sizeFactor:.67,weight:"bold",family:null,marginTop:2.33,marginBottom:2.33,indent:0};case "P":return{sizeFactor:1,weight:null,family:null,marginTop:1,
marginBottom:1,indent:0};case "PRE":return{sizeFactor:1,weight:null,family:"monospace",marginTop:1,marginBottom:1,indent:0};case "BLOCKQUOTE":return{sizeFactor:1,weight:null,family:null,marginTop:1,marginBottom:1,indent:40};case "DIV":return{sizeFactor:1,weight:null,family:null,marginTop:0,marginBottom:0,indent:0};default:return null}},getMaxInlineFontSize:function(a,b){for(var c=b,d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.style){var f=
e.style.fontSize;null!=f&&""!=f&&("px"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f))):"pt"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,4*f/3))):"em"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f*b))):"%"==f.slice(-1)&&(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f/100*b))));e=mxUtils.getMaxInlineFontSize(e,b);c=Math.max(c,e)}}return c},containsBlockChild:function(a){for(var b=0;b<a.childNodes.length;b++)if(null!=mxUtils.getBlockElementStyle(a.childNodes[b].nodeName))return!0;
return!1},convertHtmlBlocksToSvg:function(a,b,c,d){function e(n){return n.nodeType!=mxConstants.NODETYPE_ELEMENT||null==mxUtils.getBlockElementStyle(n.nodeName)}function f(n,p){for(var q=0;q<n.childNodes.length&&m;q++){var r=n.childNodes[q];if(e(r)){for(r=[];q<n.childNodes.length&&e(n.childNodes[q]);)r.push(n.childNodes[q]),q++;q--;var t=r;r=null!=p&&""!=p?mxUtils.getLightDarkColor(p):null;for(var v=document.createElement("span"),u=0;u<t.length;u++)v.appendChild(t[u].cloneNode(!0));t=!1;for(u=0;u<
v.childNodes.length;u++){var x=v.childNodes[u];if(x.nodeType==mxConstants.NODETYPE_ELEMENT||x.nodeType==mxConstants.NODETYPE_TEXT&&0<mxUtils.trim(x.nodeValue).length){t=!0;break}}if(t){if(mxUtils.containsBrElement(v))for(v=mxUtils.splitAtBr(v),u=0;u<v.length&&m;u++){var y=v[u],w=document.createElement("span");for(t=0;t<y.length;t++)w.appendChild(y[t]);t=mxUtils.getMaxInlineFontSize(w,g);h+=t;var A=d.createElement("text");A.setAttribute("y",mxUtils.format(h));A.setAttribute("data-line-font-size",t);
null!=r&&(A.setAttribute("fill",r.light),A.style.fill=r.cssText);x=new mxPoint(0,0);0<y.length&&(m=mxUtils.convertHtmlInlineToSvg(w,A,x,1,g,d));b.appendChild(A);y=t*(mxConstants.LINE_HEIGHT-1);y+=mxUtils.getSupSubLineExpansion(t,x.supDyPx,x.subDyPx);h+=y}else t=mxUtils.getMaxInlineFontSize(v,g),h+=t,A=d.createElement("text"),A.setAttribute("y",mxUtils.format(h)),A.setAttribute("data-line-font-size",t),null!=r&&(A.setAttribute("fill",r.light),A.style.fill=r.cssText),x=new mxPoint(0,0),m=mxUtils.convertHtmlInlineToSvg(v,
A,x,1,g,d),b.appendChild(A),y=t*(mxConstants.LINE_HEIGHT-1),y+=mxUtils.getSupSubLineExpansion(t,x.supDyPx,x.subDyPx,x.supFontSize,x.subFontSize),h+=y;k=0;l=!1}}else if(v=mxUtils.getBlockElementStyle(r.nodeName),null==v)m=!1;else if(null!=r.style&&""!=r.style.backgroundColor)m=!1;else if(t=null!=r.style&&""!=r.style.color?r.style.color:p,"DIV"==r.nodeName&&mxUtils.containsBlockChild(r))f(r,t);else{x=r;r=v;v=g*v.sizeFactor;y=r.marginTop;u=r.marginBottom;t=null!=t&&""!=t?mxUtils.getLightDarkColor(t):
null;null!=x.style&&(""!=x.style.marginTop&&(w=parseFloat(x.style.marginTop),isNaN(w)||(0<=x.style.marginTop.indexOf("px")?y=w/v:0<=x.style.marginTop.indexOf("em")&&(y=w))),""!=x.style.marginBottom&&(w=parseFloat(x.style.marginBottom),isNaN(w)||(0<=x.style.marginBottom.indexOf("px")?u=w/v:0<=x.style.marginBottom.indexOf("em")&&(u=w))));y*=v;h=l?h+y:h+Math.max(k,y);if(mxUtils.containsBrElement(x))for(x=mxUtils.splitAtBr(x),y=0;y<x.length&&m;y++){var C=x[y],B=document.createElement("span");for(w=0;w<
C.length;w++)B.appendChild(C[w]);w=mxUtils.getMaxInlineFontSize(B,v);h+=w;var z=d.createElement("text");z.setAttribute("y",mxUtils.format(h));z.setAttribute("data-line-font-size",w);1!=r.sizeFactor&&z.setAttribute("font-size",v+"px");null!=r.weight&&z.setAttribute("font-weight",r.weight);null!=r.family&&z.setAttribute("font-family",r.family);0<r.indent&&z.setAttribute("dx",r.indent);null!=t&&(z.setAttribute("fill",t.light),z.style.fill=t.cssText);A=new mxPoint(0,0);0<C.length&&(m=mxUtils.convertHtmlInlineToSvg(B,
z,A,1,v,d));b.appendChild(z);C=w*(mxConstants.LINE_HEIGHT-1);C+=mxUtils.getSupSubLineExpansion(w,A.supDyPx,A.subDyPx);h+=C}else w=mxUtils.getMaxInlineFontSize(x,v),h+=w,z=d.createElement("text"),z.setAttribute("y",mxUtils.format(h)),z.setAttribute("data-line-font-size",w),1!=r.sizeFactor&&z.setAttribute("font-size",v+"px"),null!=r.weight&&z.setAttribute("font-weight",r.weight),null!=r.family&&z.setAttribute("font-family",r.family),0<r.indent&&z.setAttribute("dx",r.indent),null!=t&&(z.setAttribute("fill",
t.light),z.style.fill=t.cssText),A=new mxPoint(0,0),m=mxUtils.convertHtmlInlineToSvg(x,z,A,1,v,d),b.appendChild(z),C=w*(mxConstants.LINE_HEIGHT-1),C+=mxUtils.getSupSubLineExpansion(w,A.supDyPx,A.subDyPx,A.supFontSize,A.subFontSize),h+=C;k=u*v;l=!1}}}var g=d.fontSize,h=0,k=0,l=!0,m=!0;f(a,null);h+=k;c.textHeight=h;return m},convertHtmlInlineToSvg:function(a,b,c,d,e,f){var g=!0;if(null!=a){d=null!=d?d:1;var h=f.fontSize;e=null!=e?e:h;for(var k=0,l=0;l<a.childNodes.length&&g;l++){var m=a.childNodes[l];
if(m.nodeType==mxConstants.NODETYPE_TEXT||m.nodeType==mxConstants.NODETYPE_ELEMENT){var n=f.createElement("tspan"),p=0;if(m.nodeType==mxConstants.NODETYPE_TEXT)mxUtils.write(n,m.nodeValue);else if(""!=m.style.backgroundColor||"SUP"!=m.nodeName&&"SUB"!=m.nodeName&&"B"!=m.nodeName&&"I"!=m.nodeName&&"SPAN"!=m.nodeName&&"FONT"!=m.nodeName&&"STRIKE"!=m.nodeName&&"U"!=m.nodeName)g=!1;else{""!=m.style.cssText&&(n.style.cssText=m.style.cssText);null!=m.getAttribute("face")&&(n.style.fontFamily=mxUtils.parseCssFontFamily(m.getAttribute("face")));
g=""!=m.style.color?m.style.color:m.getAttribute("color");null!=g&&""!=g&&(g=mxUtils.getLightDarkColor(g),n.setAttribute("fill",g.light),n.style.fill=g.cssText,n.style.color="");g=n.style.fontSize||"";var q=d,r=e;if("SUP"==m.nodeName||"SUB"==m.nodeName)if(""==g&&(n.style.fontSize="smaller",q=1.2*d,r=e/1.2),"SUP"==m.nodeName&&0==c.y?c.y=-.2:"SUB"==m.nodeName&&(c.y=Math.max(c.y,.15)),p=("SUP"==m.nodeName?-.35:.15)*e,"SUP"==m.nodeName){if(null==c.supDyPx||p<c.supDyPx)c.supDyPx=p,c.supFontSize=r}else{if(null==
c.subDyPx||p>c.subDyPx)c.subDyPx=p,c.subFontSize=r}else"I"==m.nodeName?n.setAttribute("font-style","italic"):"B"==m.nodeName?n.setAttribute("font-weight","bold"):"STRIKE"==m.nodeName?n.setAttribute("text-decoration","line-through"):"U"==m.nodeName&&n.setAttribute("text-decoration","underline");""!=g&&"smaller"!=g&&("px"==g.slice(-2)?r=parseFloat(g):"em"==g.slice(-2)?r=parseFloat(g)*e:"%"==g.slice(-1)&&(r=parseFloat(g)/100*e));"px"==g.slice(-2)&&(n.style.fontSize=parseFloat(g)*q/h+"em");g=mxUtils.convertHtmlInlineToSvg(m,
n,c,q,r,f)}m=p;0==k&&0==m||n.setAttribute("dy",Math.round(100*(m-k))/100);k=m;b.appendChild(n)}}}return g},getSupSubLineExpansion:function(a,b,c,d,e){var f=0;null!=b&&0>b&&(f=Math.max(0,(d||a/1.2)-a-b-a*(mxConstants.LINE_HEIGHT-1)/2));null!=c&&0<c&&(f=Math.max(f,c+(e||a/1.2)*(mxConstants.LINE_HEIGHT-1)-a*(mxConstants.LINE_HEIGHT-1)));return f},containsBrElement:function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("BR"==c.nodeName||c.nodeType==mxConstants.NODETYPE_ELEMENT&&mxUtils.containsBrElement(c))return!0}return!1},
splitAtBr:function(a){for(var b=[[]],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if("BR"==d.nodeName)b.push([]);else if(d.nodeType==mxConstants.NODETYPE_TEXT)b[b.length-1].push(d.cloneNode(!0));else if(d.nodeType==mxConstants.NODETYPE_ELEMENT)if(mxUtils.containsBrElement(d))for(var e=mxUtils.splitAtBr(d),f=0;f<e.length;f++){if(0<f&&b.push([]),0<e[f].length){for(var g=d.cloneNode(!1),h=0;h<e[f].length;h++)g.appendChild(e[f][h]);b[b.length-1].push(g)}}else b[b.length-1].push(d.cloneNode(!0))}return b},
convertHtmlWithBreaksToSvg:function(a,b,c,d,e){var f=!0,g=e.fontSize;a=mxUtils.splitAtBr(a);for(var h=0,k=0;k<a.length&&f;k++){for(var l=a[k],m=document.createElement("span"),n=0;n<l.length;n++)m.appendChild(l[n]);n=mxUtils.getMaxInlineFontSize(m,g);h+=n;var p=e.createElement("text");p.setAttribute("y",mxUtils.format(h));p.setAttribute("data-line-font-size",n);var q=new mxPoint(0,0);0<l.length&&(f=mxUtils.convertHtmlInlineToSvg(m,p,q,d||1,null,e));b.appendChild(p);l=n*(mxConstants.LINE_HEIGHT-1);
l+=mxUtils.getSupSubLineExpansion(n,q.supDyPx,q.subDyPx);h+=l}c.textHeight=h;return f},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",
NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",
OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",
EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",
DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),
PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_OPACITY_GROUP:"opacityGroup",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_HACHURE_GAP:"hachureGap",
STYLE_HACHURE_ANGLE:"hachureAngle",STYLE_FILL_WEIGHT:"fillWeight",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",
STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",
STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_BORDER_WIDTH:"labelBorderWidth",
STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",
STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_FIXED_HEADER:"fixedHeader",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_FOOTER_SIZE:"footerSize",STYLE_FOOTER_COLOR:"footerColor",STYLE_CENTER_RADIUS:"centerRadius",
STYLE_CENTER_COLOR:"centerColor",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_ENDSTROKECOLOR:"endStrokeColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_STARTSTROKECOLOR:"startStrokeColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_BEZIER:"bezier",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",
STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_FIXED_POINT_SPACING:"fixedPointSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_LABEL_PERIMETER:"labelPerimeter",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",
STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_GROUP_PADDING:"groupPadding",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_COLLAPSED_POINTS:"collapsedPoints",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",
STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,FONT_UNDERLINE_DOTTED:16,SHAPE_RECTANGLE:"rectangle",
SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",
ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,
DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",
PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};
mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;
mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};
mxMouseEvent.prototype.getGraphY=function(){return this.graphY};mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var a=this.getState();return null!=a?a.cell:null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};
mxMouseEvent.prototype.consume=function(a){(null!=a?a:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault();this.consumed=!0};function mxEventSource(a){this.setEventSource(a)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.removedListeners=null;mxEventSource.prototype.removedListenerCount=0;mxEventSource.prototype.eventsEnabled=!0;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};
mxEventSource.prototype.setEventsEnabled=function(a){this.eventsEnabled=a};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(a){this.eventSource=a};mxEventSource.prototype.addListener=function(a,b){null!=this.removedListeners&&this.removedListeners.get(b)&&this.removeCollectedListeners();null==this.eventListeners&&(this.eventListeners=[]);this.eventListeners.push(a);this.eventListeners.push(b)};
mxEventSource.prototype.removeListener=function(a){if(null!=this.removedListeners)this.removedListeners.put(a,!0),this.removedListenerCount++;else if(null!=this.eventListeners)for(var b=0;b<this.eventListeners.length;)this.eventListeners[b+1]==a?this.eventListeners.splice(b,2):b+=2};mxEventSource.prototype.beginRemoveListeners=function(){null==this.removedListeners&&(this.removedListeners=new mxDictionary,this.removedListenerCount=0)};
mxEventSource.prototype.endRemoveListeners=function(){this.removeCollectedListeners();this.removedListeners=null};
mxEventSource.prototype.removeCollectedListeners=function(){if(0<this.removedListenerCount){var a=this.removedListeners;this.removedListeners=new mxDictionary;this.removedListenerCount=0;if(null!=this.eventListeners){for(var b=0,c=0;c<this.eventListeners.length;c+=2)a.get(this.eventListeners[c+1])||(this.eventListeners[b++]=this.eventListeners[c],this.eventListeners[b++]=this.eventListeners[c+1]);this.eventListeners.length=b}}};
mxEventSource.prototype.fireEvent=function(a,b){this.removeCollectedListeners();var c=this.removedListeners;this.removedListeners=null;if(null!=this.eventListeners&&this.isEventsEnabled()){null==a&&(a=new mxEventObject);null==b&&(b=this.getEventSource());null==b&&(b=this);for(var d=0;d<this.eventListeners.length;d+=2){var e=this.eventListeners[d];null!=e&&e!=a.getName()||this.eventListeners[d+1].apply(this,[b,a])}}this.removedListeners=c};
var mxEvent={addListener:function(){if(window.addEventListener){var a=!1;try{document.addEventListener("test",function(){},Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){a=!0}}))}catch(b){}return function(b,c,d){b.addEventListener(c,d,a?{passive:!1}:!1);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}return function(b,c,d){b.attachEvent("on"+c,d);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}(),removeListener:function(){var a=
function(b,c,d){if(null!=b.mxListenerList){c=b.mxListenerList.length;for(var e=0;e<c;e++)if(b.mxListenerList[e].f==d){b.mxListenerList.splice(e,1);break}0==b.mxListenerList.length&&(b.mxListenerList=null)}};return window.removeEventListener?function(b,c,d){b.removeEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.detachEvent("on"+c,d);a(b,c,d)}}(),removeAllListeners:function(a){var b=a.mxListenerList;if(null!=b)for(;0<b.length;){var c=b[0];mxEvent.removeListener(a,c.name,c.f)}},addGestureListeners:function(a,
b,c,d,e){null!=b&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.addListener(a,"touchstart",b),null!=c&&mxEvent.addListener(a,"touchmove",c),null!=d&&mxEvent.addListener(a,"touchend",d));null!=e&&(mxClient.IS_POINTER?mxEvent.addListener(a,"pointercancel",e):mxClient.IS_TOUCH&&
mxEvent.addListener(a,"touchcancel",e))},removeGestureListeners:function(a,b,c,d,e){null!=b&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.removeListener(a,"touchstart",b),null!=c&&mxEvent.removeListener(a,"touchmove",c),null!=d&&mxEvent.removeListener(a,
"touchend",d));null!=e&&(mxClient.IS_POINTER?mxEvent.removeListener(a,"pointercancel",e):mxClient.IS_TOUCH&&mxEvent.removeListener(a,"touchcancel",e))},redirectMouseEvents:function(a,b,c,d,e,f,g){var h=function(k){return"function"==typeof c?c(k):c};mxEvent.addGestureListeners(a,function(k){null!=d?d(k):mxEvent.isConsumed(k)||b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(k,h(k)))},function(k){null!=e?e(k):mxEvent.isConsumed(k)||b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(k,h(k)))},
function(k){null!=f?f(k):mxEvent.isConsumed(k)||b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(k,h(k)))});mxEvent.addListener(a,"dblclick",function(k){if(null!=g)g(k);else if(!mxEvent.isConsumed(k)){var l=h(k);b.dblClick(k,null!=l?l.cell:null)}})},release:function(a){try{if(null!=a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;for(a=0;a<c;a+=1)mxEvent.release(b[a])}}}catch(d){}},addMouseWheelListener:function(a,b){if(null!=a){b=null!=b?b:window;if(mxClient.IS_SF&&
!mxClient.IS_TOUCH){var c=1;mxEvent.addListener(b,"gesturestart",function(h){mxEvent.consume(h);c=1});mxEvent.addListener(b,"gesturechange",function(h){mxEvent.consume(h);var k=c-h.scale;.2<Math.abs(k)&&(a(h,0>k,!0),c=h.scale)});mxEvent.addListener(b,"gestureend",function(h){mxEvent.consume(h)})}else{var d=[],e=0,f=function(){return Math.sqrt(Math.pow(d[0].clientX-d[1].clientX,2)+Math.pow(d[0].clientY-d[1].clientY,2))},g=function(){d=[];e=0};mxEvent.addGestureListeners(b,mxUtils.bind(this,function(h){mxEvent.isMouseEvent(h)||
null==h.pointerId||(d.push(h),2==d.length&&(e=f()))}),mxUtils.bind(this,function(h){if(!mxEvent.isMouseEvent(h)&&2==d.length){for(var k=0;k<d.length;k++)if(h.pointerId==d[k].pointerId){d[k]=h;break}h=f();0<e&&0<h&&Math.abs(h-e)>mxEvent.PINCH_THRESHOLD&&(a(d[0],h>e,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/2,d[0].clientY+(d[1].clientY-d[0].clientY)/2,h/e),e=h)}}),g,g)}mxEvent.addListener(b,"wheel",function(h){null==h&&(h=window.event);h.ctrlKey&&h.preventDefault();var k=0==h.deltaMode?.5:0;(Math.abs(h.deltaX)>
k||Math.abs(h.deltaY)>k||h.ctrlKey&&null!=h.deltaY&&0!=h.deltaY)&&a(h,0==h.deltaY?0<-h.deltaX:0<-h.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&
0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=
a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},
isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&&(a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},
consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",
RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",CONSUME_MOUSE_EVENT:"consumeMouseEvent",GESTURE:"gesture",CANCEL_MOUSE_GESTURE:"cancelMouseGesture",
TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",
LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",
UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",
START:"start",UPDATE:"update",RESET:"reset",PINCH_THRESHOLD:4};function mxXmlRequest(a,b,c,d,e,f){this.url=a;this.params=b;this.method=c||"POST";this.async=null!=d?d:!0;this.username=e;this.password=f}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null;mxXmlRequest.prototype.binary=!1;mxXmlRequest.prototype.withCredentials=!1;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;
mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=!1;mxXmlRequest.prototype.acceptResponse=!0;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(a){this.binary=a};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState};
mxXmlRequest.prototype.getDocumentElement=function(){var a=this.getXml();return null!=a?a.documentElement:null};mxXmlRequest.prototype.getXml=function(){var a=this.request.responseXML;if(9<=document.documentMode||null==a||null==a.documentElement)a=mxUtils.parseXml(this.request.responseText);return a};mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null};
mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var a=new XMLHttpRequest;this.isBinary()&&a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined");return a};if("undefined"!=typeof ActiveXObject)return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}();
mxXmlRequest.prototype.send=function(a,b,c,d){this.request=this.create();null!=this.request&&(null!=a&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&this.acceptResponse&&(this.acceptResponse=!1,a(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),null!=b&&(this.request.onerror=
mxUtils.bind(this,function(e){this.acceptResponse&&(this.acceptResponse=!1,b(this,e))})),(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&null!=c&&null!=d&&(this.request.timeout=c,this.request.ontimeout=d),this.request.send(this.params))};mxXmlRequest.prototype.setRequestHeaders=function(a,b){null!=b&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")};
mxXmlRequest.prototype.simulate=function(a,b){a=a||document;var c=null;a==document&&(c=window.onbeforeunload,window.onbeforeunload=null);var d=a.createElement("form");d.setAttribute("method",this.method);d.setAttribute("action",this.url);null!=b&&d.setAttribute("target",b);d.style.display="none";d.style.visibility="hidden";b=0<this.params.indexOf("&")?this.params.split("&"):this.params.split();for(var e=0;e<b.length;e++){var f=b[e].indexOf("=");if(0<f){var g=b[e].substring(0,f);f=b[e].substring(f+
1);this.decodeSimulateValues&&(f=decodeURIComponent(f));var h=a.createElement("textarea");h.setAttribute("wrap","off");h.setAttribute("name",g);mxUtils.write(h,f);d.appendChild(h)}}a.body.appendChild(d);d.submit();null!=d.parentNode&&d.parentNode.removeChild(d);null!=c&&(window.onbeforeunload=c)};
var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(a){mxClipboard.cells=a},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(a,b){b=mxClipboard.copy(a,b);mxClipboard.insertCount=0;mxClipboard.removeCells(a,b,!1);return b},removeCells:function(a,b,c){a.removeCells(b,c)},copy:function(a,b){b=b||a.getSelectionCells();b=a.getExportableCells(a.model.getTopmostCells(b));mxClipboard.insertCount=1;mxClipboard.setCells(a.cloneCells(b));
return b},paste:function(a){var b=null;if(!mxClipboard.isEmpty()){b=a.getImportableCells(mxClipboard.getCells());var c=mxClipboard.insertCount*mxClipboard.STEPSIZE,d=a.getDefaultParent();b=a.importCells(b,c,c,d);mxClipboard.insertCount++;a.setSelectionCells(b)}return b}};
function mxWindow(a,b,c,d,e,f,g,h,k,l){null!=b&&(g=null!=g?g:!0,this.content=b,this.init(c,d,e,f,l),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(g),this.setTitle(a),(null==h||h)&&this.installMoveHandler(),null!=k&&null!=k.parentNode?k.parentNode.replaceChild(this.div,k):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif";
mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.dockState=null;mxWindow.prototype.visible=!1;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=!0;
mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null;
mxWindow.prototype.init=function(a,b,c,d,e){e=null!=e?e:"mxWindow";this.div=document.createElement("div");this.div.className=e;this.div.setAttribute("role","dialog");this.div.style.left=a+"px";this.div.style.top=b+"px";this.table=document.createElement("table");this.table.className=e;mxClient.IS_POINTER&&(this.div.style.touchAction="none");null!=c&&(this.div.style.width=c+"px",this.table.style.width=c+"px");null!=d&&(this.div.style.height=d+"px",this.table.style.height=d+"px");a=document.createElement("tbody");
b=document.createElement("tr");this.title=document.createElement("td");this.title.className=e+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.title.appendChild(this.buttons);b.appendChild(this.title);a.appendChild(b);b=document.createElement("tr");this.td=document.createElement("td");this.td.className=e+"Pane";7==document.documentMode&&(this.td.style.height="100%");this.contentWrapper=
document.createElement("div");this.contentWrapper.className=e+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);"DIV"!=this.content.nodeName.toUpperCase()&&(this.contentWrapper.style.height="100%");this.td.appendChild(this.contentWrapper);b.appendChild(this.td);a.appendChild(b);this.table.appendChild(a);this.div.appendChild(this.table);e=mxUtils.bind(this,function(f){this.activate()});mxEvent.addGestureListeners(this.title,e);mxEvent.addGestureListeners(this.table,
e);this.hide()};mxWindow.prototype.setTitle=function(a){for(var b=this.title.firstChild;null!=b;){var c=b.nextSibling;b!=this.buttons&&b.parentNode.removeChild(b);b=c}mxUtils.write(this.title,a||"");this.title.appendChild(this.buttons);this.div.setAttribute("aria-label",a||"")};mxWindow.prototype.setScrollable=function(a){if(null==navigator.userAgent||0>navigator.userAgent.indexOf("Presto/2.5"))this.contentWrapper.style.overflow=a?"auto":"hidden"};
mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var a=mxUtils.getCurrentStyle(this.getElement());a=null!=a?a.zIndex:3;if(mxWindow.activeWindow){var b=mxWindow.activeWindow.getElement();null!=b&&null!=b.style&&(b.style.zIndex=a)}b=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(a)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",b))}};mxWindow.prototype.getElement=function(){return this.div};
mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){return null!=this.resize?"none"!=this.resize.style.display:!1};
mxWindow.prototype.setResizable=function(a){if(a)if(null==this.resize){this.resize=document.createElement("img");this.resize.setAttribute("alt","");this.resize.style.position="absolute";this.resize.style.bottom="0px";this.resize.style.right="0px";this.resize.style.zIndex="2";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nwse-resize";var b=null,c=null,d=null,e=null;a=mxUtils.bind(this,function(h){this.activate();b=mxEvent.getClientX(h);c=mxEvent.getClientY(h);d=this.div.offsetWidth;
e=this.div.offsetHeight;mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",h));mxEvent.consume(h)});var f=mxUtils.bind(this,function(h){if(null!=b&&null!=c){var k=mxEvent.getClientX(h)-b,l=mxEvent.getClientY(h)-c;this.setSize(d+k,e+l);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",h));mxEvent.consume(h)}}),g=mxUtils.bind(this,function(h){null!=b&&null!=c&&(c=b=null,mxEvent.removeGestureListeners(document,null,f,g),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,
"event",h)),mxEvent.consume(h))});mxEvent.addGestureListeners(this.resize,a,f,g);this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")};
mxWindow.prototype.setSize=function(a,b){a=Math.max(this.minimumSize.width,a);b=Math.max(this.minimumSize.height,b);this.div.style.width=a+"px";this.div.style.height=b+"px";this.table.style.width=a+"px";this.table.style.height=b+"px";this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"};mxWindow.prototype.setMinimizable=function(a){this.minimizeImg.style.display=a?"":"none"};
mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)};
mxWindow.prototype.toggleMinimized=function(a){this.activate();if(this.minimized)this.minimized=!1,this.minimizeImg.setAttribute("aria-expanded","true"),this.minimizeImg.setAttribute("src",this.minimizeImage),this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize")),this.contentWrapper.style.display="",this.maximize.style.display=this.maxDisplay,this.div.style.height=this.height,this.table.style.height=this.height,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,
"event",a));else{this.minimized=!0;this.minimizeImg.setAttribute("aria-expanded","false");this.minimizeImg.setAttribute("src",this.normalizeImage);this.minimizeImg.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="none";this.maxDisplay=this.maximize.style.display;this.maximize.style.display="none";this.height=this.table.style.height;var b=this.getMinimumSize();0<b.height&&(this.div.style.height=b.height+"px",this.table.style.height=b.height+"px");0<
b.width&&(this.div.style.width=b.width+"px",this.table.style.width=b.width+"px");null!=this.resize&&(this.resize.style.visibility="hidden");this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",a))}};
mxWindow.prototype.installMinimizeHandler=function(){this.minimizeImg=document.createElement("img");this.minimizeImg.setAttribute("src",this.minimizeImage);this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize"));this.minimizeImg.style.cursor="pointer";this.minimizeImg.style.marginLeft="2px";this.minimizeImg.style.display="none";this.buttons.appendChild(this.minimizeImg);this.minimized=!1;this.height=this.maxDisplay=null;var a=mxUtils.bind(this,function(b){this.toggleMinimized(b);
mxEvent.consume(b)});mxEvent.addGestureListeners(this.minimizeImg,a);this.installKeyboardButton(this.minimizeImg,a);this.minimizeImg.setAttribute("aria-expanded","true")};mxWindow.prototype.installKeyboardButton=function(a,b){a.setAttribute("role","button");a.setAttribute("tabindex","0");mxEvent.addListener(a,"keydown",function(c){13!=c.keyCode&&32!=c.keyCode||mxEvent.isAltDown(c)||mxEvent.isControlDown(c)||mxEvent.isMetaDown(c)||(b(c),mxEvent.consume(c))})};
mxWindow.prototype.setMaximizable=function(a){this.maximize.style.display=a?"":"none"};
mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var a=!1,b=null,c=null,d=null,e=null,f=null,g=mxUtils.bind(this,function(h){this.activate();
if("none"!=this.maximize.style.display){if(a){a=!1;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.contentWrapper.style.display="";this.minimizeImg.style.display=f;this.div.style.left=b+"px";this.div.style.top=c+"px";this.div.style.height=d;this.div.style.width=e;k=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==k.overflow||null!=this.resize)this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-
this.contentHeightCorrection+"px";this.table.style.height=d;this.table.style.width=e;null!=this.resize&&(this.resize.style.visibility="");this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",h))}else{a=!0;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="";f=this.minimizeImg.style.display;this.minimizeImg.style.display="none";b=parseInt(this.div.style.left);c=parseInt(this.div.style.top);
d=this.table.style.height;e=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";k=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=k-2+"px";this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=k-2+"px";null!=this.resize&&(this.resize.style.visibility="hidden");var k=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==k.overflow||null!=this.resize)this.contentWrapper.style.height=
this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px";this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",h))}mxEvent.consume(h)}});mxEvent.addGestureListeners(this.maximize,g);mxEvent.addListener(this.title,"dblclick",g);this.installKeyboardButton(this.maximize,g)};
mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(a){var b=mxEvent.getClientX(a),c=mxEvent.getClientY(a),d=this.getX(),e=this.getY(),f=mxUtils.bind(this,function(h){var k=mxEvent.getClientX(h)-b,l=mxEvent.getClientY(h)-c;this.setLocation(d+k,e+l);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",h));mxEvent.consume(h)}),g=mxUtils.bind(this,function(h){mxEvent.removeGestureListeners(document,null,f,
g);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",h));mxEvent.consume(h)});mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",a));mxEvent.consume(a)}));mxClient.IS_POINTER&&(this.title.style.touchAction="none")};mxWindow.prototype.setLocation=function(a,b){null!=this.div&&(this.div.style.left=a+"px",this.div.style.top=b+"px")};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)};
mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title",mxResources.get("close",null,"Close"));this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(a){this.close(a);mxEvent.consume(a)}));this.installKeyboardButton(this.closeImg,
mxUtils.bind(this,function(a){this.close(a)}))};mxWindow.prototype.close=function(a){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",a));this.destroyOnClose?this.destroy():this.setVisible(!1)};mxWindow.prototype.close=function(a){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",a));this.destroyOnClose?this.destroy():this.setVisible(!1)};
mxWindow.prototype.setImage=function(a){this.image=document.createElement("img");this.image.setAttribute("src",a);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(a){this.closeImg.style.display=a?"":"none"};mxWindow.prototype.isClosable=function(){return null!=this.closeImg&&"none"!=this.closeImg.style.display};
mxWindow.prototype.isVisible=function(){return null!=this.div?"none"!=this.div.style.display:!1};mxWindow.prototype.setVisible=function(a){null!=this.div&&(this.isVisible()!=a?a?this.show():this.hide():this.fireEvent(new mxEventObject(a?mxEvent.SHOW:mxEvent.HIDE)))};
mxWindow.prototype.show=function(){this.div.style.display="";this.activate();"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))};
mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null);this.contentWrapper=this.content=this.title=null};function mxForm(a){this.table=document.createElement("table");this.table.className=a;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=!1;mxForm.prototype.getTable=function(){return this.table};
mxForm.prototype.addButtons=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");c.appendChild(d);d=document.createElement("td");var e=document.createElement("button");mxUtils.write(e,mxResources.get("ok")||"OK");d.appendChild(e);mxEvent.addListener(e,"click",function(){a()});e=document.createElement("button");mxUtils.write(e,mxResources.get("cancel")||"Cancel");d.appendChild(e);mxEvent.addListener(e,"click",function(){b()});c.appendChild(d);this.body.appendChild(c)};
mxForm.prototype.addText=function(a,b,c){var d=document.createElement("input");d.setAttribute("type",c||"text");d.value=b;return this.addField(a,d)};mxForm.prototype.addCheckbox=function(a,b){var c=document.createElement("input");c.setAttribute("type","checkbox");this.addField(a,c);b&&(c.checked=!0);return c};mxForm.prototype.addTextarea=function(a,b,c){var d=document.createElement("textarea");mxClient.IS_NS&&c--;d.setAttribute("rows",c||2);d.value=b;return this.addField(a,d)};
mxForm.prototype.addCombo=function(a,b,c){var d=document.createElement("select");null!=c&&d.setAttribute("size",c);b&&d.setAttribute("multiple","true");return this.addField(a,d)};mxForm.prototype.addOption=function(a,b,c,d){var e=document.createElement("option");mxUtils.writeln(e,b);e.setAttribute("value",c);d&&e.setAttribute("selected",d);a.appendChild(e)};
mxForm.prototype.addField=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");mxUtils.write(d,a);c.appendChild(d);d=document.createElement("td");d.appendChild(b);c.appendChild(d);this.body.appendChild(c);return b};function mxImage(a,b,c,d,e){this.src=a;this.width=null!=b?b:this.width;this.height=null!=c?c:this.height;this.x=null!=d?d:this.x;this.y=null!=e?e:this.y}mxImage.prototype.src=null;mxImage.prototype.width=0;mxImage.prototype.height=0;mxImage.prototype.x=0;
mxImage.prototype.y=0;function mxDivResizer(a,b){"div"==a.nodeName.toLowerCase()&&(null==b&&(b=window),this.div=a,a=mxUtils.getCurrentStyle(a),null!=a&&(this.resizeWidth="auto"==a.width,this.resizeHeight="auto"==a.height),mxEvent.addListener(b,"resize",mxUtils.bind(this,function(c){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize())}mxDivResizer.prototype.resizeWidth=!0;mxDivResizer.prototype.resizeHeight=!0;mxDivResizer.prototype.handlingResize=!1;
mxDivResizer.prototype.resize=function(){var a=this.getDocumentWidth(),b=this.getDocumentHeight(),c=parseInt(this.div.style.left),d=parseInt(this.div.style.right),e=parseInt(this.div.style.top),f=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(c)&&!isNaN(d)&&0<=c&&0<=d&&0<a-d-c&&(this.div.style.width=a-d-c+"px");this.resizeHeight&&!isNaN(e)&&!isNaN(f)&&0<=e&&0<=f&&0<b-e-f&&(this.div.style.height=b-e-f+"px")};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth};
mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};function mxDragSource(a,b){this.element=a;this.dropHandler=b;mxEvent.addGestureListeners(a,mxUtils.bind(this,function(c){this.mouseDown(c);mxEvent.consume(c)}));mxEvent.addListener(a,"dragstart",function(c){mxEvent.consume(c)});this.eventConsumer=function(c,d){c=d.getProperty("eventName");d=d.getProperty("event");c!=mxEvent.MOUSE_DOWN&&d.consume()}}mxDragSource.prototype.element=null;
mxDragSource.prototype.dropHandler=null;mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=!0;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=!0;
mxDragSource.prototype.guidesEnabled=!0;mxDragSource.prototype.gridEnabled=!0;mxDragSource.prototype.highlightDropTargets=!0;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=!0;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(a){this.enabled=a};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled};
mxDragSource.prototype.setGuidesEnabled=function(a){this.guidesEnabled=a};mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxDragSource.prototype.getGraphForEvent=function(a){return null};mxDragSource.prototype.getDropTarget=function(a,b,c,d){return a.getCellAt(b,c)};mxDragSource.prototype.createDragElement=function(a){return this.element.cloneNode(!0)};mxDragSource.prototype.createPreviewElement=function(a){return null};
mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler};mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null);this.removeDragElement();this.removeListeners();this.stopDrag()};
mxDragSource.prototype.mouseDown=function(a){this.enabled&&!mxEvent.isConsumed(a)&&null==this.mouseMoveHandler&&(this.startDrag(a),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),this.mouseCancelHandler=mxUtils.bind(this,this.mouseCancel),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler,this.mouseCancelHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(a)&&(this.eventSource=mxEvent.getSource(a),mxEvent.addGestureListeners(this.eventSource,
null,this.mouseMoveHandler,this.mouseUpHandler,this.mouseCancelHandler)))};mxDragSource.prototype.startDrag=function(a){this.dragElement=this.createDragElement(a);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()};
mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)};mxDragSource.prototype.getElementForEvent=function(a){return mxEvent.isTouchEvent(a)||mxEvent.isPenEvent(a)?document.elementFromPoint(mxEvent.getClientX(a),mxEvent.getClientY(a)):mxEvent.getSource(a)};
mxDragSource.prototype.graphContainsEvent=function(a,b){var c=mxEvent.getClientX(b),d=mxEvent.getClientY(b),e=mxUtils.getOffset(a.container),f=mxUtils.getScrollOrigin();b=this.getElementForEvent(b);if(this.checkEventSource)for(;null!=b&&b!=a.container;)b=b.parentNode;return null!=b&&c>=e.x-f.x&&d>=e.y-f.y&&c<=e.x-f.x+a.container.offsetWidth&&d<=e.y-f.y+a.container.offsetHeight};
mxDragSource.prototype.mouseMove=function(a){var b=this.getGraphForEvent(a);null==b||this.graphContainsEvent(b,a)||(b=null);b!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,a),this.currentGraph=b,null!=this.currentGraph&&this.dragEnter(this.currentGraph,a));null!=this.currentGraph&&this.dragOver(this.currentGraph,a);if(null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&mxUtils.setOpacity(this.dragElement,
0);else{b=mxEvent.getClientX(a);var c=mxEvent.getClientY(a);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement);mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);null!=this.dragOffset&&(b+=this.dragOffset.x,c+=this.dragOffset.y);var d=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=b+d.x+"px";this.dragElement.style.top=c+d.y+"px"}mxEvent.consume(a)};
mxDragSource.prototype.mouseUp=function(a){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var b=this.currentGraph.view.scale,c=this.currentGraph.view.translate;this.drop(this.currentGraph,a,this.currentDropTarget,this.currentPoint.x/b-c.x,this.currentPoint.y/b-c.y)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(a)};
mxDragSource.prototype.mouseCancel=function(a){this.reset()};mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler,this.mouseCancelHandler),this.eventSource=null);mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler,this.mouseCancelHandler);this.mouseCancelHandler=this.mouseUpHandler=this.mouseMoveHandler=null};
mxDragSource.prototype.dragEnter=function(a,b){a.isMouseDown=!0;a.isMouseTrigger=mxEvent.isMouseEvent(b);this.previewElement=this.createPreviewElement(a);null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none");this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(a,a.graphHandler.getGuideStates()));this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(a,mxConstants.DROP_TARGET_COLOR));a.addListener(mxEvent.FIRE_MOUSE_EVENT,
this.eventConsumer)};mxDragSource.prototype.dragExit=function(a,b){this.currentPoint=this.currentDropTarget=null;a.isMouseDown=!1;a.removeListener(this.eventConsumer);null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null);null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null);null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)};
mxDragSource.prototype.dragOver=function(a,b){var c=mxUtils.getOffset(a.container),d=mxUtils.getScrollOrigin(a.container),e=mxEvent.getClientX(b)-c.x+d.x-a.panDx;c=mxEvent.getClientY(b)-c.y+d.y-a.panDy;a.autoScroll&&(null==this.autoscroll||this.autoscroll)&&a.scrollPointToVisible(e,c,a.autoExtend);null!=this.currentHighlight&&a.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(a,e,c,b),d=a.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(d));if(null!=this.previewElement){null==
this.previewElement.parentNode&&(a.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");d=this.isGridEnabled()&&a.isGridEnabledEvent(b);var f=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(b))a=parseInt(this.previewElement.style.width),f=parseInt(this.previewElement.style.height),a=new mxRectangle(0,0,a,f),c=new mxPoint(e,c),c=this.currentGuide.move(a,c,d,!0),f=!1,e=c.x,c=c.y;else if(d){d=a.view.scale;b=
a.view.translate;var g=a.gridSize/2;e=(a.snap(e/d-b.x-g)+b.x)*d;c=(a.snap(c/d-b.y-g)+b.y)*d}null!=this.currentGuide&&f&&this.currentGuide.hide();null!=this.previewOffset&&(e+=this.previewOffset.x,c+=this.previewOffset.y);this.previewElement.style.left=Math.round(e)+"px";this.previewElement.style.top=Math.round(c)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(e,c)};
mxDragSource.prototype.drop=function(a,b,c,d,e){this.dropHandler.apply(this,arguments);"hidden"!=a.container.style.visibility&&a.container.focus()};function mxToolbar(a){this.container=a}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=!0;mxToolbar.prototype.noReset=!1;mxToolbar.prototype.updateDefaultMode=!0;
mxToolbar.prototype.addItem=function(a,b,c,d,e,f){var g=document.createElement(null!=b?"img":"button"),h=e||(null!=f?"mxToolbarMode":"mxToolbarItem");g.className=h;g.setAttribute("src",b);null!=a&&(null!=b?g.setAttribute("title",a):mxUtils.write(g,a));this.container.appendChild(g);null!=c&&(mxEvent.addListener(g,"click",c),mxClient.IS_TOUCH&&mxEvent.addListener(g,"touchend",c));a=mxUtils.bind(this,function(k){null!=d?g.setAttribute("src",b):g.style.backgroundColor=""});mxEvent.addGestureListeners(g,
mxUtils.bind(this,function(k){null!=d?g.setAttribute("src",d):g.style.backgroundColor="gray";if(null!=f){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var l=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu();l!=g&&(this.currentImg=g,this.menu.factoryMethod=f,l=new mxPoint(g.offsetLeft,g.offsetTop+g.offsetHeight),this.menu.popup(l.x,l.y,null,k),this.menu.isMenuShowing()&&(g.className=h+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this);
g.className=h;this.currentImg=null}))}}),null,a);mxEvent.addListener(g,"mouseout",a);return g};mxToolbar.prototype.addCombo=function(a){var b=document.createElement("div");b.style.display="inline";b.className="mxToolbarComboContainer";var c=document.createElement("select");c.className=a||"mxToolbarCombo";b.appendChild(c);this.container.appendChild(b);return c};
mxToolbar.prototype.addActionCombo=function(a,b){var c=document.createElement("select");c.className=b||"mxToolbarCombo";this.addOption(c,a,null);mxEvent.addListener(c,"change",function(d){var e=c.options[c.selectedIndex];c.selectedIndex=0;null!=e.funct&&e.funct(d)});this.container.appendChild(c);return c};mxToolbar.prototype.addOption=function(a,b,c){var d=document.createElement("option");mxUtils.writeln(d,b);"function"==typeof c?d.funct=c:d.setAttribute("value",c);a.appendChild(d);return d};
mxToolbar.prototype.addSwitchMode=function(a,b,c,d,e){var f=document.createElement("img");f.initialClassName=e||"mxToolbarMode";f.className=f.initialClassName;f.setAttribute("src",b);f.altIcon=d;null!=a&&f.setAttribute("title",a);mxEvent.addListener(f,"click",mxUtils.bind(this,function(g){g=this.selectedMode.altIcon;null!=g?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",g)):this.selectedMode.className=this.selectedMode.initialClassName;this.updateDefaultMode&&
(this.defaultMode=f);this.selectedMode=f;g=f.altIcon;null!=g?(f.altIcon=f.getAttribute("src"),f.setAttribute("src",g)):f.className=f.initialClassName+"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT));c()}));this.container.appendChild(f);null==this.defaultMode&&(this.defaultMode=f,this.selectMode(f),c());return f};
mxToolbar.prototype.addMode=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement(null!=b?"img":"button");g.initialClassName=e||"mxToolbarMode";g.className=g.initialClassName;g.setAttribute("src",b);g.altIcon=d;null!=a&&g.setAttribute("title",a);this.enabled&&f&&(mxEvent.addListener(g,"click",mxUtils.bind(this,function(h){this.selectMode(g,c);this.noReset=!1})),mxEvent.addListener(g,"dblclick",mxUtils.bind(this,function(h){this.selectMode(g,c);this.noReset=!0})),null==this.defaultMode&&
(this.defaultMode=g,this.defaultFunction=c,this.selectMode(g,c)));this.container.appendChild(g);return g};
mxToolbar.prototype.selectMode=function(a,b){if(this.selectedMode!=a){if(null!=this.selectedMode){var c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=a;c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName+
"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",b))}};mxToolbar.prototype.resetMode=function(a){!a&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)};mxToolbar.prototype.addSeparator=function(a){return this.addItem(null,a,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)};
mxToolbar.prototype.addLine=function(){var a=document.createElement("hr");a.style.marginRight="6px";a.setAttribute("size","1");this.container.appendChild(a)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null;null!=this.menu&&this.menu.destroy()};function mxUndoableEdit(a,b){this.source=a;this.changes=[];this.significant=null!=b?b:!0}mxUndoableEdit.prototype.source=null;
mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){};
mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var b=this.changes[a];null!=b.execute?b.execute():null!=b.undo&&b.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",b))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};
mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,b=0;b<a;b++){var c=this.changes[b];null!=c.execute?c.execute():null!=c.redo&&c.redo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!1;this.redone=!0;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};function mxUndoManager(a){this.size=null!=a?a:100;this.clear()}mxUndoManager.prototype=new mxEventSource;
mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd};
mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var a=this.history[--this.indexOfNextAdd];a.undo();if(a.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length};
mxUndoManager.prototype.redo=function(){for(var a=this.history.length;this.indexOfNextAdd<a;){var b=this.history[this.indexOfNextAdd++];b.redo();if(b.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",b));break}}};mxUndoManager.prototype.undoableEditHappened=function(a){this.trim();0<this.size&&this.size==this.history.length&&this.history.shift();this.history.push(a);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",a))};
mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),b=0;b<a.length;b++)a[b].die()};var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=!0;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null;
mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var a=this.baseUrl.lastIndexOf("/");0<a&&(this.baseUrl=this.baseUrl.substring(0,a+1))};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(a){this.enabled=a};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(a){this.baseUrl=a};
mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(a){this.baseDomain=a};mxUrlConverter.prototype.isRelativeUrl=function(a){return"string"===typeof a&&"data:image"!=a.substring(0,10)&&!/^(\/\/|[a-zA-Z][a-zA-Z\d+\-.]*:)/.test(a)};mxUrlConverter.prototype.convert=function(a){this.isEnabled()&&this.isRelativeUrl(a)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),a="/"==a.charAt(0)?this.getBaseDomain()+a:this.getBaseUrl()+a);return a};
function mxPanningManager(a){this.thread=null;this.active=!1;this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0;this.scrollbars=!1;this.scrollTop=this.scrollLeft=0;this.mouseListener={mouseDown:function(c,d){},mouseMove:function(c,d){},mouseUp:mxUtils.bind(this,function(c,d){this.active&&this.stop()})};a.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()});mxEvent.addListener(document,"mouseup",this.mouseUpListener);var b=mxUtils.bind(this,
function(){this.scrollbars=mxUtils.hasScrollbars(a.container);this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;return window.setInterval(mxUtils.bind(this,function(){this.tdx-=this.dx;this.tdy-=this.dy;this.scrollbars?(a.panGraph(-a.container.scrollLeft-Math.ceil(this.dx),-a.container.scrollTop-Math.ceil(this.dy)),a.panDx=this.scrollLeft-a.container.scrollLeft,a.panDy=this.scrollTop-a.container.scrollTop,a.fireEvent(new mxEventObject(mxEvent.PAN))):a.panGraph(this.getDx(),
this.getDy())}),this.delay)});this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=a.view.translate.x;this.t0y=a.view.translate.y;this.active=!0};this.panTo=function(c,d,e,f){this.active||this.start();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;e=null!=e?e:0;f=null!=f?f:0;var g=a.container,h=this.getBorders(g);this.dx=c+e-g.scrollLeft-g.clientWidth;
this.dx=0>this.dx&&Math.abs(this.dx)<h.right?h.right+this.dx:this.handleMouseOut?Math.max(this.dx,0):0;0==this.dx&&(this.dx=c-g.scrollLeft,this.dx=0<this.dx&&this.dx<h.left?this.dx-h.left:this.handleMouseOut?Math.min(0,this.dx):0);this.dy=d+f-g.scrollTop-g.clientHeight;this.dy=0>this.dy&&Math.abs(this.dy)<h.bottom?h.bottom+this.dy:this.handleMouseOut?Math.max(this.dy,0):0;0==this.dy&&(this.dy=d-g.scrollTop,this.dy=0<this.dy&&this.dy<h.top?this.dy-h.top:this.handleMouseOut?Math.min(0,this.dy):0);0!=
this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=b())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)};this.getBorders=function(c){var d={left:this.border,top:this.border,right:this.border,bottom:this.border};if(0<this.windowBorder){var e=c.getBoundingClientRect(),f=this.windowBorder,g=window.innerWidth||document.documentElement.clientWidth,h=window.innerHeight||document.documentElement.clientHeight;1>e.left&&(d.left=Math.max(d.left,
f));1>e.top&&(d.top=Math.max(d.top,f));e.left+c.clientLeft+c.clientWidth>g-1&&(d.right=Math.max(d.right,f));e.top+c.clientTop+c.clientHeight>h-1&&(d.bottom=Math.max(d.bottom,f))}return d};this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)a.panDx=0,a.panDy=0,a.fireEvent(new mxEventObject(mxEvent.PAN));else{var c=a.panDx,d=a.panDy;if(0!=c||0!=d)a.panGraph(0,0),a.view.setTranslate(this.t0x+
c/a.view.scale,this.t0y+d/a.view.scale)}};this.destroy=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null);this.active=!1;a.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=!0;mxPanningManager.prototype.border=0;mxPanningManager.prototype.windowBorder=0;
function mxPopupMenu(a){this.factoryMethod=a;null!=a&&this.init()}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4=";mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;
mxPopupMenu.prototype.useLeftButtonForPopup=!1;mxPopupMenu.prototype.enabled=!0;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=!1;mxPopupMenu.prototype.smartSeparators=!1;mxPopupMenu.prototype.labels=!0;mxPopupMenu.prototype.returnFocus=null;mxPopupMenu.prototype.actionFocus=null;
mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.table.setAttribute("role","menu");this.tbody=document.createElement("tbody");this.tbody.setAttribute("role","none");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div);this.installKeyHandler(this.div)};
mxPopupMenu.prototype.isEnabled=function(){return this.enabled};mxPopupMenu.prototype.setEnabled=function(a){this.enabled=a};mxPopupMenu.prototype.isPopupTrigger=function(a){return a.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(a.getEvent())};
mxPopupMenu.prototype.addItem=function(a,b,c,d,e,f,g,h){d=d||this;this.itemCount++;d.willAddSeparator&&(d.containsItems&&this.addSeparator(d,!0),d.willAddSeparator=!1);d.containsItems=!0;var k=document.createElement("tr");k.className="mxPopupMenuItem";k.setAttribute("role","menuitem");null==f||f||k.setAttribute("aria-disabled","true");var l=document.createElement("td");l.className="mxPopupMenuIcon";l.setAttribute("role","none");null!=b?(e=document.createElement("img"),e.src=b,l.appendChild(e)):null!=
e&&(b=document.createElement("div"),b.className=e,l.appendChild(b));k.appendChild(l);this.labels&&(l=document.createElement("td"),l.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),l.setAttribute("role","none"),mxUtils.write(l,a),l.align="left",k.appendChild(l),a=document.createElement("td"),a.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),a.setAttribute("role","none"),a.style.paddingRight="6px",a.style.textAlign="right",k.appendChild(a),null==d.div&&this.createSubmenu(d));d.tbody.appendChild(k);
0==g||h||(k.menuParent=d,mxEvent.addListener(k,"focus",mxUtils.bind(this,function(){for(var n=this.getItems(d),p=0;p<n.length;p++)n[p].className="mxPopupMenuItem";k.className="mxPopupMenuItemHover"})),mxEvent.addListener(k,"blur",mxUtils.bind(this,function(){this.isHighlightedItem(k)||(k.className="mxPopupMenuItem")})));if(0!=g&&0!=f){var m=null;k.activate=mxUtils.bind(this,function(n){this.hideMenu();null!=c&&c(n)});mxEvent.addGestureListeners(k,mxUtils.bind(this,function(n){this.eventReceiver=k;
d.activeRow!=k&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),null!=k.div&&(this.showSubmenu(d,k),d.activeRow=k));null!=document.selection&&8==document.documentMode&&(m=document.selection.createRange());mxEvent.consume(n)}),mxUtils.bind(this,function(n){d.activeRow!=k&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),this.autoExpand&&null!=k.div&&(this.showSubmenu(d,k),d.activeRow=k));h||(k.className="mxPopupMenuItemHover");
null!=k.menuParent&&this.isMenuElement(document.activeElement)&&this.focusItem(k,!0)}),mxUtils.bind(this,function(n){if(this.eventReceiver==k){d.activeRow!=k&&this.hideMenu();if(null!=m){try{m.select()}catch(p){}m=null}null!=c&&c(n)}this.eventReceiver=null;mxEvent.consume(n)}));h||mxEvent.addListener(k,"mouseout",mxUtils.bind(this,function(n){this.isHighlightedItem(k)||(k.className="mxPopupMenuItem")}))}return k};
mxPopupMenu.prototype.addCheckmark=function(a,b){a.setAttribute("role","menuitemcheckbox");a.setAttribute("aria-checked","true");a=this.addImage(a.firstChild.nextSibling,b);a.style.marginTop="-2px";a.style.left="6px"};
mxPopupMenu.prototype.addImage=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.display="inline-block";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="center center";c.style.backgroundImage="url("+b+")";c.style.backgroundSize="22px";c.style.height="22px";c.style.width="22px";a.appendChild(c);return c};
mxPopupMenu.prototype.createSubmenu=function(a){a.table=document.createElement("table");a.table.className="mxPopupMenu";a.table.setAttribute("role","menu");a.tbody=document.createElement("tbody");a.tbody.setAttribute("role","none");a.table.appendChild(a.tbody);a.div=document.createElement("div");a.div.className="mxPopupMenu";a.div.style.position="absolute";a.div.style.display="inline";a.div.style.zIndex=this.zIndex;a.div.appendChild(a.table);a.setAttribute("aria-haspopup","menu");a.setAttribute("aria-expanded",
"false");this.installKeyHandler(a.div);a=this.addImage(a.firstChild.nextSibling.nextSibling,this.submenuImage);a.style.marginLeft="-18px";a.style.marginTop="-11px"};
mxPopupMenu.prototype.showSubmenu=function(a,b){if(null!=b.div){b.div.style.left=a.div.offsetLeft+b.offsetLeft+b.offsetWidth-1+"px";b.div.style.top=a.div.offsetTop+b.offsetTop+"px";document.body.appendChild(b.div);b.setAttribute("aria-expanded","true");var c=parseInt(b.div.offsetLeft),d=parseInt(b.div.offsetWidth),e=mxUtils.getDocumentScrollOrigin(document),f=document.documentElement;c+d>e.x+(document.body.clientWidth||f.clientWidth)&&(b.div.style.left=Math.max(0,a.div.offsetLeft-d+16)+"px");b.div.style.overflowY=
"auto";b.div.style.overflowX="hidden";b.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px";mxUtils.fit(b.div)}};
mxPopupMenu.prototype.addSeparator=function(a,b){a=a||this;if(this.smartSeparators&&!b)a.willAddSeparator=!0;else if(null!=a.tbody){a.willAddSeparator=!1;b=document.createElement("tr");b.setAttribute("role","separator");var c=document.createElement("td");c.className="mxPopupMenuIcon";c.setAttribute("role","none");c.style.padding="0 0 0 0px";b.appendChild(c);c=document.createElement("td");c.setAttribute("role","none");c.style.padding="0 0 0 0px";c.setAttribute("colSpan","2");var d=document.createElement("hr");
d.setAttribute("size","1");c.appendChild(d);b.appendChild(c);a.tbody.appendChild(b)}};mxPopupMenu.prototype.popup=function(a,b,c,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.returnFocus=null;this.div.style.left=a+"px";for(this.div.style.top=b+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,c,d);0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}};
mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none");document.body.appendChild(this.div);null==this.documentKeyHandler&&(this.documentKeyHandler=mxUtils.bind(this,this.documentKeyDown),document.addEventListener("keydown",this.documentKeyHandler,!0));window.setTimeout(mxUtils.bind(this,function(){null!=this.div&&mxUtils.fit(this.div)}),0)};
mxPopupMenu.prototype.hideMenu=function(){this.removeDocumentKeyHandler();null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))};
mxPopupMenu.prototype.hideSubmenu=function(a){null!=a.activeRow&&(this.hideSubmenu(a.activeRow),null!=a.activeRow.div.parentNode&&a.activeRow.div.parentNode.removeChild(a.activeRow.div),a.activeRow.setAttribute("aria-expanded","false"),document.activeElement!=a.activeRow&&(a.activeRow.className="mxPopupMenuItem"),a.activeRow=null)};
mxPopupMenu.prototype.installKeyHandler=function(a){mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(b){var c=mxEvent.getSource(b);if(null!=c.menuParent)this.keyDown(b,c)&&mxEvent.consume(b);else if(!(38!=b.keyCode&&40!=b.keyCode||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||mxEvent.isShiftDown(b))){var d=this.getInputParent(c);null!=d&&c==this.getMenuInput(d)&&(this.focusFirstItem(38==b.keyCode,d),mxEvent.consume(b))}}));mxEvent.addListener(a,"focusout",mxUtils.bind(this,
function(b){null!=b.relatedTarget&&this.isMenuShowing()&&!this.isMenuElement(b.relatedTarget)&&this.hideMenu()}))};mxPopupMenu.prototype.isMenuElement=function(a){for(var b=this,c=mxUtils.isAncestorNode(this.div,a);!c&&null!=b.activeRow;)b=b.activeRow,c=mxUtils.isAncestorNode(b.div,a);return c};
mxPopupMenu.prototype.getMenuInput=function(a){for(var b=null!=a.tbody?a.tbody.getElementsByTagName("input"):[],c=0;c<b.length;c++){for(var d=b[c];null!=d&&d.parentNode!=a.tbody;)d=d.parentNode;if(null!=d&&null==d.menuParent&&null==b[c].list&&/^(text|search|email|url|tel|password)$/.test(b[c].type))return b[c]}return null};
mxPopupMenu.prototype.getInputParent=function(a){for(;null!=a&&"TBODY"!=a.nodeName;)a=a.parentNode;for(a=null!=a?a.firstChild:null;null!=a;a=a.nextSibling)if(null!=a.menuParent)return a.menuParent;return null};mxPopupMenu.prototype.getItems=function(a){for(var b=[],c=a.tbody.firstChild;null!=c;c=c.nextSibling)c.menuParent==a&&"none"!=c.style.display&&b.push(c);return b};mxPopupMenu.prototype.isHighlightedItem=function(a){return document.activeElement==a||"true"==a.getAttribute("aria-expanded")};
mxPopupMenu.prototype.getHoverItem=function(){for(var a=null,b=this;null!=b;b=b.activeRow)for(var c=this.getItems(b),d=0;d<c.length;d++)"mxPopupMenuItemHover"==c[d].className&&(a=c[d]);return a};mxPopupMenu.prototype.focusItem=function(a,b){null!=a&&(a.tabIndex=-1,a.focus({preventScroll:1==b}))};mxPopupMenu.prototype.isTextInputEvent=function(a){a=mxEvent.getSource(a);return a.isContentEditable||"TEXTAREA"==a.nodeName||"SELECT"==a.nodeName||"INPUT"==a.nodeName&&!/^(button|checkbox|color|file|image|radio|range|reset|submit)$/.test(a.type)};
mxPopupMenu.prototype.documentKeyDown=function(a){var b=mxEvent.getSource(a);if(!(!this.isMenuShowing()||this.isMenuElement(b)||this.isTextInputEvent(a)||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a))){var c=mxEvent.isShiftDown(a),d=!c&&35<=a.keyCode&&40>=a.keyCode,e=this.getHoverItem();null==this.returnFocus&&b!=document.body&&(this.returnFocus=b);27==a.keyCode?(this.hideMenu(),mxEvent.consume(a)):null==e||!d&&13!=a.keyCode&&32!=a.keyCode?c||37!=a.keyCode&&39!=a.keyCode?d&&
(this.focusFirstItem(38==a.keyCode||35==a.keyCode),mxEvent.consume(a)):(this.moveToSiblingMenu(37==a.keyCode,a),mxEvent.consume(a)):(this.focusItem(e,!0),this.keyDown(a,e),mxEvent.consume(a))}};mxPopupMenu.prototype.removeDocumentKeyHandler=function(){null!=this.documentKeyHandler&&(document.removeEventListener("keydown",this.documentKeyHandler,!0),this.documentKeyHandler=null)};mxPopupMenu.prototype.focusFirstItem=function(a,b){b=this.getItems(b||this);this.focusItem(b[a?b.length-1:0])};
mxPopupMenu.prototype.moveToSiblingMenu=function(a,b){return!1};
mxPopupMenu.prototype.keyDown=function(a,b){var c=b.menuParent,d=this.getItems(c),e=mxUtils.indexOf(d,b),f="true"!=b.getAttribute("aria-disabled"),g=!mxEvent.isAltDown(a)&&!mxEvent.isControlDown(a)&&!mxEvent.isMetaDown(a);if(g)if(!mxEvent.isShiftDown(a)||37!=a.keyCode&&39!=a.keyCode)if(38==a.keyCode||40==a.keyCode||36==a.keyCode||35==a.keyCode)b=38==a.keyCode&&0==e||40==a.keyCode&&e==d.length-1?this.getMenuInput(c):null,this.hideSubmenu(c),null!=b?b.focus():this.focusItem(d[36==a.keyCode?0:35==a.keyCode?
d.length-1:(e+(38==a.keyCode?d.length-1:1))%d.length]);else if(null==b.div||!f||39!=a.keyCode&&13!=a.keyCode&&32!=a.keyCode)if(13==a.keyCode||32==a.keyCode)null!=b.activate&&(c=null!=this.actionFocus?this.actionFocus:this.returnFocus,b.activate(a),null!=document.activeElement&&document.activeElement!=document.body||this.restoreFocus(c));else if(c==this||37!=a.keyCode&&27!=a.keyCode)if(37==a.keyCode||39==a.keyCode)g=this.moveToSiblingMenu(37==a.keyCode,a);else if(27==a.keyCode||9==a.keyCode)this.hideMenu(),
this.restoreFocus(this.returnFocus),g=27==a.keyCode;else if(null!=a.key&&1==a.key.length&&" "!=a.key)for(a=a.key.toLowerCase(),g=!1,b=1;b<=d.length&&!g;b++)f=d[(e+b)%d.length],f.textContent.trim().toLowerCase().charAt(0)==a&&(this.hideSubmenu(c),this.focusItem(f),g=!0);else g=!1;else this.hideSubmenu(c.menuParent),this.focusItem(c);else c.activeRow!=b&&(this.hideSubmenu(c),this.showSubmenu(c,b),c.activeRow=b),this.focusFirstItem(!1,b);else this.hideMenu(),this.restoreFocus(this.returnFocus),g=!1;
return g};mxPopupMenu.prototype.restoreFocus=function(a){null!=a&&0<a.getClientRects().length&&a.focus()};mxPopupMenu.prototype.destroy=function(){this.removeDocumentKeyHandler();null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)};function mxAutoSaveManager(a){this.changeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.graphModelChanged(c.getProperty("edit").changes)});this.setGraph(a)}
mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null;mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=!0;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};
mxAutoSaveManager.prototype.setEnabled=function(a){this.enabled=a};mxAutoSaveManager.prototype.setGraph=function(a){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler);this.graph=a;null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)};mxAutoSaveManager.prototype.save=function(){};
mxAutoSaveManager.prototype.graphModelChanged=function(a){a=((new Date).getTime()-this.lastSnapshot)/1E3;a>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&a>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++};mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};function mxAnimation(a){this.delay=null!=a?a:20}mxAnimation.prototype=new mxEventSource;
mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return null!=this.thread};mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};
mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))};function mxMorphing(a,b,c,d){mxAnimation.call(this,d);this.graph=a;this.steps=null!=b?b:6;this.ease=null!=c?c:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;
mxMorphing.prototype.cells=null;mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var a=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var b=0;b<this.cells.length;b++)this.animateCell(this.cells[b],a,!1);else this.animateCell(this.graph.getModel().getRoot(),a,!0);this.show(a);(a.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()};mxMorphing.prototype.show=function(a){a.show()};
mxMorphing.prototype.animateCell=function(a,b,c){var d=this.graph.getView().getState(a),e=null;if(null!=d&&(e=this.getDelta(d),this.graph.getModel().isVertex(a)&&(0!=e.x||0!=e.y))){var f=this.graph.view.getTranslate(),g=this.graph.view.getScale();e.x+=f.x*g;e.y+=f.y*g;b.moveState(d,-e.x/this.ease,-e.y/this.ease)}if(c&&!this.stopRecursion(d,e))for(d=this.graph.getModel().getChildCount(a),e=0;e<d;e++)this.animateCell(this.graph.getModel().getChildAt(a,e),b,c)};
mxMorphing.prototype.stopRecursion=function(a,b){return null!=b&&(0!=b.x||0!=b.y)};mxMorphing.prototype.getDelta=function(a){var b=this.getOriginForCell(a.cell),c=this.graph.getView().getTranslate(),d=this.graph.getView().getScale();return new mxPoint((b.x-(a.x/d-c.x))*d,(b.y-(a.y/d-c.y))*d)};
mxMorphing.prototype.getOriginForCell=function(a){var b=null;if(null!=a){var c=this.graph.getModel().getParent(a);a=this.graph.getCellGeometry(a);b=this.getOriginForCell(c);null!=a&&(a.relative?(c=this.graph.getCellGeometry(c),null!=c&&(b.x+=a.x*c.width,b.y+=a.y*c.height)):(b.x+=a.x,b.y+=a.y))}null==b&&(b=this.graph.view.getTranslate(),b=new mxPoint(-b.x,-b.y));return b};function mxImageBundle(a){this.images=[];this.alt=null!=a?a:!1}mxImageBundle.prototype.images=null;
mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(a,b,c){this.images[a]={value:b,fallback:c}};mxImageBundle.prototype.getImage=function(a){var b=null;null!=a&&(a=this.images[a],null!=a&&(b=this.alt?a.fallback:a.value));return b};function mxImageExport(){}mxImageExport.prototype.includeOverlays=!1;
mxImageExport.prototype.drawState=function(a,b){null!=a&&(this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))};
mxImageExport.prototype.visitStatesRecursive=function(a,b,c){if(null!=a){c(a,b);for(var d=a.view.graph,e=d.model.getChildCount(a.cell),f=0;f<e;f++){var g=d.view.getState(d.model.getChildAt(a.cell,f));this.visitStatesRecursive(g,b,c)}}};mxImageExport.prototype.getTitleForCellState=function(a,b){return null};mxImageExport.prototype.getLinkForCellState=function(a,b){return null};mxImageExport.prototype.getLinkTargetForCellState=function(a,b){return null};
mxImageExport.prototype.drawCellState=function(a,b){var c=this.getLinkForCellState(a,b);null!=c&&b.setLink(c,this.getLinkTargetForCellState(a,b));var d=this.getTitleForCellState(a,b),e=null!=d?b.root:null,f=null!=e?e.lastChild:null;this.drawShape(a,b);this.drawText(a,b);null!=e&&this.addTitle(a,b,d,e,null!=f?f.nextSibling:e.firstChild,null!=c);null!=c&&b.setLink(null)};
mxImageExport.prototype.addTitle=function(a,b,c,d,e,f){if(this.isPainted(e)){a=d;if(!f)for(a=b.createElement("g"),d.insertBefore(a,e);null!=a.nextSibling;)a.appendChild(a.nextSibling);b=b.createElement("title");mxUtils.write(b,c);a.insertBefore(b,a.firstChild)}};mxImageExport.prototype.isPainted=function(a){for(;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT&&("g"!=a.nodeName||this.isPainted(a.firstChild)))return!0;a=a.nextSibling}return!1};
mxImageExport.prototype.drawShape=function(a,b){a.shape instanceof mxShape&&this.doDrawShape(a.shape,b)};mxImageExport.prototype.drawText=function(a,b){this.doDrawShape(a.text,b)};
mxImageExport.prototype.doDrawShape=function(a,b){if(null!=a&&a.checkBounds()){var c=b.root,d=a.node;b.root=a.createSvg();c.appendChild(b.root);a.node=b.root;b.save();var e=this.getSvgShapeOffset(a,b);0!=e?a.node.setAttribute("transform","translate("+e+","+e+")"):a.node.removeAttribute("transform");a.beforePaint(b);a.paint(b);a.afterPaint(b);b.restore();a.node=d;b.root=c}};
mxImageExport.prototype.getSvgShapeOffset=function(a,b){if(a.getSvgScreenOffset!=mxShape.prototype.getSvgScreenOffset)return a.getSvgScreenOffset();var c=null!=a.stencil&&"inherit"!=a.stencil.strokewidth?Number(a.stencil.strokewidth):a.strokewidth;b=a.scale*(null!=b.state?b.state.scale:1);return null!=a.stroke&&0<c&&1==mxUtils.mod(Math.max(1,Math.round(c*b)),2)?.5:0};mxImageExport.prototype.drawOverlays=function(a,b){null!=a.overlays&&a.overlays.visit(function(c,d){d instanceof mxShape&&d.paint(b)})};
function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=!0;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C";
mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=!1;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]};
mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontBorderWidth:1,labelPadding:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,
fontStyle:0,shadow:!1,shadowStyle:null,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(a){return Math.round(parseFloat(a))};
mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var a=this.state,b=2;b<arguments.length;b+=2)this.lastX=arguments[b-1],this.lastY=arguments[b],this.path.push(this.format((this.lastX+a.dx)*a.scale)),this.path.push(this.format((this.lastY+a.dy)*a.scale))};mxAbstractCanvas2D.prototype.rotatePoint=function(a,b,c,d,e){c*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(a,b),Math.cos(c),Math.sin(c),new mxPoint(d,e))};
mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())};mxAbstractCanvas2D.prototype.setTitle=function(a){};mxAbstractCanvas2D.prototype.setLink=function(a,b){};mxAbstractCanvas2D.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a};mxAbstractCanvas2D.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b};
mxAbstractCanvas2D.prototype.rotate=function(a,b,c,d,e){};mxAbstractCanvas2D.prototype.setAlpha=function(a){this.state.alpha=a};mxAbstractCanvas2D.prototype.setFillAlpha=function(a){this.state.fillAlpha=a};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(a){this.state.strokeAlpha=a};mxAbstractCanvas2D.prototype.setFillColor=function(a){if(a==mxConstants.NONE||mxUtils.hasResourceReference(a))a=null;this.state.fillColor=a;this.state.gradientColor=null};
mxAbstractCanvas2D.prototype.setFillStyle=function(a,b,c,d){a==mxConstants.NONE&&(a=null);this.state.fillStyle=a;this.state.hachureGap=b;this.state.fillWeight=c;this.state.hachureAngle=d};mxAbstractCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,h,k){c=this.state;c.fillColor=mxUtils.hasResourceReference(a)?null:a;c.gradientFillAlpha=null!=h?h:1;c.gradientColor=mxUtils.hasResourceReference(b)?null:b;c.gradientAlpha=null!=k?k:1;c.gradientDirection=g};
mxAbstractCanvas2D.prototype.setStrokeColor=function(a){if(a==mxConstants.NONE||mxUtils.hasResourceReference(a))a=null;this.state.strokeColor=a};mxAbstractCanvas2D.prototype.setStrokeWidth=function(a){this.state.strokeWidth=a};mxAbstractCanvas2D.prototype.setDashed=function(a,b){this.state.dashed=a;this.state.fixDash=b};mxAbstractCanvas2D.prototype.setDashPattern=function(a){this.state.dashPattern=a};mxAbstractCanvas2D.prototype.setLineCap=function(a){this.state.lineCap=a};
mxAbstractCanvas2D.prototype.setLineJoin=function(a){this.state.lineJoin=a};mxAbstractCanvas2D.prototype.setMiterLimit=function(a){this.state.miterLimit=a};mxAbstractCanvas2D.prototype.setFontColor=function(a){if(a==mxConstants.NONE||mxUtils.hasResourceReference(a))a=null;this.state.fontColor=a};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(a){if(a==mxConstants.NONE||mxUtils.hasResourceReference(a))a=null;this.state.fontBackgroundColor=a};
mxAbstractCanvas2D.prototype.setLabelPadding=function(a){this.state.labelPadding=mxUtils.parseCssSpacing(a)};mxAbstractCanvas2D.prototype.setFontBorderColor=function(a){if(a==mxConstants.NONE||mxUtils.hasResourceReference(a))a=null;this.state.fontBorderColor=a};mxAbstractCanvas2D.prototype.setFontBorderWidth=function(a){a=parseFloat(a);this.state.fontBorderWidth=isFinite(a)&&0<=a?a:1};mxAbstractCanvas2D.prototype.setFontSize=function(a){this.state.fontSize=parseFloat(a)};
mxAbstractCanvas2D.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAbstractCanvas2D.prototype.setFontStyle=function(a){null==a&&(a=0);this.state.fontStyle=a};mxAbstractCanvas2D.prototype.setShadow=function(a,b){this.state.shadow=a;this.state.shadowStyle=b};mxAbstractCanvas2D.prototype.setShadowColor=function(a){a==mxConstants.NONE&&(a=null);this.state.shadowColor=a};mxAbstractCanvas2D.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a};
mxAbstractCanvas2D.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b};mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(a,b){this.addOp(this.moveOp,a,b)};mxAbstractCanvas2D.prototype.lineTo=function(a,b){this.addOp(this.lineOp,a,b)};mxAbstractCanvas2D.prototype.quadTo=function(a,b,c,d){this.addOp(this.quadOp,a,b,c,d)};
mxAbstractCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){this.addOp(this.curveOp,a,b,c,d,e,f)};mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxAbstractCanvas2D.prototype.close=function(a,b,c,d,e,f){this.addOp(this.closeOp)};mxAbstractCanvas2D.prototype.end=function(){};
function mxXmlCanvas2D(a){mxAbstractCanvas2D.call(this);this.root=a;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=!0;mxXmlCanvas2D.prototype.compressed=!0;
mxXmlCanvas2D.prototype.writeDefaults=function(){var a=this.createElement("fontfamily");a.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(a);a=this.createElement("fontsize");a.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(a);a=this.createElement("shadowcolor");a.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(a);a=this.createElement("shadowalpha");a.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(a);a=
this.createElement("shadowoffset");a.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);a.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(a)};mxXmlCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(a){return this.root.ownerDocument.createElement(a)};mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments);this.root.appendChild(this.createElement("save"))};
mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments);this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(a){var b=this.createElement("scale");b.setAttribute("scale",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.translate=function(a,b){var c=this.createElement("translate");c.setAttribute("dx",this.format(a));c.setAttribute("dy",this.format(b));this.root.appendChild(c)};
mxXmlCanvas2D.prototype.rotate=function(a,b,c,d,e){var f=this.createElement("rotate");if(0!=a||b||c)f.setAttribute("theta",this.format(a)),f.setAttribute("flipH",b?"1":"0"),f.setAttribute("flipV",c?"1":"0"),f.setAttribute("cx",this.format(d)),f.setAttribute("cy",this.format(e)),this.root.appendChild(f)};
mxXmlCanvas2D.prototype.setAlpha=function(a){if(this.compressed){if(this.state.alpha==a)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var b=this.createElement("alpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};mxXmlCanvas2D.prototype.setFillAlpha=function(a){if(this.compressed){if(this.state.fillAlpha==a)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var b=this.createElement("fillalpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setStrokeAlpha=function(a){if(this.compressed){if(this.state.strokeAlpha==a)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var b=this.createElement("strokealpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fillColor==a)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var b=this.createElement("fillcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,h,k){if(null!=a&&null!=b){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var l=this.createElement("gradient");l.setAttribute("c1",a);l.setAttribute("c2",b);l.setAttribute("x",this.format(c));l.setAttribute("y",this.format(d));l.setAttribute("w",this.format(e));l.setAttribute("h",this.format(f));null!=g&&l.setAttribute("direction",g);null!=h&&l.setAttribute("alpha1",h);null!=k&&l.setAttribute("alpha2",k);this.root.appendChild(l)}};
mxXmlCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.strokeColor==a)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var b=this.createElement("strokecolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setStrokeWidth=function(a){if(this.compressed){if(this.state.strokeWidth==a)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var b=this.createElement("strokewidth");b.setAttribute("width",this.format(a));this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setDashed=function(a,b){if(this.compressed){if(this.state.dashed==a)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var c=this.createElement("dashed");c.setAttribute("dashed",a?"1":"0");null!=b&&c.setAttribute("fixDash",b?"1":"0");this.root.appendChild(c)};
mxXmlCanvas2D.prototype.setDashPattern=function(a){if(this.compressed){if(this.state.dashPattern==a)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var b=this.createElement("dashpattern");b.setAttribute("pattern",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setLineCap=function(a){if(this.compressed){if(this.state.lineCap==a)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var b=this.createElement("linecap");b.setAttribute("cap",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setLineJoin=function(a){if(this.compressed){if(this.state.lineJoin==a)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var b=this.createElement("linejoin");b.setAttribute("join",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setMiterLimit=function(a){if(this.compressed){if(this.state.miterLimit==a)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var b=this.createElement("miterlimit");b.setAttribute("limit",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setFontColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontColor==a)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var b=this.createElement("fontcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontBackgroundColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBackgroundColor==a)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var b=this.createElement("fontbackgroundcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontBorderColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBorderColor==a)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var b=this.createElement("fontbordercolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontSize=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==a)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var b=this.createElement("fontsize");b.setAttribute("size",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontFamily=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==a)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var b=this.createElement("fontfamily");b.setAttribute("family",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setFontStyle=function(a){if(this.textEnabled){null==a&&(a=0);if(this.compressed){if(this.state.fontStyle==a)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var b=this.createElement("fontstyle");b.setAttribute("style",a);this.root.appendChild(b)}};
mxXmlCanvas2D.prototype.setShadow=function(a){if(this.compressed){if(this.state.shadow==a)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var b=this.createElement("shadow");b.setAttribute("enabled",a?"1":"0");this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowColor=function(a){if(this.compressed){a==mxConstants.NONE&&(a=null);if(this.state.shadowColor==a)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var b=this.createElement("shadowcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowAlpha=function(a){if(this.compressed){if(this.state.shadowAlpha==a)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var b=this.createElement("shadowalpha");b.setAttribute("alpha",a);this.root.appendChild(b)};
mxXmlCanvas2D.prototype.setShadowOffset=function(a,b){if(this.compressed){if(this.state.shadowDx==a&&this.state.shadowDy==b)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var c=this.createElement("shadowoffset");c.setAttribute("dx",a);c.setAttribute("dy",b);this.root.appendChild(c)};
mxXmlCanvas2D.prototype.rect=function(a,b,c,d){var e=this.createElement("rect");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)};
mxXmlCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){var g=this.createElement("roundrect");g.setAttribute("x",this.format(a));g.setAttribute("y",this.format(b));g.setAttribute("w",this.format(c));g.setAttribute("h",this.format(d));g.setAttribute("dx",this.format(e));g.setAttribute("dy",this.format(f));this.root.appendChild(g)};
mxXmlCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.createElement("ellipse");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)};
mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,h){e=this.converter.convert(e);var k=this.createElement("image");k.setAttribute("x",this.format(a));k.setAttribute("y",this.format(b));k.setAttribute("w",this.format(c));k.setAttribute("h",this.format(d));k.setAttribute("src",e);k.setAttribute("aspect",f?"1":"0");k.setAttribute("flipH",g?"1":"0");k.setAttribute("flipV",h?"1":"0");this.root.appendChild(k)};
mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};
mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d};
mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};
mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,h,k,l,m,n,p){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var q=this.createElement("text");q.setAttribute("x",this.format(a));q.setAttribute("y",this.format(b));q.setAttribute("w",this.format(c));q.setAttribute("h",this.format(d));q.setAttribute("str",e);null!=f&&q.setAttribute("align",f);null!=g&&q.setAttribute("valign",g);q.setAttribute("wrap",h?"1":"0");null==k&&(k="");q.setAttribute("format",k);null!=l&&q.setAttribute("overflow",
l);null!=m&&q.setAttribute("clip",m?"1":"0");null!=n&&q.setAttribute("rotation",n);null!=p&&q.setAttribute("dir",p);this.root.appendChild(q)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};
function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):
b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);
(function(){mxSvgCanvas2D.prototype.useDomParser="function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null;
mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.placeForeignObjects=!1;mxSvgCanvas2D.prototype.foreignObjectMargin=1E4;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.nonScalingTolerance=!1;
mxSvgCanvas2D.prototype.toleranceScaleVariable=mxClient.IS_SF?"--mx-scale":null;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;
mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&"function"===typeof a.setAttribute&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxSvgCanvas2D.prototype.getBaseUrl=function(){var a=window.location.href,b=a.indexOf("#");0<b&&(a=a.substring(0,b));return a};
mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[];this.fillPatterns=[]};mxSvgCanvas2D.prototype.createStyle=function(a){a=this.createElement("style");a.setAttribute("type","text/css");mxUtils.write(a,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return a};
mxSvgCanvas2D.prototype.createElement=function(a,b){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(b||mxConstants.NS_SVG,a);a=this.root.ownerDocument.createElement(a);null!=b&&a.setAttribute("xmlns",b);return a};mxSvgCanvas2D.prototype.getAlternateText=function(a,b,c,d,e,f,g,h,k,l,m,n,p){return null!=f?this.foAltText:null};
mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.state;a=a.split(/\r\n|\r|\n/);d=(d||"fill"==e||"width"==e)&&0<b;var h=b+this.foreignObjectPadding,k=null;if(d||f&&0<b)k=document.createElement("canvas").getContext("2d"),k.font=((g.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic ":"")+((g.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold ":"")+g.fontSize+"px "+mxUtils.parseCssFontFamily(g.fontFamily);if(d&&null!=k){b=[];for(var l=0;l<a.length;l++){for(var m=
a[l].split(/\s+/),n="",p=0;p<m.length;p++)if(0<m[p].length){var q=0<n.length?n+" "+m[p]:m[p];for(0<n.length&&k.measureText(q).width>h?(b.push(n),n=m[p]):n=q;1<n.length&&k.measureText(n).width>h&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(n);){for(q=n.length-1;1<q&&k.measureText(n.substring(0,q)).width>h;)q--;b.push(n.substring(0,q));n=n.substring(q)}}b.push(n)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-
1]+="..."));if(f&&!d&&null!=k)for(l=0;l<a.length;l++)if(k.measureText(a[l]).width>h){for(q=a[l].length-1;1<q&&k.measureText(a[l].substring(0,q)+"...").width>h;)q--;a[l]=mxUtils.trim(a[l].substring(0,q))+"..."}return a};
mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,h,k,l,m,n,p){l=this.getAlternateText(a,b,c,d,e,f,g,h,k,l,m,n,p);a=this.state;if(null!=l&&0<a.fontSize){f=h==mxConstants.ALIGN_TOP?1:h==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(l,d,e,k,m,n);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(h==mxConstants.ALIGN_TOP?0:h==mxConstants.ALIGN_BOTTOM?
(d.length-1)*e:(d.length-1)*e/2);k=this.getLightDarkColor(a.fontColor||"black");h=this.createElement("text");h.setAttribute("x",b);h.setAttribute("y",Math.round(c));"transparent"==k.light?h.setAttribute("fill","none"):(h.setAttribute("fill",k.light),h.style.fill=k.cssText);h.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));h.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&h.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&
h.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&h.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(h.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(h.style.textDecorationStyle=
"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),h.appendChild(g);else mxUtils.write(h,d[0]);return h}return null};
mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};
mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var h=this.root.ownerSVGElement,k=0,l=f+"-"+k;if(null!=h)for(g=h.ownerDocument.getElementById(l);null!=g&&g.ownerSVGElement!=h;)l=f+"-"+k++,g=h.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",l),null!=this.defs?this.defs.appendChild(g):
h.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};
mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");
e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f};
mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d,e,f,g){a=["mx-pattern",a,Math.round(100*b),c.light,c.dark,Math.round(100*d)];null==e&&null==f&&null==g||a.push(null!=e?Math.round(100*e):"a",null!=f?Math.round(100*f):"a",null!=g?Math.round(100*g):"a");return a.join("-").toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};
mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d,e,f,g){c=this.getLightDarkColor(c);e=parseFloat(e);e=!isFinite(e)||0>=e?null:Math.max(1,e);var h=parseFloat(f);h=!isFinite(h)||0>=h?null:h;g=parseFloat(g);g=isFinite(g)?g:null;if(null!=e||null!=h||null!=g)e=null!=e?e:Math.max(1,4*b),h=null!=h?h:b/2,g=null!=g?g:-41;var k=this.createFillPatternId(a,b,c,d,e,h,g);f=this.fillPatterns[k];if(null==f){var l=this.root.ownerSVGElement,m=0,n=k+"-"+m;if(null!=l)for(f=l.ownerDocument.getElementById(n);null!=
f&&f.ownerSVGElement!=l;)n=k+"-"+m++,f=l.ownerDocument.getElementById(n);else n="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d,e,h);break;case "dots":f=this.createDotsPattern(b,c,d,e,h);break;case "cross-hatch":f=this.createCrossHatchPattern(b,c,d,e,h);break;case "dashed":f=this.createDashedPattern(b,c,d,e,h);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d,e,h);break;default:return null}f.setAttribute("id",n);null!=this.defs?this.defs.appendChild(f):
l.appendChild(f)}this.fillPatterns[k]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate("+(null!=g?90+g:45)+")":"")+" scale("+d+")");return f.getAttribute("id")};
mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1","0");f.setAttribute("x2",e);f.setAttribute("y2",d);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width",
a);c.appendChild(f);return c};
mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1",d/4);f.setAttribute("x2",e);f.setAttribute("y2",3*d/4);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width",
a);c.appendChild(f);return c};
mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("path");var f=d/4,g=3*d/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+d+" L "+g+" "+d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a);
e.setAttribute("fill","none");c.appendChild(e);return c};
mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c,d,e){a=null!=e?e:.5*a;d=this.format(null!=d?d:1.5*(10+a));c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",d);e.setAttribute("height",d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",
a);e.setAttribute("fill","none");c.appendChild(e);return c};
mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c,d,e){a=this.format(null!=d?d:10+a);e=null!=e?Math.min(e/2,a/2):a/4;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",e);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);
return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};
mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&
c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||
"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};
mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+
")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale,a.hachureGap,a.fillWeight,a.hachureAngle);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==
document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};
mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&(a=this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale),
0<a.length&&this.node.setAttribute("stroke-dasharray",a))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};
mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++){var e=Number(c[d]);isFinite(e)&&b.push(Math.round(e*a*100)/100)}}return b.join(" ")};
mxSvgCanvas2D.prototype.createTolerance=function(a){a=a.cloneNode(!0);var b=parseFloat(a.getAttribute("stroke-width")||1),c=b+this.strokeTolerance;a.setAttribute("pointer-events","stroke");a.setAttribute("visibility","hidden");a.removeAttribute("stroke-dasharray");a.setAttribute("stroke-width",c);a.setAttribute("fill","none");this.nonScalingTolerance&&(null!=this.toleranceScaleVariable?a.style.strokeWidth="calc("+b+"px + "+this.strokeTolerance+"px / var("+this.toleranceScaleVariable+", 1))":a.setAttribute("vector-effect",
"non-scaling-stroke"));a.setAttribute("stroke",mxClient.IS_OT?"none":"white");return a};
mxSvgCanvas2D.prototype.createShadow=function(a){a=a.cloneNode(!0);var b=this.state;"none"==a.getAttribute("fill")||mxClient.IS_FF&&"transparent"==a.getAttribute("fill")||a.setAttribute("fill",b.shadowColor);"none"!=a.getAttribute("stroke")&&a.setAttribute("stroke",b.shadowColor);a.setAttribute("transform","translate("+this.format(b.shadowDx*b.scale)+","+this.format(b.shadowDy*b.scale)+")"+(b.transform||""));a.setAttribute("opacity",b.shadowAlpha);return a};
mxSvgCanvas2D.prototype.setTitle=function(a){this.title=a};mxSvgCanvas2D.prototype.setLink=function(a,b){if(null==a)this.root=this.originalRoot;else{this.originalRoot=this.root;var c=this.createElement("a");null==c.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?c.setAttribute("xlink:href",a):c.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);null!=b&&c.setAttribute("target",b);this.root.appendChild(c);this.root=c}};
mxSvgCanvas2D.prototype.rotate=function(a,b,c,d,e){if(0!=a||b||c){var f=this.state;d+=f.dx;e+=f.dy;d*=f.scale;e*=f.scale;f.transform=f.transform||"";if(b&&c)a+=180;else if(b!=c){var g=b?d:0,h=b?-1:1,k=c?e:0,l=c?-1:1;f.transform+="translate("+this.format(g)+","+this.format(k)+")scale("+this.format(h)+","+this.format(l)+")translate("+this.format(-g)+","+this.format(-k)+")"}if(b?!c:c)a*=-1;0!=a&&(f.transform+="rotate("+this.format(a)+","+this.format(d)+","+this.format(e)+")");f.rotation+=a;f.rotationCx=
d;f.rotationCy=e}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(a,b,c,d){var e=this.state,f=this.createElement("rect");f.setAttribute("x",this.format((a+e.dx)*e.scale));f.setAttribute("y",this.format((b+e.dy)*e.scale));f.setAttribute("width",this.format(c*e.scale));f.setAttribute("height",this.format(d*e.scale));this.node=f};
mxSvgCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.rect(a,b,c,d);0<e&&this.node.setAttribute("rx",this.format(e*this.state.scale));0<f&&this.node.setAttribute("ry",this.format(f*this.state.scale))};
mxSvgCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.state,f=this.createElement("ellipse");f.setAttribute("cx",this.format((a+c/2+e.dx)*e.scale));f.setAttribute("cy",this.format((b+d/2+e.dy)*e.scale));f.setAttribute("rx",this.format(c/2*e.scale));f.setAttribute("ry",this.format(d/2*e.scale));this.node=f};
mxSvgCanvas2D.prototype.image=function(a,b,c,d,e,f,g,h,k,l){e=this.converter.convert(e);null!=e&&/^\s*(javascript|vbscript|livescript)\s*:/i.test(String(e).replace(/[\x00-\x1F\x7F]/g,""))&&(e="");f=null!=f?f:!0;g=null!=g?g:!1;h=null!=h?h:!1;var m=this.state;a+=m.dx;b+=m.dy;var n=null;if(null!=l){var p=null!=this.createImageSymbol?this.createImageSymbol(e,f):null;if(null!=p||"data:"!=e.substring(0,5))p=null!=p?"#"+p:e,n=this.createElement("use"),""!=l&&n.setAttribute("style",l),n.setAttribute("href",
p),null!=n.setAttributeNS&&n.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",p)}null==n&&this.dedupImages&&null!=this.defs?(e="#"+this.getImageDef(e,c*m.scale,d*m.scale,f),n=this.createElement("use"),n.setAttribute("href",e),null!=n.setAttributeNS&&n.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e)):null==n&&(n=this.createElement("image"),null==n.setAttributeNS?n.setAttribute("xlink:href",e):n.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e),f||n.setAttribute("preserveAspectRatio","none"));
n.setAttribute("x",this.format(a*m.scale)+this.imageOffset);n.setAttribute("y",this.format(b*m.scale)+this.imageOffset);n.setAttribute("width",this.format(c*m.scale));n.setAttribute("height",this.format(d*m.scale));(1>m.alpha||1>m.fillAlpha)&&n.setAttribute("opacity",m.alpha*m.fillAlpha);e=this.state.transform||"";if(g||h){l=f=1;var q=p=0;g&&(f=-1,p=-c-2*a);h&&(l=-1,q=-d-2*b);e+="scale("+f+","+l+")translate("+p*m.scale+","+q*m.scale+")"}0<e.length&&n.setAttribute("transform",e);this.pointerEvents||
n.setAttribute("pointer-events","none");null!=k&&this.processClipPath(n,k,new mxRectangle(a,b,c,d));null!=this.title?(a=this.addTitle(this.createElement("g")),a.appendChild(n),this.root.appendChild(a)):this.root.appendChild(n)};
mxSvgCanvas2D.prototype.getImageDef=function(a,b,c,d){null==this.imageDefs&&(this.imageDefs={},this.imageDefIds={});var e=a+"|"+d+"|"+(d&&0!=c?(b/c).toFixed(4):""),f=this.imageDefs[e];if(null==f){for(f="mx-image-"+mxUtils.hashCode(e);null!=this.imageDefIds[f];)f+="-1";var g=this.createElement("symbol");g.setAttribute("id",f);g.setAttribute("viewBox","0 0 "+this.format(b)+" "+this.format(c));var h=this.createElement("image");h.setAttribute("width",this.format(b));h.setAttribute("height",this.format(c));
null==h.setAttributeNS?h.setAttribute("xlink:href",a):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);d||(g.setAttribute("preserveAspectRatio","none"),h.setAttribute("preserveAspectRatio","none"));g.appendChild(h);this.defs.appendChild(g);this.imageDefs[e]=f;this.imageDefIds[f]=e}return f};
mxSvgCanvas2D.prototype.processClipPath=function(a,b,c){try{var d=this.createElement("clipPath");d.setAttribute("id",this.createClipPathId(b));d.setAttribute("clipPathUnits","objectBoundingBox");var e=this.appendClipPath(d,b,c);if(null!=e){var f=this.state;a.setAttribute("x",c.x*f.scale-c.width*f.scale*e.x/e.width+this.imageOffset);a.setAttribute("y",c.y*f.scale-c.height*f.scale*e.y/e.height+this.imageOffset);a.setAttribute("width",c.width*f.scale/e.width);a.setAttribute("height",c.height*f.scale/
e.height)}this.setClip(a,d)}catch(g){}};
mxSvgCanvas2D.prototype.convertHtml=function(a){if("string"!==typeof a||/[<>&\r\0]|^[\t\n\f ]/.test(a))if(this.useDomParser){var b=(new DOMParser).parseFromString(a,"text/html");null!=b&&(a=(new XMLSerializer).serializeToString(b.body),"<body"==a.substring(0,5)&&(a=a.substring(a.indexOf(">",5)+1)),"</body>"==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){b=document.implementation.createDocument("http://www.w3.org/1999/xhtml",
"html",null);var c=b.createElement("body");b.documentElement.appendChild(c);var d=document.createElement("div");d.innerHTML=a;for(a=d.firstChild;null!=a;)d=a.nextSibling,c.appendChild(b.adoptNode(a)),a=d;return c.innerHTML}b=document.createElement("textarea");b.innerHTML=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">");a=b.value.replace(/&/g,"&").replace(/&lt;/g,
"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return a};
mxSvgCanvas2D.prototype.createDiv=function(a){mxUtils.isNode(a)||(a="<div><div>"+this.convertHtml(a)+"</div></div>");if(document.createElementNS){var b=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(a)){var c=document.createElement("div"),d=c.cloneNode(!1);this.root.ownerDocument!=document?c.appendChild(a.cloneNode(!0)):c.appendChild(a);d.appendChild(c);b.appendChild(d)}else b.innerHTML=a;return b}mxUtils.isNode(a)&&(a="<div><div>"+mxUtils.getXml(a)+"</div></div>");
return mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div>").documentElement};
mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,h,k,l,m,n){if(null!=n&&null!=n.firstChild)if(null!=n.firstChild.firstChild&&"foreignObject"==n.firstChild.firstChild.nodeName)this.updateTextNodes(a,b,c,d,e,f,g,h,k,l,m,n.firstChild);else if("g"==n.nodeName){n=n.firstChild;var p=n.getAttribute("data-blockTextHeight");if(null!=p){var q=n.getAttribute("data-htmlContentWidth");q=null!=q?parseFloat(q):null;this.plainText(a,b,c,d,"",e,f,g,h,k,l,m,null,n,parseFloat(p),null==q||isNaN(q)?null:q)}else this.plainText(a,
b,c,d,"",e,f,g,h,k,l,m,null,n)}};
mxSvgCanvas2D.prototype.addForeignObject=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r){var t=this.addTitle(this.createElement("g")),v=this.createElement("foreignObject");this.setCssText(v,"overflow: visible; text-align: left;");v.setAttribute("pointer-events","none");q.ownerDocument!=document&&(q=mxUtils.importNodeImplementation(v.ownerDocument,q,!0));v.appendChild(q);t.appendChild(v);this.updateTextNodes(a,b,c,d,f,g,h,l,m,n,p,t);this.root.ownerDocument!=document&&(a=this.createAlternateContent(v,a,b,c,
d,e,f,g,h,k,l,m,n),null!=a&&(v.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),b=this.createElement("switch"),b.appendChild(v),b.appendChild(a),t.appendChild(b)));r.appendChild(t)};
mxSvgCanvas2D.prototype.updateTextNodes=function(a,b,c,d,e,f,g,h,k,l,m,n){var p=this.state.scale,q="",r="";null!=m&&"vertical-"==m.substring(0,9)?(q="-rl"==m.substring(m.length-3),r=e==mxConstants.ALIGN_LEFT?q?"flex-end":"flex-start":e==mxConstants.ALIGN_RIGHT?q?"flex-start":"flex-end":"center",q=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center"):(r=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center",q=e==mxConstants.ALIGN_LEFT?
"flex-start":e==mxConstants.ALIGN_RIGHT?"flex-end":"center");var t=null!=this.state.fontBackgroundColor?this.getLightDarkColor(this.state.fontBackgroundColor):null,v=null!=this.state.fontBorderColor?this.getLightDarkColor(this.state.fontBorderColor):null;mxSvgCanvas2D.createCss(c+this.foreignObjectPadding,d,e,f,g,h,k,m,null!=t?t.cssText:null,null!=v?v.cssText:null,null!=t||null!=v?this.state.labelPadding:null,"display: flex; align-items: unsafe "+r+"; justify-content: unsafe "+q+"; "+(null!=m&&"vertical-"==
m.substring(0,9)?"writing-mode: "+m+";":""),this.getTextCss(),p,mxUtils.bind(this,function(u,x,y,w,A){a+=this.state.dx;b+=this.state.dy;var C=n.firstChild;null!=C&&"title"==C.nodeName&&(C=C.nextSibling);var B=null!=C?C.firstChild:null,z=null!=B?B.firstChild:null;if(null!=z){w+="color: "+this.getLightDarkColor(this.state.fontColor).light+"; ";w+=null!=t?"background-color: "+t.light+"; ":"";w+=null!=v?"border-color: "+v.light+"; ":"";var H=(this.rotateHtml?this.state.rotation:0)+(null!=l?l:0),E=(0!=
this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=p?"scale("+p+")":"");this.setCssText(z.firstChild,A);this.setCssText(z,w);w=Math.round(a+u);A=Math.round(b+x);n.textPosition=new mxPoint(a+u,b+x);this.placeForeignObjects?(u=this.foreignObjectMargin,C.setAttribute("x",w-u),C.setAttribute("y",A-u),C.setAttribute("width",Math.ceil(c)+2*u),C.setAttribute("height",Math.ceil(d)+2*u),y+="padding-top: "+u+"px; ",w=u):(C.setAttribute("width",Math.ceil(1/Math.min(1,p)*100)+"%"),C.setAttribute("height",
Math.ceil(1/Math.min(1,p)*100)+"%"),C.removeAttribute("x"),0>A?(C.setAttribute("y",A),y+="padding-top: 0; "):(C.removeAttribute("y"),y+="padding-top: "+A+"px; "));this.setCssText(B,y+"margin-left: "+w+"px;");E+=0!=H?"rotate("+H+" "+this.format(a)+" "+this.format(b)+")":"";""!=E?n.setAttribute("transform",E):n.removeAttribute("transform");1!=this.state.alpha?n.setAttribute("opacity",this.state.alpha):n.removeAttribute("opacity")}}),this.state.fontBorderWidth)};
mxSvgCanvas2D.createCss=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t){h=null!=h&&"vertical-"==h.substring(0,9);q="box-sizing: border-box; font-size: 0; ";q=h?q+("text-align: "+(d==mxConstants.ALIGN_TOP?"left":d==mxConstants.ALIGN_BOTTOM?"right":"center")+"; "):q+("text-align: "+(c==mxConstants.ALIGN_LEFT?"left":c==mxConstants.ALIGN_RIGHT?"right":"center")+"; ");var v=mxUtils.getAlignmentAsPoint(c,d);c="overflow: hidden; ";var u="width: 1px; ",x="height: 1px; ",y=v.x*a;v=v.y*b;g?(u="width: "+Math.round(a)+
"px; ",q+="max-height: "+Math.round(b)+"px; ",v=0):"fill"==f?(u="width: "+Math.round(a)+"px; ",x="height: "+Math.round(b)+"px; ",p+="width: 100%; height: 100%; ",q+="width: "+Math.round(a-2)+"px; "+x):"width"==f?(u="width: "+Math.round(a-2)+"px; ",p+="width: 100%; ",q+=u,v=0,0<b&&(q+="max-height: "+Math.round(b)+"px; ")):"block"==f?(u="width: "+Math.round(a-2)+"px; ",p+="width: 100%; ",c="",v=0,q+=u,"middle"==d&&(q+="max-height: "+Math.round(b)+"px; ")):(c="",h?y=0:v=0);d="";null!=k&&(d+="background-color: "+
k+"; ");t=null!=l&&null!=t?t:1;k=null!=l?t-1:0;null!=l&&(d+="border-width: "+t+"px; border-style: solid; border-color: inherit; border: "+t+"px solid "+l+"; ");""==d||null==m&&0==k||(l=null!=m?m:{top:0,right:0,bottom:0,left:0},null!=m&&(d+="padding: "+l.top+"px "+l.right+"px "+l.bottom+"px "+l.left+"px; "),""!=c&&!g)||(d+="margin: "+(-l.top-k)+"px "+(-l.right-k)+"px "+(-l.bottom-k)+"px "+(-l.left-k)+"px; ");""==c||g?p+=d:q+=d;e&&(h&&0<b||!h&&0<a)?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+
"; ",h?x="height: "+Math.round(b)+"px; ":u="width: "+Math.round(a)+"px; ",""!=c&&"fill"!=f&&(h?y=0:v=0)):(p+="white-space: nowrap; ",""==c&&"block"!=f&&(y=0));r(y,v,n+u+x,q+c,p,c)};
mxSvgCanvas2D.prototype.getTextCss=function(){var a=this.state,b=mxConstants.ABSOLUTE_LINE_HEIGHT?a.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;b="display: inline-block; font-size: "+mxUtils.htmlEntities(a.fontSize)+"px; font-family: "+mxUtils.parseCssFontFamily(a.fontFamily,!0)+"; color: "+this.getLightDarkColor(mxUtils.htmlEntities(a.fontColor)).cssText+"; line-height: "+mxUtils.htmlEntities(b)+"; pointer-events: "+(this.pointerEvents?mxUtils.htmlEntities(this.pointerEventsValue):
"none")+"; ";(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="font-weight: bold; ");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="font-style: italic; ");var c=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&((a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&c.push("dotted"),
b+="text-decoration: "+c.join(" ")+"; ");return b};mxSvgCanvas2D.prototype.convertHtmlToSvg=function(a,b,c,d,e){return mxUtils.convertHtmlToSvg(a,b,c,{dir:e,fontScale:d,fontSize:this.state.fontSize,createElement:mxUtils.bind(this,this.createElement)})};
mxSvgCanvas2D.prototype.wrapSvgTextElement=function(a,b){function c(G,D){for(var J=0;J<G.childNodes.length;J++){var I=G.childNodes[J];if(I.nodeType==mxConstants.NODETYPE_TEXT)0<I.nodeValue.length&&m.push({text:I.nodeValue,attrs:d(D.attrs),css:d(D.css),absoluteDy:n});else if(I.nodeType==mxConstants.NODETYPE_ELEMENT){for(var K={attrs:d(D.attrs),css:d(D.css)},M=["font-weight","font-style","fill","text-decoration"],L=0;L<M.length;L++){var N=I.getAttribute(M[L]);null!=N&&(K.attrs[M[L]]=N)}if(null!=I.style){if(""!=
I.style.cssText)for(M=I.style.cssText.split(";"),L=0;L<M.length;L++)if(N=M[L].split(":"),2==N.length){var P=N[0].trim();N=N[1].trim();0<P.length&&0<N.length&&(K.css[P]=N)}I.style.fill&&(K.css.fill=I.style.fill)}N=I.getAttribute("dy");null!=N&&(n+=parseFloat(N));c(I,K)}}}function d(G){var D={},J;for(J in G)G.hasOwnProperty(J)&&(D[J]=G[J]);return D}function e(G){var D=h;G=m[G].css["font-size"];null!=G&&("smaller"==G?D=h/1.2:0<=G.indexOf("em")?D=parseFloat(G)*h:0<=G.indexOf("px")&&(D=parseFloat(G)));
return D}function f(G){var D=m[G.segIdx],J=D.attrs["font-weight"]||"",I=D.attrs["font-style"]||"",K=k,M=h;D.css["font-weight"]&&(J=D.css["font-weight"]);D.css["font-style"]&&(I=D.css["font-style"]);D.css["font-family"]&&(K=D.css["font-family"]);D.css["font-size"]&&(D=D.css["font-size"],"smaller"==D?M=h/1.2:0<=D.indexOf("em")?M=parseFloat(D)*h:0<=D.indexOf("px")&&(M=parseFloat(D)));J||(l&mxConstants.FONT_BOLD)!=mxConstants.FONT_BOLD||(J="bold");I||(l&mxConstants.FONT_ITALIC)!=mxConstants.FONT_ITALIC||
(I="italic");t.font=I+" "+J+" "+M+"px "+K;return t.measureText(G.text).width}var g=this.state,h=g.fontSize,k=g.fontFamily,l=g.fontStyle,m=[],n=0;c(a,{attrs:{},css:{}});if(0==m.length)return null;for(var p=[],q=0;q<m.length;q++){a=m[q].text.split(/(\s+)/);for(var r=0;r<a.length;r++)0<a[r].length&&p.push({text:a[r],segIdx:q,isSpace:/^\s+$/.test(a[r])})}var t=document.createElement("canvas").getContext("2d"),v=this.textFlow;g=null;a=[[]];var u=0;if(null!=v){var x=h*mxConstants.LINE_HEIGHT;a=function(G){var D=
{lines:[[]],extras:[],height:0},J=G,I=v.available(J,J+x);D.extras.push({x:I.x,width:I.width,shift:0});for(var K=0,M=0;M<p.length;M++){var L=p[M];null==L.width&&(L.width=f(L));if(L.isSpace)0<K&&(D.lines[D.lines.length-1].push(L),K+=L.width);else{var N=0<M&&p[M-1].isSpace;K+L.width>I.width&&0<K&&N&&(I=D.lines[D.lines.length-1],0<I.length&&I[I.length-1].isSpace&&I.pop(),J+=x,D.lines.push([]),I=v.available(J,J+x),D.extras.push({x:I.x,width:I.width,shift:0}),K=0);for(N=0;0==K&&L.width>I.width&&J-G<v.boxHeight&&
400>N++;){J+=x;var P=D.extras[D.extras.length-1];P.shift+=x;I=v.available(J,J+x);P.x=I.x;P.width=I.width}D.lines[D.lines.length-1].push(L);K+=L.width}}D.height=J+x-G;return D};g=a(0);for(b=q=0;3>b;b++){var y=0;if(v.valign==mxConstants.ALIGN_MIDDLE)y=(v.boxHeight-g.height)/2;else if(v.valign==mxConstants.ALIGN_BOTTOM)y=v.boxHeight-g.height;else break;if(1>Math.abs(y-q))break;q=y;g=a(q)}a=g.lines;g=g.extras}else for(q=0;q<p.length;q++){y=p[q];var w=f(y);y.width=w;if(y.isSpace)0<u&&(a[a.length-1].push(y),
u+=w);else{var A=0<q&&p[q-1].isSpace;u+w>b&&0<u&&A&&(u=a[a.length-1],0<u.length&&u[u.length-1].isSpace&&u.pop(),a.push([]),u=0);a[a.length-1].push(y);u+=w}}for(q=b=0;q<a.length;q++){y=a[q];for(w=y.length;0<w&&y[w-1].isSpace;)w--;for(A=u=0;A<w;A++)u+=y[A].width;u>b&&(b=u)}if(null==v&&1>=a.length)return{elements:null,totalHeight:0,maxLineWidth:b};y=[];for(q=w=0;q<a.length;q++)if(u=a[q],0!=u.length){A=h;for(r=0;r<u.length;r++)u[r].isSpace||(A=Math.max(A,e(u[r].segIdx)));null!=g&&null!=g[q]&&(w+=g[q].shift);
w+=A;var C=this.createElement("text");C.setAttribute("y",this.format(w));if(null!=g&&null!=g[q]){var B=g[q];C.setAttribute("x",this.format(v.align==mxConstants.ALIGN_LEFT?B.x:v.align==mxConstants.ALIGN_RIGHT?B.x+B.width-v.boxWidth:B.x+B.width/2-v.boxWidth/2))}for(var z=r=0;r<u.length;){B=u[r].segIdx;for(var H="";r<u.length&&u[r].segIdx==B;)H+=u[r].text,r++;r==u.length&&(H=H.replace(/\s+$/,""));if(0<H.length){B=m[B];var E=this.createElement("tspan"),F;for(F in B.attrs)B.attrs.hasOwnProperty(F)&&E.setAttribute(F,
B.attrs[F]);var O="";for(F in B.css)B.css.hasOwnProperty(F)&&"color"!=F&&"fill"!=F&&(O+=F+": "+B.css[F]+"; ");0<O.length&&(E.style.cssText=O);B.css.fill&&(E.style.fill=B.css.fill);B=B.absoluteDy;B!=z&&(E.setAttribute("dy",Math.round(100*(B-z))/100),z=B);E.textContent=H;C.appendChild(E)}}y.push(C);C=A*(mxConstants.LINE_HEIGHT-1);H=z=0;O=E=null;for(r=0;r<u.length;r++)u[r].isSpace||(B=m[u[r].segIdx],B=B.absoluteDy,B<z&&(z=B,E=e(u[r].segIdx)),B>H&&(H=B,O=e(u[r].segIdx)));0>z&&(C+=mxUtils.getSupSubLineExpansion(A,
z,null,E,null));0<H&&(C+=mxUtils.getSupSubLineExpansion(A,null,H,null,O));w+=C}return{elements:y,totalHeight:w,maxLineWidth:b}};
mxSvgCanvas2D.prototype.wrapSvgBlockElements=function(a,b,c){for(var d=this.state.fontSize,e=[],f=0;f<a.childNodes.length;f++)"text"==a.childNodes[f].nodeName&&e.push(a.childNodes[f]);var g=0,h=0;for(f=0;f<e.length;f++){var k=e[f],l=parseFloat(k.getAttribute("font-size"))||d,m=this.wrapSvgTextElement(k,b);null!=m&&m.maxLineWidth>h&&(h=m.maxLineWidth);if(null!=m&&null!=m.elements&&0<m.elements.length){var n=parseFloat(k.getAttribute("y"))||0;n+=g;var p=parseFloat(m.elements[0].getAttribute("y"))||
0;l=parseFloat(k.getAttribute("data-line-font-size"))||l;n-=l-p;for(var q=0;q<m.elements.length;q++){var r=m.elements[q],t=parseFloat(r.getAttribute("y"))||0;r.setAttribute("y",this.format(n+(t-p)));k.getAttribute("font-size")&&r.setAttribute("font-size",k.getAttribute("font-size"));k.getAttribute("font-weight")&&r.setAttribute("font-weight",k.getAttribute("font-weight"));k.getAttribute("font-family")&&r.setAttribute("font-family",k.getAttribute("font-family"));k.getAttribute("fill")&&(r.setAttribute("fill",
k.getAttribute("fill")),r.style.fill=k.style.fill);a.insertBefore(r,k)}a.removeChild(k);g+=m.totalHeight-l*mxConstants.LINE_HEIGHT}else 0!=g&&(n=parseFloat(k.getAttribute("y"))||0,k.setAttribute("y",this.format(n+g)))}0!=g&&(c.textHeight+=g);c.maxLineWidth=h};
mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,h,k,l,m,n,p){if(this.textEnabled&&null!=e)if(n=null!=n?n:0,this.foEnabled&&"html"==k){var q=this.createDiv(e);if(null!=q){var r=this.createElement("text"),t=new mxPoint(0,0);if(this.allowConvertHtmlToSvg&&this.convertHtmlToSvg(q.firstChild.firstChild,r,t,null,p))if(null!=t.textHeight){for(e=this.createElement("g");r.firstChild;)e.appendChild(r.firstChild);h&&0<c&&this.wrapSvgBlockElements(e,c+this.foreignObjectPadding,t);r=null;h?r=null!=t.maxLineWidth?
t.maxLineWidth:null:!m||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(r=this.measureHtmlContentWidth(q.firstChild.firstChild));this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,h,l,m,n,p,e,null,t.textHeight,r)}else if(h&&0<c&&(q=this.wrapSvgTextElement(r,c+this.foreignObjectPadding),null!=q&&null!=q.elements)){e=this.createElement("g");for(t=0;t<q.elements.length;t++)e.appendChild(q.elements[t]);this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,h,l,m,n,p,e,null,q.totalHeight,
q.maxLineWidth)}else 0>t.y&&g==mxConstants.ALIGN_TOP?r.style.transform="translateY("+-t.y+"em)":0<t.y&&g==mxConstants.ALIGN_BOTTOM?r.style.transform="translateY("+-t.y+"em)":0<t.y&&g==mxConstants.ALIGN_TOP&&(r.style.transform="translateY("+t.y+"em)"),this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,h,l,m,n,p,r);else null!=p&&"vertical-"!=p.substring(0,9)&&q.setAttribute("dir",p),this.addForeignObject(a,b,c,d,e,f,g,h,k,l,m,n,p,q,this.root)}}else this.plainText(a+this.state.dx,b+this.state.dy,
c,d,e,f,g,h,l,m,n,p)};mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;e=this.createElement("clipPath");e.setAttribute("id",g);g=this.createElement("rect");g.setAttribute("x",a);g.setAttribute("y",b);g.setAttribute("width",c);g.setAttribute("height",d);e.appendChild(g);return e};
mxSvgCanvas2D.prototype.createClipPathId=function(a){a="mx-clippath-"+a.replace(/[^a-zA-Z0-9]+/g,"-");for(var b="-"==a.charAt(a.length-1)?"":"-",c=0,d=a+b+c;null!=document.getElementById(d);)d=a+b+ ++c;return d};
mxSvgCanvas2D.prototype.appendClipPath=function(a,b,c){var d=b.match(/\(([^)]+)\)/),e=null;"polygon"==b.substring(0,7)?e=this.appendPolygonClip(d[1],a,c):"circle"==b.substring(0,6)?e=this.appendCircleClip(d[1],a,c):"ellipse"==b.substring(0,7)?e=this.appendEllipseClip(d[1],a,c):"inset"==b.substring(0,5)&&(e=this.appendInsetClip(d[1],a,c));return e};
mxSvgCanvas2D.prototype.appendPolygonClip=function(a,b,c){c=this.createElement("polygon");a=a.split(/[ ,]+/);for(var d=null,e=null,f=null,g=null,h=[],k=0;k<a.length;k++){var l=this.parseClipValue(a,k);if(0==k%2){if(null==d||d>l)d=l;if(null==f||f<l)f=l}else{if(null==e||e>l)e=l;if(null==g||g<l)g=l}h.push(l)}c.setAttribute("points",h.join(","));b.appendChild(c);return new mxRectangle(d,e,f-d,g-e)};
mxSvgCanvas2D.prototype.appendCircleClip=function(a,b,c){c=this.createElement("circle");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,2);d=this.parseClipValue(d,3);c.setAttribute("r",a);c.setAttribute("cx",e);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(e-a,d-a,2*a,2*a)};
mxSvgCanvas2D.prototype.appendEllipseClip=function(a,b,c){c=this.createElement("ellipse");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,3);d=this.parseClipValue(d,4);c.setAttribute("rx",a);c.setAttribute("ry",e);c.setAttribute("cx",f);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(f-a,d-e,2*a,2*e)};
mxSvgCanvas2D.prototype.appendInsetClip=function(a,b,c){c=this.createElement("rect");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,2),g=this.parseClipValue(d,3);e=1-e-g;f=1-a-f;c.setAttribute("x",g);c.setAttribute("y",a);c.setAttribute("width",e);c.setAttribute("height",f);4<d.length&&"round"==d[4]&&(d=this.parseClipValue(d,5),c.setAttribute("rx",d),c.setAttribute("ry",d));b.appendChild(c);return new mxRectangle(g,a,e,f)};
mxSvgCanvas2D.prototype.parseClipValue=function(a,b){b=a[Math.min(b,a.length-1)];a=1;"center"==b?a=.5:"top"==b||"left"==b?a=0:(b=parseFloat(b),isNaN(b)||(a=Math.max(0,Math.min(1,b/100))));return a};
mxSvgCanvas2D.prototype.setClip=function(a,b){if(null!=a.getAttribute("clip-path")){var c=a.getAttribute("clip-path").replace(/url\(.*#/,"").replace(/\)$/,"");c=document.getElementById(c);null!=c&&null!=c.parentNode&&c.parentNode.removeChild(c)}null!=this.defs?this.defs.appendChild(b):this.root.appendChild(b);mxClient.IS_CHROMEAPP||this.root.ownerDocument!=document?a.setAttribute("clip-path","url(#"+b.getAttribute("id")+")"):(c=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),a.setAttribute("clip-path",
"url("+c+"#"+b.getAttribute("id")+")"))};
mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t){m=null!=m?m:0;h=this.state;var v=h.fontSize,u=h.transform||"";q=null!=q?q:this.addTitle(this.createElement("g"));this.updateFont(q);this.pointerEvents||null!=this.originalRoot?q.removeAttribute("pointer-events"):q.setAttribute("pointer-events","none");0!=m&&(u+="rotate("+m+","+this.format(a*h.scale)+","+this.format(b*h.scale)+")");null!=n&&"vertical-"!=n.substring(0,9)&&q.setAttribute("direction",n);n=f==mxConstants.ALIGN_RIGHT?
"end":f==mxConstants.ALIGN_CENTER?"middle":"start";q.setAttribute("text-anchor",n);0<u.length&&q.setAttribute("transform",u);1>h.alpha&&q.setAttribute("opacity",h.alpha);u=e.split("\n");var x=Math.round(v*mxConstants.LINE_HEIGHT),y=null!=r?r:v+(u.length-1)*x;m=null!=r?b:b+v-1;if(g==mxConstants.ALIGN_MIDDLE)if("fill"==k)m-=d/2;else{var w=(this.matchHtmlAlignment&&l&&0<d?Math.min(y,d):y)/2;m-=w}else g==mxConstants.ALIGN_BOTTOM&&("fill"==k?m-=d:(w=this.matchHtmlAlignment&&l&&0<d?Math.min(y,d):y,m-=w+
1));if(null!=p)if(null!=r){e=this.format(a*h.scale)+this.textOffset;u=this.format(m*h.scale)+this.textOffset;p.setAttribute("transform","translate("+e+","+u+") scale("+h.scale+")");q.setAttribute("data-blockTextHeight",r);null!=t&&q.setAttribute("data-htmlContentWidth",t);e=p.childNodes;for(r=0;r<e.length;r++)"text"==e[r].nodeName&&(u=parseFloat(e[r].getAttribute("dx"))||0,e[r].setAttribute("x","start"==n?u:"end"==n?-u:0),e[r].removeAttribute("dx"));q.appendChild(p);this.root.appendChild(q);q.setAttribute("font-size",
v+"px");!l||"middle"!=n&&"end"!=n||this.adjustBlockTextOverflow(p,a,m,c,h.scale,t,f)}else t=this.createElement("g"),e=this.format(a*h.scale)+this.textOffset,u=this.format(m*h.scale)+this.textOffset,t.setAttribute("transform","translate("+e+","+u+") scale("+h.scale+")"),t.appendChild(p),q.appendChild(t),this.root.appendChild(q),q.setAttribute("font-size",v+"px");else if(null!=q.parentNode)null!=r?(p=q.firstChild,null!=p&&"title"==p.nodeName&&(p=p.nextSibling),null!=p&&"g"==p.nodeName&&(e=this.format(a*
h.scale)+this.textOffset,u=this.format(m*h.scale)+this.textOffset,p.setAttribute("transform","translate("+e+","+u+") scale("+h.scale+")"),!l||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(t=parseFloat(q.getAttribute("data-htmlContentWidth")),this.adjustBlockTextOverflow(p,a,m,c,h.scale,isNaN(t)?null:t,f)))):(p=q.firstChild,null!=p&&"title"==p.nodeName&&(p=p.nextSibling),e=this.format(a*h.scale)+this.textOffset,u=this.format(m*h.scale)+this.textOffset,p.setAttribute("transform","translate("+
e+","+u+") scale("+h.scale+")")),q.setAttribute("font-size",v+"px");else{this.styleEnabled&&v==mxConstants.DEFAULT_FONTSIZE||q.setAttribute("font-size",v*h.scale+"px");for(r=0;r<u.length;r++)0<u[r].length&&0<mxUtils.trim(u[r]).length&&(v=this.createElement("text"),v.setAttribute("x",this.format(a*h.scale)+this.textOffset),v.setAttribute("y",this.format(m*h.scale)+this.textOffset),mxUtils.write(v,u[r]),q.appendChild(v)),m+=x;this.root.appendChild(q);this.addTextBackground(q,e,a,b,c,"fill"==k?d:y,f,
g,k)}l&&0<c&&0<d&&(m=b,f==mxConstants.ALIGN_CENTER?a-=c/2:f==mxConstants.ALIGN_RIGHT&&(a-=c),"fill"!=k&&(g==mxConstants.ALIGN_MIDDLE?m-=d/2:g==mxConstants.ALIGN_BOTTOM&&(m-=d)),this.setClip(q,this.createClip(a*h.scale-2,m*h.scale-2,c*h.scale+4,d*h.scale+4)))};
mxSvgCanvas2D.prototype.measureHtmlContentWidth=function(a){try{var b=this.state,c=document.createElement("div");c.style.cssText="position:absolute;visibility:hidden;display:inline-block;white-space:nowrap;font-size:"+b.fontSize+"px;font-family:"+mxUtils.parseCssFontFamily(b.fontFamily,!0)+";line-height:"+b.fontSize*mxConstants.LINE_HEIGHT+"px;";(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle=
"italic");for(b=0;b<a.childNodes.length;b++)c.appendChild(a.childNodes[b].cloneNode(!0));document.body.appendChild(c);var d=c.offsetWidth;document.body.removeChild(c);return d}catch(e){return null}};mxSvgCanvas2D.prototype.adjustBlockTextOverflow=function(a,b,c,d,e,f,g){try{if(null==f&&(f=a.getBBox().width),f>d){var h=this.format((b+(g==mxConstants.ALIGN_CENTER?(f-d)/2:f-d))*e)+this.textOffset,k=this.format(c*e)+this.textOffset;a.setAttribute("transform","translate("+h+","+k+") scale("+e+")")}}catch(l){}};
mxSvgCanvas2D.prototype.updateFont=function(a){var b=this.state,c=this.getLightDarkColor(b.fontColor);a.setAttribute("fill",c.light);a.style.fill=c.cssText;this.styleEnabled&&b.fontFamily==mxConstants.DEFAULT_FONTFAMILY||a.setAttribute("font-family",mxUtils.parseCssFontFamily(b.fontFamily));(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&a.setAttribute("font-weight","bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&a.setAttribute("font-style","italic");c=[];(b.fontStyle&
mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(b.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&(a.setAttribute("text-decoration",c.join(" ")),(b.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(a.style.textDecorationStyle="dotted"))};mxSvgCanvas2D.textBackgrounds=null;
mxSvgCanvas2D.prototype.addTextBackground=function(a,b,c,d,e,f,g,h,k){var l=this.state;if(null!=document.body&&(null!=l.fontBackgroundColor||null!=l.fontBorderColor)){b={node:a,str:b,x:c,y:d,align:g,valign:h,fontSize:l.fontSize,fontFamily:l.fontFamily,fontStyle:l.fontStyle,scale:l.scale};var m=null,n=0,p=!1;"fill"==k||"width"==k?(g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),h==mxConstants.ALIGN_MIDDLE?d-=f/2:h==mxConstants.ALIGN_BOTTOM&&(d-=f),m=new mxRectangle((c+1)*l.scale,
d*l.scale,(e-2)*l.scale,(f+2)*l.scale)):null!=a.getBBox&&this.root.ownerDocument==document&&(null!=mxSvgCanvas2D.textBackgrounds?p=!0:(m=mxSvgCanvas2D.getTextBoundingBox(a),n=1));p||null!=m||(n=0,m=mxSvgCanvas2D.getStringBoundingBox(b));c=this.createElement("rect");d=null!=l.fontBackgroundColor&&l.fontBackgroundColor!=mxConstants.NONE?this.getLightDarkColor(l.fontBackgroundColor):null;e=null!=l.fontBorderColor&&l.fontBorderColor!=mxConstants.NONE?this.getLightDarkColor(l.fontBorderColor):null;c.textBackground=
{x:0,y:0,width:0,height:0,dy:n,scale:l.scale,padding:"fill"!=k&&"width"!=k?l.labelPadding:null,strokeWidth:null!=l.fontBorderColor?this.format(l.scale*l.fontBorderWidth):null,crisp:this.root.ownerDocument==document,pending:p?b:null};null!=m&&mxSvgCanvas2D.setTextBackgroundBounds(c,m);c.setAttribute("fill",null!=d?d.light:"none");c.setAttribute("stroke",null!=e?e.light:"none");c.setAttribute("x",0);c.setAttribute("y",0);c.setAttribute("width",0);c.setAttribute("height",0);null!=d&&(c.style.fill=d.cssText);
e&&(c.style.stroke=e.cssText);c.setAttribute("stroke-width",0);p&&(c.setAttribute("display","none"),mxSvgCanvas2D.textBackgrounds.push(c));mxSvgCanvas2D.updateTextBackground(c,1,0,0);a.insertBefore(c,a.firstChild)}};mxSvgCanvas2D.getTextBoundingBox=function(a){try{var b=a.getBBox();return 0<b.width&&0<b.height?new mxRectangle(b.x,b.y,b.width,b.height):null}catch(c){return null}};
mxSvgCanvas2D.getStringBoundingBox=function(a){var b=mxUtils.getSizeForString(mxUtils.htmlEntities(a.str,!1).replace(/\n/g,"<br/>"),a.fontSize,a.fontFamily,null,a.fontStyle),c=a.x,d=a.y,e=b.width;b=b.height;a.align==mxConstants.ALIGN_CENTER?c-=e/2:a.align==mxConstants.ALIGN_RIGHT&&(c-=e);a.valign==mxConstants.ALIGN_MIDDLE?d-=b/2:a.valign==mxConstants.ALIGN_BOTTOM&&(d-=b);return new mxRectangle((c+1)*a.scale,(d+2)*a.scale,e*a.scale,(b+1)*a.scale)};
mxSvgCanvas2D.setTextBackgroundBounds=function(a,b){a=a.textBackground;a.x=b.x;a.y=b.y;a.width=b.width;a.height=b.height};mxSvgCanvas2D.isTextBackgroundPending=function(a){a=null!=mxSvgCanvas2D.textBackgrounds&&0<mxSvgCanvas2D.textBackgrounds.length?a.getElementsByTagName("rect"):[];for(var b=0;b<a.length;b++)if(null!=a[b].textBackground&&null!=a[b].textBackground.pending)return!0;return!1};
mxSvgCanvas2D.measureTextBackgrounds=function(){var a=mxSvgCanvas2D.textBackgrounds;if(null!=a&&0<a.length){mxSvgCanvas2D.textBackgrounds=[];for(var b=[],c=0;c<a.length;c++){var d=a[c].textBackground.pending;b.push(null!=d.node.parentNode?mxSvgCanvas2D.getTextBoundingBox(d.node):null)}for(c=0;c<a.length;c++){var e=a[c].textBackground;null!=e.pending.node.parentNode&&(null!=b[c]?e.dy=1:b[c]=mxSvgCanvas2D.getStringBoundingBox(e.pending))}for(c=0;c<a.length;c++)e=a[c].textBackground,d=e.pending,e.pending=
null,null!=b[c]&&(mxSvgCanvas2D.setTextBackgroundBounds(a[c],b[c]),a[c].removeAttribute("display"),mxSvgCanvas2D.updateTextBackground(a[c],null!=d.px?d.px:1,null!=d.ox?d.ox:0,null!=d.oy?d.oy:0))}};
mxSvgCanvas2D.updateTextBackground=function(a,b,c,d){var e=a.textBackground;null!=e.pending?(e.pending.px=b,e.pending.ox=c,e.pending.oy=d):(b=mxSvgCanvas2D.getTextBackgroundBounds(a,b,c,d),a.setAttribute("x",b.x),a.setAttribute("y",b.y),a.setAttribute("width",b.width),a.setAttribute("height",b.height),a.setAttribute("stroke-width",b.strokeWidth),0!=b.offset?a.setAttribute("transform","translate("+b.offset+", "+b.offset+")"):a.removeAttribute("transform"))};
mxSvgCanvas2D.getTextBackgroundBounds=function(a,b,c,d,e){a=a.textBackground;var f=null!=e?e.x:a.x,g=null!=e?e.y+b:a.y+a.dy*b,h=null!=e?e.width:a.width;e=null!=e?e.height:a.height;null!=a.padding&&(f-=a.padding.left*a.scale,g-=a.padding.top*a.scale,h+=(a.padding.left+a.padding.right)*a.scale,e+=(a.padding.top+a.padding.bottom)*a.scale);var k=null!=a.strokeWidth?Math.max(0,a.strokeWidth-a.scale)/2:0,l=null!=a.strokeWidth?Math.max(b,a.strokeWidth):0;return{x:Math.floor((f-k+c)/b-1)*b-c,y:Math.floor((g-
k+d)/b-1)*b-d,width:Math.ceil((h+2*k)/b+2)*b,height:Math.ceil((e+2*k)/b)*b,strokeWidth:l,offset:a.crisp&&1==mxUtils.mod(l/b,2)?.5*b:0}};mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;
mxGuide.prototype.vertical=!0;mxGuide.prototype.positionEnabled=!0;mxGuide.prototype.distanceEnabled=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.distanceGuidesX=null;mxGuide.prototype.distanceGuidesY=null;mxGuide.prototype.rounded=!1;mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};
mxGuide.prototype.getGuideTolerance=function(a){return a&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance};mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a};mxGuide.prototype.createDistanceGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxGuide.prototype.isStateIgnored=function(a){return!1};
mxGuide.prototype.move=function(a,b,c,d){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){d=function(z,H,E){var F=!1;E&&f(Math.abs(z-B),u,H,r)?(b.y=z-a.getCenterY(),u=Math.abs(z-B),F=!0):E||(f(Math.abs(z-A),u,H,r)?(b.y=z-a.y,u=Math.abs(z-A),F=!0):f(Math.abs(z-C),u,H,r)&&(b.y=z-a.y-a.height,u=Math.abs(z-C),F=!0));F&&(r=H,t=z,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane())));
q=q||F};var e=function(z,H,E){var F=!1;E&&f(Math.abs(z-w),v,H,n)?(b.x=z-a.getCenterX(),v=Math.abs(z-w),F=!0):E||(f(Math.abs(z-x),v,H,n)?(b.x=z-a.x,v=Math.abs(z-x),F=!0):f(Math.abs(z-y),v,H,n)&&(b.x=z-a.x-a.width,v=Math.abs(z-y),F=!0));F&&(n=H,p=z,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));m=m||F},f=function(z,H,E,F){var O;if(!(O=z<H)){if(z=z==H)null==F||
E==F?z=!1:(z=E.getCenterX()-w,E=E.getCenterY()-B,H=F.getCenterX()-w,F=F.getCenterY()-B,z=z*z+E*E<H*H+F*F);O=z}return O},g=this.graph.getView().scale,h=Math.max(2,this.getGuideTolerance(c)*g),k=this.distanceEnabled?this.moveDistance(a,b,Math.max(2,h/2)):null;g=null!=k?k.x:null;k=null!=k?k.y:null;null!=g&&(b.x=g);null!=k&&(b.y=k);var l=a.clone();l.x+=b.x;l.y+=b.y;var m=!1,n=null,p=null,q=!1,r=null,t=null,v=h,u=h,x=l.x,y=l.x+l.width,w=l.getCenterX(),A=l.y,C=l.y+l.height,B=l.getCenterY();if(this.positionEnabled)for(h=
0;h<this.states.length;h++)l=this.states[h],null==l||this.isStateIgnored(l)||(this.horizontal&&(e.call(this,l.getCenterX(),l,!0),e.call(this,l.x,l,!1),e.call(this,l.x+l.width,l,!1),null==l.cell&&e.call(this,l.getCenterX(),l,!1)),this.vertical&&(d.call(this,l.getCenterY(),l,!0),d.call(this,l.y,l,!1),d.call(this,l.y+l.height,l,!1),null==l.cell&&d.call(this,l.getCenterY(),l,!1)));null!=g&&b.x!=g&&(b.x=g,m=!1);null!=k&&b.y!=k&&(b.y=k,q=!1);this.graph.snapDelta(b,a,!c,m||null!=g,q||null!=k);b=this.getDelta(a,
n,b.x,r,b.y);m||null==this.guideX?null!=this.guideX&&(c=Math.max(a.y+a.height+b.y-this.graph.panDy,n.y+n.height),this.guideX.points=[new mxPoint(p,Math.min(a.y+b.y-this.graph.panDy,n.y)),new mxPoint(p,c)],this.guideX.stroke=this.getGuideColor(n,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden";q||null==this.guideY?null!=this.guideY&&(c=Math.max(a.x+a.width+b.x-this.graph.panDx,r.x+r.width),this.guideY.points=[new mxPoint(Math.min(a.x+
b.x-this.graph.panDx,r.x),t),new mxPoint(c,t)],this.guideY.stroke=this.getGuideColor(r,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden"}return b};
mxGuide.prototype.moveExact=function(a,b){a=this.move(a,b.clone(),!1,!1);var c=this.graph.getView().scale/2;Math.abs(a.x-b.x)>c&&(null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),this.hideDistanceGuides(!0,!1));Math.abs(a.y-b.y)>c&&(null!=this.guideY&&(this.guideY.node.style.visibility="hidden"),this.hideDistanceGuides(!1,!0))};
mxGuide.prototype.moveDistance=function(a,b,c){b=new mxRectangle(a.x+b.x,a.y+b.y,a.width,a.height);for(var d=[],e=[],f=0;f<this.states.length;f++){var g=this.states[f];null==g||null==g.cell||this.isStateIgnored(g)||((b.x>=g.x&&b.x<=g.x+g.width||g.x>=b.x&&g.x<=b.x+b.width)&&(b.y>g.y+g.height+4||b.y+b.height+4<g.y)?e.push(g):(b.y>=g.y&&b.y<=g.y+g.height||g.y>=b.y&&g.y<=b.y+b.height)&&(b.x>g.x+g.width+4||b.x+b.width+4<g.x)&&d.push(g))}d=this.horizontal&&1<d.length?this.snapDistance(d,b,!0,c):null;c=
this.vertical&&1<e.length?this.snapDistance(e,b,!1,c):null;null==d&&this.hideDistanceGuides(!0,!1);null==c&&this.hideDistanceGuides(!1,!0);return null!=d||null!=c?{x:null!=d?d-a.x:null,y:null!=c?c-a.y:null}:null};
mxGuide.prototype.snapDistance=function(a,b,c,d){function e(t){return c?t.x:t.y}function f(t){return c?t.width:t.height}a.push(b);a.sort(function(t,v){return e(t)-e(v)});var g=a[a.length-1]==b,h=!1,k=0,l=0,m=0,n=0;if(a[0]!=b&&!g)for(var p=1;p<a.length-1;p++)if(a[p]==b){m=l=n=(e(a[p+1])-e(a[p-1])-f(a[p-1])-f(b))/2;break}for(p=0;p<a.length-1;p++){g=a[p];var q=a[p+1],r=g==b||q==b;q=e(q)-e(g)-f(g);h=h||g==b;if(0==l&&0==k)l=q,k=1;else if(Math.abs(l-q)<=(r||1==p&&h?d:0))k+=1;else if(1<k&&h){a=a.slice(0,
p+1);break}else if(3<=a.length-p&&!h)k=0,m=l=0!=n?n:0,a.splice(0,0==p?1:p),p=-1;else break;0!=m||r||(l=m=q)}(g=3==a.length&&a[1]==b)&&(m=0);if(1<k&&k==a.length-1&&(0<m||g)){g=a[a[0]==b?1:0];k=c?g.y+g.height:g.x+g.width;d=5*this.graph.getView().scale;h=[];l=0;if(0<m)for(p=0;p<a.length-1;p++)g=a[p],q=a[p+1],g==b?(l=this.roundToPixel(e(q)-f(b)-m),h.push(l+f(b)+d),h.push(e(q)-d)):q==b?(h.push(e(g)+f(g)+d),l=this.roundToPixel(e(g)+f(g)+m),h.push(l-d)):(h.push(e(g)+f(g)+d),h.push(e(q)-d));else g=a[0],a=
a[2],l=this.roundToPixel(e(g)+f(g)+(e(a)-e(g)-f(g)-f(b))/2),h.push(e(g)+f(g)+d),h.push(l-d),h.push(l+f(b)+d),h.push(e(a)-d);this.redrawDistanceGuides(c,k,h,d);return l}return null};
mxGuide.prototype.redrawDistanceGuides=function(a,b,c,d){var e=a?this.distanceGuidesX:this.distanceGuidesY;e=null!=e?e:[];for(var f=0;f<c.length;f+=2){var g=e[f/2],h=a?new mxPoint(c[f],b):new mxPoint(b,c[f]),k=a?new mxPoint(c[f+1],b):new mxPoint(b,c[f+1]),l=a?0:d,m=a?d:0;null==g&&(g=this.createDistanceGuideShape(a),g.dialect=mxConstants.DIALECT_SVG,g.pointerEvents=!1,g.init(this.graph.getView().getOverlayPane()),e[f/2]=g);g.points=[new mxPoint(h.x-l,h.y-m),new mxPoint(h.x+l,h.y+m),h,k,new mxPoint(k.x-
l,k.y-m),new mxPoint(k.x+l,k.y+m)];g.node.style.visibility="visible";g.redraw()}for(f=c.length/2;f<e.length;f++)e[f].destroy();e.splice(c.length/2,e.length-c.length/2);a?this.distanceGuidesX=e:this.distanceGuidesY=e};
mxGuide.prototype.hideDistanceGuides=function(a,b){if(a&&null!=this.distanceGuidesX)for(a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].node.style.visibility="hidden";if(b&&null!=this.distanceGuidesY)for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].node.style.visibility="hidden"};mxGuide.prototype.roundToPixel=function(a){var b=this.graph.getView().scale;return Math.round(a/b)*b};
mxGuide.prototype.getDelta=function(a,b,c,d,e){var f=this.graph.view.scale;if(this.rounded||null!=b&&null==b.cell)c=Math.round((a.x+c)/f)*f-a.x;if(this.rounded||null!=d&&null==d.cell)e=Math.round((a.y+e)/f)*f-a.y;return new mxPoint(c,e)};mxGuide.prototype.getGuideColor=function(a,b){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(!1)};
mxGuide.prototype.setVisible=function(a){a=a?"visible":"hidden";null!=this.guideX&&(this.guideX.node.style.visibility=a);null!=this.guideY&&(this.guideY.node.style.visibility=a);if(null!=this.distanceGuidesX)for(var b=0;b<this.distanceGuidesX.length;b++)this.distanceGuidesX[b].node.style.visibility=a;if(null!=this.distanceGuidesY)for(b=0;b<this.distanceGuidesY.length;b++)this.distanceGuidesY[b].node.style.visibility=a};
mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null);null!=this.guideY&&(this.guideY.destroy(),this.guideY=null);if(null!=this.distanceGuidesX){for(var a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].destroy();this.distanceGuidesX=null}if(null!=this.distanceGuidesY){for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].destroy();this.distanceGuidesY=null}};function mxShape(a){this.stencil=a;this.initStyles()}
mxShape.forceFilledPointerEvents=!0;mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=!0;mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.invalidBoundingBox=!0;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=!0;
mxShape.prototype.svgPointerEvents="all";mxShape.prototype.shapePointerEvents=!1;mxShape.prototype.stencilPointerEvents=!1;mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSvgBoundingBox=!1;mxShape.prototype.inModelUnits=!1;mxShape.prototype.init=function(a){null==this.node&&(this.node=this.create(a),null!=a&&a.appendChild(this.node))};
mxShape.prototype.initStyles=function(a){this.strokewidth=1;this.rotation=0;this.strokeOpacity=this.fillOpacity=this.opacity=100;this.flipV=this.flipH=!1};mxShape.prototype.isHtmlAllowed=function(){return!1};mxShape.prototype.getSvgScreenOffset=function(a){a=null!=a?a:this.scale;return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*a)),2)?.5:0};mxShape.prototype.svgScreenOffsetTolerance=.25;
mxShape.prototype.updateSvgScreenOffset=function(){var a=this.isModelCoordinates()?this.state.view.scale:null,b=null!=a?this.getSvgScreenOffset(a)/a:this.getSvgScreenOffset();null!=a&&a!=Math.round(a)&&null!=this.svgScreenOffset&&Math.abs(this.svgScreenOffset-b)*a<=this.svgScreenOffsetTolerance&&(b=this.svgScreenOffset);this.svgScreenOffset!=b&&(this.svgScreenOffset=b,0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform"))};
mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};
mxShape.prototype.isModelCoordinates=function(){var a=null!=this.state?this.state.view:null;return null!=a&&a.modelCoordinates&&null!=this.node&&mxUtils.isAncestorNode(a.getDrawPane(),this.node)};mxShape.prototype.getScreenRectangle=function(a){if(this.isModelCoordinates()){var b=this.state.view.scale,c=this.state.view.translate;a=new mxRectangle((a.x+c.x)*b,(a.y+c.y)*b,a.width*b,a.height*b)}return a};
mxShape.prototype.beginModelUnits=function(){var a=null;if(!this.inModelUnits&&this.isModelCoordinates()){var b=this.scale,c=null!=this.viewTranslate?this.viewTranslate:this.state.view.translate;a={bounds:this.bounds,points:this.points,scale:b,viewTranslate:this.viewTranslate};null!=this.bounds&&(this.bounds=new mxRectangle(mxUtils.unscale(this.bounds.x,b,c.x),mxUtils.unscale(this.bounds.y,b,c.y),mxUtils.unscale(this.bounds.width,b),mxUtils.unscale(this.bounds.height,b)));if(null!=this.points){this.points=
[];for(var d=0;d<a.points.length;d++){var e=a.points[d];this.points.push(null!=e?new mxPoint(mxUtils.unscale(e.x,b,c.x),mxUtils.unscale(e.y,b,c.y)):null)}}this.scale=1;this.viewTranslate=new mxPoint;this.inModelUnits=!0}return a};mxShape.prototype.endModelUnits=function(a){null!=a&&(this.bounds=a.bounds,this.points=a.points,this.scale=a.scale,this.viewTranslate=a.viewTranslate,this.inModelUnits=!1,this.updateBoundsFromPoints())};
mxShape.prototype.invalidateBoundingBox=function(){this.invalidBoundingBox=!0;null!=this.state&&null!=this.state.view&&null!=this.state.view.invalidateBoundingBox&&this.state.view.invalidateBoundingBox(this.state)};mxShape.prototype.redraw=function(){this.invalidateBoundingBox();var a=this.beginModelUnits();try{this.redrawNode()}finally{this.endModelUnits(a)}};
mxShape.prototype.redrawNode=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)};
mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};
mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){};
mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,
!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};
mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};
mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_X,dy:mxConstants.SHADOW_OFFSET_Y,blur:mxConstants.SHADOW_BLUR,color:mxConstants.SHADOWCOLOR,opacity:100*mxConstants.SHADOW_OPACITY};if(null!=this.style){a.dx=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_X,a.dx);a.dy=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_Y,a.dy);a.blur=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_BLUR,a.blur);var b=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOWCOLOR,
a.color);mxUtils.hasResourceReference(b)||(a.color=b);a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity)}return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};
mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""};mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))};
mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a};
mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.nonScalingTolerance=this.inModelUnits;a.placeForeignObjects=this.inModelUnits;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;this.svgScreenOffset=null;this.updateSvgScreenOffset();a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(b){return Math.round(parseFloat(b))});return a};
mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};
mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1,
west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b};
mxShape.prototype.updateHtmlColors=function(a){var b=this.stroke;null!=b&&b!=mxConstants.NONE?(a.style.borderColor=mxUtils.getLightDarkColor(b).cssText,this.isDashed?a.style.borderStyle="dashed":0<this.strokewidth&&(a.style.borderStyle="solid"),a.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):a.style.borderWidth="0px";b=this.outline?null:this.fill;null!=b&&b!=mxConstants.NONE?(a.style.backgroundColor=mxUtils.getLightDarkColor(b).cssText,a.style.backgroundImage="none"):
this.pointerEvents?a.style.backgroundColor="transparent":this.setTransparentBackgroundImage(a)};
mxShape.prototype.updateHtmlBounds=function(a){var b=Math.ceil(this.strokewidth*this.scale);a.style.borderWidth=Math.max(1,b)+"px";a.style.overflow="hidden";a.style.left=Math.round(this.bounds.x-b/2)+"px";a.style.top=Math.round(this.bounds.y-b/2)+"px";"CSS1Compat"==document.compatMode&&(b=-b);a.style.width=Math.round(Math.max(0,this.bounds.width+b))+"px";a.style.height=Math.round(Math.max(0,this.bounds.height+b))+"px"};
mxShape.prototype.destroyCanvas=function(a){if(a instanceof mxSvgCanvas2D){for(var b in a.gradients){var c=a.gradients[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1)}for(b in a.fillPatterns)c=a.fillPatterns[b],null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldGradients=a.gradients;this.oldFillPatterns=a.fillPatterns}};mxShape.prototype.beforePaint=function(a){};mxShape.prototype.afterPaint=function(a){};
mxShape.prototype.isOpacityGroup=function(a){return a instanceof mxSvgCanvas2D&&100>this.opacity&&null!=this.style&&"1"==mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY_GROUP,"0")};
mxShape.prototype.paint=function(a){var b=a.pointerEvents,c=!1;if(null!=a&&this.outline){var d=a.stroke;a.stroke=function(){c=!0;d.apply(this,arguments)};a.fillAndStroke=a.stroke}var e=this.scale,f=this.bounds.x/e,g=this.bounds.y/e,h=this.bounds.width/e,k=this.bounds.height/e;if(this.isPaintBoundsInverted()){var l=(h-k)/2;f+=l;g-=l;l=h;h=k;k=l}this.updateTransform(a,f,g,h,k);this.configureCanvas(a,f,g,h,k);this.updateSvgFilters(null!=a?a.state.scale:e);l=null;if(null==this.stencil&&null==this.points&&
this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var m=this.createBoundingBox();this.dialect==mxConstants.DIALECT_SVG?(l=this.createTransparentSvgRectangle(m.x,m.y,m.width,m.height),this.node.appendChild(l)):(e=a.createRect("rect",m.x/e,m.y/e,m.width/e,m.height/e),e.appendChild(a.createTransparentFill()),e.stroked="false",a.root.appendChild(e))}e=null;this.isOpacityGroup(a)&&(e=a.root,a.root=a.createElement("g"),a.root.setAttribute("opacity",this.opacity/100),e.appendChild(a.root),
a.setAlpha(1));this.paintShape(a,f,g,h,k);null!=e&&(a.root=e,a.setAlpha(this.opacity/100));null!=l&&null!=a.state&&null!=a.state.transform&&l.setAttribute("transform",a.state.transform);null!=a&&this.outline&&!c&&(a.rect(f,g,h,k),a.stroke());a.pointerEvents=b};
mxShape.prototype.paintShape=function(a,b,c,d,e){if(null!=this.stencil)this.stencil.drawShape(a,this,b,c,d,e,null!=this.state?this.state.view.graph:null);else{a.setStrokeWidth(this.strokewidth);var f=this.getWaypoints();if(null!=f)1<f.length&&this.paintEdgeShape(a,f);else{f=a.state.dx;var g=a.state.dy;this.paintVertexShape(a,b,c,d,e);a.state.dx=f;a.state.dy=g}}};
mxShape.prototype.getWaypoints=function(){var a=this.points,b=null;if(null!=a&&(b=[],0<a.length)){var c=this.scale,d=Math.max(c,1),e=a[0];b.push(new mxPoint(e.x/c,e.y/c));for(var f=1;f<a.length;f++){var g=a[f];(Math.abs(e.x-g.x)>=d||Math.abs(e.y-g.y)>=d)&&b.push(new mxPoint(g.x/c,g.y/c));e=g}}return b};
mxShape.prototype.configureCanvas=function(a,b,c,d,e){var f=null;null!=this.style&&(f=this.style.dashPattern);a.setAlpha(this.opacity/100);a.setFillAlpha(this.fillOpacity/100);a.setStrokeAlpha(this.strokeOpacity/100);null!=this.isShadow&&a.setShadow(this.isShadow,this.shadowStyle);null!=this.isDashed&&a.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);null!=f&&a.setDashPattern(f);null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&
this.gradient!=mxConstants.NONE?(b=this.getGradientBounds(a,b,c,d,e),a.setGradient(this.fill,this.gradient,b.x,b.y,b.width,b.height,this.gradientDirection)):(a.setFillColor(this.fill),a.setFillStyle(this.fillStyle,this.hachureGap,this.fillWeight,this.hachureAngle));null!=this.style&&(null!=this.style.linecap&&a.setLineCap(this.style.linecap),null!=this.style.linejoin&&a.setLineJoin(this.style.linejoin),null!=this.style.miterlimit&&a.setMiterLimit(this.style.miterlimit));a.setStrokeColor(this.stroke);
this.configurePointerEvents(a)};mxShape.prototype.configurePointerEvents=function(a){null==this.style||mxShape.forceFilledPointerEvents&&null!=this.fill&&this.fill!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(a.pointerEvents=!1)};mxShape.prototype.getGradientBounds=function(a,b,c,d,e){return new mxRectangle(b,c,d,e)};
mxShape.prototype.updateTransform=function(a,b,c,d,e){a.scale(this.scale);a.rotate(this.getShapeRotation(),this.flipH,this.flipV,b+d/2,c+e/2)};mxShape.prototype.paintVertexShape=function(a,b,c,d,e){this.paintBackground(a,b,c,d,e);this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),this.paintForeground(a,b,c,d,e))};mxShape.prototype.paintBackground=function(a,b,c,d,e){};mxShape.prototype.paintForeground=function(a,b,c,d,e){};
mxShape.prototype.paintEdgeShape=function(a,b){};mxShape.prototype.getArcSize=function(a,b){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))a=Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;a=Math.min(a*c,b*c)}return a};
mxShape.prototype.paintGlassEffect=function(a,b,c,d,e,f){var g=Math.ceil(this.strokewidth/2);a.setGradient("#ffffff","#ffffff",b,c,d,.6*e,"south",.9,.1);a.begin();f+=2*g;this.isRounded?(a.moveTo(b-g+f,c-g),a.quadTo(b-g,c-g,b-g,c-g+f),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g+f),a.quadTo(b+d+g,c-g,b+d+g-f,c-g)):(a.moveTo(b-g,c-g),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g));a.close();a.fill()};
mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=null!=g?g:!0;var h=b[b.length-1];if(e&&c){b=b.slice();var k=b[0];k=new mxPoint(h.x+(k.x-h.x)/2,h.y+(k.y-h.y)/2);b.splice(0,0,k)}var l=b[0];k=1;for(g?a.moveTo(l.x,l.y):a.lineTo(l.x,l.y);k<(e?b.length:b.length-1);){g=b[mxUtils.mod(k,b.length)];var m=l.x-g.x;l=l.y-g.y;if(c&&(0!=m||0!=l)&&(null==f||0>mxUtils.indexOf(f,k-1))){var n=Math.sqrt(m*m+l*l);a.lineTo(g.x+m*Math.min(d,n/2)/n,g.y+l*Math.min(d,n/2)/n);for(l=b[mxUtils.mod(k+
1,b.length)];k<b.length-2&&0==Math.round(l.x-g.x)&&0==Math.round(l.y-g.y);)l=b[mxUtils.mod(k+2,b.length)],k++;m=l.x-g.x;l=l.y-g.y;n=Math.max(1,Math.sqrt(m*m+l*l));m=g.x+m*Math.min(d,n/2)/n;l=g.y+l*Math.min(d,n/2)/n;a.quadTo(g.x,g.y,m,l);g=new mxPoint(m,l)}else a.lineTo(g.x,g.y);l=g;k++}e?a.close():a.lineTo(h.x,h.y)}};
mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};
mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,
this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.hachureGap=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_GAP,null);this.hachureAngle=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_ANGLE,null);this.fillWeight=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_WEIGHT,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,
this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,
this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==
mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);
this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1};mxShape.prototype.isGlassable=function(){return!1};
mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement){var b=this.removeForeignObjectNodes();try{var c=this.node.getBBox();0<c.width&&0<c.height&&(a=this.getScreenRectangle(new mxRectangle(c.x,c.y,c.width,c.height)),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(d){}for(c=b.length-1;0<=c;c--)this.node.insertBefore(b[c].node,b[c].next)}return a};
mxShape.prototype.removeForeignObjectNodes=function(){for(var a=[],b=this.node.getElementsByTagNameNS(mxConstants.NS_SVG,"foreignObject"),c=[],d=0;d<b.length;d++){for(var e=b[d];null!=e.parentNode&&e.parentNode!=this.node;)e=e.parentNode;e.parentNode==this.node&&0>mxUtils.indexOf(c,e)&&c.push(e)}for(d=0;d<c.length;d++)a.push({node:c[d],next:c[d].nextSibling}),this.node.removeChild(c[d]);return a};
mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a};mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};
mxShape.prototype.augmentBoundingBox=function(a){this.augmentShadowBoundingBox(a);null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)};
mxShape.prototype.augmentShadowBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle(),c=this.getPixelSize();0>b.dx&&(a.x+=b.dx*c,a.width-=b.dx*c);0>b.dy&&(a.y+=b.dy*c,a.height-=b.dy*c);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(mxUtils.unscale(Math.max(b.dx,0)*this.scale,c))*c;a.height+=Math.ceil(mxUtils.unscale(Math.max(b.dy,0)*this.scale,c))*c}};
mxShape.prototype.getPixelSize=function(){return this.inModelUnits||null==this.state||null==this.state.view||null==this.state.view.getPixelSize?1:this.state.view.getPixelSize()};mxShape.prototype.updateBoundingBox=function(){var a=this.useSvgBoundingBox?this.getSvgBoundingBox():null;null==a&&(a=this.getShapeBoundingBox());this.boundingBox=a};mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};
mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0};mxShape.prototype.getTextRotation=function(){var a=this.getRotation();1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(a+=mxText.prototype.verticalTextRotation);return a};
mxShape.prototype.getShapeRotation=function(){var a=this.getRotation();null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?a+=270:this.direction==mxConstants.DIRECTION_WEST?a+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(a+=90));return a};
mxShape.prototype.createTransparentSvgRectangle=function(a,b,c,d){var e=document.createElementNS(mxConstants.NS_SVG,"rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);e.setAttribute("fill","none");e.setAttribute("stroke","none");e.setAttribute("pointer-events","all");return e};mxShape.prototype.setTransparentBackgroundImage=function(a){a.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"};
mxShape.prototype.intersectsRectangle=function(a,b){return null!=a&&(b||null!=this.node&&"none"!=this.node.style.display&&"hidden"!=this.node.style.visibility)&&mxUtils.intersects(this.bounds,a,!0)};mxShape.prototype.releaseSvgGradients=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}};
mxShape.prototype.releaseSvgFillPatterns=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}};
mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldFillPatterns=this.oldGradients=null};function mxStencil(a){this.desc=a;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=!1;mxStencil.allowEval=!1;
mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null;
mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};
mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};
mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter"),e=a.getAttribute("name"),f=Number(a.getAttribute("dx"));a=Number(a.getAttribute("dy"));return new mxConnectionConstraint(new mxPoint(b,c),d,e,isFinite(f)?f:0,isFinite(a)?a:0)};
mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};
mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var h=a.states.slice(),k=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);k=this.computeAspect(b.style,c,d,e,f,k);var l=Math.min(k.width,k.height);l="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*l;a.setStrokeWidth(l);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),
a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,k,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,k,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=h.length&&(a.states=h)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,h,k,l,m){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,h,k,l,m),c=c.nextSibling};
mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var h=(d-e)/2;a+=h;c-=h}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};
mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(d=this.getColorValue(b,c,d,e),"default"==d&&(d=this.getDefaultColorValue(c,e)));return d};
mxStencil.prototype.getStyleWithNone=function(a,b,c){if(null!=a&&null!=a.state&&this.cachedCellStyle!=a.state.cell.style||null==this.cachedUnresolvedStyle)this.cachedCellStyle=a.state.cell.style,this.cachedUnresolvedStyle=c.getCellStyle(a.state.cell,!1);return null!=this.cachedUnresolvedStyle?this.cachedUnresolvedStyle[b]:null};
mxStencil.prototype.getColorValue=function(a,b,c,d){b=b.getAttribute("default");var e=mxUtils.getValue(a.style,c);null==e&&null!=d?(a=this.getStyleWithNone(a,c,d),e=null==b||null!=a?a:b):"default"==e&&null!=b&&b!=mxConstants.NONE&&(e=b);return e};mxStencil.prototype.getDefaultColorValue=function(a,b){var c="#ffffff";null!=b&&(c="fillcolor"==a.nodeName?b.shapeBackgroundColor:b.shapeForegroundColor);return c};
mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var h=c.nodeName,k=d.x,l=d.y,m=d.width,n=d.height,p=Math.min(m,n);if("save"==h)a.save();else if("restore"==h)a.restore();else if(f){if("path"==h){a.begin();p=!0;if("1"==c.getAttribute("rounded")){p=!1;for(var q=Number(c.getAttribute("arcSize")),r=0,t=[],v=c.firstChild;null!=v;){if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var u=v.nodeName;if("move"==u||"line"==u)"move"!=u&&0!=t.length||t.push([]),t[t.length-1].push(new mxPoint(k+Number(v.getAttribute("x"))*
m,l+Number(v.getAttribute("y"))*n)),r++;else{p=!0;break}}v=v.nextSibling}if(!p&&0<r)for(n=0;n<t.length;n++)l=!1,m=t[n][0],k=t[n][t[n].length-1],m.x==k.x&&m.y==k.y&&(t[n].pop(),l=!0),this.addPoints(a,t[n],!0,q,l);else p=!0}if(p)for(v=c.firstChild;null!=v;)v.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,v,d,e,f,g),v=v.nextSibling}else if("close"==h)a.close();else if("move"==h)a.moveTo(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n);else if("line"==h)a.lineTo(k+Number(c.getAttribute("x"))*
m,l+Number(c.getAttribute("y"))*n);else if("quad"==h)a.quadTo(k+Number(c.getAttribute("x1"))*m,l+Number(c.getAttribute("y1"))*n,k+Number(c.getAttribute("x2"))*m,l+Number(c.getAttribute("y2"))*n);else if("curve"==h)a.curveTo(k+Number(c.getAttribute("x1"))*m,l+Number(c.getAttribute("y1"))*n,k+Number(c.getAttribute("x2"))*m,l+Number(c.getAttribute("y2"))*n,k+Number(c.getAttribute("x3"))*m,l+Number(c.getAttribute("y3"))*n);else if("arc"==h)a.arcTo(Number(c.getAttribute("rx"))*m,Number(c.getAttribute("ry"))*
n,Number(c.getAttribute("x-axis-rotation")),Number(c.getAttribute("large-arc-flag")),Number(c.getAttribute("sweep-flag")),k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n);else if("rect"==h)a.rect(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n);else if("roundrect"==h)b=Number(c.getAttribute("arcsize")),0==b&&(b=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),d=Number(c.getAttribute("w"))*m,f=Number(c.getAttribute("h"))*
n,b=Number(b)/100,b=Math.min(d*b,f*b),a.roundrect(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,d,f,b,b);else if("ellipse"==h)a.ellipse(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n);else if("image"==h)b.outline||(b=this.evaluateAttribute(c,"src",b),a.image(k+Number(c.getAttribute("x"))*m,l+Number(c.getAttribute("y"))*n,Number(c.getAttribute("w"))*m,Number(c.getAttribute("h"))*n,b,!1,"1"==c.getAttribute("flipH"),
"1"==c.getAttribute("flipV")));else if("text"==h){if(!b.outline){g=this.evaluateTextAttribute(c,"str",b);d="1"==c.getAttribute("vertical")?-90:0;m=k+Number(c.getAttribute("x"))*m;n=l+Number(c.getAttribute("y"))*n;l=c.getAttribute("align")||"left";k=c.getAttribute("valign")||"top";f=(p="0"==c.getAttribute("flip-shape"))&&b.flipH;p=p&&b.flipV;"0"==c.getAttribute("align-shape")&&(q=b.rotation,t=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPH,0),b=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPV,
0),d=f||p?d-q:t&&b?d-q:t||b?d+q:d-q);d-=c.getAttribute("rotation");if(f||p)0==d&&(f&&(l="left"==l?"right":"right"==l?"left":l),p&&(k="top"==k?"bottom":"bottom"==k?"top":k)),a.save(),a.rotate(0,f,p,m,n);a.text(m,n,0,0,g,l,k,!1,"",null,!1,d);(f||p)&&a.restore()}}else if("include-shape"==h)p=mxStencilRegistry.getStencil(c.getAttribute("name")),null!=p&&(k+=Number(c.getAttribute("x"))*m,l+=Number(c.getAttribute("y"))*n,d=Number(c.getAttribute("w"))*m,f=Number(c.getAttribute("h"))*n,p.drawShape(a,b,k,
l,d,f,g));else if("fillstroke"==h)a.fillAndStroke();else if("fill"==h)a.fill();else if("stroke"==h)a.stroke();else if("strokewidth"==h)b="1"==c.getAttribute("fixed")?1:p,a.setStrokeWidth(Number(c.getAttribute("width"))*b);else if("dashed"==h)a.setDashed("1"==c.getAttribute("dashed"));else if("dashpattern"==h){if(c=c.getAttribute("pattern"),null!=c){c=c.split(" ");b=[];for(n=0;n<c.length;n++)0<c[n].length&&b.push(Number(c[n])*p);c=b.join(" ");a.setDashPattern(c)}}else"strokecolor"==h?a.setStrokeColor(this.parseColor(a,
b,c,c.getAttribute("color"),g)):"linecap"==h?a.setLineCap(c.getAttribute("cap")):"linejoin"==h?a.setLineJoin(c.getAttribute("join")):"miterlimit"==h?a.setMiterLimit(Number(c.getAttribute("limit"))):"fillcolor"==h?a.setFillColor(this.parseColor(a,b,c,c.getAttribute("color"),g)):"alpha"==h?a.setAlpha(c.getAttribute("alpha")):"fillalpha"==h?a.setAlpha(c.getAttribute("alpha")):"strokealpha"==h?a.setAlpha(c.getAttribute("alpha")):"fontcolor"==h?a.setFontColor(this.parseColor(a,b,c,c.getAttribute("color"),
g)):"fontstyle"==h?a.setFontStyle(c.getAttribute("style")):"fontfamily"==h?a.setFontFamily(c.getAttribute("family")):"fontsize"==h&&a.setFontSize(Number(c.getAttribute("size"))*p);!e||"fillstroke"!=h&&"fill"!=h&&"stroke"!=h||a.setShadow(!1)}};
var mxStencilRegistry={stencils:Object.create(null),addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:Object.create(null),addMarker:function(a,b){mxMarker.markers[a]=b},createMarker:function(a,b,c,d,e,f,g,h,k,l){var m=mxMarker.markers[c];return null!=m?m(a,b,c,d,e,f,g,h,k,l):null}};
(function(){function a(d){d=null!=d?d:2;return function(e,f,g,h,k,l,m,n,p,q){f=k*p*1.118;n=l*p*1.118;k*=m+p;l*=m+p;var r=h.clone();r.x-=f;r.y-=n;m=g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN?1:.75;h.x+=-k*m-f;h.y+=-l*m-n;return function(){e.begin();e.moveTo(r.x,r.y);e.lineTo(r.x-k-l/d,r.y-l+k/d);g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(r.x-3*k/4,r.y-3*l/4);e.lineTo(r.x+l/d-k,r.y-l-k/d);e.close();q?e.fillAndStroke():e.stroke()}}}function b(d){d=
null!=d?d:2;return function(e,f,g,h,k,l,m,n,p,q){f=k*p*1.118;g=l*p*1.118;k*=m+p;l*=m+p;var r=h.clone();r.x-=f;r.y-=g;h.x+=2*-f;h.y+=2*-g;return function(){e.begin();e.moveTo(r.x-k-l/d,r.y-l+k/d);e.lineTo(r.x,r.y);e.lineTo(r.x+l/d-k,r.y-l-k/d);e.stroke()}}}function c(d,e,f,g,h,k,l,m,n,p){m=f==mxConstants.ARROW_DIAMOND?.7071:.9862;e=h*n*m;m*=k*n;h*=l+n;k*=l+n;var q=g.clone();q.x-=e;q.y-=m;g.x+=-h-e;g.y+=-k-m;var r=f==mxConstants.ARROW_DIAMOND?2:3.4;return function(){d.begin();d.moveTo(q.x,q.y);d.lineTo(q.x-
h/2-k/r,q.y+h/r-k/2);d.lineTo(q.x-h,q.y-k);d.lineTo(q.x-h/2+k/r,q.y-k/2-h/r);d.close();p?d.fillAndStroke():d.stroke()}}mxMarker.addMarker("classic",a(2));mxMarker.addMarker("classicThin",a(3));mxMarker.addMarker("block",a(2));mxMarker.addMarker("blockThin",a(3));mxMarker.addMarker("open",b(2));mxMarker.addMarker("openThin",b(3));mxMarker.addMarker("oval",function(d,e,f,g,h,k,l,m,n,p){var q=l/2,r=g.clone();g.x-=h*q;g.y-=k*q;return function(){d.ellipse(r.x-q,r.y-q,l,l);p?d.fillAndStroke():d.stroke()}});
mxMarker.addMarker("baseDash",function(d,e,f,g,h,k,l,m,n,p){var q=h*(l+n+1),r=k*(l+n+1);return function(){d.begin();d.moveTo(g.x-r/2,g.y+q/2);d.lineTo(g.x+r/2,g.y-q/2);d.stroke()}});mxMarker.addMarker("doubleBlock",function(d,e,f,g,h,k,l,m,n,p){e=h*n*1.118;m=k*n*1.118;h*=l+n;k*=l+n;var q=g.clone();q.x-=e;q.y-=m;f=f!=mxConstants.ARROW_CLASSIC&&f!=mxConstants.ARROW_CLASSIC_THIN?1:.75;g.x+=-h*f*2-e;g.y+=-k*f*2-m;return function(){d.begin();d.moveTo(q.x,q.y);d.lineTo(q.x-h-k/2,q.y-k+h/2);d.lineTo(q.x+
k/2-h,q.y-k-h/2);d.close();d.moveTo(q.x-h,q.y-k);d.lineTo(q.x-2*h-.5*k,q.y+.5*h-2*k);d.lineTo(q.x-2*h+.5*k,q.y-.5*h-2*k);d.close();p?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("diamond",c);mxMarker.addMarker("diamondThin",c);mxMarker.addMarker("manyOptional",function(d,e,f,g,h,k,l,m,n,p){var q=h*(l+n+1),r=k*(l+n+1),t=l/2,v=g.x,u=g.y;g.x-=2*q-h*n/2;g.y-=2*r-k*n/2;return function(){d.begin();d.ellipse(v-1.5*q-t,u-1.5*r-t,2*t,2*t);p?d.fillAndStroke():d.stroke();d.begin();d.moveTo(v,u);d.lineTo(v-
q,u-r);d.moveTo(v+r/2,u-q/2);d.lineTo(v-q,u-r);d.lineTo(v-r/2,u+q/2);d.stroke()}})})();function mxActor(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e);a.fillAndStroke()};
mxActor.prototype.redrawPath=function(a,b,c,d,e){b=d/3;a.moveTo(0,e);a.curveTo(0,3*e/5,0,2*e/5,d/2,2*e/5);a.curveTo(d/2-b,2*e/5,d/2-b,0,d/2,0);a.curveTo(d/2+b,0,d/2+b,2*e/5,d/2,2*e/5);a.curveTo(d,2*e/5,d,3*e/5,d,e);a.close()};function mxCloud(a,b,c,d){mxActor.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCloud,mxActor);
mxCloud.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(.25*d,.25*e);a.curveTo(.05*d,.25*e,0,.5*e,.16*d,.55*e);a.curveTo(0,.66*e,.18*d,.9*e,.31*d,.8*e);a.curveTo(.4*d,e,.7*d,e,.8*d,.8*e);a.curveTo(d,.8*e,d,.6*e,.875*d,.5*e);a.curveTo(d,.3*e,.8*d,.1*e,.625*d,.2*e);a.curveTo(.5*d,.05*e,.3*d,.05*e,.25*d,.25*e);a.close()};function mxRectangleShape(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRectangleShape,mxShape);
mxRectangleShape.prototype.isHtmlAllowed=function(){var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));return!this.isRounded&&!this.glass&&0==this.rotation&&(a||null!=this.fill&&this.fill!=mxConstants.NONE)};
mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){if(this.isRounded){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))var f=Math.min(d/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f);a.roundrect(b,c,d,e,f,f)}else a.rect(b,c,d,e);a.fillAndStroke()};
mxRectangleShape.prototype.isRoundable=function(){return!0};mxRectangleShape.prototype.isGlassable=function(){return!0};mxRectangleShape.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))};mxRectangleShape.prototype.getLabelBounds=function(a){var b=this.getFooterSize()*this.scale;0<b&&(a=new mxRectangle(a.x,a.y,a.width,a.height-Math.min(a.height,b)));return a};
mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){var f=Math.min(e,this.getFooterSize());0<f&&!this.outline&&this.paintFooter(a,b,c,d,e,f);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(a,b,c,d,e,this.getArcSize(d+this.strokewidth,e+this.strokewidth))};
mxRectangleShape.prototype.paintFooter=function(a,b,c,d,e,f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_COLOR,this.stroke),h=this.isRounded?this.getArcSize(d,e):0,k=Math.min(d/2,h);null!=g&&g!=mxConstants.NONE&&(a.setFillColor(g),a.setStrokeColor(g));a.setShadow(!1);a.begin();if(f>=h)a.moveTo(b,c+e-f),a.lineTo(b,c+e-h),a.quadTo(b,c+e,b+k,c+e),a.lineTo(b+d-k,c+e),a.quadTo(b+d,c+e,b+d,c+e-h),a.lineTo(b+d,c+e-f);else{var l=1-Math.sqrt(f/h);h=k*l*l;l*=k;a.moveTo(b+h,c+e-f);a.quadTo(b+
l,c+e,b+k,c+e);a.lineTo(b+d-k,c+e);a.quadTo(b+d-l,c+e,b+d-h,c+e-f)}a.close();null!=g&&g!=mxConstants.NONE?a.fillAndStroke():a.stroke()};function mxEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke();null!=this.paintCenter&&this.paintCenter(a,b,c,d,e)};
mxEllipse.prototype.paintCenter=function(a,b,c,d,e){if(null!=this.style&&!this.outline){var f=Math.min(Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_RADIUS,0)),d/2,e/2);if(0<f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_COLOR,this.stroke);null!=g&&g!=mxConstants.NONE&&(a.setShadow(!1),a.setFillColor(g),a.ellipse(b+d/2-f,c+e/2-f,2*f,2*f),1==mxUtils.getValue(this.style,"centerStroke",0)&&null!=this.stroke&&this.stroke!=mxConstants.NONE?(a.setStrokeColor(this.stroke),
a.fillAndStroke()):a.fill())}}};function mxDoubleEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.paintBackground=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()};
mxDoubleEllipse.prototype.paintForeground=function(a,b,c,d,e){if(!this.outline){var f=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(d/5,e/5)));b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&a.ellipse(b,c,d,e);a.stroke()}};
mxDoubleEllipse.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(a.width/5/this.scale,a.height/5/this.scale)))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)};function mxRhombus(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return!0};
mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,[new mxPoint(b+f,c),new mxPoint(b+d,c+g),new mxPoint(b+f,c+e),new mxPoint(b,c+g)],this.isRounded,h,!0);a.fillAndStroke()};function mxPolyline(a,b,c){mxShape.call(this);this.points=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0};
mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){var c=a.pointerEventsValue;a.pointerEventsValue="stroke";null!=this.style&&1==this.style[mxConstants.STYLE_BEZIER]?this.paintBezierLine(a,b):null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]?this.paintCurvedLine(a,b):this.paintLine(a,b,this.isRounded);a.pointerEventsValue=c};
mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()};
mxPolyline.prototype.paintBezierLine=function(a,b){var c=b.length;if(!(2>c)){a.begin();a.moveTo(b[0].x,b[0].y);if(2==c)a.lineTo(b[1].x,b[1].y);else if(0==(c-1)%3)for(var d=1;d+2<c;d+=3)a.curveTo(b[d].x,b[d].y,b[d+1].x,b[d+1].y,b[d+2].x,b[d+2].y);else{for(d=1;d<c-2;d++){var e=b[d],f=b[d+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}a.quadTo(b[c-2].x,b[c-2].y,b[c-1].x,b[c-1].y)}a.stroke()}};
function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);a.grow((Math.max(this.arrowWidth,this.endSize)/2+this.strokewidth)*this.scale)};
mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=b[0];b=b[b.length-1];var f=b.x-e.x,g=b.y-e.y,h=Math.sqrt(f*f+g*g),k=h-2*c-mxConstants.ARROW_SIZE;f/=h;g/=h;h=d*g/3;d=-d*f/3;var l=e.x-h/2+c*f;e=e.y-d/2+c*g;var m=l+h,n=e+d,p=m+k*f;k=n+k*g;var q=p+h,r=k+d,t=q-3*h,v=r-3*d;a.begin();a.moveTo(l,e);a.lineTo(m,n);a.lineTo(p,k);a.lineTo(q,r);a.lineTo(b.x-c*f,b.y-c*g);a.lineTo(t,v);a.lineTo(t+h,v+d);a.close();a.fillAndStroke()};
function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;mxArrowConnector.prototype.isRoundable=function(){return!0};
mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))};
mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)};
mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.isCurved()&&2<b.length;c&&(b=this.getCurvePoints(b));var d=this.strokewidth;this.outline&&(d=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));var e=this.getStartArrowWidth()+d,f=this.getEndArrowWidth()+d,g=this.outline?this.getEdgeWidth()+d:this.getEdgeWidth(),h=this.isOpenEnded(),k=this.isMarkerStart(),l=this.isMarkerEnd(),m=h?0:this.arrowSpacing+d/2,n=this.startSize+d;d=this.endSize+d;var p=
!c&&this.isArrowRounded();c&&!h&&(k&&(b=this.trimCurveForMarker(b,m+n,!0)),l&&(b=this.trimCurveForMarker(b,m+d,!1)));c=b[b.length-1];var q=b[1].x-b[0].x,r=b[1].y-b[0].y,t=Math.sqrt(q*q+r*r);if(0!=t){var v=q/t,u=v,x=r/t,y=x;t=g*x;var w=-g*v,A=[];p?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();q=v;r=x;if(k&&!h)this.paintMarker(a,b[0].x,b[0].y,v,x,n,e,g,m,!0);else{var C=b[0].x+t/2+m*v,B=b[0].y+w/2+m*x,z=b[0].x-t/2+m*v,H=b[0].y-w/2+m*x;h?(a.moveTo(C,B),A.push(function(){a.lineTo(z,
H)})):(a.moveTo(z,H),a.lineTo(C,B))}var E=B=C=0;for(t=0;t<b.length-2;t++)if(w=mxUtils.relativeCcw(b[t].x,b[t].y,b[t+1].x,b[t+1].y,b[t+2].x,b[t+2].y),C=b[t+2].x-b[t+1].x,B=b[t+2].y-b[t+1].y,E=Math.sqrt(C*C+B*B),0!=E){u=C/E;y=B/E;E=Math.max(Math.sqrt((v*u+x*y+1)/2),.04);C=v+u;B=x+y;var F=Math.sqrt(C*C+B*B);if(0!=F){C/=F;B/=F;F=Math.max(E,Math.min(this.strokewidth/200+.04,.35));E=0!=w&&p?Math.max(.1,F):Math.max(E,.06);var O=b[t+1].x+B*g/2/E,G=b[t+1].y-C*g/2/E;B=b[t+1].x-B*g/2/E;C=b[t+1].y+C*g/2/E;0!=
w&&p?-1==w?(w=B+y*g,E=C-u*g,a.lineTo(B+x*g,C-v*g),a.quadTo(O,G,w,E),function(I,K){A.push(function(){a.lineTo(I,K)})}(B,C)):(a.lineTo(O,G),function(I,K){var M=O-x*g,L=G+v*g,N=O-y*g,P=G+u*g;A.push(function(){a.quadTo(I,K,M,L)});A.push(function(){a.lineTo(N,P)})}(B,C)):(a.lineTo(O,G),function(I,K){A.push(function(){a.lineTo(I,K)})}(B,C));v=u;x=y}}t=g*y;w=-g*u;if(l&&!h)this.paintMarker(a,c.x,c.y,-v,-x,d,f,g,m,!1);else{a.lineTo(c.x-m*u+t/2,c.y-m*y+w/2);var D=c.x-m*u-t/2,J=c.y-m*y-w/2;h?(a.moveTo(D,J),
A.splice(0,0,function(){a.moveTo(D,J)})):a.lineTo(D,J)}for(t=A.length-1;0<=t;t--)A[t]();h?(a.end(),a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);p&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),k&&!h&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,q,r,n,e,g,m,!0),a.stroke(),a.end()),l&&!h&&(a.begin(),this.paintMarker(a,c.x,c.y,-v,-x,d,f,g,m,!0),a.stroke(),a.end()))}};
mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,h,k,l){g=h/g;var m=h*e/2;h=-h*d/2;var n=(k+f)*d;f=(k+f)*e;l?a.moveTo(b-m+n,c-h+f):a.lineTo(b-m+n,c-h+f);a.lineTo(b-m/g+n,c-h/g+f);a.lineTo(b+k*d,c+k*e);a.lineTo(b+m/g+n,c+h/g+f);a.lineTo(b+m+n,c+h+f)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.isCurved=function(){return null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]};
mxArrowConnector.prototype.getCurvePoints=function(a){for(var b=[a[0]],c=a.length,d=a[0],e=this.inModelUnits?Math.max(this.scale,4):this.scale,f=1;f<c-1;f++){var g=a[f],h=f<c-2?new mxPoint((a[f].x+a[f+1].x)/2,(a[f].y+a[f+1].y)/2):a[f+1],k=g.x-d.x,l=g.y-d.y,m=h.x-g.x,n=h.y-g.y;k=Math.max(4,Math.min(Math.ceil((Math.sqrt(k*k+l*l)+Math.sqrt(m*m+n*n))*e/8),64));for(l=1;l<=k;l++)m=l/k,n=1-m,b.push(new mxPoint(n*n*d.x+2*n*m*g.x+m*m*h.x,n*n*d.y+2*n*m*g.y+m*m*h.y));d=h}return b};
mxArrowConnector.prototype.trimCurveForMarker=function(a,b,c){function d(k,l){var m=l.x-k.x;l=l.y-k.y;var n=k.x-f.x,p=k.y-f.y,q=m*m+l*l,r=2*(n*m+p*l);n=r*r-4*q*(n*n+p*p-b*b);if(0==q||0>n)return k;q=Math.max(0,Math.min(1,(-r-Math.sqrt(n))/(2*q)));return new mxPoint(k.x+q*m,k.y+q*l)}var e=a.length,f=c?a[0]:a[e-1];if(c)for(c=1;c<e-1;c++){var g=a[c].x-f.x,h=a[c].y-f.y;if(g*g+h*h>=b*b)return[f,d(a[c],a[c-1])].concat(a.slice(c))}else for(c=e-2;0<c;c--)if(g=a[c].x-f.x,h=a[c].y-f.y,g*g+h*h>=b*b)return e=
a.slice(0,c+1),e.push(d(a[c],a[c+1])),e.push(f),e;return a};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1};
mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};
function mxText(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,v,u,x,y,w){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:mxConstants.ALIGN_CENTER;this.valign=null!=d?d:mxConstants.ALIGN_MIDDLE;this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=h?h:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(k||2);this.spacingTop=this.spacing+parseInt(l||0);this.spacingRight=this.spacing+parseInt(m||0);
this.spacingBottom=this.spacing+parseInt(n||0);this.spacingLeft=this.spacing+parseInt(p||0);this.horizontal=null!=q?q:!0;this.background=r;this.border=t;this.borderWidth=1;this.wrap=null!=v?v:!1;this.clipped=null!=u?u:!1;this.overflow=null!=x?x:"visible";this.labelPadding=null!=y?y:0;this.textDirection=w;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;
mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=!0;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isHtmlAllowed=function(){return!0};mxText.prototype.getSvgScreenOffset=function(){return 0};
mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};mxText.prototype.configurePointerEvents=function(a){};
mxText.prototype.getActualTextDirection=function(){var a=this.textDirection;a==mxConstants.TEXT_DIRECTION_AUTO&&(a=this.getAutoDirection());a!=mxConstants.TEXT_DIRECTION_LTR&&a!=mxConstants.TEXT_DIRECTION_RTL&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_LR&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(a=null);return a};
mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c,g=this.bounds.height/c;this.updateTransform(a,d,e,f,g);this.configureCanvas(a,d,e,f,g);this.updateSvgFilters(null!=a?a.state.scale:c);c=this.getActualTextDirection();if(b)a.updateText(d,e,f,g,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),c,this.node);else{var h=(b=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"html":"",k=this.value;
b||"html"!=h||(k=mxUtils.htmlEntities(k,!1));"html"!=h||mxUtils.isNode(this.value)||(k=mxUtils.replaceTrailingNewlines(k,"<div><br></div>"));k=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==h?k.replace(/\n/g,"<br/>"):k;a.text(d,e,f,g,k,this.align,this.valign,this.wrap,h,this.overflow,this.clipped,this.getTextRotation(),c)}};
mxText.prototype.redraw=function(){this.invalidateBoundingBox();var a=this.beginModelUnits();try{this.redrawText()}finally{this.endModelUnits(a)}this.backgroundNodes=null;if(null!=a&&null!=this.node){a=this.node.getElementsByTagName("rect");for(var b=0;b<a.length;b++)null!=a[b].textBackground&&(this.backgroundNodes=this.backgroundNodes||[],this.backgroundNodes.push(a[b]));this.updateTextBackground()}};
mxText.prototype.updateTextBackground=function(){if(null!=this.backgroundNodes&&null!=this.state)for(var a=this.state.view.scale,b=this.state.view.translate,c=0;c<this.backgroundNodes.length;c++)mxSvgCanvas2D.updateTextBackground(this.backgroundNodes[c],1/a,b.x,b.y)};
mxText.prototype.redrawText=function(){if(this.wrap&&this.convertToSvg&&null!=this.style&&"wrap"==this.style.svgWhiteSpace&&null!=this.bounds){var a=this.bounds.width;null!=this.lastWrapWidth&&this.lastWrapWidth!=a&&(this.lastValue=null);this.lastWrapWidth=a}this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"DIV"==this.node.nodeName?mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node),
this.updateHtmlTransform()):(a=this.createCanvas(),null!=a&&null!=a.updateText?(a.pointerEvents=this.pointerEvents,this.paint(a,!0),this.destroyCanvas(a)):mxShape.prototype.redraw.apply(this,arguments)):(mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null)};
mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=this.spacing=2;this.horizontal=!0;delete this.background;delete this.border;this.borderWidth=1;this.labelPadding=0;this.textDirection=
mxConstants.DEFAULT_TEXT_DIRECTION;delete this.margin};
mxText.prototype.apply=function(a){var b=this.spacing;mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,
this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-b))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-b))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,
this.spacingBottom-b))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-b))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.borderWidth=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDER_WIDTH,
this.borderWidth),this.labelPadding=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_PADDING,this.labelPadding),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin());this.flipH=this.flipV=null};
mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0<a.length&&"z"<a[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR};mxText.prototype.getContentNode=function(){var a=this.node;null!=a&&(a=null==a.ownerSVGElement?this.node.firstChild.firstChild:a.firstChild.firstChild.firstChild.firstChild.firstChild);return a};
mxText.prototype.updateBoundingBox=function(){var a=this.node;this.boundingBox=this.bounds.clone();var b=this.getTextRotation();if(this.isStringSizeMeasured()){var c=null,d=null;if(null!=a.ownerSVGElement){var e=null!=a.firstChild?a.firstChild.firstChild:null;null!=e&&"switch"==e.nodeName&&(e=e.firstChild);if(null!=e&&"foreignObject"==e.nodeName&&null!=e.firstChild&&null!=e.firstChild.firstChild)a=e.firstChild.firstChild,d=a.offsetHeight*this.scale,c="width"==this.overflow?this.boundingBox.width:
a.offsetWidth*this.scale;else{mxSvgCanvas2D.isTextBackgroundPending(a)&&mxSvgCanvas2D.measureTextBackgrounds();try{var f=a.getBBox();"string"==typeof this.value&&0==mxUtils.trim(this.value)?this.boundingBox=null:this.boundingBox=0==f.width&&0==f.height?null:this.getScreenRectangle(new mxRectangle(f.x,f.y,f.width,f.height));return}catch(g){}}}else{if(null==this.offsetWidth||null==this.offsetHeight)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild),this.offsetWidth=a.offsetWidth+this.textWidthPadding,
this.offsetHeight=a.offsetHeight;c=this.offsetWidth*this.scale;d=this.offsetHeight*this.scale}null!=c&&null!=d&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,c,d))}null!=this.boundingBox&&(0!=b?(b=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),b,new mxPoint(0,0)),this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*
this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=b.x,this.boundingBox.y+=b.y,this.boundingBox.width=b.width,this.boundingBox.height=b.height):(this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null))};
mxText.prototype.isStringSizeMeasured=function(){var a=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,b=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;return!this.ignoreStringSize&&null!=this.node&&"fill"!=this.overflow&&(!this.clipped||!this.ignoreClippedStringSize||a!=mxConstants.ALIGN_CENTER||b!=mxConstants.ALIGN_MIDDLE)};mxText.prototype.getShapeRotation=function(){return 0};
mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)};mxText.prototype.getBorderWidth=function(){var a=parseFloat(this.borderWidth);return isFinite(a)&&0<=a?a:1};
mxText.prototype.configureCanvas=function(a,b,c,d,e){mxShape.prototype.configureCanvas.apply(this,arguments);a.setFontColor(this.color);a.setFontBackgroundColor(this.background);a.setFontBorderColor(0<this.getBorderWidth()?this.border:null);a.setFontBorderWidth(this.getBorderWidth());a.setLabelPadding(this.labelPadding);a.setFontFamily(this.family);a.setFontSize(this.size);a.setFontStyle(this.fontStyle);a.allowConvertHtmlToSvg=this.convertToSvg};
mxText.prototype.isShadowEnabled=function(){return null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_SHADOW,!1):!1};mxText.prototype.getHtmlValue=function(){var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a};
mxText.prototype.getTextCss=function(){var a=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a="display: inline-block; font-size: "+this.size+"px; font-family: "+mxUtils.parseCssFontFamily(this.family)+"; color: "+this.color+"; line-height: "+a+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight: bold; ");(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&
(a+="font-style: italic; ");var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&((this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted"),a+="text-decoration: "+b.join(" ")+"; ");return a};
mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var a=this.node.style;a.whiteSpace="normal";a.overflow="";a.width="";a.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node);this.offsetHeight=this.offsetWidth=null;this.updateHtmlTransform()}};
mxText.prototype.redrawHtmlShapeWithCss3=function(){var a=Math.max(0,Math.round(this.bounds.width/this.scale)),b=Math.max(0,Math.round(this.bounds.height/this.scale)),c="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",d=this.getTextCss(),e=this.getActualTextDirection();mxSvgCanvas2D.createCss(a+2,b,this.align,this.valign,this.wrap,this.overflow,this.clipped,e,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=
this.border&&0<this.getBorderWidth()?mxUtils.htmlEntities(this.border):null,mxUtils.parseCssSpacing(this.labelPadding),c,d,this.scale,mxUtils.bind(this,function(f,g,h,k,l,m){f=this.getTextRotation();f=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=f?"rotate("+f+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=f&&(f="transform-origin: 0 0; transform: "+f+"; ");"block"==this.overflow&&this.valign==mxConstants.ALIGN_MIDDLE&&(f+="max-height: "+
(b+1)+"px;");""==m?(h+=k,k="display:inline-block; min-width: 100%; "+f):(k+=f,mxClient.IS_SF&&(k+="-webkit-clip-path: content-box;"));"block"==this.overflow&&(k+="width: 100%; ");100>this.opacity&&(l+="opacity: "+this.opacity/100+"; ");this.node.setAttribute("style",h);h=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+h+"</div></div>");this.node.firstChild.firstChild.setAttribute("style",l);this.node.firstChild.setAttribute("style",
k)}),this.getBorderWidth())};
mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),b=this.node.style,c=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(b,"transformOrigin",100*-c+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(b,"transform","translate("+100*c+"%,"+100*d+"%) scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(b,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(b,"transform","scale("+this.scale+") translate("+100*c+"%,"+100*d+"%)"));b.left=Math.round(this.bounds.x-
Math.ceil(c*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";b.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";b.opacity=100>this.opacity?this.opacity/100:""};
mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var b=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=mxUtils.htmlEntities(b,!1));b=mxUtils.replaceTrailingNewlines(b,"<div> </div>");b=this.replaceLinefeeds?b.replace(/\n/g,"<br/>"):b;a.innerHTML='<div style="display:inline-block;_display:inline;">'+b+"</div>"}};
mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerText="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a;var b=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,c=null!=this.border&&this.border!=mxConstants.NONE&&0<this.getBorderWidth()?this.border:
null;if("fill"==this.overflow||"width"==this.overflow)null!=b&&(this.node.style.backgroundColor=b),null!=c&&(this.node.style.border=this.getBorderWidth()+"px solid "+c);else{var d="";null!=b&&(d+="background-color:"+mxUtils.htmlEntities(b)+";");null!=c&&(d+="border:"+this.getBorderWidth()+"px solid "+mxUtils.htmlEntities(c)+";");a='<div style="zoom:1;'+d+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?
this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+a+"</div>"}this.node.innerHTML=a;a=this.node.getElementsByTagName("div");0<a.length&&(b=this.textDirection,b==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=this.getAutoDirection()),b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?a[a.length-1].setAttribute("dir",b):a[a.length-1].removeAttribute("dir"))}};
mxText.prototype.updateFont=function(a){a=a.style;a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a.fontSize=this.size+"px";a.fontFamily=mxUtils.parseCssFontFamily(this.family);a.verticalAlign="top";a.color=this.color;a.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"";a.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==
mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&(this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted");a.textDecoration=b.join(" ");a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"};
mxText.prototype.updateSize=function(a){var b=Math.max(0,Math.round(this.bounds.width/this.scale)),c=Math.max(0,Math.round(this.bounds.height/this.scale)),d=a.style;this.clipped?(d.overflow="hidden",d.maxHeight=c+"px",d.maxWidth=b+"px"):"fill"==this.overflow?(d.width=b+1+"px",d.height=c+1+"px",d.overflow="hidden"):"width"==this.overflow?(d.width=b+1+"px",d.maxHeight=c+1+"px",d.overflow="hidden"):"block"==this.overflow&&(d.width=b+1+"px");if(this.wrap&&0<b){if(d.wordWrap=mxConstants.WORD_WRAP,d.whiteSpace=
"normal",d.width=b+"px","fill"!=this.overflow&&"width"!=this.overflow){c=a;null!=c.firstChild&&"DIV"==c.firstChild.nodeName&&(c=c.firstChild,"break-word"==a.style.wordWrap&&(c.style.width="100%"));var e=c.offsetWidth;if(0==e){var f=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);e=c.offsetWidth;a.style.visibility="";f.appendChild(a)}e+=3;this.clipped&&(e=Math.min(e,b));d.width=e+"px"}}else d.whiteSpace="nowrap"};
mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)};
mxText.prototype.getSpacing=function(a,b){return new mxPoint(null!=b&&-.5==b.x||null==b&&this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:null!=b&&-1==b.x||null==b&&this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-(a?0:this.baseSpacingRight):this.spacingLeft+(a?0:this.baseSpacingLeft),this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-(a?0:this.baseSpacingBottom):this.spacingTop+(a?
0:this.baseSpacingTop))};function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return!0};mxTriangle.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,.5*e),new mxPoint(0,e)],this.isRounded,b,!0)};function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor);
mxHexagon.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(.25*d,0),new mxPoint(.75*d,0),new mxPoint(d,.5*e),new mxPoint(.75*d,e),new mxPoint(.25*d,e),new mxPoint(0,.5*e)],this.isRounded,b,!0)};function mxLine(a,b,c,d){mxShape.call(this);this.bounds=a;this.stroke=b;this.strokewidth=null!=c?c:1;this.vertical=null!=d?d:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=!1;
mxLine.prototype.paintVertexShape=function(a,b,c,d,e){a.begin();if(this.vertical){var f=b+d/2;a.moveTo(f,c);a.lineTo(f,c+e)}else f=c+e/2,a.moveTo(b,f),a.lineTo(b+d,f);a.stroke()};function mxImageShape(a,b,c,d,e){mxShape.call(this);this.bounds=a;this.image=b;this.fill=c;this.stroke=d;this.strokewidth=null!=e?e:1}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=!0;mxImageShape.prototype.getSvgScreenOffset=function(){return 0};
mxImageShape.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);this.gradient=this.stroke=this.fill=null;null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.imageBackground=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),this.imageBorder=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||
1==mxUtils.getValue(this.style,"imageFlipV",0),this.clipPath=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null))};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxImageShape.prototype.isRoundable=function(){return!0};mxImageShape.prototype.isGlassable=function(){return!1};mxImageShape.prototype.getImageDataUri=function(a){return this.image};
mxImageShape.prototype.getImageCssVars=function(a){return null};mxImageShape.prototype.configurePointerEvents=function(a){};
mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){if(null!=this.image){var f=this.isRounded?this.getArcSize(d,e):0;null!=this.imageBackground&&(a.setFillColor(this.imageBackground),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.fillAndStroke());var g=this.clipPath;if(0<f){var h=" round "+100*f/Math.min(d,e)+"%";null!=g&&"inset"==g.substring(0,5)&&0>g.indexOf("round")?g=g.replace(")",h+")"):null==g&&(g="inset(0% 0% 0% 0%"+h+")")}a.image(b,c,d,e,this.getImageDataUri(a),
this.preserveImageAspect,!1,!1,g,this.getImageCssVars(a));null!=this.imageBorder&&(a.setShadow(!1),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)};
mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerText="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=
a;this.node.style.borderColor=b;a=document.createElement("img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"==
a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)};function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);
mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))};
mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape};
mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),c=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1,c))};
mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),h=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER?
a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-k):a+k;b=f==mxConstants.ALIGN_TOP?b+k:f==mxConstants.ALIGN_BOTTOM?b+(d-h-k):b+(d-h)/2;return new mxRectangle(a,b,g,h)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))};
mxLabel.prototype.getIndicatorBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),h=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),k=this.spacing+5;a=e==mxConstants.ALIGN_RIGHT?a+(c-g-k):e==mxConstants.ALIGN_CENTER?a+(c-g)/
2:a+k;b=f==mxConstants.ALIGN_BOTTOM?b+(d-h-k):f==mxConstants.ALIGN_TOP?b+k:b+(d-h)/2;return new mxRectangle(a,b,g,h)};
mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var a=document.createElement("img");a.style.position="relative";a.setAttribute("border","0");var b=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);b.x-=this.bounds.x;b.y-=this.bounds.y;a.style.left=Math.round(b.x)+"px";a.style.top=Math.round(b.y)+"px";a.style.width=
Math.round(b.width)+"px";a.style.height=Math.round(b.height)+"px";a.src=this.image;this.node.appendChild(a)}};function mxCylinder(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40;
mxCylinder.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e,!1);a.fillAndStroke();this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),a.begin(),this.redrawPath(a,b,c,d,e,!0),a.stroke())};mxCylinder.prototype.getCylinderSize=function(a,b,c,d){return Math.min(this.maxHeight,Math.round(d/5))};
mxCylinder.prototype.redrawPath=function(a,b,c,d,e,f){b=this.getCylinderSize(b,c,d,e);if(f&&null!=this.fill||!f&&null==this.fill)a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin());f||(a.moveTo(0,b),a.curveTo(0,-b/3,d,-b/3,d,b),a.lineTo(d,e-b),a.curveTo(d,e+b/3,0,e+b/3,0,e-b),a.close())};function mxConnector(a,b,c){mxPolyline.call(this,a,b,c)}mxUtils.extend(mxConnector,mxPolyline);
mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED];mxShape.prototype.updateBoundingBox.apply(this,arguments)};
mxConnector.prototype.paintEdgeShape=function(a,b){var c=this.createMarker(a,b,!0),d=this.createMarker(a,b,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);a.setShadow(!1);a.setDashed(!1);var e=null;null!=c&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_STARTFILLCOLOR,this.stroke)),e=mxUtils.getValue(this.style,mxConstants.STYLE_STARTSTROKECOLOR,null),null!=e&&a.setStrokeColor(e),c());null!=d&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_ENDFILLCOLOR,
this.stroke)),c=mxUtils.getValue(this.style,mxConstants.STYLE_ENDSTROKECOLOR,null),null!=c?a.setStrokeColor(c):null!=e&&a.setStrokeColor(this.stroke),d())};
mxConnector.prototype.createMarker=function(a,b,c){var d=null,e=b.length,f=mxUtils.getValue(this.style,c?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),g=c?b[1]:b[e-2];b=c?b[0]:b[e-1];if(null!=f&&null!=g&&null!=b){d=b.x-g.x;e=b.y-g.y;var h=Math.sqrt(d*d+e*e);g=d/h;d=e/h;e=mxUtils.getNumber(this.style,c?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);d=mxMarker.createMarker(a,this,f,b,g,d,e,c,this.strokewidth,0!=this.style[c?mxConstants.STYLE_STARTFILL:
mxConstants.STYLE_ENDFILL])}return d};
mxConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1);mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=Math.max(b,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+
1);a.grow(b*this.scale)};function mxSwimlane(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.fixedHeaderDefault=!0;mxSwimlane.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.laneFill=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE))};mxSwimlane.prototype.isRoundable=function(){return!0};
mxSwimlane.prototype.isGlassable=function(){return!0};mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};mxSwimlane.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))};
mxSwimlane.prototype.getLabelBounds=function(a){var b=this.getTitleSize(),c=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0==b&&!c)return mxShape.prototype.getLabelBounds.apply(this,arguments);var d=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);c=new mxRectangle(a.x,a.y,a.width,a.height);var f=this.isHorizontal(),g=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH;
f=f==!g;d=!f&&d!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);e=f&&e!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(g){b=Math.min(c.width,b*this.scale);if(d||e)c.x+=c.width-b;c.width=b}else{b=Math.min(c.height,b*this.scale);if(d||e)c.y+=c.height-b;c.height=b}return c};
mxSwimlane.prototype.getGradientBounds=function(a,b,c,d,e){a=this.getTitleSize();return this.isHorizontal()?new mxRectangle(b,c,d,Math.min(a,e)):new mxRectangle(b,c,Math.min(a,d),e)};
mxSwimlane.prototype.getSwimlaneArcSize=function(a,b,c){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))return Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return c*a*3};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)};
mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){if(!this.outline){var f=this.getTitleSize(),g=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0!=f||g){g=0;f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(g=this.getSwimlaneArcSize(d,e,f),g=Math.min((this.isHorizontal()?e:d)-f,Math.min(f,g)),this.paintRoundedSwimlane(a,b,c,d,e,f,g)):this.paintSwimlane(a,b,c,d,e,f);this.paintFooter(a,b,c,d,e,f,g);var h=mxUtils.getValue(this.style,
mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(a,b,c,d,e,f,h);if(null!=this.image){h=this.getImageBounds(b,c,d,e);var k=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null);a.image(h.x-b,h.y-c,h.width,h.height,this.image,!1,!1,!1,k)}this.glass&&(a.setShadow(!1),this.isHorizontal()?this.paintGlassEffect(a,0,0,d,f,g):this.paintTitleGlassEffect(a,0,0,f,e,g,mxConstants.DIRECTION_WEST))}}};
mxSwimlane.prototype.paintTitleGlassEffect=function(a,b,c,d,e,f,g){var h=g==mxConstants.DIRECTION_EAST?1:g==mxConstants.DIRECTION_SOUTH?2:g==mxConstants.DIRECTION_WEST?3:0;a.save();if(0==h)this.paintGlassEffect(a,b,c,d,e,f);else{g=2!=h;var k=[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST],l=function(n,p){return 1==h?b+d-p:2==h?b+d-n:b+p},m=function(n,p){return 1==h?c+n:2==h?c+e-p:c+e-n};this.paintGlassEffect({handJiggle:a.handJiggle,
setGradient:function(n,p,q,r,t,v,u,x,y){var w=l(q,r),A=m(q,r),C=l(q+t,r+v);q=m(q+t,r+v);r=mxUtils.indexOf(k,null!=u?u:mxConstants.DIRECTION_SOUTH);a.setGradient(n,p,Math.min(w,C),Math.min(A,q),Math.abs(C-w),Math.abs(q-A),0<=r?k[(r+h)%4]:u,x,y)},begin:function(){a.begin()},moveTo:function(n,p){a.moveTo(l(n,p),m(n,p))},lineTo:function(n,p){a.lineTo(l(n,p),m(n,p))},quadTo:function(n,p,q,r){a.quadTo(l(n,p),m(n,p),l(q,r),m(q,r))},curveTo:function(n,p,q,r,t,v){a.curveTo(l(n,p),m(n,p),l(q,r),m(q,r),l(t,
v),m(t,v))},close:function(){a.close()},fill:function(){a.fill()}},0,0,g?e:d,g?d:e,f)}a.restore()};mxSwimlane.prototype.configurePointerEvents=function(a){var b=!0,c=!0,d=!0;null!=this.style&&(b="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),d=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));(b||c||d)&&mxShape.prototype.configurePointerEvents.apply(this,arguments)};
mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f){var g=this.laneFill,h=!0,k=!0,l=!0,m=!0;null!=this.style&&(h="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),k=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),l?a.fillAndStroke():
a.fill(),f<e&&(g!=mxConstants.NONE&&h||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),m?g==mxConstants.NONE?a.stroke():m&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),l?a.fillAndStroke():a.fill(),f<d&&(g!=mxConstants.NONE&&h||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e),
m?g==mxConstants.NONE?a.stroke():m&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill()));k&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)};
mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g){var h=this.laneFill,k=!0,l=!0,m=!0,n=!0;null!=this.style&&(k="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/
2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),m?a.fillAndStroke():a.fill(),f<e&&(h!=mxConstants.NONE&&k||(a.pointerEvents=!1),h!=mxConstants.NONE&&a.setFillColor(h),a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),n?h==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():h!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f,
e),m?a.fillAndStroke():a.fill(),f<d&&(h!=mxConstants.NONE&&k||(a.pointerEvents=!1),h!=mxConstants.NONE&&a.setFillColor(h),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),n?h==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():h!=mxConstants.NONE&&a.fill()));l&&this.paintDivider(a,b,c,d,e,f,h==mxConstants.NONE)};
mxSwimlane.prototype.paintFooter=function(a,b,c,d,e,f,g){b=this.getFooterSize();c=this.isHorizontal();b=Math.min(b,(c?e:d)-f);if(!(0>=b)){f=this.fill;null!=f&&f!=mxConstants.NONE&&a.setFillColor(f);a.setShadow(!1);a.begin();if(c)if(c=Math.min(d/2,g),b>=g)a.moveTo(0,e-b),a.lineTo(0,e-g),a.quadTo(0,e,c,e),a.lineTo(d-c,e),a.quadTo(d,e,d,e-g),a.lineTo(d,e-b);else{g=1-Math.sqrt(b/g);var h=c*g*g;g*=c;a.moveTo(h,e-b);a.quadTo(g,e,c,e);a.lineTo(d-c,e);a.quadTo(d-g,e,d-h,e-b)}else c=Math.min(e/2,g),b>=g?(a.moveTo(d-
b,0),a.lineTo(d-g,0),a.quadTo(d,0,d,c),a.lineTo(d,e-c),a.quadTo(d,e,d-g,e),a.lineTo(d-b,e)):(g=1-Math.sqrt(b/g),h=c*g*g,g*=c,a.moveTo(d-b,h),a.quadTo(d,g,d,c),a.lineTo(d,e-c),a.quadTo(d,e-g,d-b,e-h));a.close();null!=f&&f!=mxConstants.NONE?a.fillAndStroke():a.stroke()}};mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){0!=f&&(g||a.setShadow(!1),a.begin(),this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e)),a.stroke())};
mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a}
mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]};
mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d))&&(d=this.graph.model.getEdgeCount(a),0<d))for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),h=this.graph.model.getTerminal(g,!0)==a;if(!b||h)h=this.graph.view.getVisibleTerminal(g,!h),this.traverse(h,b,c,g,e)}};
mxGraphLayout.prototype.isAncestor=function(a,b,c){if(!c)return this.graph.model.getParent(b)==a;if(b==a)return!1;for(;null!=b&&b!=a;)b=this.graph.model.getParent(b);return b==a};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.getModel().isVisible(a)};
mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.getModel().isVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])};
mxGraphLayout.prototype.getParentOffset=function(a){var b=new mxPoint;if(null!=a&&a!=this.parent){var c=this.graph.getModel();if(c.isAncestor(this.parent,a))for(var d=c.getGeometry(a);a!=this.parent;)b.x+=d.x,b.y+=d.y,a=c.getParent(a),d=c.getGeometry(a)}return b};
mxGraphLayout.prototype.setEdgePoints=function(a,b){if(null!=a){var c=this.graph.model,d=c.getGeometry(a);null==d?(d=new mxGeometry,d.relative=!0):d=d.clone();if(null!=this.parent&&null!=b){var e=c.getParent(a);e=this.getParentOffset(e);for(var f=0;f<b.length;f++)b[f].x-=e.x,b[f].y-=e.y}d.points=b;c.setGeometry(a,d)}};
mxGraphLayout.prototype.setVertexLocation=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a),f=null;if(null!=e){f=new mxRectangle(b,c,e.width,e.height);if(this.useBoundingBox){var g=this.graph.getView().getState(a);if(null!=g&&null!=g.text&&null!=g.text.boundingBox){var h=this.graph.getView().scale,k=g.text.boundingBox;g.text.boundingBox.x<g.x&&(b+=(g.x-k.x)/h,f.width=k.width);g.text.boundingBox.y<g.y&&(c+=(g.y-k.y)/h,f.height=k.height)}}null!=this.parent&&(g=d.getParent(a),null!=g&&g!=
this.parent&&(g=this.getParentOffset(g),b-=g.x,c-=g.y));if(e.x!=b||e.y!=c)e=e.clone(),e.x=b,e.y=c,d.setGeometry(a,e)}return f};
mxGraphLayout.prototype.getVertexBounds=function(a){var b=this.graph.getModel().getGeometry(a);if(this.useBoundingBox){var c=this.graph.getView().getState(a);if(null!=c&&null!=c.text&&null!=c.text.boundingBox){var d=this.graph.getView().scale,e=c.text.boundingBox,f=Math.max(c.x-e.x,0)/d,g=Math.max(c.y-e.y,0)/d;b=new mxRectangle(b.x-f,b.y-g,b.width+f+Math.max(e.x+e.width-(c.x+c.width),0)/d,b.height+g+Math.max(e.y+e.height-(c.y+c.height),0)/d)}}null!=this.parent&&(a=this.graph.getModel().getParent(a),
b=b.clone(),null!=a&&a!=this.parent&&(a=this.getParentOffset(a),b.x+=a.x,b.y+=a.y));return new mxRectangle(b.x,b.y,b.width,b.height)};mxGraphLayout.prototype.arrangeGroups=function(a,b,c,d,e,f){return this.graph.updateGroupBounds(a,b,!0,c,d,e,f)};function mxStackLayout(a,b,c,d,e,f){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=null!=c?c:0;this.x0=null!=d?d:0;this.y0=null!=e?e:0;this.border=null!=f?f:0}mxStackLayout.prototype=new mxGraphLayout;
mxStackLayout.prototype.constructor=mxStackLayout;mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=!1;mxStackLayout.prototype.fill=!1;mxStackLayout.prototype.resizeParent=!1;
mxStackLayout.prototype.resizeParentMax=!1;mxStackLayout.prototype.resizeLast=!1;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=!0;mxStackLayout.prototype.allowGaps=!1;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal};
mxStackLayout.prototype.moveCell=function(a,b,c){var d=this.graph.getModel(),e=d.getParent(a),f=this.isHorizontal();if(null!=a&&null!=e){var g=0,h=d.getChildCount(e);c=f?b:c;b=this.graph.getView().getState(e);null!=b&&(c-=f?b.x:b.y);c/=this.graph.view.scale;for(b=0;b<h;b++){var k=d.getChildAt(e,b);if(k!=a&&(k=d.getGeometry(k),null!=k)){k=f?k.x+k.width/2:k.y+k.height/2;if(g<=c&&k>c)break;g=k}}f=e.getIndex(a);f=Math.max(0,b-(b>f?1:0));d.add(e,a,f)}};
mxStackLayout.prototype.resizeCell=function(a,b,c){if(this.resizeLast&&!this.resizeParent&&null!=a&&null!=b&&null!=c){var d=this.graph.getModel(),e=d.getParent(a);d=d.getGeometry(e);var f=this.getLayoutCells(e);if(null!=d&&!d.relative&&0<f.length&&f[f.length-1]==a&&this.isVertexMovable(a)&&!this.graph.isCellCollapsed(e)){a=new mxRectangle(c.x,c.y,b.width,b.height);b=this.resizeParentMax;this.resizeParentMax=!1;try{this.updateParentGeometry(e,d,a)}finally{this.resizeParentMax=b}}}};
mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot)&&(c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return c};
mxStackLayout.prototype.getLayoutCells=function(a){for(var b=this.graph.getModel(),c=b.getChildCount(a),d=[],e=0;e<c;e++){var f=b.getChildAt(a,e);this.isVertexIgnored(f)||d.push(f)}this.allowGaps&&d.sort(mxUtils.bind(this,function(g,h){g=this.graph.getCellGeometry(g);h=this.graph.getCellGeometry(h);return this.horizontal?g.x==h.x?0:g.x>h.x>0?1:-1:g.y==h.y?0:g.y>h.y>0?1:-1}));return d};
mxStackLayout.prototype.snap=function(a){if(null!=this.gridSize&&0<this.gridSize&&(a=Math.max(a,this.gridSize),1<a/this.gridSize)){var b=a%this.gridSize;a+=b>this.gridSize/2?this.gridSize-b:-b}return a};
mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);e-=2*this.border;var f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop,h=this.graph.getActualStartSize(a,!0);null!=b&&(h.x=Math.min(h.x,b.width),h.y=Math.min(h.y,b.height),h.width=Math.min(h.width,b.width),h.height=Math.min(h.height,b.height));
var k=this.graph.getActualFooterSize(a,!0);e=c?e-(h.y+h.height+k.y+k.height):e-(h.x+h.width+k.x+k.width);f+=h.x+k.x;g+=h.y+k.y;d.beginUpdate();try{for(var l=0,m=null,n=0,p=null,q=!1,r=this.getLayoutCells(a),t=0;t<r.length;t++){var v=r[t],u=d.getGeometry(v);if(null!=u&&!this.isVertexMovable(v)){var x=0;this.borderCollapse||(x=mxUtils.getNumber(this.graph.getCellStyle(v),mxConstants.STYLE_STROKEWIDTH,1));m=u;p=null;n=(c?u.x+u.width:u.y+u.height)+Math.floor(x/2)}else if(null!=u){u=u.clone();q=!0;null!=
this.wrap&&null!=m&&(c&&m.x+m.width+u.width+2*this.spacing>this.wrap||!c&&m.y+m.height+u.height+2*this.spacing>this.wrap)&&(m=null,c?g+=l+this.spacing:f+=l+this.spacing,l=0);l=Math.max(l,c?u.height:u.width);x=0;if(!this.borderCollapse){var y=this.graph.getCellStyle(v);x=mxUtils.getNumber(y,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=m){var w=n+this.spacing+Math.floor(x/2);c?u.x=this.snap((this.allowGaps?Math.max(w,u.x):w)-this.marginLeft)+this.marginLeft:u.y=this.snap((this.allowGaps?Math.max(w,u.y):
w)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(c?u.x=this.allowGaps&&u.x>f?Math.max(this.snap(u.x-this.marginLeft)+this.marginLeft,f):f:u.y=this.allowGaps&&u.y>g?Math.max(this.snap(u.y-this.marginTop)+this.marginTop,g):g);c?u.y=g:u.x=f;this.fill&&null!=e&&(c?u.height=e:u.width=e);c?u.width=this.snap(u.width):u.height=this.snap(u.height);this.setChildGeometry(v,u);p=v;m=u;n=c?m.x+m.width+Math.floor(x/2):m.y+m.height+Math.floor(x/2)}}q||(m=null);this.resizeParent&&null!=b&&null!=m&&
!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,b,m):this.resizeLast&&null!=b&&null!=m&&null!=p&&(c?m.width=b.width-m.x-this.spacing-this.marginRight-h.width-k.width:m.height=b.height-m.y-this.spacing-this.marginBottom-h.height-k.height,this.setChildGeometry(p,m))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);null!=c&&b.x==c.x&&b.y==c.y&&b.width==c.width&&b.height==c.height||this.graph.getModel().setGeometry(a,b)};
mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=this.graph.getActualStartSize(a,!0),g=this.graph.getActualFooterSize(a,!0),h=b.clone();d?(c=c.x+c.width+this.marginRight+this.border+f.width+g.width,h.width=this.resizeParentMax?Math.max(h.width,c):c):(c=c.y+c.height+this.marginBottom+this.border+f.height+g.height,h.height=this.resizeParentMax?Math.max(h.height,c):c);b.x==h.x&&b.y==h.y&&b.width==h.width&&b.height==h.height||e.setGeometry(a,
h)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),h=0;h<g;h++){var k=b.getChildAt(a,h);if(this.isVertexIgnored(k))this.isEdgeIgnored(k)||(this.resetEdges&&this.graph.resetEdge(k),this.disableEdgeStyle&&this.setEdgeStyleEnabled(k,!1));else{f.push(k);var l=this.getVertexBounds(k);d=null==d?l.y:Math.min(d,l.y);e=null==e?l.x:Math.min(e,l.x);c=Math.max(c,Math.max(l.width,l.height))}}var m=this.getRadius(f.length,
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,m,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.cos(g*f-Math.PI/2)),Math.round(d+b+b*Math.sin(g*f-Math.PI/2)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}
mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=!1;mxParallelEdgeLayout.prototype.execute=function(a,b){a=this.findParallels(a,b);this.graph.model.beginUpdate();try{for(var c in a){var d=a[c];1<d.length&&this.layout(d)}}finally{this.graph.model.endUpdate()}};
mxParallelEdgeLayout.prototype.findParallels=function(a,b){var c=[],d=mxUtils.bind(this,function(g){if(!this.isEdgeIgnored(g)){var h=this.getEdgeId(g);null!=h&&(null==c[h]&&(c[h]=[]),c[h].push(g))}});if(null!=b)for(var e=0;e<b.length;e++)d(b[e]);else{b=this.graph.getModel();var f=b.getChildCount(a);for(e=0;e<f;e++)d(b.getChildAt(a,e))}return c};
mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);b=b.getVisibleTerminal(a,!1);var d="";if(null!=c&&null!=b){c=mxObjectIdentity.get(c);b=mxObjectIdentity.get(b);if(this.checkOverlap&&(a=this.graph.view.getState(a),null!=a&&null!=a.absolutePoints)){d=[];for(var e=0;e<a.absolutePoints.length;e++){var f=a.absolutePoints[e];null!=f&&d.push(f.x,f.y)}d=d.join(",")}return(c>b?b+"-"+c:c+"-"+b)+d}return null};
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.view.getState(b);if(null!=c&&null!=c.absolutePoints){var d=c.absolutePoints[0];c=c.absolutePoints[c.absolutePoints.length-1];if(null!=d&&null!=c){var e=this.graph.getView(),f=this.graph.getModel(),g=f.getGeometry(e.getVisibleTerminal(b,!0));b=f.getGeometry(e.getVisibleTerminal(b,!1));if(g==b)for(c=g.x+g.width+this.spacing,d=g.y+g.height/2,g=0;g<a.length;g++)this.route(a[g],c,d),c+=this.spacing;else if(null!=g&&null!=b&&(g=this.graph.view.scale,
b=this.graph.view.translate,d.x=d.x/g-b.x,d.y=d.y/g-b.y,c.x=c.x/g-b.x,c.y=c.y/g-b.y,g=c.x-d.x,e=c.y-d.y,b=Math.sqrt(g*g+e*e),0<b))for(c=d.x+g/2,d=d.y+e/2,e=e*this.spacing/b,b=g*this.spacing/b,c+=e*(a.length-1)/2,d-=b*(a.length-1)/2,g=0;g<a.length;g++)this.route(a[g],c,d),c-=e,d+=b}}};mxParallelEdgeLayout.prototype.route=function(a,b,c){this.graph.isCellMovable(a)&&this.setEdgePoints(a,[new mxPoint(Math.round(b),Math.round(c))])};
function mxCompositeLayout(a,b,c){mxGraphLayout.call(this,a);this.layouts=b;this.master=c}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;mxCompositeLayout.prototype.moveCell=function(a,b,c){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)};
mxCompositeLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0;c<this.layouts.length;c++)this.layouts[c].execute.apply(this.layouts[c],arguments)}finally{b.endUpdate()}};function mxGraphModel(a){this.currentEdit=this.createUndoableEdit();null!=a?this.setRoot(a):this.clear()}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null;mxGraphModel.prototype.cells=null;
mxGraphModel.prototype.maintainEdgeParent=!0;mxGraphModel.prototype.ignoreRelativeEdgeParent=!0;mxGraphModel.prototype.createIds=!0;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=!1;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds};
mxGraphModel.prototype.setCreateIds=function(a){this.createIds=a};mxGraphModel.prototype.createRoot=function(){var a=new mxCell;a.insert(new mxCell);return a};mxGraphModel.prototype.getCells=function(){var a=[];if(null!=this.cells)for(var b in this.cells)a.push(this.cells[b]);return a};mxGraphModel.prototype.getCellCount=function(){var a=0;if(null!=this.cells)for(var b in this.cells)a++;return a};mxGraphModel.prototype.getCell=function(a){return null!=this.cells?this.cells[a]:null};
mxGraphModel.prototype.filterCells=function(a,b){var c=null;if(null!=a){c=[];for(var d=0;d<a.length;d++)b(a[d])&&c.push(a[d])}return c};mxGraphModel.prototype.getDescendants=function(a){return this.filterDescendants(null,a)};mxGraphModel.prototype.filterDescendants=function(a,b,c){c=null!=c?c:[];b=b||this.getRoot();(null==a||a(b))&&c.push(b);for(var d=this.getChildCount(b),e=0;e<d;e++)this.filterDescendants(a,this.getChildAt(b,e),c);return c};
mxGraphModel.prototype.getRoot=function(a){var b=a||this.root;if(null!=a)for(;null!=a;)b=a,a=this.getParent(a);return b};mxGraphModel.prototype.setRoot=function(a){this.execute(new mxRootChange(this,a));return a};mxGraphModel.prototype.rootChanged=function(a){var b=this.root;this.root=a;this.nextId=0;this.cells=null;this.cellAdded(a);return b};mxGraphModel.prototype.isRoot=function(a){return null!=a&&this.root==a};mxGraphModel.prototype.isLayer=function(a){return this.isRoot(this.getParent(a))};
mxGraphModel.prototype.isAncestor=function(a,b){for(;null!=b&&b!=a;)b=this.getParent(b);return b==a};mxGraphModel.prototype.contains=function(a){return this.isAncestor(this.root,a)};mxGraphModel.prototype.getParent=function(a){return null!=a?a.getParent():null};mxGraphModel.prototype.add=function(a,b,c){if(b!=a&&null!=a&&null!=b){null==c&&(c=this.getChildCount(a));var d=a!=this.getParent(b);this.execute(new mxChildChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParents(b)}return b};
mxGraphModel.prototype.cellAdded=function(a){if(null!=a){null==a.getId()&&this.createIds&&a.setId(this.createId(a));if(null!=a.getId()){var b=this.getCell(a.getId());if(b!=a){for(;null!=b;)a.setId(this.createId(a)),b=this.getCell(a.getId());null==this.cells&&(this.cells=Object.create(null));this.cells[a.getId()]=a}}mxUtils.isNumeric(a.getId())&&4503599627370496>a.getId()&&(this.nextId=Math.max(this.nextId,a.getId()));b=this.getChildCount(a);for(var c=0;c<b;c++)this.cellAdded(this.getChildAt(a,c))}};
mxGraphModel.prototype.createId=function(a){a=this.nextId;this.nextId++;return this.prefix+a+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(a,b){b=b||this.getRoot(a);for(var c=this.getChildCount(a),d=0;d<c;d++){var e=this.getChildAt(a,d);this.updateEdgeParents(e,b)}e=this.getEdgeCount(a);c=[];for(d=0;d<e;d++)c.push(this.getEdgeAt(a,d));for(d=0;d<c.length;d++)a=c[d],this.isAncestor(b,a)&&this.updateEdgeParent(a,b)};
mxGraphModel.prototype.updateEdgeParent=function(a,b){for(var c=this.getTerminal(a,!0),d=this.getTerminal(a,!1);null!=c&&!this.isEdge(c)&&null!=c.geometry&&c.geometry.relative;)c=this.getParent(c);for(;null!=d&&this.ignoreRelativeEdgeParent&&!this.isEdge(d)&&null!=d.geometry&&d.geometry.relative;)d=this.getParent(d);if(this.isAncestor(b,c)&&this.isAncestor(b,d)&&(b=c==d?this.getParent(c):this.getNearestCommonAncestor(c,d),null!=b&&(this.getParent(b)!=this.root||this.isAncestor(b,a))&&this.getParent(a)!=
b)){c=this.getGeometry(a);if(null!=c){var e=this.getOrigin(this.getParent(a)),f=this.getOrigin(b);d=f.x-e.x;e=f.y-e.y;c=c.clone();c.translate(-d,-e);this.setGeometry(a,c)}this.add(b,a,this.getChildCount(b))}};mxGraphModel.prototype.getOrigin=function(a){if(null!=a){var b=this.getOrigin(this.getParent(a));this.isEdge(a)||(a=this.getGeometry(a),null!=a&&(b.x+=a.x,b.y+=a.y))}else b=new mxPoint;return b};
mxGraphModel.prototype.getNearestCommonAncestor=function(a,b){if(null!=a&&null!=b){var c=mxUtils.bind(this,function(f){var g=0;for(f=this.getParent(f);null!=f;f=this.getParent(f))g++;return g}),d=c(a);c=c(b);var e=d>c?a:b;a=d>c?b:a;for(b=Math.abs(d-c);0<b;b--)e=this.getParent(e);for(d==c&&(a=this.getParent(a),e=this.getParent(e));null!=a&&a!=e;)a=this.getParent(a),e=this.getParent(e);if(null!=a&&null!=this.getParent(a))return a}return null};
mxGraphModel.prototype.remove=function(a){a==this.root?this.setRoot(null):null!=this.getParent(a)&&this.execute(new mxChildChange(this,null,a));return a};mxGraphModel.prototype.cellRemoved=function(a){if(null!=a&&null!=this.cells){for(var b=this.getChildCount(a)-1;0<=b;b--)this.cellRemoved(this.getChildAt(a,b));null!=this.cells&&null!=a.getId()&&delete this.cells[a.getId()]}};
mxGraphModel.prototype.parentForCellChanged=function(a,b,c){var d=this.getParent(a);null!=b?b==d&&d.getIndex(a)==c||b.insert(a,c):null!=d&&(c=d.getIndex(a),d.remove(c));b=this.contains(b);c=this.contains(d);b&&!c?this.cellAdded(a):c&&!b&&this.cellRemoved(a);return d};mxGraphModel.prototype.getChildCount=function(a){return null!=a?a.getChildCount():0};mxGraphModel.prototype.getChildAt=function(a,b){return null!=a?a.getChildAt(b):null};
mxGraphModel.prototype.getChildren=function(a){return null!=a?a.children:null};mxGraphModel.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraphModel.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};mxGraphModel.prototype.getChildCells=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;for(var d=this.getChildCount(a),e=[],f=0;f<d;f++){var g=this.getChildAt(a,f);(!c&&!b||c&&this.isEdge(g)||b&&this.isVertex(g))&&e.push(g)}return e};
mxGraphModel.prototype.getTerminal=function(a,b){return null!=a?a.getTerminal(b):null};mxGraphModel.prototype.setTerminal=function(a,b,c){var d=b!=this.getTerminal(a,c);this.execute(new mxTerminalChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParent(a,this.getRoot());return b};mxGraphModel.prototype.setTerminals=function(a,b,c){this.beginUpdate();try{this.setTerminal(a,b,!0),this.setTerminal(a,c,!1)}finally{this.endUpdate()}};
mxGraphModel.prototype.terminalForCellChanged=function(a,b,c){var d=this.getTerminal(a,c);null!=b?b.insertEdge(a,c):null!=d&&d.removeEdge(a,c);return d};mxGraphModel.prototype.getEdgeCount=function(a){return null!=a?a.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(a,b){return null!=a?a.getEdgeAt(b):null};mxGraphModel.prototype.getDirectedEdgeCount=function(a,b,c){for(var d=0,e=this.getEdgeCount(a),f=0;f<e;f++){var g=this.getEdgeAt(a,f);g!=c&&this.getTerminal(g,b)==a&&d++}return d};
mxGraphModel.prototype.getConnections=function(a){return this.getEdges(a,!0,!0,!1)};mxGraphModel.prototype.getIncomingEdges=function(a){return this.getEdges(a,!0,!1,!1)};mxGraphModel.prototype.getOutgoingEdges=function(a){return this.getEdges(a,!1,!0,!1)};
mxGraphModel.prototype.getEdges=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:!0;d=null!=d?d:!0;for(var e=this.getEdgeCount(a),f=[],g=0;g<e;g++){var h=this.getEdgeAt(a,g),k=this.getTerminal(h,!0),l=this.getTerminal(h,!1);(d&&k==l||k!=l&&(b&&l==a||c&&k==a))&&f.push(h)}return f};
mxGraphModel.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;var d=this.getEdgeCount(a),e=this.getEdgeCount(b),f=a,g=d;e<d&&(g=e,f=b);d=[];for(e=0;e<g;e++){var h=this.getEdgeAt(f,e),k=this.getTerminal(h,!0),l=this.getTerminal(h,!1),m=l==a&&k==b;(k==a&&l==b||!c&&m)&&d.push(h)}return d};
mxGraphModel.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[];if(null!=a)for(var f=0;f<a.length;f++){var g=this.getTerminal(a[f],!0),h=this.getTerminal(a[f],!1);g==b&&null!=h&&h!=b&&d?e.push(h):h==b&&null!=g&&g!=b&&c&&e.push(g)}return e};
mxGraphModel.prototype.getTopmostCells=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<a.length;d++){for(var e=a[d],f=!0,g=this.getParent(e);null!=g;){if(b.get(g)){f=!1;break}g=this.getParent(g)}f&&c.push(e)}return c};mxGraphModel.prototype.isVertex=function(a){return null!=a?a.isVertex():!1};mxGraphModel.prototype.isEdge=function(a){return null!=a?a.isEdge():!1};mxGraphModel.prototype.isConnectable=function(a){return null!=a?a.isConnectable():!1};
mxGraphModel.prototype.getValue=function(a){return null!=a?a.getValue():null};mxGraphModel.prototype.setValue=function(a,b){this.execute(new mxValueChange(this,a,b));return b};mxGraphModel.prototype.valueForCellChanged=function(a,b){return a.valueChanged(b)};mxGraphModel.prototype.getGeometry=function(a){return null!=a?a.getGeometry():null};mxGraphModel.prototype.setGeometry=function(a,b){b!=this.getGeometry(a)&&this.execute(new mxGeometryChange(this,a,b));return b};
mxGraphModel.prototype.geometryForCellChanged=function(a,b){var c=this.getGeometry(a);a.setGeometry(b);return c};mxGraphModel.prototype.getStyle=function(a){return null!=a?a.getStyle():null};mxGraphModel.prototype.setStyle=function(a,b){b!=this.getStyle(a)&&this.execute(new mxStyleChange(this,a,b));return b};mxGraphModel.prototype.styleForCellChanged=function(a,b){var c=this.getStyle(a);a.setStyle(b);return c};mxGraphModel.prototype.isCollapsed=function(a){return null!=a?a.isCollapsed():!1};
mxGraphModel.prototype.setCollapsed=function(a,b){b!=this.isCollapsed(a)&&this.execute(new mxCollapseChange(this,a,b));return b};mxGraphModel.prototype.collapsedStateForCellChanged=function(a,b){var c=this.isCollapsed(a);a.setCollapsed(b);return c};mxGraphModel.prototype.isVisible=function(a){return null!=a?a.isVisible():!1};mxGraphModel.prototype.setVisible=function(a,b){b!=this.isVisible(a)&&this.execute(new mxVisibleChange(this,a,b));return b};
mxGraphModel.prototype.visibleStateForCellChanged=function(a,b){var c=this.isVisible(a);a.setVisible(b);return c};mxGraphModel.prototype.execute=function(a){a.execute();this.beginUpdate();this.currentEdit.add(a);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",a));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",a));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))};
mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT));if(!this.endingUpdate){this.endingUpdate=0==this.updateLevel;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var a=this.currentEdit;this.currentEdit=this.createUndoableEdit();a.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO,
"edit",a))}}finally{this.endingUpdate=!1}}};mxGraphModel.prototype.createUndoableEdit=function(a){var b=new mxUndoableEdit(this,null!=a?a:!0);b.notify=function(){b.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",b,"changes",b.changes));b.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",b,"changes",b.changes))};return b};
mxGraphModel.prototype.mergeChildren=function(a,b,c){mxUtils.deprecated("mxGraphModel.mergeChildren");c=null!=c?c:!0;this.beginUpdate();try{var d={};this.mergeChildrenImpl(a,b,c,d);for(var e in d){var f=d[e],g=this.getTerminal(f,!0);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!0));g=this.getTerminal(f,!1);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!1))}}finally{this.endUpdate()}};
mxGraphModel.prototype.mergeChildrenImpl=function(a,b,c,d){mxUtils.deprecated("mxGraphModel.mergeChildrenImpl");this.beginUpdate();try{for(var e=a.getChildCount(),f=0;f<e;f++){var g=a.getChildAt(f);if("function"==typeof g.getId){var h=g.getId(),k=null==h||this.isEdge(g)&&c?null:this.getCell(h);if(null==k){var l=g.clone();l.setId(h);l.setTerminal(g.getTerminal(!0),!0);l.setTerminal(g.getTerminal(!1),!1);k=b.insert(l);this.cellAdded(k)}d[mxCellPath.create(g)]=k;this.mergeChildrenImpl(g,k,c,d)}}}finally{this.endUpdate()}};
mxGraphModel.prototype.getParents=function(a){var b=[];if(null!=a)for(var c=new mxDictionary,d=0;d<a.length;d++){var e=this.getParent(a[d]);null==e||c.get(e)||(c.put(e,!0),b.push(e))}return b};mxGraphModel.prototype.cloneCell=function(a,b,c){return null!=a?this.cloneCells([a],b,null,c)[0]:null};
mxGraphModel.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:{};d=null!=d?d:!1;for(var e=[],f=0;f<a.length;f++)null!=a[f]?e.push(this.cloneCellImpl(a[f],c,b,d)):e.push(null);for(f=0;f<e.length;f++)null!=e[f]&&this.restoreClone(e[f],a[f],c);return e};
mxGraphModel.prototype.cloneCellImpl=function(a,b,c,d){var e=mxObjectIdentity.get(a),f=b[e];if(null==f&&(f=this.cellCloned(a),b[e]=f,d&&(f.id=a.id),c))for(c=this.getChildCount(a),e=0;e<c;e++){var g=this.cloneCellImpl(this.getChildAt(a,e),b,!0,d);f.insert(g)}return f};mxGraphModel.prototype.cellCloned=function(a){return a.clone()};
mxGraphModel.prototype.restoreClone=function(a,b,c){var d=this.getTerminal(b,!0);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!0));d=this.getTerminal(b,!1);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!1));d=this.getChildCount(a);for(var e=0;e<d;e++)this.restoreClone(this.getChildAt(a,e),this.getChildAt(b,e),c)};function mxRootChange(a,b){this.model=a;this.previous=this.root=b}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)};
function mxChildChange(a,b,c,d){this.model=a;this.previous=this.parent=b;this.child=c;this.previousIndex=this.index=d}
mxChildChange.prototype.execute=function(){if(null!=this.child){var a=this.model.getParent(this.child),b=null!=a?a.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1);a=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);null!=this.previous&&this.connect(this.child,!0);this.parent=this.previous;this.previous=a;this.index=this.previousIndex;this.previousIndex=b}};
mxChildChange.prototype.connect=function(a,b){b=null!=b?b:!0;var c=a.getTerminal(!0),d=a.getTerminal(!1);null!=c&&(b?this.model.terminalForCellChanged(a,c,!0):this.model.terminalForCellChanged(a,null,!0));null!=d&&(b?this.model.terminalForCellChanged(a,d,!1):this.model.terminalForCellChanged(a,null,!1));a.setTerminal(c,!0);a.setTerminal(d,!1);c=this.model.getChildCount(a);for(d=0;d<c;d++)this.connect(this.model.getChildAt(a,d),b)};
function mxTerminalChange(a,b,c,d){this.model=a;this.cell=b;this.previous=this.terminal=c;this.source=d}mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))};function mxValueChange(a,b,c){this.model=a;this.cell=b;this.previous=this.value=c}
mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))};function mxStyleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.style=c}mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))};function mxGeometryChange(a,b,c){this.model=a;this.cell=b;this.previous=this.geometry=c}
mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))};function mxCollapseChange(a,b,c){this.model=a;this.cell=b;this.previous=this.collapsed=c}mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))};
function mxVisibleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.visible=c}mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))};function mxCellAttributeChange(a,b,c){this.cell=a;this.attribute=b;this.previous=this.value=c}
mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var a=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous);this.previous=a}};function mxCell(a,b,c){this.value=a;this.setGeometry(b);this.setStyle(c);if(null!=this.onInit)this.onInit()}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=!1;
mxCell.prototype.edge=!1;mxCell.prototype.connectable=!0;mxCell.prototype.visible=!0;mxCell.prototype.collapsed=!1;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient="id value parent source target children edges overlays".split(" ");mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(a){this.id=a};mxCell.prototype.getValue=function(){return this.value};
mxCell.prototype.setValue=function(a){this.value=a};mxCell.prototype.valueChanged=function(a){var b=this.getValue();this.setValue(a);return b};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(a){this.geometry=a};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(a){this.style=a};mxCell.prototype.isVertex=function(){return 0!=this.vertex};mxCell.prototype.setVertex=function(a){this.vertex=a};
mxCell.prototype.isEdge=function(){return 0!=this.edge};mxCell.prototype.setEdge=function(a){this.edge=a};mxCell.prototype.isConnectable=function(){return 0!=this.connectable};mxCell.prototype.setConnectable=function(a){this.connectable=a};mxCell.prototype.isVisible=function(){return 0!=this.visible};mxCell.prototype.setVisible=function(a){this.visible=a};mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed};mxCell.prototype.setCollapsed=function(a){this.collapsed=a};
mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(a){this.parent=a};mxCell.prototype.getTerminal=function(a){return a?this.source:this.target};mxCell.prototype.setTerminal=function(a,b){b?this.source=a:this.target=a;return a};mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length};mxCell.prototype.getIndex=function(a){return mxUtils.indexOf(this.children,a)};
mxCell.prototype.getChildAt=function(a){return null==this.children?null:this.children[a]};mxCell.prototype.insert=function(a,b){null!=a&&(null==b&&(b=this.getChildCount(),a.getParent()==this&&b--),a.removeFromParent(),a.setParent(this),null==this.children?(this.children=[],this.children.push(a)):this.children.splice(b,0,a));return a};mxCell.prototype.remove=function(a){var b=null;null!=this.children&&0<=a&&(b=this.getChildAt(a),null!=b&&(this.children.splice(a,1),b.setParent(null)));return b};
mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var a=this.parent.getIndex(this);this.parent.remove(a)}};mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(a){return mxUtils.indexOf(this.edges,a)};mxCell.prototype.getEdgeAt=function(a){return null==this.edges?null:this.edges[a]};
mxCell.prototype.insertEdge=function(a,b){null!=a&&(a.removeFromTerminal(b),a.setTerminal(this,b),null==this.edges||a.getTerminal(!b)!=this||this.edges[this.edges.length-1]!=a&&0>mxUtils.indexOf(this.edges,a))&&(null==this.edges&&(this.edges=[]),this.edges.push(a));return a};mxCell.prototype.removeEdge=function(a,b){if(null!=a){if(a.getTerminal(!b)!=this&&null!=this.edges){var c=this.getEdgeIndex(a);0<=c&&this.edges.splice(c,1)}a.setTerminal(null,b)}return a};
mxCell.prototype.removeFromTerminal=function(a){var b=this.getTerminal(a);null!=b&&b.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var b=this.getValue();return null!=b&&b.nodeType==mxConstants.NODETYPE_ELEMENT&&b.hasAttribute?b.hasAttribute(a):null!=b.getAttribute(a)};mxCell.prototype.getAttribute=function(a,b){var c=this.getValue();a=null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT?c.getAttribute(a):null;return null!=a?a:b};
mxCell.prototype.setAttribute=function(a,b){var c=this.getValue();null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT&&c.setAttribute(a,b)};mxCell.prototype.clone=function(){var a=mxUtils.clone(this,this.mxTransient);a.setValue(this.cloneValue());return a};mxCell.prototype.cloneValue=function(a){a=null!=a?a:this.getValue();null!=a&&("function"==typeof a.clone?a=a.clone():isNaN(a.nodeType)||(a=a.cloneNode(!0)));return a};function mxGeometry(a,b,c,d){mxRectangle.call(this,a,b,c,d)}
mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=!1;
mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var a=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=a}};mxGeometry.prototype.getTerminalPoint=function(a){return a?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(a,b){b?this.sourcePoint=a:this.targetPoint=a;return a};
mxGeometry.prototype.rotate=function(a,b){var c=mxUtils.toRadians(a);a=Math.cos(c);c=Math.sin(c);if(!this.relative){var d=new mxPoint(this.getCenterX(),this.getCenterY());d=mxUtils.getRotatedPoint(d,a,c,b);this.x=Math.round(d.x-this.width/2);this.y=Math.round(d.y-this.height/2)}null!=this.sourcePoint&&(d=mxUtils.getRotatedPoint(this.sourcePoint,a,c,b),this.sourcePoint.x=Math.round(d.x),this.sourcePoint.y=Math.round(d.y));null!=this.targetPoint&&(d=mxUtils.getRotatedPoint(this.targetPoint,a,c,b),this.targetPoint.x=
Math.round(d.x),this.targetPoint.y=Math.round(d.y));if(null!=this.points)for(var e=0;e<this.points.length;e++)null!=this.points[e]&&(d=mxUtils.getRotatedPoint(this.points[e],a,c,b),this.points[e].x=Math.round(d.x),this.points[e].y=Math.round(d.y))};
mxGeometry.prototype.translate=function(a,b,c){a=parseFloat(a);b=parseFloat(b);this.relative||c||(this.x=parseFloat(this.x)+a,this.y=parseFloat(this.y)+b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+a,this.targetPoint.y=parseFloat(this.targetPoint.y)+b);if(this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(c=0;c<this.points.length;c++)null!=
this.points[c]&&(this.points[c].x=parseFloat(this.points[c].x)+a,this.points[c].y=parseFloat(this.points[c].y)+b)};
mxGeometry.prototype.scale=function(a,b,c){a=parseFloat(a);b=parseFloat(b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*a,this.targetPoint.y=parseFloat(this.targetPoint.y)*b);if(null!=this.points)for(var d=0;d<this.points.length;d++)null!=this.points[d]&&(this.points[d].x=parseFloat(this.points[d].x)*a,this.points[d].y=parseFloat(this.points[d].y)*
b);this.relative||(this.x=parseFloat(this.x)*a,this.y=parseFloat(this.y)*b,c&&(b=a=Math.min(a,b)),this.width=parseFloat(this.width)*a,this.height=parseFloat(this.height)*b)};
mxGeometry.prototype.equals=function(a){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==a.relative&&(null==this.sourcePoint&&null==a.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(a.sourcePoint))&&(null==this.targetPoint&&null==a.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(a.targetPoint))&&(null==this.points&&null==a.points||null!=this.points&&mxUtils.equalPoints(this.points,a.points))&&(null==this.alternateBounds&&null==a.alternateBounds||
null!=this.alternateBounds&&this.alternateBounds.equals(a.alternateBounds))&&(null==this.offset&&null==a.offset||null!=this.offset&&null!=a.offset&&("function"===typeof this.offset.equals?this.offset.equals(a.offset):this.offset.x==a.offset.x&&this.offset.y==a.offset.y))};
var mxCellPath={PATH_SEPARATOR:".",create:function(a){var b="";if(null!=a)for(var c=a.getParent();null!=c;)b=c.getIndex(a)+mxCellPath.PATH_SEPARATOR+b,a=c,c=a.getParent();a=b.length;1<a&&(b=b.substring(0,a-1));return b},getParentPath:function(a){if(null!=a){var b=a.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=b)return a.substring(0,b);if(0<a.length)return""}return null},resolve:function(a,b){if(null!=b){b=b.split(mxCellPath.PATH_SEPARATOR);for(var c=0;c<b.length;c++)a=a.getChildAt(parseInt(b[c]))}return a},
compare:function(a,b){for(var c=Math.min(a.length,b.length),d=0,e=0;e<c;e++)if(a[e]!=b[e]){0==a[e].length||0==b[e].length?d=a[e]==b[e]?0:a[e]>b[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),h=Math.PI,k=Math.PI/2-f,l=Math.atan2(a.height,a.width);f<-h+l||f>h-l?(g.x=a.x,g.y=e-a.width*Math.tan(f)/
2):f<-l?(g.y=a.y,g.x=b-a.height*Math.tan(k)/2):f<l?(g.x=a.x+a.width,g.y=e+a.width*Math.tan(f)/2):(g.y=a.y+a.height,g.x=b+a.height*Math.tan(k)/2);d&&(c.x>=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.x<a.x?g.x=a.x:c.x>a.x+a.width&&(g.x=a.x+a.width),c.y<a.y?g.y=a.y:c.y>a.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,h=a.height/2,k=e+g,l=f+h,m=c.x;c=c.y;b=null!=b?b.view:null;var n=null!=b?b.scale:1;b=parseInt(mxUtils.unscale(m-
k,n));n=parseInt(mxUtils.unscale(c-l,n));if(0==b&&0!=n)return new mxPoint(k,l+h*n/Math.abs(n));if(0==b&&0==n)return new mxPoint(m,c);if(d){if(c>=f&&c<=f+a.height)return a=c-l,a=Math.sqrt(g*g*(1-a*a/(h*h)))||0,m<=e&&(a=-a),new mxPoint(k+a,c);if(m>=e&&m<=e+a.width)return a=m-k,a=Math.sqrt(h*h*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(m,l+a)}e=g*h/Math.sqrt(h*h*b*b+g*g*n*n);return new mxPoint(k+e*b,l+e*n)},RhombusPerimeter:function(a,b,c,d){b=a.x;var e=a.y,f=a.width;a=a.height;var g=b+f/2,h=e+a/2,k=
c.x;c=c.y;if(g==k)return h>c?new mxPoint(g,e):new mxPoint(g,e+a);if(h==c)return g>k?new mxPoint(b,h):new mxPoint(b+f,h);var l=g,m=h;d&&(k>=b&&k<=b+f?l=k:c>=e&&c<=e+a&&(m=c));return k<g?c<h?mxUtils.intersection(k,c,l,m,g,e,b,h):mxUtils.intersection(k,c,l,m,g,e+a,b,h):c<h?mxUtils.intersection(k,c,l,m,g,e,b+f,h):mxUtils.intersection(k,c,l,m,g,e+a,b+f,h)},TrianglePerimeter:function(a,b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,
f=a.x,g=a.y,h=a.width,k=a.height;a=f+h/2;var l=g+k/2,m=new mxPoint(f,g),n=new mxPoint(f+h,l),p=new mxPoint(f,g+k);b==mxConstants.DIRECTION_NORTH?(m=p,n=new mxPoint(a,g),p=new mxPoint(f+h,g+k)):b==mxConstants.DIRECTION_SOUTH?(n=new mxPoint(a,g+k),p=new mxPoint(f+h,g)):b==mxConstants.DIRECTION_WEST&&(m=new mxPoint(f+h,g),n=new mxPoint(f,l),p=new mxPoint(f+h,g+k));var q=c.x-a,r=c.y-l;q=e?Math.atan2(q,r):Math.atan2(r,q);r=e?Math.atan2(h,k):Math.atan2(k,h);(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?
q>-r&&q<r:q<-Math.PI+r||q>Math.PI-r)?c=d&&(e&&c.x>=m.x&&c.x<=p.x||!e&&c.y>=m.y&&c.y<=p.y)?e?new mxPoint(c.x,m.y):new mxPoint(m.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+h/2+k*Math.tan(q)/2,g+k):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+h/2-k*Math.tan(q)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+h,g+k/2+h*Math.tan(q)/2):new mxPoint(f,g+k/2-h*Math.tan(q)/2):(d&&(d=new mxPoint(a,l),c.y>=g&&c.y<=g+k?(d.x=e?a:b==mxConstants.DIRECTION_WEST?f+h:f,d.y=c.y):c.x>=f&&c.x<=f+h&&(d.x=c.x,d.y=
e?b==mxConstants.DIRECTION_NORTH?g+k:g:l),a=d.x,l=d.y),c=e&&c.x<=f+h/2||!e&&c.y<=g+k/2?mxUtils.intersection(c.x,c.y,a,l,m.x,m.y,n.x,n.y):mxUtils.intersection(c.x,c.y,a,l,n.x,n.y,p.x,p.y));null==c&&(c=new mxPoint(a,l));return c},HexagonPerimeter:function(a,b,c,d){var e=null!=b?b.view:null,f=null!=e?e.scale:1;e=null!=e?e.translate:new mxPoint;a=mxPerimeter.getHexagonPerimeterPoint(new mxRectangle(mxUtils.unscale(a.x,f,e.x),mxUtils.unscale(a.y,f,e.y),mxUtils.unscale(a.width,f),mxUtils.unscale(a.height,
f)),b,new mxPoint(mxUtils.unscale(c.x,f,e.x),mxUtils.unscale(c.y,f,e.y)),d);return new mxPoint((a.x+e.x)*f,(a.y+e.y)*f)},getHexagonPerimeterPoint:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,h=a.height,k=a.getCenterX();a=a.getCenterY();var l=c.x,m=c.y,n=-Math.atan2(m-a,l-k),p=Math.PI,q=Math.PI/2;new mxPoint(k,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var r=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=
new mxPoint;var t=new mxPoint;if(l<e&&m<f||l<e&&m>f+h||l>e+g&&m<f||l>e+g&&m>f+h)d=!1;if(d){if(r){if(l==k){if(m<=f)return new mxPoint(k,f);if(m>=f+h)return new mxPoint(k,f+h)}else if(l<e){if(m==f+h/4)return new mxPoint(e,f+h/4);if(m==f+3*h/4)return new mxPoint(e,f+3*h/4)}else if(l>e+g){if(m==f+h/4)return new mxPoint(e+g,f+h/4);if(m==f+3*h/4)return new mxPoint(e+g,f+3*h/4)}else if(l==e){if(m<a)return new mxPoint(e,f+h/4);if(m>a)return new mxPoint(e,f+3*h/4)}else if(l==e+g){if(m<a)return new mxPoint(e+
g,f+h/4);if(m>a)return new mxPoint(e+g,f+3*h/4)}if(m==f)return new mxPoint(k,f);if(m==f+h)return new mxPoint(k,f+h);l<k?m>f+h/4&&m<f+3*h/4?(b=new mxPoint(e,f),t=new mxPoint(e,f+h)):m<f+h/4?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*h)),t=new mxPoint(e+g,f-Math.floor(.25*h))):m>f+3*h/4&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*h)),t=new mxPoint(e+g,f+Math.floor(1.25*h))):l>k&&(m>f+h/4&&m<f+3*h/4?(b=new mxPoint(e+g,f),t=new mxPoint(e+g,f+h)):m<f+h/4?(b=new mxPoint(e,f-Math.floor(.25*
h)),t=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*h))):m>f+3*h/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*h)),t=new mxPoint(e,f+Math.floor(1.25*h))))}else{if(m==a){if(l<=e)return new mxPoint(e,f+h/2);if(l>=e+g)return new mxPoint(e+g,f+h/2)}else if(m<f){if(l==e+g/4)return new mxPoint(e+g/4,f);if(l==e+3*g/4)return new mxPoint(e+3*g/4,f)}else if(m>f+h){if(l==e+g/4)return new mxPoint(e+g/4,f+h);if(l==e+3*g/4)return new mxPoint(e+3*g/4,f+h)}else if(m==f){if(l<k)return new mxPoint(e+g/4,
f);if(l>k)return new mxPoint(e+3*g/4,f)}else if(m==f+h){if(l<k)return new mxPoint(e+g/4,f+h);if(m>a)return new mxPoint(e+3*g/4,f+h)}if(l==e)return new mxPoint(e,a);if(l==e+g)return new mxPoint(e+g,a);m<a?l>e+g/4&&l<e+3*g/4?(b=new mxPoint(e,f),t=new mxPoint(e+g,f)):l<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f+h),t=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*h))):l>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*h)),t=new mxPoint(e+Math.floor(1.25*g),f+h)):m>a&&(l>e+g/4&&l<e+3*g/4?(b=
new mxPoint(e,f+h),t=new mxPoint(e+g,f+h)):l<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f),t=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*h))):l>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*h)),t=new mxPoint(e+Math.floor(1.25*g),f)))}d=k;n=a;l>=e&&l<=e+g?(d=l,n=m<a?f+h:f):m>=f&&m<=f+h&&(n=m,d=l<k?e+g:e);c=mxUtils.intersection(d,n,c.x,c.y,b.x,b.y,t.x,t.y)}else{if(r){l=Math.atan2(h/4,g/2);if(n==l)return new mxPoint(e+g,f+Math.floor(.25*h));if(n==q)return new mxPoint(e+Math.floor(.5*
g),f);if(n==p-l)return new mxPoint(e,f+Math.floor(.25*h));if(n==-l)return new mxPoint(e+g,f+Math.floor(.75*h));if(n==-q)return new mxPoint(e+Math.floor(.5*g),f+h);if(n==-p+l)return new mxPoint(e,f+Math.floor(.75*h));n<l&&n>-l?(b=new mxPoint(e+g,f),t=new mxPoint(e+g,f+h)):n>l&&n<q?(b=new mxPoint(e,f-Math.floor(.25*h)),t=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*h))):n>q&&n<p-l?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*h)),t=new mxPoint(e+g,f-Math.floor(.25*h))):n>p-l&&n<=p||n<-p+l&&n>=
-p?(b=new mxPoint(e,f),t=new mxPoint(e,f+h)):n<-l&&n>-q?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*h)),t=new mxPoint(e,f+Math.floor(1.25*h))):n<-q&&n>-p+l&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*h)),t=new mxPoint(e+g,f+Math.floor(1.25*h)))}else{l=Math.atan2(h/2,g/4);if(n==l)return new mxPoint(e+Math.floor(.75*g),f);if(n==p-l)return new mxPoint(e+Math.floor(.25*g),f);if(n==p||n==-p)return new mxPoint(e,f+Math.floor(.5*h));if(0==n)return new mxPoint(e+g,f+Math.floor(.5*h));if(n==
-l)return new mxPoint(e+Math.floor(.75*g),f+h);if(n==-p+l)return new mxPoint(e+Math.floor(.25*g),f+h);0<n&&n<l?(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*h)),t=new mxPoint(e+Math.floor(1.25*g),f+h)):n>l&&n<p-l?(b=new mxPoint(e,f),t=new mxPoint(e+g,f)):n>p-l&&n<p?(b=new mxPoint(e-Math.floor(.25*g),f+h),t=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*h))):0>n&&n>-l?(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*h)),t=new mxPoint(e+Math.floor(1.25*g),f)):n<-l&&n>-p+l?(b=new mxPoint(e,f+h),
t=new mxPoint(e+g,f+h)):n<-p+l&&n>-p&&(b=new mxPoint(e-Math.floor(.25*g),f),t=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*h)))}c=mxUtils.intersection(k,a,c.x,c.y,b.x,b.y,t.x,t.y)}return null==c?new mxPoint(k,a):c}};
function mxPrintPreview(a,b,c,d,e,f,g,h,k){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=h?h:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=k?k:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.addPageCss=!1;mxPrintPreview.prototype.pixelsPerInch=100;
mxPrintPreview.prototype.pageMargin=27;mxPrintPreview.prototype.overflowClipMargin="1px";mxPrintPreview.prototype.gridSize=null;mxPrintPreview.prototype.gridSteps=null;mxPrintPreview.prototype.gridColor=null;mxPrintPreview.prototype.gridStrokeWidth=.5;mxPrintPreview.prototype.defaultCss="@media screen {\n body {\n background: gray;\n zoom: 0.7;\n }\n body > div {\n margin-bottom: 20px;\n box-sizing: border-box;\n }\n a, a * {\n pointer-events: none;\n }\n}\n@media print {\n body {\n margin: 0px;\n }\n body > div {\n break-after: page;\n break-inside: avoid;\n }\n body > div:last-of-type {\n break-after: auto;\n }\n * {\n -webkit-print-color-adjust: exact;\n }\n}";
mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;
mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.lastPageDiv=null;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd};
mxPrintPreview.prototype.getDoctype=function(){var a="";8==document.documentMode?a='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(a='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e');return a};mxPrintPreview.prototype.appendGraph=function(a,b,c,d,e,f,g,h,k){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.x0=c;this.y0=d;this.open(null,null,e,f,g,h,k)};mxPrintPreview.prototype.isPageAreaSizeEnabled=function(){return mxClient.IS_SF};
mxPrintPreview.prototype.getPageAreaCss=function(){return this.isPageAreaSizeEnabled()?"@page {\n margin: 0;\n}\n@media print {\n html, body {\n height: 100%;\n }\n}\n":""};
mxPrintPreview.prototype.getPageClassCss=function(a,b){var c=this.pageMargin,d=this.pixelsPerInch,e=this.isPageAreaSizeEnabled(),f=(b.width/d).toFixed(2)+"in "+(b.height/d).toFixed(2)+"in";b=(e?"":"@page "+a+" {\n margin: 0;\n size: "+mxUtils.htmlEntities(f)+";\n}\n")+"."+a+" {\n"+(e?"":" page: "+a+";\n")+(mxClient.IS_SF?" padding: "+mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n":"")+" width: "+mxUtils.htmlEntities((b.width/d).toFixed(2))+"in;\n height: "+mxUtils.htmlEntities((b.height/d).toFixed(2))+
"in;\n}\n";mxClient.IS_SF||(b+="."+a+" > svg {\n margin: "+mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n}\n");e&&(b+="@media print {\n ."+a+" {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n }\n}\n");return b};
mxPrintPreview.prototype.open=function(a,b,c,d,e,f,g){c=null;try{var h=this.graph.cellRenderer.initializeOverlay,k=null!=f;f=mxRectangle.fromRectangle(null!=f?f:this.pageFormat);var l=f.width+1,m=f.height+1,n=null;k&&(null==this.pendingCss&&(this.pageFormatClass={},this.pendingCss=this.getPageAreaCss()),n=mxUtils.htmlEntities("gePageFormat-"+String(f.width).replace(/\./g,"_")+"-"+String(f.height).replace(/\./g,"_")),null==this.pageFormatClass[n]&&(this.pageFormatClass[n]=!0,this.pendingCss+=this.getPageClassCss(n,
f)));this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(G,D){D.init(G.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(G,D,J,I){D.dialect=G.view.graph.dialect;D.init(G.view.getDrawPane())});this.wnd=null!=b?b:this.wnd;b=!1;if(null==this.wnd&&(b=!0,this.wnd=window.open(),null==this.wnd))return null;var p=this.wnd.document;if(b){var q=this.getDoctype();null!=q&&0<q.length&&p.writeln(q);"CSS1Compat"===document.compatMode&&p.writeln("<!DOCTYPE html>");
p.writeln("<html>");p.writeln("<head>");this.writeHead(p,a);p.writeln("</head>");p.writeln("<body>")}var r=mxRectangle.fromRectangle(null!=g?this.graph.getBoundingBox(g):this.graph.getGraphBounds()),t=this.graph.getView().getScale(),v=t/this.scale,u=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=u.x*this.scale,this.y0-=u.y*this.scale,r.width+=r.x,r.height+=r.y,r.x=0,this.border=r.y=0);var x=l-2*this.border,y=m-2*this.border;m+=this.marginTop+this.marginBottom;r.width/=v;r.height/=
v;var w=Math.max(1,Math.ceil((r.width+this.x0)/x)),A=Math.max(1,Math.ceil((r.height+this.y0)/y));this.pageCount=w*A;var C=mxUtils.bind(this,function(G){null!=this.borderColor&&(G.style.borderColor=this.borderColor,G.style.borderStyle="solid",G.style.borderWidth="1px");G.style.background=this.backgroundColor;null!=n?G.classList.add(n):(G.style.width=f.width+"px",G.style.height=f.height+"px");null!=this.lastPageDiv&&(this.lastPageDiv.style.breakAfter="");G.style.breakAfter="auto";this.lastPageDiv=G;
p.body.appendChild(G)}),B=this.getCoverPages(l,m);if(null!=B)for(var z=0;z<B.length;z++)C(B[z],!0);var H=this.getAppendices(l,m);for(z=0;z<A;z++){var E=z*y/this.scale-this.y0/this.scale+(r.y-u.y*t)/t-z;for(a=0;a<w;a++){if(null==this.wnd)return null;var F=a*x/this.scale-this.x0/this.scale+(r.x-u.x*t)/t-a;g=z*w+a+1;c=p.createElement("div");c.style.display="flex";c.style.alignItems="center";c.style.justifyContent="center";C(c,!0);var O=new mxRectangle(F,E,x,y);this.addGraphFragment(-F,-E,this.scale,
g,c,O);null!=e&&0==z&&0==a&&c.setAttribute("id",e)}}if(null!=H)for(z=0;z<H.length;z++)C(H[z],z<H.length-1);b&&!d&&this.closeDocument();this.wnd.focus()}catch(G){null!=c&&null!=c.parentNode&&c.parentNode.removeChild(c),null!=window.console&&console.error(G)}finally{this.graph.cellRenderer.initializeOverlay=h}return this.wnd};
mxPrintPreview.prototype.addPendingCss=function(a){if(null!=this.pendingCss){var b=a.createElement("style");b.setAttribute("type","text/css");b.appendChild(a.createTextNode(this.pendingCss));a.getElementsByTagName("head")[0].appendChild(b);this.pendingCss=null}};mxPrintPreview.prototype.closeDocument=function(){try{if(null!=this.wnd&&null!=this.wnd.document){var a=this.wnd.document;this.writePostfix(a);a.writeln("</body>");a.writeln("</html>");a.close();this.addPendingCss(a);mxEvent.release(a.body)}}catch(b){}};
mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln("<title>"+mxUtils.htmlEntities(this.title)+"</title>");var c=mxClient.basePath;"/src"==c.substring(c.length-4)&&(c=c.substring(0,c.length-4));mxClient.link("stylesheet",c+"/css/common.css",a);a.writeln('<style type="text/css">');a.writeln(this.defaultCss);c=this.pageFormat;this.addPageCss&&null!=c&&null==this.pendingCss&&(c=(c.width/this.pixelsPerInch).toFixed(2)+"in "+(c.height/this.pixelsPerInch).toFixed(2)+"in",a.writeln("@page {"),
a.writeln(" margin: "+mxUtils.htmlEntities((this.pageMargin/this.pixelsPerInch).toFixed(2))+"in;"),a.writeln(" size: "+mxUtils.htmlEntities(c)+";"),a.writeln("}"));null!=b&&a.writeln(b.replace(/<\/style/gi,"<\\/style"));a.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(a){};mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};
mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF};mxPrintPreview.prototype.isCellVisible=function(a){return!0};mxPrintPreview.prototype.drawBackgroundImage=function(a){a.redraw()};
mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var h=g.getCanvas(),k=g.getBackgroundPane(),l=g.getDrawPane(),m=g.getOverlayPane(),n=c;g.createSvg();if(this.useCssTransforms()){var p=g.getDrawPane().parentNode;p.setAttribute("transformOrigin","0 0");p.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}else g.modelCoordinates&&g.getDrawPane().setAttribute("transform","translate("+a*
c+","+b*c+") scale("+c+")");p=g.isEventsEnabled();g.setEventsEnabled(!1);var q=this.graph.isEnabled();this.graph.setEnabled(!1);var r=g.getTranslate();g.translate=new mxPoint(a,b);var t=this.graph.selectionCellsHandler.updateHandler;this.graph.selectionCellsHandler.updateHandler=function(){};var v=this.graph.cellRenderer.redraw,u=g.states,x=g.scale,y=null;if(this.printBackgroundImage){var w=this.getBackgroundImage();null!=w&&(y=new mxRectangle(Math.round(a*x+w.x),Math.round(b*x+w.y),w.width-1,w.height-
1),y=new mxImageShape(y,w.src),y.dialect=this.graph.dialect)}if(this.clipping){var A=new mxRectangle((f.x+r.x+1.5)*x,(f.y+r.y+1.5)*x,(f.width-1.5)*x/n,(f.height-1.5)*x/n),C=this;this.graph.cellRenderer.redraw=function(z,H,E){if(null!=z){var F=u.get(z.cell);if(null!=F&&(F=g.getBoundingBox(F,!1),null!=F&&0<F.width&&0<F.height&&!mxUtils.intersects(A,F))||!C.isCellVisible(z.cell))return}v.apply(this,arguments)};null!=y&&(a=new mxRectangle(y.bounds.x*x+(r.x-a)*x,y.bounds.y*x+(r.y-b)*x,y.bounds.width*x,
y.bounds.height*x),mxUtils.intersects(A,a)||(y=null))}null!=y&&(y.init(g.backgroundPane),this.drawBackgroundImage(y));a=null;try{var B=[this.getRoot()];a=new mxTemporaryCellStates(g,c,B,null,mxUtils.bind(this,function(z){return this.getLinkForCellState(z)}))}finally{for(c=e.firstChild;null!=c;)e=c.nextSibling,"svg"==c.nodeName.toLowerCase()?(c.style.top="",c.style.left="",c.style.width="",c.style.height="",c.style.display="",c.style.maxWidth="100%",c.style.maxHeight="100%",c.style.overflow=mxClient.IS_SF?
"hidden":"clip",c.style.overflowClipMargin=this.overflowClipMargin,c.setAttribute("viewBox","0 0 "+(f.width+1)+" "+(f.height+1)),this.addGrid(c,f),mxClient.IS_SF&&(f.width>f.height?c.style.height="100%":c.style.width="100%")):this.isTextLabel(c)||c.parentNode.removeChild(c),c=e;g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(q);this.graph.container=d;this.graph.cellRenderer.redraw=v;this.graph.selectionCellsHandler.updateHandler=t;g.canvas=h;g.backgroundPane=k;g.drawPane=
l;g.overlayPane=m;g.translate=r;a.destroy();g.setEventsEnabled(p)}};mxPrintPreview.prototype.addGrid=function(a,b){0<this.gridSize&&0<this.gridSteps&&null!=this.gridColor&&(b=this.createSvgGrid(a,b),a=mxUtils.getSvgDefs(a),null!=a.nextSibling?a.parentNode.insertBefore(b,a.nextSibling):a.parentNode.appendChild(b))};
mxPrintPreview.prototype.createSvgGrid=function(a,b){var c=this.gridSize;a=a.ownerDocument;var d=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"g"):a.createElement("g"),e=mxUtils.mod(Math.ceil(b.x/c),this.gridSteps),f=mxUtils.mod(c-mxUtils.mod(b.x,c),c),g=mxUtils.mod(Math.ceil(b.y/c),this.gridSteps),h=mxUtils.mod(c-mxUtils.mod(b.y,c),c);f*=this.scale;h*=this.scale;c*=this.scale;for(var k=Math.ceil(b.height/c),l=0;l<k;l++){var m=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,
"line"):a.createElement("line");m.setAttribute("x1",0);m.setAttribute("y1",l*c+h);m.setAttribute("x2",b.width);m.setAttribute("y2",l*c+h);m.setAttribute("stroke",this.gridColor);m.setAttribute("opacity",0==mxUtils.mod(l+g,this.gridSteps)?"1":"0.2");m.setAttribute("stroke-width","0.5");d.appendChild(m)}g=Math.ceil(b.width/c);for(l=0;l<g;l++)m=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"line"):a.createElement("line"),m.setAttribute("x1",l*c+f),m.setAttribute("y1",0),m.setAttribute("x2",
l*c+f),m.setAttribute("y2",b.height),m.setAttribute("stroke",this.gridColor),m.setAttribute("opacity",0==mxUtils.mod(l+e,this.gridSteps)?"1":"0.2"),m.setAttribute("stroke-width","0.5"),d.appendChild(m);return d};mxPrintPreview.prototype.isTextLabel=function(a){return"default"==tmp.style.cursor||"div"==a.nodeName.toLowerCase()};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};mxPrintPreview.prototype.getBackgroundImage=function(){return this.graph.backgroundImage};
mxPrintPreview.prototype.getCoverPages=function(){return null};mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}
mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a};
mxStylesheet.prototype.createDefaultEdgeStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;a[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#446299";return a};mxStylesheet.prototype.putDefaultVertexStyle=function(a){this.putCellStyle("defaultVertex",a)};
mxStylesheet.prototype.putDefaultEdgeStyle=function(a){this.putCellStyle("defaultEdge",a)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge};mxStylesheet.prototype.putCellStyle=function(a,b){"__proto__"!=a&&"constructor"!=a&&"prototype"!=a&&(this.styles[a]=b)};
mxStylesheet.prototype.getCellStyle=function(a,b,c){c=null!=c?c:!0;if(null!=a&&0<a.length){var d=a.split(";");b=null!=b&&";"!=a.charAt(0)?mxUtils.clone(b):{};for(a=0;a<d.length;a++){var e=d[a],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f);e=e.substring(f+1);e==mxConstants.NONE&&c?delete b[g]:mxUtils.isNumeric(e)?b[g]=parseFloat(e):b[g]=e}else if(e=Object.prototype.hasOwnProperty.call(this.styles,e)?this.styles[e]:null,null!=e)for(g in e)b[g]=e[g]}}return b};
function mxCellState(a,b,c){this.view=a;this.cell=b;this.style=null!=c?c:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=!1;mxCellState.prototype.invalid=!0;mxCellState.prototype.graphBoundingBox=null;mxCellState.prototype.invalidBoundingBox=!1;
mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null;mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null;mxCellState.prototype.cellPoints=null;
mxCellState.prototype.cellOffset=null;mxCellState.prototype.cellSegments=null;mxCellState.prototype.cellLength=null;mxCellState.prototype.cellTerminalDistance=null;
mxCellState.prototype.getPerimeterBounds=function(a,b){a=a||0;b=null!=b?b:new mxRectangle(this.x,this.y,this.width,this.height);if(null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var c=this.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?this.shape.stencil.h0:this.shape.stencil.w0;d=d?this.shape.stencil.w0:this.shape.stencil.h0;var e=Math.min(b.width/c,b.height/d);b.x+=(b.width-c*e)/2;b.y+=(b.height-d*e)/2;b.width=
c*e;b.height=d*e}0!=a&&b.grow(a);return b};mxCellState.prototype.setAbsoluteTerminalPoint=function(a,b){b?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[0]=a):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(a)):1==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[this.absolutePoints.length-1]=a};
mxCellState.prototype.setCursor=function(a){null!=this.shape&&this.shape.setCursor(a);null!=this.text&&this.text.setCursor(a)};mxCellState.prototype.isFloatingTerminalPoint=function(a){var b=this.getVisibleTerminalState(a);if(null==b)return!1;a=this.view.graph.getConnectionConstraint(this,b,a);return null==a||null==a.point};mxCellState.prototype.getVisibleTerminal=function(a){a=this.getVisibleTerminalState(a);return null!=a?a.cell:null};
mxCellState.prototype.getVisibleTerminalState=function(a){return a?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(a,b){b?this.visibleSourceState=a:this.visibleTargetState=a};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds};
mxCellState.prototype.updateCachedBounds=function(){var a=this.view.translate,b=this.view.scale;this.paintBounds=this.cellBounds=null;this.cell!=this.view.currentRoot&&null!=this.view.graph.getCellGeometry(this.cell)&&(this.cellBounds=new mxRectangle(mxUtils.unscale(this.x,b,a.x),mxUtils.unscale(this.y,b,a.y),mxUtils.unscale(this.width,b),mxUtils.unscale(this.height,b)),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90());
this.cellPoints=null;if(null!=this.absolutePoints){this.cellPoints=[];for(var c=0;c<this.absolutePoints.length;c++){var d=this.absolutePoints[c];this.cellPoints.push(null!=d?new mxPoint(mxUtils.unscale(d.x,b,a.x),mxUtils.unscale(d.y,b,a.y)):null)}}this.cellOffset=null;null!=this.absoluteOffset&&(d=(c=this.isAbsoluteOffset())?a.y:0,this.cellOffset=new mxPoint(mxUtils.unscale(this.absoluteOffset.x,b,c?a.x:0),mxUtils.unscale(this.absoluteOffset.y,b,d)));this.cellSegments=null;if(null!=this.segments)for(this.cellSegments=
[],c=0;c<this.segments.length;c++)this.cellSegments.push(mxUtils.unscale(this.segments[c],b));this.cellLength=mxUtils.unscale(this.length,b);this.cellTerminalDistance=mxUtils.unscale(this.terminalDistance,b)};
mxCellState.prototype.updateScreenBounds=function(){var a=this.view.translate,b=this.view.scale;null!=this.cellBounds&&(this.x=(this.cellBounds.x+a.x)*b,this.y=(this.cellBounds.y+a.y)*b,this.width=this.cellBounds.width*b,this.height=this.cellBounds.height*b);if(null!=this.cellPoints){this.absolutePoints=[];for(var c=0;c<this.cellPoints.length;c++){var d=this.cellPoints[c];this.absolutePoints.push(null!=d?new mxPoint((d.x+a.x)*b,(d.y+a.y)*b):null)}}null!=this.cellOffset&&(c=this.isAbsoluteOffset(),
this.absoluteOffset=new mxPoint((this.cellOffset.x+(c?a.x:0))*b,(this.cellOffset.y+(c?a.y:0))*b));if(null!=this.cellSegments)for(this.segments=[],c=0;c<this.cellSegments.length;c++)this.segments.push(this.cellSegments[c]*b);null!=this.cellLength&&(this.length=this.cellLength*b);null!=this.cellTerminalDistance&&(this.terminalDistance=this.cellTerminalDistance*b)};mxCellState.prototype.isAbsoluteOffset=function(){return this.view.graph.model.isEdge(this.cell)};
mxCellState.prototype.setState=function(a){this.view=a.view;this.cell=a.cell;this.style=a.style;this.absolutePoints=a.absolutePoints;this.origin=a.origin;this.absoluteOffset=a.absoluteOffset;this.boundingBox=a.boundingBox;this.terminalDistance=a.terminalDistance;this.segments=a.segments;this.length=a.length;this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;this.unscaledWidth=a.unscaledWidth;this.unscaledHeight=a.unscaledHeight};
mxCellState.prototype.clone=function(){var a=new mxCellState(this.view,this.cell,null!=this.style?mxUtils.clone(this.style):null);if(null!=this.absolutePoints){a.absolutePoints=[];for(var b=0;b<this.absolutePoints.length;b++)a.absolutePoints[b]=null!=this.absolutePoints[b]?this.absolutePoints[b].clone():null}null!=this.origin&&(a.origin=this.origin.clone());null!=this.absoluteOffset&&(a.absoluteOffset=this.absoluteOffset.clone());null!=this.boundingBox&&(a.boundingBox=this.boundingBox.clone());a.terminalDistance=
this.terminalDistance;a.segments=this.segments;a.length=this.length;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;a.unscaledWidth=this.unscaledWidth;a.unscaledHeight=this.unscaledHeight;return a};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};function mxGraphSelectionModel(a){this.graph=a;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel;
mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=!1;mxGraphSelectionModel.prototype.lookup=null;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(a){this.singleSelection=a};
mxGraphSelectionModel.prototype.isSelected=function(a){return null!=a?0<this.getLookup().counts.get(a):!1};mxGraphSelectionModel.prototype.getLookup=function(){if(null==this.lookup||this.lookup.cells!=this.cells||this.lookup.length!=this.cells.length){this.lookup={cells:this.cells,length:0,counts:new mxDictionary};for(var a=0;a<this.cells.length;a++)this.updateLookup(this.cells[a],1)}return this.lookup};
mxGraphSelectionModel.prototype.updateLookup=function(a,b){var c=(this.lookup.counts.get(a)||0)+b;0<c?this.lookup.counts.put(a,c):this.lookup.counts.remove(a);this.lookup.length+=b};mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(a){null!=a&&this.setCells([a])};
mxGraphSelectionModel.prototype.setCells=function(a){if(null!=a){this.singleSelection&&(a=[this.getFirstSelectableCell(a)]);for(var b=[],c=0;c<a.length;c++)this.graph.isCellSelectable(a[c])&&b.push(a[c]);this.changeSelection(b,this.cells)}};mxGraphSelectionModel.prototype.getFirstSelectableCell=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(this.graph.isCellSelectable(a[b]))return a[b];return null};mxGraphSelectionModel.prototype.addCell=function(a){null!=a&&this.addCells([a])};
mxGraphSelectionModel.prototype.addCells=function(a){if(null!=a){var b=null;this.singleSelection&&(b=this.cells,a=[this.getFirstSelectableCell(a)]);for(var c=[],d=0;d<a.length;d++)!this.isSelected(a[d])&&this.graph.isCellSelectable(a[d])&&c.push(a[d]);this.changeSelection(c,b)}};mxGraphSelectionModel.prototype.removeCell=function(a){null!=a&&this.removeCells([a])};
mxGraphSelectionModel.prototype.removeCells=function(a){if(null!=a){for(var b=[],c=0;c<a.length;c++)this.isSelected(a[c])&&b.push(a[c]);this.changeSelection(null,b)}};mxGraphSelectionModel.prototype.changeSelection=function(a,b){if(null!=a&&0<a.length&&null!=a[0]||null!=b&&0<b.length&&null!=b[0])a=new mxSelectionChange(this,a,b),a.execute(),b=new mxUndoableEdit(this,!1),b.add(a),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))};
mxGraphSelectionModel.prototype.cellAdded=function(a){null==a||this.isSelected(a)||(this.getLookup(),this.updateLookup(a,1),this.cells.push(a))};mxGraphSelectionModel.prototype.cellRemoved=function(a){if(null!=a){var b=mxUtils.indexOf(this.cells,a);0<=b&&(this.getLookup(),this.updateLookup(a,-1),this.cells.splice(b,1))}};mxGraphSelectionModel.cellRemoved=mxGraphSelectionModel.prototype.cellRemoved;
mxGraphSelectionModel.prototype.cellsRemoved=function(a){for(var b=new mxDictionary,c=0,d=0;d<a.length;d++)null!=a[d]&&b.put(a[d],(b.get(a[d])||0)+1);this.getLookup();for(d=0;d<this.cells.length;d++){a=this.cells[d];var e=b.get(a);0<e?(b.put(a,e-1),this.updateLookup(a,-1)):this.cells[c++]=a}this.cells.length=c};function mxSelectionChange(a,b,c){this.selectionModel=a;this.added=null!=b?b.slice():null;this.removed=null!=c?c.slice():null}
mxSelectionChange.prototype.execute=function(){var a=mxLog.enter("mxSelectionChange.execute");if(null!=this.removed)if(1<this.removed.length&&this.selectionModel.cellRemoved==mxGraphSelectionModel.cellRemoved)this.selectionModel.cellsRemoved(this.removed);else for(var b=0;b<this.removed.length;b++)this.selectionModel.cellRemoved(this.removed[b]);if(null!=this.added)for(b=0;b<this.added.length;b++)this.selectionModel.cellAdded(this.added[b]);b=this.added;this.added=this.removed;this.removed=b;mxLog.leave("mxSelectionChange.execute",
a);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))};
function mxCellEditor(a){this.graph=a;this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()});null!=this.graph.container&&mxEvent.addListener(this.graph.container,"scroll",this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,function(b){null!=this.editingCell&&(b=this.graph.getView().getState(this.editingCell),null==b?this.stopEditing(!0):
this.updateTextAreaStyle(b))});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=!1;mxCellEditor.prototype.autoSize=!0;mxCellEditor.prototype.selectText=!0;mxCellEditor.prototype.rotateText=!0;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=!0;
mxCellEditor.prototype.textNode=null;mxCellEditor.prototype.zIndex=1;mxCellEditor.prototype.minResize=new mxRectangle(0,20);mxCellEditor.prototype.blurEnabled=!1;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=!0;mxClient.IS_GC&&(this.textarea.style.minHeight="1em");this.installListeners(this.textarea)};
mxCellEditor.prototype.applyValue=function(a,b){this.graph.labelChanged(a.cell,b,this.trigger)};mxCellEditor.prototype.setAlign=function(a){var b=this.graph.getView().getState(this.editingCell);null!=this.textarea&&null!=b&&(b=mxUtils.getValue(b.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),mxUtils.isVerticalTextDirection(b)||(this.textarea.style.textAlign=a));this.align=a;this.resize()};
mxCellEditor.prototype.getInitialValue=function(a,b){a=mxUtils.htmlEntities(this.graph.getEditingValue(a.cell,b),!1);a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return a.replace(/\n/g,"<br>")};mxCellEditor.prototype.getCurrentValue=function(a){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(a){return this.escapeCancelsEditing||mxEvent.isShiftDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)};
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(e){this.graph.stopEditing(!1);mxEvent.consume(e)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(e){this.blurEnabled&&this.focusLost(e)}));var b=this.graph.container.scrollTop,c=this.graph.container.scrollLeft;mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){b=this.graph.container.scrollTop;c=this.graph.container.scrollLeft;mxEvent.isConsumed(e)||(this.isStopEditingEvent(e)?
(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(e)),mxEvent.consume(e)))}));var d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,a.innerText="")});mxEvent.addListener(a,"keypress",d);mxEvent.addListener(a,"paste",d);mxEvent.addListener(a,"compositionstart",mxUtils.bind(this,function(e){null!=this.editingCell&&
this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,a.innerText="")}));d=mxUtils.bind(this,function(e){null!=this.editingCell&&(this.graph.container.scrollTop=b,this.graph.container.scrollLeft=c,a.scrollIntoView({block:"nearest",inline:"nearest"}),0!=this.textarea.innerHTML.length&&"<br>"!=this.textarea.innerHTML||this.textarea.innerHTML==this.getEmptyLabelText()?this.clearOnChange=!1:(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length))});
mxEvent.addListener(a,"input",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a,"paste",d);d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(e)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;null!=document.body&&this.resize()}),0))});mxEvent.addListener(a,"input",d);mxEvent.addListener(window,"resize",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a,
"paste",d)};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea};
mxCellEditor.prototype.resize=function(){var a=this.graph.getView().getState(this.editingCell);if(null==a)this.stopEditing(!0);else if(null!=this.textarea){var b=mxUtils.getAlignmentAsPoint(null!=this.align?this.align:this.textShape.align,this.textShape.valign);this.bounds=this.graph.cellRenderer.getLabelBounds(a,this.textShape,b,!this.rotateText);var c=this.rotateText?this.textShape.getTextRotation():0,d=this.graph.getView().scale;this.bounds.x+=-.5==b.x?0:0==b.x?-d:d;this.bounds.y+=-.5==b.y?0:0==
b.y?-d:d;this.textarea.style.left=Math.max(0,Math.round(this.bounds.x))+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y))+"px";if(this.autoSize&&"fill"!=a.style[mxConstants.STYLE_OVERFLOW]){var e="1"==mxUtils.getValue(a.style,"convertToSvg","0")&&"wrap"==a.style.svgWhiteSpace;if(this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&(e||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("text").length))if(e=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,
mxConstants.DEFAULT_TEXT_DIRECTION),e=mxUtils.isVerticalTextDirection(e),this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]?this.bounds.width-=2*d:a.view.graph.isHtmlLabel(a.cell)&&(this.bounds.width+=mxSvgCanvas2D.prototype.foreignObjectPadding*d),this.textarea.innerHTML!=this.getEmptyLabelText())if("block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]){if(-.5==
b.y||"width"==a.style[mxConstants.STYLE_OVERFLOW])this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px";this.textarea.style.width=Math.round(this.bounds.width/d)+"px"}else e?this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px":this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width=""}else this.textarea.style.width=Math.round(this.bounds.width/
d)+"px",this.textarea.style.height=Math.round(this.bounds.height/d)+"px",this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/d)+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=
""));mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=c?"rotate("+c+"deg) ":"")+"scale("+d+","+d+") translate("+100*b.x+"%,"+100*b.y+"%)")}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(a){return null};mxCellEditor.prototype.getBorderColor=function(a){return null};
mxCellEditor.prototype.updateTextAreaStyle=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,f=[],g=this.graph.getCellStyle(this.graph.model.getParent(a.cell),
!0);"inherit"==b&&(b=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE):mxConstants.DEFAULT_FONTSIZE);"inherit"==c&&(c=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY):mxConstants.DEFAULT_FONTFAMILY);(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline");(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&
f.push("line-through");0<f.length&&(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&f.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.textDecoration=f.join(" ");this.textarea.style.fontWeight=d?"bold":"normal";this.textarea.style.fontStyle=e?"italic":"";this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.zIndex=
this.zIndex;this.textarea.style.fontFamily=mxUtils.parseCssFontFamily(c);this.textarea.style.writingMode="";b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTCOLOR);if(null==b||b==mxConstants.NONE)b=this.graph.shapeForegroundColor;this.textarea.style.color=mxUtils.getLightDarkColor(b).cssText;b=this.getBackgroundColor(a);this.textarea.style.backgroundColor=null!=b?mxUtils.getLightDarkColor(b).cssText:"transparent";b=this.getBorderColor(a);this.textarea.style.border=null!=b?"1px solid "+mxUtils.getLightDarkColor(b).cssText:
"1px solid transparent";b=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT);this.textarea.removeAttribute("dir");b!=mxConstants.TEXT_DIRECTION_AUTO||null==a||null==a.text||a.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(a.text.value)||(b=a.text.getAutoDirection());if(b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL)this.textarea.setAttribute("dir",
b);else if(b==mxConstants.TEXT_DIRECTION_VERTICAL_LR||b==mxConstants.TEXT_DIRECTION_VERTICAL_RL)a=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),c=a==mxConstants.ALIGN_TOP?"left":a==mxConstants.ALIGN_BOTTOM?"right":"center",this.textarea.style.writingMode=b;this.textarea.style.textAlign=c};mxCellEditor.prototype.setEditingValue=function(a,b){this.textarea.innerHTML=b};
mxCellEditor.prototype.startEditing=function(a,b,c){this.stopEditing(!0);this.align=null;null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var d=this.graph.getView().getState(a);null!=d&&(this.updateTextAreaStyle(d),this.setEditingValue(d,this.getInitialValue(d,b)||""),this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=
!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.textShape=d.text,this.editingCell=a,this.trigger=b,null==this.textShape&&(this.textShape=this.graph.cellRenderer.createTextShape(d,"",this.graph.dialect)),a=mxUtils.bind(this,function(){if(null!=this.editingCell)if(null!=this.textShape&&null!=this.textShape.node&&this.isHideLabel(d)&&(this.textNode=this.textShape.node,this.textNode.style.visibility="hidden"),this.resize(),this.graph.container.appendChild(this.textarea),
mxClient.IS_IOS&&(this.graph.container.scrollTop=Math.max(this.graph.container.scrollTop,d.y+d.height-this.graph.container.clientHeight/3)),this.textarea.scrollIntoView({block:"nearest",inline:"nearest"}),this.textarea.focus(),null!=c){this.textarea.innerHTML=mxUtils.htmlEntities(c,!1).replace(/\n/g,"<br>");var e=document.createRange();e.selectNodeContents(this.textarea);e.collapse(!1);var f=window.getSelection();f.removeAllRanges();f.addRange(e)}else this.isSelectText()&&0<this.textarea.innerHTML.length&&
(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}),mxClient.IS_IOS||this.editByTyping?(this.editByTyping=!1,a()):window.setTimeout(a,0))};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var a=null;window.getSelection?a=window.getSelection():document.selection&&(a=document.selection);null!=a&&(a.empty?a.empty():a.removeAllRanges&&a.removeAllRanges())};
mxCellEditor.prototype.stopEditing=function(a){if(null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);a=a?null:this.graph.view.getState(this.editingCell);var b=this.initialValue;this.bounds=this.trigger=this.textShape=this.editingCell=this.initialValue=null;this.textarea.blur();this.clearSelection();null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea);this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&
(this.textarea.innerText="",this.clearOnChange=!1);if(null!=a&&(this.textarea.innerHTML!=b||null!=this.align)){this.prepareTextarea();b=this.getCurrentValue(a);this.graph.getModel().beginUpdate();try{null!=b&&this.applyValue(a,b),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[a.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.align=this.textarea=null}};
mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)};mxCellEditor.prototype.isHideLabel=function(a){return!0};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,"left"==this.textarea.style.textAlign?120:40)};mxCellEditor.prototype.getEmptyLabelText=function(a){return this.emptyLabelText};
mxCellEditor.prototype.getEditingCell=function(){return this.editingCell};
mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);this.zoomHandler&&(null!=this.graph.container&&mxEvent.removeListener(this.graph.container,"scroll",this.zoomHandler),this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)};
function mxCellRenderer(){}mxCellRenderer.defaultShapes=Object.create(null);mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=!0;mxCellRenderer.prototype.legacySpacing=!0;mxCellRenderer.prototype.antiAlias=!0;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=!1;
mxCellRenderer.prototype.minControlHitSize=12;mxCellRenderer.registerShape=function(a,b){mxCellRenderer.defaultShapes[a]=b};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);
mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor);mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);
mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(a){a.shape.dialect=a.view.graph.dialect;this.configureShape(a);a.shape.init(a.view.getDrawPane())};
mxCellRenderer.prototype.createShape=function(a){var b=null;null!=a.style&&(b=a.style[mxConstants.STYLE_SHAPE],b=null==mxCellRenderer.defaultShapes[b]?mxStencilRegistry.getStencil(b):null,b=null!=b?new mxShape(b):new (this.getShapeConstructor(a)));return b};mxCellRenderer.prototype.createIndicatorShape=function(a){a.shape.indicatorShape=this.getShape(a.view.graph.getIndicatorShape(a))};mxCellRenderer.prototype.getShape=function(a){return null!=a?mxCellRenderer.defaultShapes[a]:null};
mxCellRenderer.prototype.getShapeConstructor=function(a){var b=this.getShape(a.style[mxConstants.STYLE_SHAPE]);null==b&&(b=a.view.graph.getModel().isEdge(a.cell)?this.defaultEdgeShape:this.defaultVertexShape);return b};
mxCellRenderer.prototype.configureShape=function(a){a.shape.apply(a);a.shape.image=a.view.graph.getImage(a);a.shape.indicatorColor=a.view.graph.getIndicatorColor(a);a.shape.indicatorStrokeColor=a.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];a.shape.indicatorGradientColor=a.view.graph.getIndicatorGradientColor(a);a.shape.indicatorDirection=a.style[mxConstants.STYLE_INDICATOR_DIRECTION];a.shape.indicatorImage=a.view.graph.getIndicatorImage(a);this.postConfigureShape(a)};
mxCellRenderer.prototype.postConfigureShape=function(a){null!=a.shape&&(this.resolveColor(a,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(a,"fill",mxConstants.STYLE_FILLCOLOR))};
mxCellRenderer.prototype.checkPlaceholderStyles=function(a){if(null!=a.style){for(var b="inherit"==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTFAMILY],c=!1,d=this.placeholderValues,e=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],f=0;f<e.length;f++)0<=mxUtils.indexOf(d,a.style[e[f]])&&(e[f]==mxConstants.STYLE_FONTCOLOR?b=!0:c=!0);return c&&this.isPlaceholderShapeChanged(a)||b&&this.isPlaceholderLabelChanged(a)}return!1};
mxCellRenderer.prototype.placeholderValues=["inherit","swimlane","indicated","parentFillColor","parentStrokeColor"];mxCellRenderer.prototype.placeholderShapeFields="fill gradient stroke laneFill indicatorColor indicatorGradientColor indicatorStrokeColor".split(" ");
mxCellRenderer.prototype.isPlaceholderShapeChanged=function(a){var b=a.shape;if(null==b)return!0;try{for(var c=Object.getPrototypeOf(b),d=Object.create(b),e=0;e<this.placeholderShapeFields.length;e++){var f=this.placeholderShapeFields[e];d[f]=c[f]}var g=Object.create(a);g.shape=d;this.configureShape(g);return this.isShapeConfigurationChanged(b,d)}catch(h){return!0}};
mxCellRenderer.prototype.isShapeConfigurationChanged=function(a,b){for(var c=0;c<this.placeholderShapeFields.length;c++){var d=this.placeholderShapeFields[c];if(a[d]!=b[d])return!0}return!1};
mxCellRenderer.prototype.isPlaceholderLabelChanged=function(a){var b=a.text;if(null==b)return!1;var c={color:a.style[mxConstants.STYLE_FONTCOLOR],size:a.style[mxConstants.STYLE_FONTSIZE],family:a.style[mxConstants.STYLE_FONTFAMILY]},d=Object.create(a);d.text=c;this.resolveColor(d,"color",mxConstants.STYLE_FONTCOLOR);this.inheritFontStyle(d,"size",mxConstants.STYLE_FONTSIZE);this.inheritFontStyle(d,"family",mxConstants.STYLE_FONTFAMILY);return 0<=mxUtils.indexOf(this.placeholderValues,a.style[mxConstants.STYLE_FONTCOLOR])&&
c.color!=b.color||"inherit"==a.style[mxConstants.STYLE_FONTSIZE]&&c.size!=b.size||"inherit"==a.style[mxConstants.STYLE_FONTFAMILY]&&c.family!=b.family};mxCellRenderer.prototype.inheritFontStyle=function(a,b,c){if(null!=a.text&&"inherit"==a.text[b]){var d=a.view.graph;d=d.getView().getState(d.model.getParent(a.cell));null!=d&&(a.text[b]=d.style[c])}};
mxCellRenderer.prototype.resolveColor=function(a,b,c){var d=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(null!=d){var e=a.view.graph,f=d[b],g=null,h=b;"inherit"==f?g=e.model.getParent(a.cell):"parentFillColor"==f||"parentStrokeColor"==f?(g=e.model.getParent(a.cell),c="parentFillColor"==f?mxConstants.STYLE_FILLCOLOR:mxConstants.STYLE_STROKECOLOR,h="parentFillColor"==f?"fill":"stroke"):"swimlane"==f?(d[b]=c==mxConstants.STYLE_STROKECOLOR||c==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",g=null!=
e.model.getTerminal(a.cell,!1)?e.model.getTerminal(a.cell,!1):a.cell,g=e.getSwimlane(g),c=e.swimlaneIndicatorColorAttribute):"indicated"==f&&null!=a.shape?d[b]=a.shape.indicatorColor:c!=mxConstants.STYLE_FILLCOLOR&&f==mxConstants.STYLE_FILLCOLOR&&null!=a.shape?d[b]=a.style[mxConstants.STYLE_FILLCOLOR]:c!=mxConstants.STYLE_STROKECOLOR&&f==mxConstants.STYLE_STROKECOLOR&&null!=a.shape&&(d[b]=a.style[mxConstants.STYLE_STROKECOLOR]);null!=g&&(a=e.getView().getState(g),d[b]=null,null!=a&&(e=c==mxConstants.STYLE_FONTCOLOR?
a.text:a.shape,d[b]=null!=e&&"indicatorColor"!=b?e[h]:a.style[c]))}};mxCellRenderer.prototype.getLabelValue=function(a){return a.view.graph.getLabel(a.cell)};
mxCellRenderer.prototype.createTextShape=function(a,b,c){var d=a.view.graph;b=new this.defaultTextShape(b,new mxRectangle,a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,d.getVerticalAlign(a),a.style[mxConstants.STYLE_FONTCOLOR],a.style[mxConstants.STYLE_FONTFAMILY],a.style[mxConstants.STYLE_FONTSIZE],a.style[mxConstants.STYLE_FONTSTYLE],a.style[mxConstants.STYLE_SPACING],a.style[mxConstants.STYLE_SPACING_TOP],a.style[mxConstants.STYLE_SPACING_RIGHT],a.style[mxConstants.STYLE_SPACING_BOTTOM],
a.style[mxConstants.STYLE_SPACING_LEFT],a.style[mxConstants.STYLE_HORIZONTAL],a.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],a.style[mxConstants.STYLE_LABEL_BORDERCOLOR],d.isWrapping(a.cell)&&d.isHtmlLabel(a.cell),d.isLabelClipped(a.cell),a.style[mxConstants.STYLE_OVERFLOW],a.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION));b.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100);b.convertToSvg="1"==
mxUtils.getValue(a.style,"convertToSvg","0");b.dialect=c;b.style=a.style;b.state=a;return b};
mxCellRenderer.prototype.createLabel=function(a,b){var c=a.view.graph;if(0<a.style[mxConstants.STYLE_FONTSIZE]||null==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTSIZE]){var d=c.isHtmlLabel(a.cell)||null!=b&&mxUtils.isNode(b);a.text=this.createTextShape(a,b,d?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect);this.initializeLabel(a,a.text);this.configureShape(a);var e=!1,f=function(g){var h=a;if(mxClient.IS_TOUCH||e)h=mxEvent.getClientX(g),g=mxEvent.getClientY(g),
g=mxUtils.convertPoint(c.container,h,g),h=c.view.getState(c.getCellAt(g.x,g.y));return h};mxEvent.addGestureListeners(a.text.node,mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a)),e=c.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(g).nodeName)}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&c.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,f(g)))}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_UP,
new mxMouseEvent(g,f(g))),e=!1)}));c.nativeDblClickEnabled&&mxEvent.addListener(a.text.node,"dblclick",mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.dblClick(g,a.cell),mxEvent.consume(g))}))}};mxCellRenderer.prototype.initializeLabel=function(a,b){mxClient.IS_SVG&&mxClient.NO_FO&&b.dialect!=mxConstants.DIALECT_SVG?b.init(a.view.graph.container):b.init(a.view.getDrawPane())};
mxCellRenderer.prototype.createCellOverlays=function(a){var b=a.view.graph.getCellOverlays(a.cell),c=null;if(null!=b){c=new mxDictionary;for(var d=0;d<b.length;d++){var e=null!=a.overlays?a.overlays.remove(b[d]):null;null==e?(e=new mxImageShape(new mxRectangle,b[d].image.src),e.dialect=a.view.graph.dialect,e.preserveImageAspect=!1,e.overlay=b[d],this.initializeOverlay(a,e),this.installCellOverlayListeners(a,b[d],e),null!=b[d].cursor&&(e.node.style.cursor=b[d].cursor),c.put(b[d],e)):c.put(b[d],e)}}null!=
a.overlays&&a.overlays.visit(function(f,g){g.destroy()});a.overlays=c};mxCellRenderer.prototype.initializeOverlay=function(a,b){b.init(a.view.getOverlayPane())};
mxCellRenderer.prototype.installCellOverlayListeners=function(a,b,c){var d=a.view.graph;mxEvent.addListener(c.node,"click",function(e){d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());b.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",a.cell))});mxEvent.addGestureListeners(c.node,function(e){mxEvent.consume(e)},function(e){d.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,a))});mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchend",function(e){b.fireEvent(new mxEventObject(mxEvent.CLICK,
"event",e,"cell",a.cell))})};mxCellRenderer.prototype.createControl=function(a){var b=a.view.graph,c=b.getFoldingImage(a);if(b.foldingEnabled&&null!=c){if(null==a.control){var d=new mxRectangle(0,0,c.width,c.height);a.control=new mxImageShape(d,c.src);a.control.preserveImageAspect=!1;a.control.state=a;a.control.dialect=b.dialect;this.initControl(a,a.control,!0,this.createControlClickHandler(a));this.addControlHitArea(a.control)}}else null!=a.control&&(a.control.destroy(),a.control=null)};
mxCellRenderer.prototype.addControlHitArea=function(a){var b=this.minControlHitSize;0<b&&(a.afterPaint=function(c){this.constructor.prototype.afterPaint.apply(this,arguments);var d=this.bounds,e=this.inModelUnits?b/this.state.view.scale:b;if(null!=this.node&&null!=this.node.ownerSVGElement&&null!=d&&(d.width<e||d.height<e)){var f=Math.max(d.width,e);e=Math.max(d.height,e);this.node.appendChild(this.createTransparentSvgRectangle(d.getCenterX()-f/2,d.getCenterY()-e/2,f,e))}})};
mxCellRenderer.prototype.createControlClickHandler=function(a){var b=a.view.graph;return mxUtils.bind(this,function(c){if(this.forceControlClickHandler||b.isEnabled()){var d=!b.isCellCollapsed(a.cell);b.foldCells(d,!1,[a.cell],null,c);mxEvent.consume(c)}})};
mxCellRenderer.prototype.initControl=function(a,b,c,d){var e=a.view.graph;e.isHtmlLabel(a.cell)&&mxClient.NO_FO&&e.dialect==mxConstants.DIALECT_SVG?(b.dialect=mxConstants.DIALECT_PREFERHTML,b.init(e.container),b.node.style.zIndex=1):b.init(a.view.modelCoordinates?a.view.getDrawPane():a.view.getOverlayPane());b=b.innerNode||b.node;null==d||mxClient.IS_IOS||(e.isEnabled()&&(b.style.cursor="pointer"),mxEvent.addListener(b,"click",d));if(c){var f=null;mxEvent.addGestureListeners(b,function(g){f=new mxPoint(mxEvent.getClientX(g),
mxEvent.getClientY(g));e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a));mxEvent.consume(g)},function(g){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,a))},function(g){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,a));mxEvent.consume(g)});null!=d&&mxClient.IS_IOS&&b.addEventListener("touchend",function(g){if(null!=f){var h=e.tolerance;Math.abs(f.x-mxEvent.getClientX(g))<h&&Math.abs(f.y-mxEvent.getClientY(g))<h&&(d.call(d,g),mxEvent.consume(g))}},!0)}return b};
mxCellRenderer.prototype.isShapeEvent=function(a,b){return!0};mxCellRenderer.prototype.isLabelEvent=function(a,b){return!0};
mxCellRenderer.prototype.installListeners=function(a){var b=a.view.graph,c=function(d){var e=a;if(b.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(d).nodeName||mxClient.IS_TOUCH)e=mxEvent.getClientX(d),d=mxEvent.getClientY(d),d=mxUtils.convertPoint(b.container,e,d),e=b.view.getState(b.getCellAt(d.x,d.y));return e};mxEvent.addGestureListeners(a.shape.node,mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d,a))}),mxUtils.bind(this,
function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,c(d)))}),mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d,c(d)))}));b.nativeDblClickEnabled&&mxEvent.addListener(a.shape.node,"dblclick",mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&(b.dblClick(d,a.cell),mxEvent.consume(d))}))};
mxCellRenderer.prototype.redrawLabel=function(a,b){var c=a.view.graph,d=this.getLabelValue(a),e=c.isWrapping(a.cell),f=c.isLabelClipped(a.cell),g=a.view.graph.isHtmlLabel(a.cell)||null!=d&&mxUtils.isNode(d)?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect,h=a.style[mxConstants.STYLE_OVERFLOW]||"visible",k="1"==mxUtils.getValue(a.style,"convertToSvg","0");null==a.text||a.text.wrap==e&&a.text.clipped==f&&a.text.overflow==h&&a.text.dialect==g&&a.text.convertToSvg==k||(a.text.destroy(),a.text=null);
null==a.text&&null!=d&&(mxUtils.isNode(d)||0<d.length)?this.createLabel(a,d):null==a.text||null!=d&&0!=d.length||(a.text.destroy(),a.text=null);null!=a.text&&(b&&(null!=a.text.lastValue&&this.isTextShapeInvalid(a,a.text)&&(a.text.lastValue=null),a.text.resetStyles(),a.text.apply(a),this.configureShape(a),a.text.valign=c.getVerticalAlign(a),a.text.updateMargin()),c=this.getLabelBounds(a),k=this.getTextScale(a),this.resolveColor(a,"color",mxConstants.STYLE_FONTCOLOR),this.inheritFontStyle(a,"size",
mxConstants.STYLE_FONTSIZE),this.inheritFontStyle(a,"family",mxConstants.STYLE_FONTFAMILY),b||a.text.value!=d||a.text.isWrapping!=e||a.text.overflow!=h||a.text.isClipping!=f||a.text.scale!=k||a.text.dialect!=g||null==a.text.bounds||!a.text.bounds.equals(c))&&(a.text.dialect=g,a.text.value=d,a.text.bounds=c,a.text.scale=k,a.text.wrap=e,a.text.clipped=f,a.text.overflow=h,b=a.text.node.style.visibility,this.redrawLabelShape(a.text),a.text.node.style.visibility=b)};
mxCellRenderer.prototype.isTextShapeInvalid=function(a,b){function c(d,e,f){return"spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(b[d])-parseFloat(b.spacing)!=(a.style[e]||f):b[d]!=(null!=a.style[e]?a.style[e]:f)}return c("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||c("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||c("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||c("color",mxConstants.STYLE_FONTCOLOR,
"black")||c("align",mxConstants.STYLE_ALIGN,"")||c("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||c("spacing",mxConstants.STYLE_SPACING,2)||c("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||c("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||c("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||c("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||c("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||c("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||c("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||
c("borderWidth",mxConstants.STYLE_LABEL_BORDER_WIDTH,1)||c("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||c("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(a){a.redraw()};mxCellRenderer.prototype.getTextScale=function(a){return a.view.scale};
mxCellRenderer.prototype.getLabelBounds=function(a,b,c,d){b=null!=b?b:a.text;var e=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y),f=a.view.graph.getModel().isEdge(a.cell),g=a.view.scale;if(f){var h=b.getSpacing(null,c);e.x+=h.x*g;e.y+=h.y*g;h=a.view.graph.getCellGeometry(a.cell);null!=h&&(e.width=Math.max(0,h.width*g),e.height=Math.max(0,h.height*g))}else b.isPaintBoundsInverted()&&!d&&(h=e.x,e.x=e.y,e.y=h),e.x+=a.x,e.y+=a.y,h=a.view.modelCoordinates?g:1,e.width=Math.max(h,a.width),e.height=
Math.max(h,a.height);b.isPaintBoundsInverted()&&!d&&(h=(a.width-a.height)/2,e.x+=h,e.y-=h,h=e.width,e.width=e.height,e.height=h);if(null!=a.shape){h=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var k=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&k==mxConstants.ALIGN_MIDDLE&&(e=this.getShapeLabelBounds(a,e))}h=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);null!=h&&(e.width=
parseFloat(h)*g);f||this.rotateLabelBounds(a,e,b,c,d);return e};
mxCellRenderer.prototype.getShapeLabelBounds=function(a,b){var c=a.shape,d=c.beginModelUnits();if(null!=d){var e=d.scale;a=null!=d.viewTranslate?d.viewTranslate:a.view.translate;try{b=c.getLabelBounds(new mxRectangle(mxUtils.unscale(b.x,e,a.x),mxUtils.unscale(b.y,e,a.y),mxUtils.unscale(b.width,e),mxUtils.unscale(b.height,e)))}finally{c.endModelUnits(d)}b=new mxRectangle((b.x+a.x)*e,(b.y+a.y)*e,b.width*e,b.height*e)}else b=c.getLabelBounds(b);return b};
mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:c.margin;b.y-=f.y*b.height;b.x-=f.x*b.width;if(!this.legacySpacing||"fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&"width"!=a.style[mxConstants.STYLE_OVERFLOW]&&("block"!=a.style[mxConstants.STYLE_OVERFLOW]||"1"==a.style[mxConstants.STYLE_BLOCK_SPACING])){d=a.view.scale;f=c.getSpacing("1"==a.style[mxConstants.STYLE_BLOCK_SPACING],f);b.x+=f.x*d;b.y+=f.y*d;f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);
var g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),h=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==h?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/
180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)};
mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,h){g=h.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var k=g.getCenterX(),l=g.getCenterY();l=mxUtils.getRotatedPoint(new mxPoint(k,l),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));k=l.x;l=l.y;g.x=Math.round(k-
g.width/2);g.y=Math.round(l-g.height/2)}if(b||null==h.bounds||h.scale!=a.view.scale||!h.bounds.equals(g))h.bounds=g,h.scale=a.view.scale,h.viewTranslate=a.view.translate,h.redraw()})}};
mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};
mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+Math.max(b/2,9)*d,f=a.y+Math.max(c/2,9)*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var h=(a.width-a.height)/2;e+=h;f-=h}0!=g&&(h=mxUtils.toRadians(g),g=Math.cos(h),h=Math.sin(h),f=mxUtils.getRotatedPoint(new mxPoint(e,
f),g,h,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};
mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShapesForState(a),e=0;e<d.length;e++)if(null!=d[e]&&null!=d[e].node){var f=d[e].node.parentNode!=a.view.getDrawPane()&&d[e].node.parentNode!=a.view.getOverlayPane(),g=f?c:b;if(null!=g&&null!=g.parentNode&&g.nextSibling!=d[e].node)null==g.nextSibling?g.parentNode.appendChild(d[e].node):g.parentNode.insertBefore(d[e].node,g.nextSibling);else if(null==g)if(d[e].node.parentNode==a.view.graph.container){for(g=a.view.canvas;null!=
g&&g.parentNode!=a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]};
mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))};
mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),
this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a),
null!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,a.shape.viewTranslate=a.view.translate,(null==c||c)&&this.doRedrawShape(a),e=!0);
return e};
mxCellRenderer.prototype.updateScreenBounds=function(a,b,c){var d=a.shape,e=a.text;null!=d&&(d.scale=a.view.scale,d.viewTranslate=a.view.translate,null!=a.absolutePoints?(d.points=a.absolutePoints.slice(),d.updateBoundsFromPoints()):d.bounds=new mxRectangle(a.x,a.y,a.width,a.height),d.boundingBox=this.getScreenBounds(a,d.boundingBox,b,c),d.updateSvgScreenOffset());null!=e&&null!=e.bounds&&(e.bounds=this.getLabelBounds(a),e.scale=this.getTextScale(a),e.boundingBox=this.getScreenBounds(a,e.boundingBox,
b,c),e.unrotatedBoundingBox=this.getScreenBounds(a,e.unrotatedBoundingBox,b,c),e.updateTextBackground());this.redrawControl(a);this.redrawCellOverlays(a)};mxCellRenderer.prototype.getScreenBounds=function(a,b,c,d){if(null!=b){var e=a.view.scale;a=a.view.translate;b=new mxRectangle((b.x/c-d.x+a.x)*e,(b.y/c-d.y+a.y)*e,b.width/c*e,b.height/c*e)}return b};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};
mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};
var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var h=a.absolutePoints,k=h[0],l=h[h.length-1];h=function(q,r){return mxUtils.unscale(q,f.scale,f.translate.x)<mxUtils.unscale(r,f.scale,f.translate.x)};var m=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?m=.5>=n.x:null!=c&&(m=h(null!=l?l.x:c.x+c.width,null!=k?k.x:b.x))}if(null!=k)b=new mxCellState,b.x=k.x,b.y=k.y;else if(null!=
b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(m=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=h(null!=k?k.x:b.x+b.width,null!=l?l.x:c.x)));null!=l?(c=new mxCellState,c.x=l.x,c.y=l.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&
p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));null!=b&&null!=c&&(a=m?b.x:b.x+b.width,b=f.getRoutingCenterY(b),k=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),g=new mxPoint(a+(m?-d:d),b),l=new mxPoint(k+(n?-d:d),c),m==n?(d=m?Math.min(a,k)-d:Math.max(a,k)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(h(g.x,l.x)==m?(d=b+(c-b)/2,e.push(g),e.push(new mxPoint(g.x,d)),e.push(new mxPoint(l.x,d))):e.push(g),e.push(l)))},Loop:function(a,b,c,
d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var h=d=0,k=0,l=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);
a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),h=g):(k=f.getRoutingCenterY(b),l=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,l=Math.max(Math.abs(k-c.y),l)):a==mxConstants.DIRECTION_NORTH?k=b.y-2*h:a==mxConstants.DIRECTION_SOUTH?k=b.y+b.height+2*h:d=a==mxConstants.DIRECTION_EAST?b.x-2*l:b.x+b.width+2*l:null!=c&&(d=f.getRoutingCenterX(b),h=Math.max(Math.abs(d-c.x),l),k=c.y,l=0);e.push(new mxPoint(d-h,k-l));e.push(new mxPoint(d+h,k+l))}},ElbowConnector:function(a,
b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,h=!1;if(null!=b&&null!=c)if(null!=f){var k=Math.min(b.x,c.x),l=Math.max(b.x+b.width,c.x+c.width);h=Math.min(b.y,c.y);var m=Math.max(b.y+b.height,c.y+c.height);f=a.view.transformControlPoint(a,f);g=f.y<h||f.y>m;h=f.x<k||f.x>l}else k=Math.max(b.x,c.x),l=Math.min(b.x+b.width,c.x+c.width),(g=k==l)||(h=Math.max(b.y,c.y),m=Math.min(b.y+b.height,c.y+c.height),h=h==m);h||!g&&a.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(a,
b,c,d,e):mxEdgeStyle.TopToBottom(a,b,c,d,e)},SideToSide:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=h&&(b=new mxCellState,b.x=h.x,b.y=h.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),h=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:mxEdgeStyle.roundScaled(h+(a-h)/2,f.scale,f.translate.x),h=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=
d&&(d.y>=b.y&&d.y<=b.y+b.height&&(h=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),mxUtils.contains(c,a,h)||mxUtils.contains(b,a,h)||e.push(new mxPoint(a,h)),mxUtils.contains(c,a,f)||mxUtils.contains(b,a,f)||e.push(new mxPoint(a,f)),1==e.length&&(null!=d?mxUtils.contains(c,a,d.y)||mxUtils.contains(b,a,d.y)||e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),e.push(new mxPoint(a,f+(Math.min(b.y+b.height,c.y+c.height)-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;
var g=a.absolutePoints,h=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=h&&(b=new mxCellState,b.x=h.x,b.y=h.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(h=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),null!=d&&d.x>=b.x&&d.x<=b.x+b.width&&(a=d.x),h=null!=d?d.y:mxEdgeStyle.roundScaled(g+(h-g)/2,f.scale,f.translate.y),mxUtils.contains(c,a,h)||mxUtils.contains(b,a,h)||e.push(new mxPoint(a,h)),a=null!=d&&d.x>=c.x&&d.x<=c.x+
c.width?d.x:f.getRoutingCenterX(c),mxUtils.contains(c,a,h)||mxUtils.contains(b,a,h)||e.push(new mxPoint(a,h)),1==e.length&&(null!=d&&1==e.length?mxUtils.contains(c,d.x,h)||mxUtils.contains(b,d.x,h)||e.push(new mxPoint(d.x,h)):(f=Math.max(b.x,c.x),e.push(new mxPoint(f+(Math.min(b.x+b.width,c.x+c.width)-f)/2,h)))))},SegmentConnector:function(a,b,c,d,e){var f=a.view.scale,g=a.view.translate,h=mxEdgeStyle.scalePointArray(a.absolutePoints,f,g),k=mxEdgeStyle.scaleCellState(b,f,g),l=mxEdgeStyle.scaleCellState(c,
f,g),m=mxEdgeStyle.getChannelBounds(a.view,b,k,f,g),n=mxEdgeStyle.getChannelBounds(a.view,c,l,f,g),p=[],q=0<e.length&&null!=e[0]?new mxPoint(mxUtils.unscale(e[0].x,f,g.x),mxUtils.unscale(e[0].y,f,g.y)):null,r=!0,t=h[0];null==t&&null!=k?t=new mxPoint(a.view.getRoutingCenterX(k),a.view.getRoutingCenterY(k)):null!=t&&(t=t.clone());var v=h.length-1;if(null!=d&&0<d.length){for(var u=[],x=0;x<d.length;x++){var y=a.view.transformControlPoint(a,d[x],!0);null!=y&&u.push(new mxPoint(mxUtils.unscale(y.x,1,g.x),
mxUtils.unscale(y.y,1,g.y)))}if(0==u.length)return;null!=t&&null!=u[0]&&(1>Math.abs(u[0].x-t.x)&&(u[0].x=t.x),1>Math.abs(u[0].y-t.y)&&(u[0].y=t.y));y=h[v];null!=y&&null!=u[u.length-1]&&(1>Math.abs(u[u.length-1].x-y.x)&&(u[u.length-1].x=y.x),1>Math.abs(u[u.length-1].y-y.y)&&(u[u.length-1].y=y.y));d=u[0];var w=k,A=m,C=h[0],B=d;null!=C&&(w=null);for(x=0;2>x;x++){var z=null!=C&&C.x==B.x,H=null!=C&&C.y==B.y,E=null!=w&&B.y>=A.y&&B.y<=A.y+A.height;B=null!=w&&B.x>=A.x&&B.x<=A.x+A.width;w=H||null==C&&E;A=
z||null==C&&B;if(0!=x||!(w&&A||z&&H)){if(null!=C&&!H&&!z&&(E||B)){r=E?!1:!0;break}if(A||w){r=w;1==x&&(r=0==u.length%2?w:A);break}}w=l;A=n;C=h[v];null!=C&&(w=null);B=u[u.length-1];z&&H&&(u=u.slice(1))}r&&(null!=h[0]&&h[0].y!=d.y||null==h[0]&&null!=k&&(d.y<m.y||d.y>m.y+m.height))?p.push(new mxPoint(t.x,d.y)):!r&&(null!=h[0]&&h[0].x!=d.x||null==h[0]&&null!=k&&(d.x<m.x||d.x>m.x+m.width))&&p.push(new mxPoint(d.x,t.y));r?t.y=d.y:t.x=d.x;for(x=0;x<u.length;x++)r=!r,d=u[x],r?t.y=d.y:t.x=d.x,p.push(t.clone())}else d=
t,r=!0;t=h[v];null==t&&null!=l&&(t=new mxPoint(a.view.getRoutingCenterX(l),a.view.getRoutingCenterY(l)));null!=t&&null!=d&&(r&&(null!=h[v]&&h[v].y!=d.y||null==h[v]&&null!=l&&(d.y<n.y||d.y>n.y+n.height))?p.push(new mxPoint(t.x,d.y)):!r&&(null!=h[v]&&h[v].x!=d.x||null==h[v]&&null!=l&&(d.x<n.x||d.x>n.x+n.width))&&p.push(new mxPoint(d.x,t.y)));if(null==b||b!=c||"1"!=mxUtils.getValue(a.style,"innerLoopWaypoints","0")){if(null==h[0]&&null!=k)for(;0<p.length&&null!=p[0]&&mxUtils.contains(m,p[0].x,p[0].y);)p.splice(0,
1);if(null==h[v]&&null!=l)for(;0<p.length&&null!=p[p.length-1]&&mxUtils.contains(n,p[p.length-1].x,p[p.length-1].y);)p.splice(p.length-1,1)}for(x=0;x<p.length;x++)if(a=p[x],a.x=Math.round(10*a.x)/10,a.y=Math.round(10*a.y)/10,null==q||1<=Math.abs(q.x-a.x)||1<=Math.abs(q.y-a.y))e.push(new mxPoint((a.x+g.x)*f,(a.y+g.y)*f)),q=a;null!=y&&null!=e[e.length-1]&&1>=Math.abs(y.x-mxUtils.unscale(e[e.length-1].x,f,g.x))&&1>=Math.abs(y.y-mxUtils.unscale(e[e.length-1].y,f,g.y))&&(e.splice(e.length-1,1),null!=e[e.length-
1]&&(1>Math.abs(mxUtils.unscale(e[e.length-1].x,f,g.x)-y.x)&&(e[e.length-1].x=(y.x+g.x)*f),1>Math.abs(mxUtils.unscale(e[e.length-1].y,f,g.y)-y.y)&&(e[e.length-1].y=(y.y+g.y)*f)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,
513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],
vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(a,b){var c=mxUtils.getValue(a.style,b?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==c&&(mxUtils.getValue(a.style,b?mxConstants.STYLE_STARTARROW:
mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,b?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),c=Math.max(2,Math.ceil((a+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):c=2*mxEdgeStyle.orthBuffer);return c},roundScaled:function(a,b,c){return(Math.round(mxUtils.unscale(a,b,c))+c)*b},scalePointArray:function(a,b,c){var d=[],e=null!=c?c.x:0;c=null!=c?c.y:0;if(null!=a)for(var f=0;f<a.length;f++)if(null!=
a[f]){var g=new mxPoint(Math.round(10*mxUtils.unscale(a[f].x,b,e))/10,Math.round(10*mxUtils.unscale(a[f].y,b,c))/10);d[f]=g}else d[f]=null;else d=null;return d},getChannelBounds:function(a,b,c,d,e){a=null!=b?a.getChannelBounds(b):null;return null!=a&&a!=b?(b=null!=e?e.y:0,new mxRectangle(Math.round(10*mxUtils.unscale(a.x,d,null!=e?e.x:0))/10,Math.round(10*mxUtils.unscale(a.y,d,b))/10,Math.round(10*mxUtils.unscale(a.width,d))/10,Math.round(10*mxUtils.unscale(a.height,d))/10)):c},scaleCellState:function(a,
b,c){if(null!=a){var d=null!=c?c.x:0,e=null!=c?c.y:0;c=a.clone();c.setRect(Math.round(10*mxUtils.unscale(a.x,b,d))/10,Math.round(10*mxUtils.unscale(a.y,b,e))/10,Math.round(10*mxUtils.unscale(a.width,b))/10,Math.round(10*mxUtils.unscale(a.height,b))/10)}else c=null;return c},OrthConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale,a.view.translate),g=mxEdgeStyle.scaleCellState(b,a.view.scale,a.view.translate),h=mxEdgeStyle.scaleCellState(c,a.view.scale,a.view.translate),
k=f[0],l=f[f.length-1];f=null!=g?g.x:k.x;var m=null!=g?g.y:k.y,n=null!=g?g.width:1,p=null!=g?g.height:1,q=null!=h?h.x:l.x,r=null!=h?h.y:l.y,t=null!=h?h.width:1,v=null!=h?h.height:1,u=mxEdgeStyle.getJettySize(a,!0),x=mxEdgeStyle.getJettySize(a,!1);null!=g&&h==g&&(u=x=Math.max(u,x));var y=x+u,w=!1;if(null!=k&&null!=l){w=l.x-k.x;var A=l.y-k.y;w=w*w+A*A<y*y}if(w||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else if(c=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],
null!=g&&(c[0]=mxUtils.getPortConstraints(g,a,!0,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(g.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(f,m,n,p),b),f=b.x,m=b.y,n=b.width,p=b.height)),null!=h&&(c[1]=mxUtils.getPortConstraints(h,a,!1,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(q,r,t,v),b),q=b.x,r=b.y,t=b.width,v=b.height)),0!=n&&0!=p&&0!=t&&0!=v){b=[0,0];f=[[f,
m,n,p],[q,r,t,v]];x=[u,x];for(w=0;2>w;w++)mxEdgeStyle.limits[w][1]=f[w][0]-x[w],mxEdgeStyle.limits[w][2]=f[w][1]-x[w],mxEdgeStyle.limits[w][4]=f[w][0]+f[w][2]+x[w],mxEdgeStyle.limits[w][8]=f[w][1]+f[w][3]+x[w];x=f[0][1]+f[0][3]/2;m=f[1][1]+f[1][3]/2;w=f[0][0]+f[0][2]/2-(f[1][0]+f[1][2]/2);A=x-m;x=0;0>w?x=0>A?2:1:0>=A&&(x=3,0==w&&(x=2));m=null;null!=g&&(m=k);k=[[.5,.5],[.5,.5]];g||(k[0]=[0,0]);h||(k[1]=[0,0]);for(w=0;2>w;w++)null!=m&&(k[w][0]=(m.x-f[w][0])/f[w][2],1>=Math.abs(m.x-f[w][0])?b[w]=mxConstants.DIRECTION_MASK_WEST:
1>=Math.abs(m.x-f[w][0]-f[w][2])&&(b[w]=mxConstants.DIRECTION_MASK_EAST),k[w][1]=(m.y-f[w][1])/f[w][3],1>=Math.abs(m.y-f[w][1])?b[w]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(m.y-f[w][1]-f[w][3])&&(b[w]=mxConstants.DIRECTION_MASK_SOUTH)),m=null,null!=h&&(m=l);w=f[0][1]-(f[1][1]+f[1][3]);l=f[0][0]-(f[1][0]+f[1][2]);m=f[1][1]-(f[0][1]+f[0][3]);n=f[1][0]-(f[0][0]+f[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(l-y,0);mxEdgeStyle.vertexSeperations[2]=Math.max(w-y,0);mxEdgeStyle.vertexSeperations[4]=
Math.max(m-y,0);mxEdgeStyle.vertexSeperations[3]=Math.max(n-y,0);y=[];g=[];h=[];g[0]=l>=n?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;h[0]=w>=m?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;g[1]=mxUtils.reversePortConstraints(g[0]);h[1]=mxUtils.reversePortConstraints(h[0]);l=l>=n?l:n;m=w>=m?w:m;n=[[0,0],[0,0]];p=!1;for(w=0;2>w;w++)0==b[w]&&(0==(g[w]&c[w])&&(g[w]=mxUtils.reversePortConstraints(g[w])),0==(h[w]&c[w])&&(h[w]=mxUtils.reversePortConstraints(h[w])),
n[w][0]=h[w],n[w][1]=g[w]);0<m&&0<l&&(0<(g[0]&c[0])&&0<(h[1]&c[1])?(n[0][0]=g[0],n[0][1]=h[0],n[1][0]=h[1],n[1][1]=g[1],p=!0):0<(h[0]&c[0])&&0<(g[1]&c[1])&&(n[0][0]=h[0],n[0][1]=g[0],n[1][0]=g[1],n[1][1]=h[1],p=!0));0<m&&!p&&(n[0][0]=h[0],n[0][1]=g[0],n[1][0]=h[1],n[1][1]=g[1],p=!0);0<l&&!p&&(n[0][0]=g[0],n[0][1]=h[0],n[1][0]=g[1],n[1][1]=h[1]);for(w=0;2>w;w++)0==b[w]&&(0==(n[w][0]&c[w])&&(n[w][0]=n[w][1]),y[w]=n[w][0]&c[w],y[w]|=(n[w][1]&c[w])<<8,y[w]|=(n[1-w][w]&c[w])<<16,y[w]|=(n[1-w][1-w]&c[w])<<
24,0==(y[w]&15)&&(y[w]<<=8),0==(y[w]&3840)&&(y[w]=y[w]&15|y[w]>>8),0==(y[w]&983040)&&(y[w]=y[w]&65535|(y[w]&251658240)>>8),b[w]=y[w]&15,c[w]==mxConstants.DIRECTION_MASK_WEST||c[w]==mxConstants.DIRECTION_MASK_NORTH||c[w]==mxConstants.DIRECTION_MASK_EAST||c[w]==mxConstants.DIRECTION_MASK_SOUTH)&&(b[w]=c[w]);c=b[0]==mxConstants.DIRECTION_MASK_EAST?3:b[0];y=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=x;y-=x;1>c&&(c+=4);1>y&&(y+=4);c=mxEdgeStyle.routePatterns[c-1][y-1];mxEdgeStyle.wayPoints1[0][0]=
f[0][0];mxEdgeStyle.wayPoints1[0][1]=f[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=u;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=k[0][0]*f[0][2];mxEdgeStyle.wayPoints1[0][1]+=f[0][3]+u;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=f[0][2]+u;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=
k[0][0]*f[0][2],mxEdgeStyle.wayPoints1[0][1]-=u}u=0;g=y=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1;for(w=0;w<c.length;w++)h=c[w]&15,p=h==mxConstants.DIRECTION_MASK_EAST?3:h,p+=x,4<p&&(p-=4),l=mxEdgeStyle.dirVectors[p-1],h=0<p%2?0:1,h!=y&&(u++,mxEdgeStyle.wayPoints1[u][0]=mxEdgeStyle.wayPoints1[u-1][0],mxEdgeStyle.wayPoints1[u][1]=mxEdgeStyle.wayPoints1[u-1][1]),q=0<(c[w]&mxEdgeStyle.TARGET_MASK),r=0<(c[w]&mxEdgeStyle.SOURCE_MASK),m=(c[w]&mxEdgeStyle.SIDE_MASK)>>
5,m<<=x,15<m&&(m>>=4),n=0<(c[w]&mxEdgeStyle.CENTER_MASK),(r||q)&&9>m?(p=r?0:1,m=n&&0==h?f[p][0]+k[p][0]*f[p][2]:n?f[p][1]+k[p][1]*f[p][3]:mxEdgeStyle.limits[p][m],0==h?(m=(m-mxEdgeStyle.wayPoints1[u][0])*l[0],0<m&&(mxEdgeStyle.wayPoints1[u][0]+=l[0]*m)):(m=(m-mxEdgeStyle.wayPoints1[u][1])*l[1],0<m&&(mxEdgeStyle.wayPoints1[u][1]+=l[1]*m))):n&&(mxEdgeStyle.wayPoints1[u][0]+=l[0]*Math.abs(mxEdgeStyle.vertexSeperations[p]/2),mxEdgeStyle.wayPoints1[u][1]+=l[1]*Math.abs(mxEdgeStyle.vertexSeperations[p]/
2)),0<u&&mxEdgeStyle.wayPoints1[u][h]==mxEdgeStyle.wayPoints1[u-1][h]?u--:y=h;for(w=0;w<=u&&(w!=u||((0<(b[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==g?0:1)==(u+1)%2);w++)e.push(new mxPoint((Math.round(10*mxEdgeStyle.wayPoints1[w][0])/10+a.view.translate.x)*a.view.scale,(Math.round(10*mxEdgeStyle.wayPoints1[w][1])/10+a.view.translate.y)*a.view.scale));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,
b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];0!=c&&0!=d||null==inlineRoutePatterns[e-1][a-1]||(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:Object.create(null),putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;
return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);
mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);
function mxGraphView(a){this.graph=a;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource;mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"";mxGraphView.prototype.allowEval=!1;
mxGraphView.prototype.captureDocumentGesture=!0;mxGraphView.prototype.labelBoundingBoxDelay=100;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.checkCachedBounds=!1;mxGraphView.prototype.modelCoordinates=!1;mxGraphView.prototype.stateScale=null;mxGraphView.prototype.stateTranslate=null;mxGraphView.prototype.modelGraphBounds=null;mxGraphView.prototype.graphBoundsInvalid=!0;mxGraphView.prototype.incrementalValidation=!0;mxGraphView.prototype.maxInvalidCells=1E3;
mxGraphView.prototype.maxDependencyDepth=100;mxGraphView.prototype.dependencyDepth=0;mxGraphView.prototype.removedDependencies=null;mxGraphView.prototype.invalidCells=null;mxGraphView.prototype.invalidCellsRoot=null;mxGraphView.prototype.invalidatedCells=null;mxGraphView.prototype.createdCells=null;mxGraphView.prototype.validatingAllCells=!1;mxGraphView.prototype.walkStopped=!1;mxGraphView.prototype.fullValidationRequired=!1;mxGraphView.prototype.invalidBoundingBoxes=null;
mxGraphView.prototype.removedBoundingBoxes=null;mxGraphView.prototype.addedGraphBounds=null;mxGraphView.prototype.stateFieldNames="bounds points offset segments length terminalDistance".split(" ");mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;
mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.getModelGraphBounds=function(){var a=this.getGraphBounds(),b=this.scale,c=this.translate;return new mxRectangle(mxUtils.unscale(a.x,b,c.x),mxUtils.unscale(a.y,b,c.y),mxUtils.unscale(a.width,b),mxUtils.unscale(a.height,b))};
mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a;this.modelGraphBounds=null!=a?new mxRectangle(mxUtils.unscale(a.x,this.scale,this.translate.x),mxUtils.unscale(a.y,this.scale,this.translate.y),mxUtils.unscale(a.width,this.scale),mxUtils.unscale(a.height,this.scale)):null};
mxGraphView.prototype.getBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.getState(a[d]);null!=e&&(null==b?b=mxRectangle.fromRectangle(e):b.add(e))}return b};mxGraphView.prototype.setCurrentRoot=function(a){if(this.currentRoot!=a){var b=new mxCurrentRootChange(this,a);b.execute();var c=new mxUndoableEdit(this,!0);c.add(b);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c));this.graph.sizeDidChange()}return a};
mxGraphView.prototype.scaleAndTranslate=function(a,b,c){var d=this.scale,e=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=a||this.translate.x!=b||this.translate.y!=c)this.scale=a,this.translate.x=b,this.translate.y=c,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",a,"previousScale",d,"translate",this.translate,"previousTranslate",e))};mxGraphView.prototype.getScale=function(){return this.scale};
mxGraphView.prototype.setScale=function(a){var b=this.scale;this.scale!=a&&(this.scale=a,this.isEventsEnabled()&&this.viewStateChanged());this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",a,"previousScale",b))};mxGraphView.prototype.getTranslate=function(){return this.translate};
mxGraphView.prototype.setTranslate=function(a,b){var c=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=a||this.translate.y!=b)this.translate.x=a,this.translate.y=b,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",c))};
mxGraphView.prototype.viewStateChanged=function(){this.modelCoordinates?this.graph.updateContainerMetrics(mxUtils.bind(this,function(){this.validate();this.graph.sizeDidChange()})):(this.revalidate(),this.graph.sizeDidChange())};
mxGraphView.prototype.updateScreenStates=function(){var a=this.stateScale,b=this.stateTranslate;if(null!=a&&(a!=this.scale||b.x!=this.translate.x||b.y!=this.translate.y))for(var c=this.states.getValues(),d=0;d<c.length;d++)c[d].updateScreenBounds(),this.graph.cellRenderer.updateScreenBounds(c[d],a,b);this.stateScale=this.scale;this.stateTranslate=this.translate.clone()};
mxGraphView.prototype.updateDrawPaneTransform=function(){if(null!=this.drawPane){var a=this.scale,b=this.translate;this.drawPane.setAttribute("transform","translate("+b.x*a+","+b.y*a+") scale("+a+")");a=mxSvgCanvas2D.prototype.toleranceScaleVariable;null!=a&&(""==this.drawPane.style.getPropertyValue(a)?this.updateToleranceScale():this.scheduleToleranceScaleUpdate())}};mxGraphView.prototype.toleranceScaleDelay=250;mxGraphView.prototype.toleranceScaleThread=null;
mxGraphView.prototype.scheduleToleranceScaleUpdate=function(){window.clearTimeout(this.toleranceScaleThread);this.toleranceScaleThread=window.setTimeout(mxUtils.bind(this,function(){this.toleranceScaleThread=null;this.updateToleranceScale()}),this.toleranceScaleDelay)};
mxGraphView.prototype.updateToleranceScale=function(){var a=mxSvgCanvas2D.prototype.toleranceScaleVariable;if(null!=this.drawPane&&null!=a){var b=String(this.getToleranceScale());this.drawPane.style.getPropertyValue(a)!=b&&this.drawPane.style.setProperty(a,b)}};mxGraphView.prototype.getPixelSize=function(){return this.modelCoordinates?this.scale:1};mxGraphView.prototype.getToleranceScale=function(){return this.scale};mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear();this.revalidate()};
mxGraphView.prototype.revalidate=function(){var a=this.checkCachedBounds?this.getCachedBounds():null;this.invalidate();this.validate();null!=a&&this.compareCachedBounds(a)};mxGraphView.prototype.getStateFields=function(a,b){return b?[a.cellBounds,a.cellPoints,a.cellOffset,a.cellSegments,a.cellLength,a.cellTerminalDistance]:[new mxRectangle(a.x,a.y,a.width,a.height),a.absolutePoints,a.absoluteOffset,a.segments,a.length,a.terminalDistance]};
mxGraphView.prototype.getCachedBounds=function(){for(var a=new mxDictionary,b=this.states.getValues(),c=0;c<b.length;c++)a.put(b[c].cell,this.getStateFields(b[c],!0));return a};mxGraphView.prototype.compareCachedBounds=function(a){for(var b=this.states.getValues(),c=[],d=0;d<b.length;d++){var e=a.get(b[d].cell);null!=e&&this.addFieldDifferences(c,b[d],e,this.getStateFields(b[d],!0),1E-5)}this.writeFieldDifferences("Revalidation changed fields in model units",c)};
mxGraphView.prototype.compareScreenBounds=function(a){for(var b=1E-4*Math.max(1,this.scale),c=[],d=0;d<a.length;d++){var e=a[d],f=new mxCellState(this,e.cell,e.style);f.cellBounds=e.cellBounds;f.cellPoints=e.cellPoints;f.cellOffset=e.cellOffset;f.cellSegments=e.cellSegments;f.cellLength=e.cellLength;f.cellTerminalDistance=e.cellTerminalDistance;f.updateScreenBounds();this.addFieldDifferences(c,e,this.getStateFields(e),this.getStateFields(f),b)}this.writeFieldDifferences("Screen fields differ from fields in model units",
c)};mxGraphView.prototype.addFieldDifferences=function(a,b,c,d,e){for(var f=0;f<c.length;f++)this.equalsWithTolerance(c[f],d[f],e)||a.push({id:b.cell.id,field:this.stateFieldNames[f],value:JSON.stringify(c[f]),expected:JSON.stringify(d[f])})};
mxGraphView.prototype.equalsWithTolerance=function(a,b,c){var d=a==b;if(!d&&null!=a&&null!=b)if("number"===typeof a)d=Math.abs(a-b)<=c;else if(null!=a.length){d=a.length==b.length;for(var e=0;e<a.length&&d;e++)d=this.equalsWithTolerance(a[e],b[e],c)}else d=this.equalsWithTolerance(a.x,b.x,c)&&this.equalsWithTolerance(a.y,b.y,c)&&this.equalsWithTolerance(a.width,b.width,c)&&this.equalsWithTolerance(a.height,b.height,c);return d};
mxGraphView.prototype.writeFieldDifferences=function(a,b){0<b.length&&null!=window.console&&console.warn("mxGraphView: "+a+" ("+b.length+"): "+JSON.stringify(b.slice(0,10)))};mxGraphView.prototype.clear=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!1;c=null!=c?c:!0;this.addInvalidCell(a);this.removeState(a);if(c&&(b||a!=this.currentRoot)){c=d.getChildCount(a);for(var e=0;e<c;e++)this.clear(d.getChildAt(a,e),b)}else this.invalidate(a)};
mxGraphView.prototype.invalidate=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();if(null!=a){b=null!=b?b:!0;c=null!=c?c:!0;for(var e=null!=this.invalidatedCells?this.invalidatedCells:new mxDictionary,f=(b?1:0)|(c?2:0),g=0,h=0;4>h;h++)(h&f)==f&&(g|=1<<h);for(a=[a];0<a.length;){var k=a.pop();h=e.get(k)||0;if(0==(h&g)){e.put(k,h|1<<f);h=this.getState(k);null!=h&&(h.invalid=!0);this.addInvalidCell(k);if(c)for(h=d.getEdgeCount(k)-1;0<=h;h--)a.push(d.getEdgeAt(k,h));if(b)for(h=d.getChildCount(k)-
1;0<=h;h--)a.push(d.getChildAt(k,h))}}}};
mxGraphView.prototype.validate=function(a){var b=mxSvgCanvas2D.textBackgrounds,c=this.invalidatedCells;this.invalidatedCells=null;null==b&&(mxSvgCanvas2D.textBackgrounds=[]);for(var d=[this.graph,this,this.graph.getModel()],e=0;e<d.length;e++)d[e].beginRemoveListeners();try{this.validateCells(a)}finally{for(e=0;e<d.length;e++)d[e].endRemoveListeners();this.invalidatedCells=null!=c?new mxDictionary:null;if(null==b)try{mxSvgCanvas2D.measureTextBackgrounds()}finally{mxSvgCanvas2D.textBackgrounds=null}}};
mxGraphView.prototype.validateCells=function(a){var b=mxLog.enter("mxGraphView.validate");this.resetValidationState();this.validatedStates=this.checkCachedBounds?[]:null;this.modelCoordinates&&this.updateScreenStates();var c=null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot();a=null!=a?a:c;var d=null;if(a==c&&this.validateInvalidCells(c))d=this.getState(c);else{a==c&&(this.resetValidationState(),this.invalidCells=[],this.invalidCellsRoot=c,this.fullValidationRequired=!1);this.validatingAllCells=
!0;try{d=this.validateCellState(this.validateCell(a))}finally{this.validatingAllCells=!1}}var e=this.modelGraphBounds;e=null!=e?new mxRectangle((e.x+this.translate.x)*this.scale,(e.y+this.translate.y)*this.scale,e.width*this.scale,e.height*this.scale):null;if(this.modelCoordinates&&!this.graphBoundsInvalid&&null!=e)var f=e;else f=a==c?this.getChangedGraphBounds():null,null==f&&(f=this.getBoundingBox(d,!0,!0)),a!=c?(null!=e&&(0<e.width||0<e.height)&&(e.add(f),f=e),this.addedGraphBounds=null):this.setAddedGraphBounds(f),
this.graphBoundsInvalid=a!=c;this.setGraphBounds(null!=f?f:this.getEmptyBounds());this.validateBackground();this.modelCoordinates&&this.updateDrawPaneTransform();null!=this.validatedStates&&(this.compareScreenBounds(this.validatedStates),this.validatedStates=null);this.resetValidationState();mxLog.leave("mxGraphView.validate",b)};
mxGraphView.prototype.addInvalidCell=function(a){if(null!=this.invalidCells){var b=this.graph.getModel();a==b.getRoot()||this.invalidCells.length>=this.maxInvalidCells?this.invalidCells=null:null!=b.getParent(a)&&this.invalidCells.push(a)}};mxGraphView.prototype.isIncrementalValidation=function(a){return this.incrementalValidation&&null!=this.invalidCells&&!this.fullValidationRequired&&this.invalidCellsRoot==a&&null!=this.getState(a)&&!mxClient.NO_FO&&!this.graph.keepEdgesInForeground&&!this.graph.keepEdgesInBackground};
mxGraphView.prototype.validateInvalidCells=function(a){if(!this.isIncrementalValidation(a))return!1;var b=this.invalidCells,c=new mxDictionary,d=new mxDictionary,e=new mxDictionary,f=new mxDictionary,g=[],h=[],k;this.invalidCells=[];this.createdCells=[];try{for(k=0;k<b.length;k++)if(!c.get(b[k])){c.put(b[k],!0);var l=this.getValidationVisibility(b[k],a,d);null!=l&&(h.push(b[k]),g.push(l))}b=[];this.walkStopped=!1;for(k=0;k<h.length;k++)this.hasInvalidAncestor(h[k],a,c,e)?b.push(k):this.validateCell(h[k],
g[k]);if(this.walkStopped)for(k=0;k<b.length;k++)this.validateCell(h[b[k]],g[b[k]]);for(k=0;k<this.createdCells.length;k++)c.get(this.createdCells[k])||(c.put(this.createdCells[k],!0),h.push(this.createdCells[k]))}finally{this.createdCells=null}mxUtils.sortCells(h,!0);c=[];for(k=0;k<h.length;k++)e=this.validateInvalidCell(h[k],a,f),null!=e&&c.push(e);return!this.fullValidationRequired&&this.updateStateOrder(c,a)&&!this.fullValidationRequired};
mxGraphView.prototype.getValidationVisibility=function(a,b,c){if(a==b)return!0;var d=this.graph.getModel(),e=[],f=d.getParent(a);for(a=null!=c?c.get(f):void 0;void 0===a&&null!=f&&f!=b;)e.push(f),f=d.getParent(f),a=null!=c?c.get(f):void 0;void 0===a&&(null==f?a=null:(e.push(b),a=!0));for(b=e.length-1;0<=b;b--)null!=a&&(a=a&&this.graph.isCellVisible(e[b])&&(!this.isCellCollapsed(e[b])||e[b]==this.currentRoot)),null!=c&&c.put(e[b],a);return a};
mxGraphView.prototype.hasInvalidAncestor=function(a,b,c,d){var e=this.graph.getModel(),f=[],g=a!=b?e.getParent(a):null;for(a=!1;null!=g;){var h=d.get(g);if(null!=h){a=h;break}f.push(g);if(c.get(g)){a=!0;break}g=g!=b?e.getParent(g):null}for(b=0;b<f.length;b++)d.put(f[b],a);return a};
mxGraphView.prototype.validateInvalidCell=function(a,b,c){var d=this.graph.getModel(),e=this.getState(a);if(null!=e&&a!=b){var f=d.getParent(a);this.validateCellState(f,!1);for(var g=[];null!=f&&null!=e&&(null==c||!c.get(f));f=f!=b?d.getParent(f):null){var h=this.getState(f);null==h||h.invalid?e=null:null!=c&&g.push(f)}for(b=0;null!=e&&b<g.length;b++)c.put(g[b],!0)}null!=e&&(e=this.validateCellState(a,!1));return null==e||e.invalid?null:e};
mxGraphView.prototype.updateStateOrder=function(a,b){for(var c=0;c<a.length;c++){var d=a[c];if(null!=d.shape){for(var e=this.graph.cellRenderer.getShapesForState(d),f=0;f<e.length;f++)if(null!=e[f]&&null!=e[f].node&&!this.isPaneNode(e[f].node))return!1;this.lastNode=this.getPreviousNode(d.cell,b);this.lastHtmlNode=null;this.stateValidated(d)}}return!0};mxGraphView.prototype.isPaneNode=function(a){return a.parentNode==this.getDrawPane()||a.parentNode==this.getOverlayPane()};
mxGraphView.prototype.getPreviousNode=function(a,b){if(a==b)return null;var c=this.graph.getModel(),d=c.getParent(a);for(a=null!=d?[d,d.getIndex(a)]:[];0<a.length;){var e=a.pop(),f=a.pop();d=null;for(--e;0<=e&&null==d;e--)this.isValidState(c.getChildAt(f,e))&&(d=c.getChildAt(f,e),a.push(f,e,d,c.getChildCount(d)));if(null==d){d=this.getState(f);if(null!=d&&null!=d.shape)for(d=this.graph.cellRenderer.getShapesForState(d),e=d.length-1;0<=e;e--)if(null!=d[e]&&null!=d[e].node&&this.isPaneNode(d[e].node))return d[e].node;
0==a.length&&f!=b&&(d=c.getParent(f),null!=d&&a.push(d,d.getIndex(f)))}}return null};mxGraphView.prototype.getPreviousCell=function(a,b){if(a==b)return null;b=this.graph.getModel();var c=b.getParent(a);for(a=c.getIndex(a)-1;0<=a;a--){var d=b.getChildAt(c,a);if(this.isValidState(d))return this.getLastCell(d)}return c};
mxGraphView.prototype.getLastCell=function(a){for(var b=this.graph.getModel(),c=a;null!=c;){a=c;c=null;for(var d=b.getChildCount(a)-1;0<=d&&null==c;d--){var e=b.getChildAt(a,d);this.isValidState(e)&&(c=e)}}return a};mxGraphView.prototype.isValidState=function(a){a=this.getState(a);return null!=a&&!a.invalid};mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};
mxGraphView.prototype.updateBoundingBox=function(a){null!=a.shape&&a.shape.invalidBoundingBox&&(a.shape.updateBoundingBox(),a.shape.invalidBoundingBox=!1);null!=a.text&&a.text.invalidBoundingBox&&(a.text.updateBoundingBox(),a.text.invalidBoundingBox=!1)};mxGraphView.prototype.getBoundingBox=function(a,b,c){var d=null;null!=a&&(d=this.addBoundingBox(null,a,null!=b?b:!0,null!=c?c:!1));return d};
mxGraphView.prototype.addBoundingBox=function(a,b,c,d){d&&(this.updateBoundingBox(b),b.graphBoundingBox=this.getStateBoundingBox(b),b.invalidBoundingBox=!1);a=this.addShapeBoundingBox(a,b.shape);a=this.addShapeBoundingBox(a,b.text);if(c)for(var e=this.graph.getModel(),f=e.getChildCount(b.cell),g=0;g<f;g++){var h=this.getState(e.getChildAt(b.cell,g));null!=h&&(a=this.addBoundingBox(a,h,c,d))}return a};
mxGraphView.prototype.addShapeBoundingBox=function(a,b){b=null!=b?b.boundingBox:null;null==b||isNaN(b.x)||isNaN(b.y)||isNaN(b.width)||isNaN(b.height)||(null==a?a=mxRectangle.fromRectangle(b):a.add(b));return a};mxGraphView.prototype.getStateBoundingBox=function(a){return this.addShapeBoundingBox(this.addShapeBoundingBox(null,a.shape),a.text)};
mxGraphView.prototype.invalidateBoundingBox=function(a){this.graphBoundsInvalid=!0;a.invalidBoundingBox||(a.invalidBoundingBox=!0,null!=this.invalidBoundingBoxes&&this.invalidBoundingBoxes.push(a))};
mxGraphView.prototype.getChangedGraphBounds=function(){function a(h){return h.x>e.x+.001&&h.y>e.y+.001&&h.x+h.width<e.x+e.width-.001&&h.y+h.height<e.y+e.height-.001}var b=this.addedGraphBounds,c=this.invalidBoundingBoxes,d=this.removedBoundingBoxes;if(null==b||null==c||null==d||b.scale!=this.scale||b.x!=this.translate.x||b.y!=this.translate.y||null==this.graphBounds||!this.graphBounds.equals(b.bounds))return null;var e=b.bounds;b=mxRectangle.fromRectangle(e);for(var f=0;f<d.length;f++)if(!a(d[f]))return null;
for(f=0;f<c.length;f++)if(d=c[f],d.invalidBoundingBox=!1,this.getState(d.cell)==d){if(null!=d.graphBoundingBox&&!a(d.graphBoundingBox))return null;this.updateBoundingBox(d);var g=this.getStateBoundingBox(d);d.graphBoundingBox=g;null!=g&&(g.x<b.x||g.y<b.y||g.x+g.width>b.x+b.width||g.y+g.height>b.y+b.height)&&b.add(g)}return b};
mxGraphView.prototype.setAddedGraphBounds=function(a){this.addedGraphBounds=null!=a?{bounds:mxRectangle.fromRectangle(a),scale:this.scale,x:this.translate.x,y:this.translate.y}:null;this.invalidBoundingBoxes=[];this.removedBoundingBoxes=[]};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()};
mxGraphView.prototype.validateBackgroundImage=function(){var a=this.graph.getBackgroundImage();if(null!=a){if(null==this.backgroundImage||this.backgroundImage.image!=a.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var b=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(b,a.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,a)}else null!=this.backgroundImage&&
(this.backgroundImage.destroy(),this.backgroundImage=null)};
mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var a=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(a),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node,
"dblclick",mxUtils.bind(this,function(b){this.graph.dblClick(b)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide();this.graph.isMouseDown&&!mxEvent.isConsumed(b)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,
new mxMouseEvent(b))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=a,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.graph.pageFormat,b=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,a.width*b,a.height*b)};
mxGraphView.prototype.redrawBackgroundImage=function(a,b){b=new mxRectangle(this.scale*(this.translate.x+b.x),this.scale*(this.translate.y+b.y),this.scale*b.width,this.scale*b.height);a.scale==this.scale&&b.equals(a.bounds)||(a.scale=this.scale,a.bounds=b,null==a.node||"g"!=a.node.nodeName||"image"!=a.node.firstChild.nodeName&&"svg"!=a.node.firstChild.nodeName?a.redraw():(a.node.firstChild.setAttribute("x",b.x),a.node.firstChild.setAttribute("y",b.y),a.node.firstChild.setAttribute("width",b.width),
a.node.firstChild.setAttribute("height",b.height)))};mxGraphView.prototype.validateCell=function(a,b){if(null!=a)if(b=(null!=b?b:!0)&&this.graph.isCellVisible(a),null==this.getState(a,b)||b)for(var c=this.graph.getModel(),d=c.getChildCount(a),e=0;e<d;e++)this.validateCell(c.getChildAt(a,e),b&&(!this.isCellCollapsed(a)||a==this.currentRoot));else this.removeState(a),this.walkStopped=!0;return a};
mxGraphView.prototype.validateCellState=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(c=this.getState(a),null!=c)){var d=this.graph.getModel();if(c.invalid){c.invalid=!1;this.graphBoundsInvalid=!0;null!=this.validatedStates&&this.validatedStates.push(c);this.validateCellStyle(c);var e=this.removedDependencies;this.dependencyDepth++;try{this.dependencyDepth>this.maxDependencyDepth&&this.validateDependencies(a),a!=this.currentRoot&&this.validateDependency(a,d.getParent(a)),c.setVisibleTerminalState(this.validateDependency(a,
this.getVisibleTerminal(a,!0)),!0),c.setVisibleTerminalState(this.validateDependency(a,this.getVisibleTerminal(a,!1)),!1)}finally{this.dependencyDepth--,this.removedDependencies=e}this.updateCellState(c);a==this.currentRoot||c.invalid||(this.graph.cellRenderer.redraw(c,!1,this.isRendering()),c.updateCachedBounds())}if(b&&!c.invalid)for(null!=c.shape&&this.stateValidated(c),b=d.getChildCount(a),e=0;e<b;e++)this.validateCellState(d.getChildAt(a,e))}return c};
mxGraphView.prototype.validateCellStyle=function(a){if(null==a.style||a.invalidStyle)a.style=this.graph.getCellStyle(a.cell),a.invalidStyle=!1};mxGraphView.prototype.getDependency=function(a,b){return 0==b?a!=this.currentRoot?this.graph.getModel().getParent(a):null:this.getVisibleTerminal(a,1==b)};mxGraphView.prototype.validateDependency=function(a,b){var c=this.validateCellState(b,!1),d=this.removedDependencies;null==c&&null!=b&&null!=d&&d.cell==a&&(c=d.states.remove(b)||null);return c};
mxGraphView.prototype.validateDependencies=function(a){for(var b={cell:a,index:0,removed:null},c=[b],d=new mxDictionary;0<c.length;){var e=c[c.length-1];if(3>e.index){e=this.getDependency(e.cell,e.index++);var f=this.getState(e);null!=f&&f.invalid&&!d.get(f)&&(d.put(f,!0),f.invalid=!1,this.validateCellStyle(f),c.push({cell:e,state:f,index:0,removed:null}))}else if(c.pop(),null!=e.state){var g=this.removedDependencies;this.removedDependencies=null!=e.removed?{cell:e.cell,states:e.removed}:null;e.state.invalid=
!0;f=null;try{f=this.validateCellState(e.cell,!1)}finally{this.removedDependencies=g}null!=f&&this.getState(e.cell)!=f&&(g=c[c.length-1],null==g.removed&&(g.removed=new mxDictionary),g.removed.put(e.cell,f))}}null!=b.removed&&(this.removedDependencies={cell:a,states:b.removed})};
mxGraphView.prototype.updateCellState=function(a){a.absoluteOffset.x=0;a.absoluteOffset.y=0;a.origin.x=0;a.origin.y=0;a.length=0;if(a.cell!=this.currentRoot){var b=this.graph.getModel(),c=this.getState(b.getParent(a.cell));null!=c&&c.cell!=this.currentRoot&&(a.origin.x+=c.origin.x,a.origin.y+=c.origin.y);var d=this.graph.getChildOffsetForCell(a.cell);null!=d&&(a.origin.x+=d.x,a.origin.y+=d.y);var e=this.graph.getCellGeometry(a.cell);null!=e&&(b.isEdge(a.cell)||(d=null!=e.offset?e.offset:this.EMPTY_POINT,
e.relative&&null!=c?b.isEdge(c.cell)?(d=this.getPoint(c,e),null!=d&&(a.origin.x+=d.x/this.scale-c.origin.x-this.translate.x,a.origin.y+=d.y/this.scale-c.origin.y-this.translate.y)):(a.origin.x+=e.x*c.unscaledWidth+d.x,a.origin.y+=e.y*c.unscaledHeight+d.y):(a.absoluteOffset.x=this.scale*d.x,a.absoluteOffset.y=this.scale*d.y,a.origin.x+=e.x,a.origin.y+=e.y)),a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*e.width,a.unscaledWidth=e.width,a.height=
this.scale*e.height,a.unscaledHeight=e.height,b.isVertex(a.cell)&&this.updateVertexState(a,e),b.isEdge(a.cell)&&this.updateEdgeState(a,e))}a.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(a){return this.graph.isCellCollapsed(a)};
mxGraphView.prototype.updateVertexState=function(a,b){var c=this.graph.getModel(),d=this.getState(c.getParent(a.cell));if(b.relative&&null!=d&&!c.isEdge(d.cell)&&(c=mxUtils.toRadians(d.style[mxConstants.STYLE_ROTATION]||"0"),0!=c)){b=Math.cos(c);c=Math.sin(c);var e=new mxPoint(a.getCenterX(),a.getCenterY());d=new mxPoint(d.getCenterX(),d.getCenterY());d=mxUtils.getRotatedPoint(e,b,c,d);a.x=d.x-a.width/2;a.y=d.y-a.height/2}this.updateVertexLabelOffset(a)};
mxGraphView.prototype.updateEdgeState=function(a,b){var c=a.getVisibleTerminalState(!0),d=a.getVisibleTerminalState(!1),e="function"===typeof b.getTerminalPoint;null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&(!e||null==b.getTerminalPoint(!0))||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&(!e||null==b.getTerminalPoint(!1))?this.clear(a.cell,!0):(this.updateFixedTerminalPoints(a,c,d),this.updatePoints(a,b.points,c,d),this.updateFloatingTerminalPoints(a,c,d),this.removeDuplicatePoints(a,
b.points,c,d),b=a.absolutePoints,a.cell!=this.currentRoot&&(null==b||2>b.length||null==b[0]||null==b[b.length-1])?this.clear(a.cell,!0):(this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)))};
mxGraphView.prototype.updateVertexLabelOffset=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(b==mxConstants.ALIGN_LEFT)b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),b=null!=b?b*this.scale:a.width,a.absoluteOffset.x-=b;else if(b==mxConstants.ALIGN_RIGHT)a.absoluteOffset.x+=a.width;else if(b==mxConstants.ALIGN_CENTER&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),null!=b)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,
mxConstants.ALIGN_CENTER),d=0;c==mxConstants.ALIGN_CENTER?d=.5:c==mxConstants.ALIGN_RIGHT&&(d=1);0!=d&&(a.absoluteOffset.x-=(b*this.scale-a.width)*d)}b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b==mxConstants.ALIGN_TOP?a.absoluteOffset.y-=a.height:b==mxConstants.ALIGN_BOTTOM&&(a.absoluteOffset.y+=a.height)};mxGraphView.prototype.resetValidationState=function(){this.lastForegroundHtmlNode=this.lastForegroundNode=this.lastHtmlNode=this.lastNode=null};
mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEdge(a.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(a.cell)&&this.graph.keepEdgesInBackground;a=this.graph.cellRenderer.insertStateAfter(a,b?this.lastForegroundNode||this.lastNode:this.lastNode,b?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode);b?(this.lastForegroundHtmlNode=a[1],this.lastForegroundNode=a[0]):(this.lastHtmlNode=a[1],this.lastNode=a[0])};
mxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};
mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};
mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?a.shape.stencil.h0:a.shape.stencil.w0;d=d?a.shape.stencil.w0:a.shape.stencil.h0;var e=Math.min(a.width/c,a.height/d);a.setRect(a.x+(a.width-c*e)/2,a.y+(a.height-d*e)/2,c*e,d*e)}return b};
mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){null!=b&&0<b.length&&this.isCollapsedPointsIgnored(a.cell,a.style)&&(b=null);var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),h=c!=d?this.updateBoundsFromStencil(d):null;try{f(a,c,d,b,e)}finally{null!=g&&c.setRect(g.x,g.y,g.width,g.height),null!=h&&d.setRect(h.x,
h.y,h.width,h.height)}}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.isCollapsedPointsIgnored=function(a,b){if(null!=a&&null!=b&&"0"==mxUtils.getValue(b,mxConstants.STYLE_COLLAPSED_POINTS,"1")){b=this.graph.getModel();for(var c=0;2>c;c++){var d=b.getTerminal(a,0==c);if(null!=d){var e=this.getVisibleTerminal(a,0==c);if(null!=e&&e!=d)return!0}}}return!1};
mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};
mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};
mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};
mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints;if(null!=d){var e=d[0];d=d[d.length-1];null==d&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0);null!=a.style&&1==mxUtils.getValue(a.style,mxConstants.STYLE_FIXED_POINT_SPACING,0)&&this.updateFixedPointSpacing(a,null!=e?b:null,null!=d?c:null)}};
mxGraphView.prototype.removeDuplicatePoints=function(a,b,c,d){var e=a.absolutePoints;if(null!=e&&2<e.length){for(var f=.01*this.scale,g=function(l,m){return null!=l&&null!=m&&Math.abs(l.x-m.x)<f&&Math.abs(l.y-m.y)<f},h=!1,k=1;k<e.length&&!h;k++)h=g(e[k-1],e[k]);if(h&&this.isDuplicatePointsRemoved(a,this.getEdgeStyle(a,b,c,d),b))for(k=e.length-2;0<k&&2<e.length;k--)(g(e[k],e[k+1])||g(e[k],e[k-1]))&&e.splice(k,1)}};
mxGraphView.prototype.isDuplicatePointsRemoved=function(a,b,c){return b==mxEdgeStyle.OrthConnector&&(null==c||0==c.length)||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom||b==mxEdgeStyle.EntityRelation};
mxGraphView.prototype.updateFixedPointSpacing=function(a,b,c){var d=a.absolutePoints,e=null!=d?d.length:0;if(1<e&&null!=d[0]&&null!=d[e-1]){var f=this.scale,g=function(t){t=parseFloat(a.style[t]||0);return isNaN(t)||!isFinite(t)?0:t*f},h=function(t,v){var u=d[t];for(t+=v;0<=t&&t<e;t+=v)if(null!=d[t]&&(d[t].x!=u.x||d[t].y!=u.y))return t;return-1},k=d[0],l=d[e-1];b=b?g(mxConstants.STYLE_SOURCE_PERIMETER_SPACING):0;c=c?g(mxConstants.STYLE_TARGET_PERIMETER_SPACING):0;g=0!=b?h(0,1):-1;var m=0!=c?h(e-1,
-1):-1;h=0<=g?d[g]:null;var n=0<=m?d[m]:null,p=null!=h?Math.sqrt((h.x-k.x)*(h.x-k.x)+(h.y-k.y)*(h.y-k.y)):0,q=null!=n?Math.sqrt((n.x-l.x)*(n.x-l.x)+(n.y-l.y)*(n.y-l.y)):0,r=Math.max(0,p-1);b=Math.min(b,r);c=Math.min(c,Math.max(0,q-1));g==e-1&&0==m&&0<b&&0<c&&b+c>r&&(g=r/(b+c),b*=g,c*=g);null!=h&&0!=b&&a.setAbsoluteTerminalPoint(new mxPoint(k.x+(h.x-k.x)*b/p,k.y+(h.y-k.y)*b/p),!0);null!=n&&0!=c&&a.setAbsoluteTerminalPoint(new mxPoint(l.x+(n.x-l.x)*c/q,l.y+(n.y-l.y)*c/q),!1)}};
mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};
mxGraphView.prototype.getFloatingTerminalPoint=function(a,b,c,d){b=this.getTerminalPort(a,b,d);var e=this.getNextPoint(a,c,d),f=this.graph.isOrthogonal(a),g=Number(b.style[mxConstants.STYLE_ROTATION]||"0");c=mxUtils.toRadians(g);var h=new mxPoint(b.getCenterX(),b.getCenterY());g=0==g%90;if(0!=c){var k=Math.cos(-c),l=Math.sin(-c);g&&(k=Math.round(k),l=Math.round(l));e=mxUtils.getRotatedPoint(e,k,l,h)}k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:
mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);a=this.getPerimeterPoint(b,e,g&&f,k);0!=c&&(k=Math.cos(c),l=Math.sin(c),g&&(k=Math.round(k),l=Math.round(l)),a=mxUtils.getRotatedPoint(a,k,l,h));return a};mxGraphView.prototype.getTerminalPort=function(a,b,c){a=mxUtils.getValue(a.style,c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT);null!=a&&(a=this.getState(this.graph.getModel().getCell(a)),null!=a&&(b=a));return b};
mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a){var f=this.getPerimeterFunction(a);if(null!=f&&null!=b&&(d=this.getPerimeterBounds(a,d),0<d.width||0<d.height)){e=new mxPoint(b.x,b.y);var g=!1,h=!1;this.graph.model.isVertex(a.cell)&&(g=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPH,0),h=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPV,0),null!=a.shape&&null!=a.shape.stencil&&(g=1==mxUtils.getValue(a.style,"stencilFlipH",0)||g,h=1==mxUtils.getValue(a.style,"stencilFlipV",
0)||h),g&&(e.x=2*d.getCenterX()-e.x),h&&(e.y=2*d.getCenterY()-e.y));e=f(d,a,e,c);null!=e&&(g&&(e.x=2*d.getCenterX()-e.x),h&&(e.y=2*d.getCenterY()-e.y));e=this.getLabelPerimeterPoint(a,b,c,d,e)}null==e&&(e=this.getPoint(a))}return e};
mxGraphView.prototype.getLabelPerimeterSide=function(a){var b=null;if(this.isLabelPerimeter(a)&&null!=a.text){a.text.invalidBoundingBox&&this.updateBoundingBox(a);var c=a.text.boundingBox,d=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);null!=c&&(d==mxConstants.ALIGN_CENTER?e==mxConstants.ALIGN_BOTTOM&&c.y+c.height>a.y+a.height?b=mxConstants.DIRECTION_SOUTH:e==mxConstants.ALIGN_TOP&&
c.y<a.y&&(b=mxConstants.DIRECTION_NORTH):e==mxConstants.ALIGN_MIDDLE&&(d==mxConstants.ALIGN_RIGHT&&c.x+c.width>a.x+a.width?b=mxConstants.DIRECTION_EAST:d==mxConstants.ALIGN_LEFT&&c.x<a.x&&(b=mxConstants.DIRECTION_WEST)))}return b};
mxGraphView.prototype.isLabelPerimeter=function(a){return null!=a&&null!=a.style&&this.graph.model.isVertex(a.cell)&&1==mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_PERIMETER,0)&&0==mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0)&&1!=mxUtils.getValue(a.style,mxConstants.STYLE_FLIPH,0)&&1!=mxUtils.getValue(a.style,mxConstants.STYLE_FLIPV,0)&&1!=mxUtils.getValue(a.style,"stencilFlipH",0)&&1!=mxUtils.getValue(a.style,"stencilFlipV",0)};
mxGraphView.prototype.getLabelPerimeterPoint=function(a,b,c,d,e){c=null!=e&&null!=b?this.getLabelPerimeterSide(a):null;if(null!=c){var f=Math.max(0,a.x-d.x),g=a.text.boundingBox;a=g.x-f;var h=g.y-f,k=g.x+g.width+f;f=g.y+g.height+f;for(var l=[[a,h,k,h],[k,h,k,f],[a,f,k,f],[a,h,a,f]],m=g=null,n=0;n<l.length;n++){var p=l[n];p=mxUtils.intersection(b.x,b.y,e.x,e.y,p[0],p[1],p[2],p[3]);if(null!=p){var q=(p.x-b.x)*(p.x-b.x)+(p.y-b.y)*(p.y-b.y);if(null==m||q<m)g=p,m=q}}null==g&&(l=d.x+d.width,m=d.y+d.height,
n=b.x>=d.x-1&&b.x<=l+1&&b.x>a&&b.x<k,p=b.y>=d.y-1&&b.y<=m+1&&b.y>h&&b.y<f,c==mxConstants.DIRECTION_SOUTH&&n&&1>=Math.abs(b.y-m)?g=new mxPoint(b.x,f):c==mxConstants.DIRECTION_NORTH&&n&&1>=Math.abs(b.y-d.y)?g=new mxPoint(b.x,h):c==mxConstants.DIRECTION_EAST&&p&&1>=Math.abs(b.x-l)?g=new mxPoint(k,b.y):c==mxConstants.DIRECTION_WEST&&p&&1>=Math.abs(b.x-d.x)&&(g=new mxPoint(a,b.y)));null!=g&&(e=g)}return e};
mxGraphView.prototype.getRoutingCenterX=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return a.getCenterX()+b*a.width};mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getChannelBounds=function(a){return a};
mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)};mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};
mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d};
mxGraphView.prototype.getVisibleTerminal=function(a,b){var c=this.graph.getModel();for(b=a=c.getTerminal(a,b);null!=a&&a!=this.currentRoot;){if(!this.graph.isCellVisible(b)||this.isCellCollapsed(a))b=a;a=c.getParent(a)}null==b||c.contains(b)&&c.getParent(b)!=c.getRoot()&&b!=this.currentRoot||(b=null);return b};
mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;d=0;var g=[];f=c;if(null!=f){c=f.x;for(var h=f.y,k=c,l=h,m=1;m<b.length;m++){var n=b[m];null!=n&&(e=f.x-n.x,f=f.y-n.y,e=Math.sqrt(e*e+f*f),g.push(e),d+=e,f=n,c=Math.min(f.x,c),h=Math.min(f.y,h),k=Math.max(f.x,k),l=Math.max(f.y,l))}a.length=d;a.segments=g;b=this.scale;a.x=c;a.y=h;a.width=Math.max(b,
k-c);a.height=Math.max(b,l-h)}};
mxGraphView.prototype.getPoint=function(a,b){var c=a.getCenterX(),d=a.getCenterY();if(null==a.segments||null!=b&&!b.relative)null!=b&&(b=b.offset,null!=b&&(c+=b.x,d+=b.y));else{var e=a.absolutePoints.length,f=Math.round(mxUtils.unscale(((null!=b?b.x/2:0)+.5)*a.length,this.scale))*this.scale,g=this.getSegmentLengths(a),h=1;for(--e;h<e;){var k=h+e>>1;f>=Math.round(mxUtils.unscale(g[k],this.scale))*this.scale?h=k+1:e=k}e=a.segments[h-1];g=g[h-1];f=0==e?0:(f-g)/e;g=a.absolutePoints[h-1];a=a.absolutePoints[h];
null!=g&&null!=a&&(h=c=d=0,null!=b&&(d=b.y,b=b.offset,null!=b&&(c=b.x,h=b.y)),b=a.x-g.x,a=a.y-g.y,c=g.x+b*f+((0==e?0:a/e)*d+c)*this.scale,d=g.y+a*f-((0==e?0:b/e)*d-h)*this.scale)}return new mxPoint(c,d)};mxGraphView.prototype.getSegmentLengths=function(a){var b=a.segments,c=a.segmentLengths;if(null==c||c.segments!==b||c.lengths.length!=b.length+1){c=[0];for(var d=0;d<b.length;d++)c.push(c[d]+b[d]);c={segments:b,lengths:c};a.segmentLengths=c}return c.lengths};
mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1<e){d=a.length;for(var f=a.segments,g=a.absolutePoints[0],h=a.absolutePoints[1],k=mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c),l=0,m=0,n=0,p=2;p<e;p++)g=h,h=a.absolutePoints[p],g=mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c),n+=f[p-2],g<=k&&(k=g,m=p-1,l=n);e=f[m];g=a.absolutePoints[m];h=a.absolutePoints[m+1];k=h.x;f=h.y;a=g.x-k;m=g.y-f;f=(a-(b-k))*
a+(m-(c-f))*m;a=Math.sqrt(0>=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,h.x,h.y,b,c)&&(e=-e);return new mxPoint(0<d?(d/2-l-a)/d*-2:0,e/this.scale)}}return new mxPoint};
mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0<b.length&&null!=a.segments){var c=this.graph.getCellGeometry(a.cell);if(c.relative){var d=this.getPoint(a,c);null!=d&&(a.absoluteOffset=d)}else{d=b[0];var e=b[b.length-1];if(null!=d&&null!=e){b=e.x-d.x;var f=e.y-d.y,g=e=0;c=c.offset;null!=c&&(e=c.x,g=c.y);c=d.y+f/2+g*this.scale;a.absoluteOffset.x=d.x+b/2+e*this.scale;a.absoluteOffset.y=c}}}};
mxGraphView.prototype.getState=function(a,b){b=b||!1;var c=null;null!=a&&(c=this.states.get(a),b&&(null==c||this.updateStyle)&&this.graph.isCellVisible(a)&&(null==c?(c=this.createState(a),this.states.put(a,c),null!=this.createdCells?this.createdCells.push(a):this.validatingAllCells||this.addInvalidCell(a)):c.style=this.graph.getCellStyle(a)));return c};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(a){this.rendering=a};
mxGraphView.prototype.isAllowEval=function(){return this.allowEval};mxGraphView.prototype.setAllowEval=function(a){this.allowEval=a};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(a){this.states=a;this.removedBoundingBoxes=this.invalidBoundingBoxes=this.addedGraphBounds=this.invalidCells=null};mxGraphView.prototype.getCellStates=function(a){if(null==a)return this.states;for(var b=[],c=0;c<a.length;c++){var d=this.getState(a[c]);null!=d&&b.push(d)}return b};
mxGraphView.prototype.removeState=function(a){var b=null;null!=a&&(b=this.states.remove(a),null!=b&&(this.graphBoundsInvalid=!0,null!=b.graphBoundingBox&&null!=this.removedBoundingBoxes&&this.removedBoundingBoxes.push(b.graphBoundingBox),this.graph.cellRenderer.destroy(b),b.invalid=!0,b.destroy()));return b};mxGraphView.prototype.createState=function(a){return new mxCellState(this,a,this.graph.getCellStyle(a))};mxGraphView.prototype.getCanvas=function(){return this.canvas};
mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane};mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};
mxGraphView.prototype.isContainerEvent=function(a){a=mxEvent.getSource(a);return a==this.graph.container||this.backgroundPane.contains(a)||a==this.canvas.parentNode||a==this.canvas||a==this.drawPane||a==this.overlayPane||a==this.decoratorPane};
mxGraphView.prototype.isScrollEvent=function(a){var b=mxUtils.getOffset(this.graph.container);a=new mxPoint(a.clientX-b.x,a.clientY-b.y);b=this.graph.container.offsetWidth;var c=this.graph.container.clientWidth;if(b>c&&a.x>c+2&&a.x<=b)return!0;b=this.graph.container.offsetHeight;c=this.graph.container.clientHeight;return b>c&&a.y>c+2&&a.y<=b?!0:!1};mxGraphView.prototype.init=function(){this.installListeners();this.createSvg()};
mxGraphView.prototype.installListeners=function(){var a=this.graph,b=a.container;null!=b&&(mxClient.IS_TOUCH&&(mxEvent.addListener(b,"gesturestart",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gesturechange",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gestureend",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)}))),mxEvent.addGestureListeners(b,mxUtils.bind(this,function(c){!this.isContainerEvent(c)||
(mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(c)||a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})),mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.dblClick(c)})),a.addMouseListener({mouseDown:function(c,
d){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();if(this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(c)){var d=a.fireMouseEvent,e=mxEvent.MOUSE_MOVE,f=null;if(mxClient.IS_TOUCH){f=mxEvent.getClientX(c);var g=
mxEvent.getClientY(c);f=mxUtils.convertPoint(b,f,g);f=a.view.getState(a.getCellAt(f.x,f.y))}d.call(a,e,new mxMouseEvent(c,f))}}),this.endHandler=mxUtils.bind(this,function(c){this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))}),this.cancelHandler=mxUtils.bind(this,function(c){!a.isMouseDown&&null==a.eventSource||null!=a.currentPointerId&&
null!=c.pointerId&&c.pointerId!=a.currentPointerId||a.cancelMouseGesture(c)}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler,this.cancelHandler),this.labelSizeHandler=mxUtils.bind(this,function(c){("loadingdone"==c.type||null!=c.target&&"IMG"==c.target.nodeName)&&this.scheduleLabelBoundingBoxUpdate()}),b.addEventListener("load",this.labelSizeHandler,!0),b.addEventListener("error",this.labelSizeHandler,!0),this.fontFaceSet=b.ownerDocument.fonts,null!=this.fontFaceSet&&"function"===
typeof this.fontFaceSet.addEventListener&&this.fontFaceSet.addEventListener("loadingdone",this.labelSizeHandler))};mxGraphView.prototype.scheduleLabelBoundingBoxUpdate=function(){null==this.labelBoundingBoxThread&&(this.labelBoundingBoxThread=window.setTimeout(mxUtils.bind(this,function(){this.labelBoundingBoxThread=null;this.updateLabelBoundingBoxes()}),this.labelBoundingBoxDelay))};
mxGraphView.prototype.updateLabelBoundingBoxes=function(){if(null!=this.canvas){var a=[];this.states.visit(mxUtils.bind(this,function(g,h){null!=h.text&&(this.isLabelPerimeter(h)&&(g=h.text.invalidBoundingBox?null:h.text.boundingBox,a.push([h,null!=g?[g.width,g.height]:null])),h.text.invalidateBoundingBox(),h.text.offsetWidth=null,h.text.offsetHeight=null)}));var b=this.invalidatedCells;null==b&&(this.invalidatedCells=new mxDictionary);try{for(var c=0;c<a.length;c++){var d=a[c][0],e=a[c][1];this.updateBoundingBox(d);
var f=d.text.boundingBox;null!=e&&null!=f&&f.width==e[0]&&f.height==e[1]||this.invalidate(d.cell,!1,!0)}}finally{null==b&&(this.invalidatedCells=null)}this.graphBoundsInvalid=!0;0==this.graph.model.updateLevel&&(b=mxRectangle.fromRectangle(this.getGraphBounds()),this.validate(),b.equals(this.getGraphBounds())||this.graph.sizeDidChange())}};
mxGraphView.prototype.createSvg=function(){var a=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,
"g");this.canvas.appendChild(this.decoratorPane);var b=document.createElementNS(mxConstants.NS_SVG,"svg");b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";b.style.display="block";b.appendChild(this.canvas);null!=a&&(a.appendChild(b),this.updateContainerStyle(a))};mxGraphView.prototype.updateContainerStyle=function(a){var b=mxUtils.getCurrentStyle(a);null!=b&&"static"==b.position&&(a.style.position="relative");mxClient.IS_POINTER&&(a.style.touchAction="none")};
mxGraphView.prototype.destroy=function(){var a=null!=this.canvas?this.canvas.ownerSVGElement:null;null==a&&(a=this.canvas);null!=a&&null!=a.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler,this.cancelHandler),mxEvent.release(this.graph.container),a.parentNode.removeChild(a),null!=this.labelSizeHandler&&(this.graph.container.removeEventListener("load",this.labelSizeHandler,!0),this.graph.container.removeEventListener("error",
this.labelSizeHandler,!0),null!=this.fontFaceSet&&"function"===typeof this.fontFaceSet.removeEventListener&&this.fontFaceSet.removeEventListener("loadingdone",this.labelSizeHandler),window.clearTimeout(this.labelBoundingBoxThread),this.fontFaceSet=this.labelSizeHandler=this.labelBoundingBoxThread=null),window.clearTimeout(this.toleranceScaleThread),this.decoratorPane=this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.cancelHandler=this.endHandler=this.moveHandler=this.toleranceScaleThread=
null)};function mxCurrentRootChange(a,b){this.view=a;this.previous=this.root=b;this.isUp=null==b;if(!this.isUp){a=this.view.currentRoot;for(var c=this.view.graph.getModel();null!=a;){if(a==b){this.isUp=!0;break}a=c.getParent(a)}}}
mxCurrentRootChange.prototype.execute=function(){var a=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=a;a=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=a&&(this.view.translate=new mxPoint(-a.x,-a.y));this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp};
function mxGraph(a,b,c,d,e){this.mouseListeners=null;this.renderHint=c;this.dialect=mxConstants.DIALECT_SVG;this.model=null!=b?b:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(null!=d?d:this.createStylesheet());this.view=this.createGraphView();this.view.rendering=null!=e?e:this.view.rendering;this.graphModelChangeListener=mxUtils.bind(this,function(f,g){this.graphModelChanged(g.getProperty("edit").changes)});
this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();null!=a&&this.init(a);this.view.rendering&&this.view.revalidate()}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph");mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=!1;mxGraph.prototype.model=null;mxGraph.prototype.view=null;
mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10;mxGraph.prototype.gridEnabled=!0;mxGraph.prototype.portsEnabled=!0;mxGraph.prototype.nativeDblClickEnabled=!0;mxGraph.prototype.doubleTapEnabled=!0;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;
mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=!0;mxGraph.prototype.tapAndHoldDelay=350;mxGraph.prototype.tapAndHoldInProgress=!1;mxGraph.prototype.tapAndHoldValid=!1;mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;
mxGraph.prototype.pageVisible=!1;mxGraph.prototype.pageBreaksVisible=!1;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=!0;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.maxPageBreaks=1E4;mxGraph.prototype.preferPageSize=!1;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=!0;mxGraph.prototype.escapeEnabled=!0;mxGraph.prototype.invokesStopCellEditing=!0;
mxGraph.prototype.enterStopsCellEditing=!1;mxGraph.prototype.useScrollbarsForPanning=!0;mxGraph.prototype.exportEnabled=!0;mxGraph.prototype.importEnabled=!0;mxGraph.prototype.cellsLocked=!1;mxGraph.prototype.cellsCloneable=!0;mxGraph.prototype.foldingEnabled=!0;mxGraph.prototype.cellsEditable=!0;mxGraph.prototype.cellsDeletable=!0;mxGraph.prototype.cellsMovable=!0;mxGraph.prototype.edgeLabelsMovable=!0;mxGraph.prototype.vertexLabelsMovable=!1;mxGraph.prototype.dropEnabled=!1;
mxGraph.prototype.splitEnabled=!0;mxGraph.prototype.cellsResizable=!0;mxGraph.prototype.cellsBendable=!0;mxGraph.prototype.cellsSelectable=!0;mxGraph.prototype.cellsDisconnectable=!0;mxGraph.prototype.autoSizeCells=!1;mxGraph.prototype.autoSizeCellsOnAdd=!1;mxGraph.prototype.autoScroll=!0;mxGraph.prototype.ignoreScrollbars=!1;mxGraph.prototype.translateToScrollPosition=!1;mxGraph.prototype.timerAutoScroll=!1;mxGraph.prototype.allowAutoPanning=!1;mxGraph.prototype.autoExtend=!0;
mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=!1;mxGraph.prototype.border=0;mxGraph.prototype.keepEdgesInForeground=!1;mxGraph.prototype.keepEdgesInBackground=!1;mxGraph.prototype.allowNegativeCoordinates=!0;mxGraph.prototype.constrainChildren=!0;mxGraph.prototype.constrainRelativeChildren=!1;mxGraph.prototype.extendParents=!0;
mxGraph.prototype.extendParentsOnAdd=!0;mxGraph.prototype.extendParentsOnMove=!1;mxGraph.prototype.contractParents=!1;mxGraph.prototype.contractParentsOnRemove=!0;mxGraph.prototype.contractParentsOnMove=!1;mxGraph.prototype.recursiveResize=!1;mxGraph.prototype.collapseToPreferredSize=!0;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=!1;mxGraph.prototype.centerZoom=!0;mxGraph.prototype.resetViewOnRootChange=!0;mxGraph.prototype.resetEdgesOnResize=!1;
mxGraph.prototype.resetEdgesOnMove=!1;mxGraph.prototype.resetEdgesOnConnect=!0;mxGraph.prototype.allowLoops=!1;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=!0;mxGraph.prototype.connectableEdges=!1;mxGraph.prototype.allowDanglingEdges=!0;mxGraph.prototype.cloneInvalidEdges=!1;mxGraph.prototype.disconnectOnMove=!0;mxGraph.prototype.labelsVisible=!0;mxGraph.prototype.htmlLabels=!1;mxGraph.prototype.swimlaneSelectionEnabled=!0;mxGraph.prototype.swimlaneNesting=!0;
mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0;mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);
mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"";mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"";
mxGraph.prototype.init=function(a){this.container=a;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(a,"mouseleave",mxUtils.bind(this,function(b){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=b.relatedTarget&&this.tooltipHandler.hide()}))};
mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(!1);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(!1);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=!1;this.popupMenuHandler=this.createPopupMenuHandler()};
mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)};
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
mxGraph.prototype.getSelectionCellsForChanges=function(a,b){for(var c=new mxDictionary,d=[],e=mxUtils.bind(this,function(h){if(null!=h&&!c.get(h)&&this.model.contains(h)&&!this.model.isLayer(h))if(this.model.isEdge(h)||this.model.isVertex(h))c.put(h,!0),d.push(h);else for(var k=this.model.getChildCount(h),l=0;l<k;l++)e(this.model.getChildAt(h,l))}),f=0;f<a.length;f++){var g=a[f];g.constructor==mxRootChange||null!=b&&b(g)||e(this.getCellForChange(g))}return d};
mxGraph.prototype.getCellForChange=function(a){var b=null;a instanceof mxChildChange?b=a.child:null!=a.cell&&a.cell instanceof mxCell&&(b=a.cell);return b};mxGraph.prototype.graphModelChanged=function(a){var b=this.view.invalidatedCells;this.view.invalidatedCells=new mxDictionary;try{for(var c=0;c<a.length;c++)this.processChange(a[c])}finally{this.view.invalidatedCells=b}this.updateSelection();this.view.validate();this.sizeDidChange()};
mxGraph.prototype.updateSelection=function(){for(var a=this.model,b=a.getRoot(),c=this.view.currentRoot,d=this.getSelectionCells(),e=new mxDictionary,f=new mxDictionary,g=[],h=function(n,p,q){for(var r=[],t=null;null==t;)t=null!=n?p.get(n):null,null==t&&(t=q(n),null!=n&&(r.push(n),n=a.getParent(n)));for(n=0;n<r.length;n++)p.put(r[n],t);return t},k=function(n){return null==n||n==b?n==b:null},l=mxUtils.bind(this,function(n){return null==n||n==c?!0:this.isCellCollapsed(n)||!this.isCellVisible(n)?!1:
null}),m=0;m<d.length;m++)h(d[m],e,k)&&this.isCellVisible(d[m])&&h(a.getParent(d[m]),f,l)||g.push(d[m]);this.removeSelectionCells(g)};
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.removeStateForCell(a.child),this.view.currentRoot==
a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&(null==a.previous.equals||!a.previous.equals(a.geometry)))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,this.view.isLabelPerimeter(this.view.getState(a.cell))):a instanceof
mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),null!=a&&(a.invalidStyle=!0)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell);null==this.getDefaultParent()||this.model.contains(this.getDefaultParent())||this.setDefaultParent(null)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
mxGraph.prototype.addCellOverlay=function(a,b){null==a.overlays&&(a.overlays=[]);a.overlays.push(b);var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",a,"overlay",b));return b};mxGraph.prototype.getCellOverlays=function(a){return a.overlays};
mxGraph.prototype.removeCellOverlay=function(a,b){if(null==b)this.removeCellOverlays(a);else{var c=mxUtils.indexOf(a.overlays,b);0<=c?(a.overlays.splice(c,1),0==a.overlays.length&&(a.overlays=null),c=this.view.getState(a),null!=c&&this.cellRenderer.redraw(c),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b))):b=null}return b};
mxGraph.prototype.removeCellOverlays=function(a){var b=a.overlays;if(null!=b){a.overlays=null;var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);for(c=0;c<b.length;c++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b[c]))}return b};mxGraph.prototype.clearCellOverlays=function(a){a=null!=a?a:this.model.getRoot();this.removeCellOverlays(a);for(var b=this.model.getChildCount(a),c=0;c<b;c++){var d=this.model.getChildAt(a,c);this.clearCellOverlays(d)}};
mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return c=null!=c?c:this.warningImage,b=new mxCellOverlay(c,"<font color=red>"+b+"</font>"),d&&b.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,f){this.isEnabled()&&this.setSelectionCell(a)})),this.addCellOverlay(a,b);this.removeCellOverlays(a);return null};mxGraph.prototype.startEditing=function(a,b){this.startEditingAtCell(null,a,b)};
mxGraph.prototype.startEditingAtCell=function(a,b,c){null!=b&&mxEvent.isMultiTouchEvent(b)||(null==a&&(a=this.getSelectionCell(),null==a||this.isCellEditable(a)||(a=null)),null!=a&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",a,"event",b)),this.cellEditor.startEditing(a,b,c),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",a,"event",b))))};mxGraph.prototype.getEditingValue=function(a,b){return this.convertValueToString(a)};
mxGraph.prototype.stopEditing=function(a){this.cellEditor.stopEditing(a);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",a))};mxGraph.prototype.labelChanged=function(a,b,c){this.model.beginUpdate();try{var d=a.value;this.cellLabelChanged(a,b,this.isAutoSizeCell(a));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",a,"value",b,"old",d,"event",c))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellLabelChanged=function(a,b,c){this.model.beginUpdate();try{this.model.setValue(a,b),c&&this.cellSizeUpdated(a,!1)}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(a){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",a))};
mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed()){if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(g){var h=this.isCellSelected(g.cell);e=e||h;return!e||h||g.cell!=c&&this.model.isAncestor(g.cell,c)}));null!=a&&(c=a)}}else if(this.isSwimlaneSelectionEnabled()&&
(c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY()),!(null==c||this.isToggleEvent(b)&&mxEvent.isAltDown(b)))){d=c;for(a=[];null!=d;){d=this.model.getParent(d);var f=this.view.getState(d);this.isSwimlane(d)&&null!=f&&a.push(d)}if(0<a.length)for(a=a.reverse(),a.splice(0,0,c),a.push(c),d=0;d<a.length-1;d++)this.isCellSelected(a[d])&&(c=a[this.isToggleEvent(b)?d:d+1])}null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()}};
mxGraph.prototype.isSiblingSelected=function(a){for(var b=this.model,c=b.getParent(a),d=b.getChildCount(c),e=0;e<d;e++){var f=b.getChildAt(c,e);if(a!=f&&this.isCellSelected(f))return!0}return!1};mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))};
mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled()&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=b,
this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))};
mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy));else{var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth-
a;f<d?(a=e.scrollLeft,e.scrollLeft+=d-f,c&&a==e.scrollLeft&&(a=this.view.getDrawPane().ownerSVGElement,a.style.width=this.container.scrollWidth+d-f+"px",e.scrollLeft+=d-f)):(f=a-e.scrollLeft,f<d&&(e.scrollLeft-=d-f));f=e.scrollTop+e.clientHeight-b;f<d?(a=e.scrollTop,e.scrollTop+=d-f,a==e.scrollTop&&c&&(a=this.view.getDrawPane().ownerSVGElement,a.style.height=this.container.scrollHeight+d-f+"px",e.scrollTop+=d-f)):(f=b-e.scrollTop,f<d&&(e.scrollTop-=d-f))}}};
mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)};
mxGraph.prototype.getBorderSizes=function(){var a=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(a.paddingLeft)+("none"!=a.borderLeftStyle?mxUtils.parseCssNumber(a.borderLeftWidth):0),mxUtils.parseCssNumber(a.paddingTop)+("none"!=a.borderTopStyle?mxUtils.parseCssNumber(a.borderTopWidth):0),mxUtils.parseCssNumber(a.paddingRight)+("none"!=a.borderRightStyle?mxUtils.parseCssNumber(a.borderRightWidth):0),mxUtils.parseCssNumber(a.paddingBottom)+("none"!=a.borderBottomStyle?
mxUtils.parseCssNumber(a.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(a,b,c){a=this.view.translate;var d=this.pageFormat,e=this.pageScale;d=new mxRectangle(0,0,Math.ceil(d.width*e),Math.ceil(d.height*e));return new mxRectangle(0,0,(this.pageBreaksVisible?Math.ceil(b/d.width):1)*d.width+2+a.x,(this.pageBreaksVisible?Math.ceil(c/d.height):1)*d.height+2+a.y)};
mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a?a:this.getBorder();b=null!=b?b:!1;c=null!=c?c:0;d=null!=d?d:!0;e=null!=e?e:!1;f=null!=f?f:!1;var h=this.getBorderSizes(),k=this.container.offsetWidth-h.x-h.width-1,l=null!=g?g:this.container.offsetHeight-h.y-h.height-1;g=this.getGraphBounds();if(0<g.width&&0<g.height){b&&null!=g.x&&null!=g.y&&(g=g.clone(),g.width+=g.x,g.height+=g.y,g.x=0,g.y=0);h=this.view.scale;var m=g.width/h,n=g.height/h;null!=this.backgroundImage&&
null!=this.backgroundImage.width&&null!=this.backgroundImage.height&&(m=Math.max(m,this.backgroundImage.width-g.x/h),n=Math.max(n,this.backgroundImage.height-g.y/h));var p=(b?a:2*a)+c+1;k-=p;l-=p;e=e?l/n:f?k/m:Math.min(k/m,l/n);if(!(0<e))return this.view.scale;null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),
null!=a.x&&(this.container.scrollLeft=a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,null!=g.x?Math.floor(this.view.translate.x-g.x/h+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/h+a/e+c/2):a);else return e}}return this.view.scale};mxGraph.prototype.containerMetrics=null;
mxGraph.prototype.getContainerMetrics=function(){var a=this.containerMetrics;null==a&&null!=this.container&&(a=this.container,a={offsetWidth:a.offsetWidth,offsetHeight:a.offsetHeight,clientWidth:a.clientWidth,clientHeight:a.clientHeight,scrollLeft:a.scrollLeft,scrollTop:a.scrollTop,scrollbars:mxUtils.hasScrollbars(a)});return a};
mxGraph.prototype.updateContainerMetrics=function(a){var b=this.containerMetrics;null==b&&(this.containerMetrics=this.getContainerMetrics());try{a()}finally{this.containerMetrics=b}};
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x)+a.width+2*b;b=Math.max(0,a.y)+a.height+2*b;null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,b));null!=d&&(c=d.width*this.view.scale,b=
d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);d=this.view.getDrawPane().ownerSVGElement;null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};
mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e);d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(d.height/f.height)+1):0,h=a?Math.min(this.maxPageBreaks,Math.ceil(d.width/f.width)+1):0,k=(h-1)*f.width,l=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<h&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(m){if(null!=m){for(var n=m==this.horizontalPageBreaks?g:h,p=0;p<=n;p++){var q=m==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),
Math.round(f.y+p*f.height)),new mxPoint(Math.round(f.x+k),Math.round(f.y+p*f.height))]:[new mxPoint(Math.round(f.x+p*f.width),Math.round(f.y)),new mxPoint(Math.round(f.x+p*f.width),Math.round(f.y+l))];null!=m[p]&&null!=m[p].node?(m[p].points=q,m[p].redraw()):(null!=m[p]&&m[p].destroy(),q=new mxPolyline(q,this.pageBreakColor),q.dialect=this.dialect,q.pointerEvents=!1,q.isDashed=this.pageBreakDashed,q.init(this.view.backgroundPane),q.redraw(),m[p]=q)}for(p=n;p<m.length;p++)m[p].destroy();m.splice(n,
m.length-n)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};mxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};
mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};
mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=
a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};
mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};
mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};
mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};
mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/
2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/
2:a==mxConstants.ALIGN_RIGHT?f.x=c-e.x-f.width:a==mxConstants.ALIGN_TOP?f.y=c-e.y:a==mxConstants.ALIGN_MIDDLE?f.y=c-e.y-f.height/2:a==mxConstants.ALIGN_BOTTOM?f.y=c-e.y-f.height:f.x=c-e.x,this.resizeCell(b[d],f));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",a,"cells",b))}finally{this.model.endUpdate()}}}return b};
mxGraph.prototype.flipEdge=function(a){if(null!=a&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var b=this.model.getStyle(a);null==b||0==b.length?this.model.setStyle(a,this.alternateEdgeStyle):this.model.setStyle(a,null);this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",a))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.addImageBundle=function(a){this.imageBundles.push(a)};
mxGraph.prototype.removeImageBundle=function(a){for(var b=[],c=0;c<this.imageBundles.length;c++)this.imageBundles[c]!=a&&b.push(this.imageBundles[c]);this.imageBundles=b};mxGraph.prototype.getImageFromBundles=function(a){if(null!=a)for(var b=0;b<this.imageBundles.length;b++){var c=this.imageBundles[b].getImage(a);if(null!=c)return c}return null};
mxGraph.prototype.orderCells=function(a,b,c){null==b&&(b=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0));this.model.beginUpdate();try{this.cellsOrdered(b,a,c),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",a,"cells",b,"increment",c))}finally{this.model.endUpdate()}return b};
mxGraph.prototype.cellsOrdered=function(a,b,c){if(null!=a){this.model.beginUpdate();try{for(var d=0;d<a.length;d++){var e=this.model.getParent(a[d]);b?c?this.model.add(e,a[d],Math.max(0,e.getIndex(a[d])-1)):this.model.add(e,a[d],d):c?this.model.add(e,a[d],Math.min(this.model.getChildCount(e)-1,e.getIndex(a[d])+1)):this.model.add(e,a[d],this.model.getChildCount(e)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",b,"cells",a,"increment",c))}finally{this.model.endUpdate()}}};
mxGraph.prototype.groupCells=function(a,b,c){null==c&&(c=mxUtils.sortCells(this.getSelectionCells(),!0));c=this.getCellsForGroup(c);null==a&&(a=this.createGroupCell(c));var d=this.getBoundsForGroup(a,c,b);if(1<c.length&&null!=d){var e=this.model.getParent(a);null==e&&(e=this.model.getParent(c[0]));this.model.beginUpdate();try{null==this.getCellGeometry(a)&&this.model.setGeometry(a,new mxGeometry);this.cellsResized([a],[d],!1);var f=this.model.getChildCount(e);this.cellsAdded([a],e,f,null,null,!1,
!1,!1);f=this.model.getChildCount(a);this.cellsAdded(c,a,f,null,null,!1,!1,!1);this.cellsMoved(c,-d.x,-d.y,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",a,"border",b,"cells",c))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.getCellsForGroup=function(a){var b=[];if(null!=a&&0<a.length){var c=this.model.getParent(a[0]);b.push(a[0]);for(var d=1;d<a.length;d++)this.model.getParent(a[d])==c&&b.push(a[d])}return b};
mxGraph.prototype.getBoundsForGroup=function(a,b,c){b=this.getBoundingBoxFromGeometry(b,!0);null!=b&&(this.isSwimlane(a)&&(a=this.getStartSize(a),b.x-=a.width,b.y-=a.height,b.width+=a.width,b.height+=a.height),null!=c&&(b.x-=c,b.y-=c,b.width+=2*c,b.height+=2*c));return b};mxGraph.prototype.createGroupCell=function(a){a=new mxCell("");a.setVertex(!0);a.setConnectable(!1);return a};
mxGraph.prototype.ungroupCells=function(a){var b=[];null==a&&(a=this.getCellsForUngroup());if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++){var d=this.model.getChildren(a[c]);if(null!=d&&0<d.length){d=d.slice();var e=this.model.getParent(a[c]),f=this.model.getChildCount(e);this.cellsAdded(d,e,f,null,null,!0);b=b.concat(d);for(var g=0;g<d.length;g++)if(this.model.isVertex(d[g])){var h=this.view.getState(d[g]),k=this.getCellGeometry(d[g]);null!=h&&null!=k&&k.relative&&
(k=k.clone(),k.x=h.origin.x,k.y=h.origin.y,k.relative=!1,this.model.setGeometry(d[g],k))}}}this.removeCellsAfterUngroup(a);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",a))}finally{this.model.endUpdate()}}return b};mxGraph.prototype.getCellsForUngroup=function(){for(var a=this.getEditableCells(this.getSelectionCells()),b=[],c=0;c<a.length;c++)this.model.isVertex(a[c])&&0<this.model.getChildCount(a[c])&&b.push(a[c]);return b};mxGraph.prototype.removeCellsAfterUngroup=function(a){this.cellsRemoved(this.addAllEdges(a))};
mxGraph.prototype.removeCellsFromParent=function(a){null==a&&(a=this.getSelectionCells());this.model.beginUpdate();try{var b=this.getDefaultParent(),c=this.model.getChildCount(b);this.cellsAdded(a,b,c,null,null,!0);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",a))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.updateGroupBounds=function(a,b,c,d,e,f,g){null==a&&(a=this.getSelectionCells());b=null!=b?b:0;c=null!=c?c:!1;d=null!=d?d:0;e=null!=e?e:0;f=null!=f?f:0;g=null!=g?g:0;this.model.beginUpdate();try{for(var h=a.length-1;0<=h;h--){var k=this.getCellGeometry(a[h]);if(null!=k){var l=this.getChildCells(a[h]);if(null!=l&&0<l.length){var m=this.getBoundingBoxFromGeometry(l,!0);if(null!=m&&0<m.width&&0<m.height){var n=this.isSwimlane(a[h])?this.getActualStartSize(a[h],!0):new mxRectangle,p=
this.getActualFooterSize(a[h],!0);k=k.clone();c&&(k.x=Math.round(k.x+m.x-b-n.x-g-p.x),k.y=Math.round(k.y+m.y-b-n.y-d-p.y));k.width=Math.round(m.width+2*b+n.x+g+e+n.width+p.x+p.width);k.height=Math.round(m.height+2*b+n.y+d+f+n.height+p.y+p.height);this.model.setGeometry(a[h],k);this.moveCells(l,b+n.x-m.x+g+p.x,b+n.y-m.y+d+p.y)}}}}}finally{this.model.endUpdate()}return a};
mxGraph.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=0;c<a.length;c++)if(this.model.isVertex(a[c])||this.model.isEdge(a[c])){var d=this.view.getBoundingBox(this.view.getState(a[c]),!0);null!=d&&(null==b?b=mxRectangle.fromRectangle(d):b.add(d))}return b};mxGraph.prototype.cloneCell=function(a,b,c,d){return this.cloneCells([a],b,c,d)[0]};
mxGraph.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;var e=null;if(null!=a){var f=new mxDictionary;e=[];for(var g=0;g<a.length;g++)f.put(a[g],!0),e.push(a[g]);if(0<e.length){var h=this.view.scale,k=this.view.translate;e=this.model.cloneCells(a,!0,c);for(g=0;g<a.length;g++)if(!b&&this.model.isEdge(e[g])&&null!=this.getEdgeValidationError(e[g],this.model.getTerminal(e[g],!0),this.model.getTerminal(e[g],!1)))e[g]=null;else{var l=this.model.getGeometry(e[g]);if(null!=l){var m=this.view.getState(a[g]),
n=this.view.getState(this.model.getParent(a[g]));if(null!=m&&null!=n)if(c=n.origin.x,n=n.origin.y,this.model.isEdge(e[g])){if(m=m.absolutePoints,null!=m){var p=this.model.getTerminal(a[g],!0);if(null!=p){for(;null!=p&&!f.get(p);)p=this.model.getParent(p);null==p&&null!=m[0]&&l.setTerminalPoint(new mxPoint(Math.round(m[0].x/h-k.x-c),Math.round(m[0].y/h-k.y-n)),!0)}d||(p=l.getTerminalPoint(!0),null!=p&&(p.x+=c,p.y+=n));p=this.model.getTerminal(a[g],!1);if(null!=p){for(;null!=p&&!f.get(p);)p=this.model.getParent(p);
var q=m.length-1;null==p&&null!=m[q]&&l.setTerminalPoint(new mxPoint(Math.round(m[q].x/h-k.x-c),Math.round(m[q].y/h-k.y-n)),!1)}d||(p=l.getTerminalPoint(!1),null!=p&&(p.x+=c,p.y+=n));l=l.points;if(!d&&null!=l)for(m=0;m<l.length;m++)null!=l[m]&&(l[m].x+=c,l[m].y+=n)}}else d||l.translate(c,n)}}}else e=[]}return e};mxGraph.prototype.insertVertex=function(a,b,c,d,e,f,g,h,k){b=this.createVertex(a,b,c,d,e,f,g,h,k);return this.addCell(b,a)};
mxGraph.prototype.createVertex=function(a,b,c,d,e,f,g,h,k){a=new mxGeometry(d,e,f,g);a.relative=null!=k?k:!1;c=new mxCell(c,a,h);c.setId(b);c.setVertex(!0);c.setConnectable(!0);return c};mxGraph.prototype.insertEdge=function(a,b,c,d,e,f){b=this.createEdge(a,b,c,d,e,f);return this.addEdge(b,a,d,e)};mxGraph.prototype.createEdge=function(a,b,c,d,e,f){a=new mxCell(c,new mxGeometry,f);a.setId(b);a.setEdge(!0);a.geometry.relative=!0;return a};
mxGraph.prototype.addEdge=function(a,b,c,d,e){return this.addCell(a,b,e,c,d)};mxGraph.prototype.addCell=function(a,b,c,d,e){return this.addCells([a],b,c,d,e)[0]};mxGraph.prototype.addCells=function(a,b,c,d,e,f){null==b&&(b=this.getDefaultParent());null==c&&(c=this.model.getChildCount(b));this.model.beginUpdate();try{this.cellsAdded(a,b,c,d,e,null!=f?f:!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",a,"parent",b,"index",c,"source",d,"target",e))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,h){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{var k=f?this.view.getState(b):null,l=null!=k?k.origin:null,m=new mxPoint(0,0);for(k=0;k<a.length;k++)if(null==a[k])c--;else{var n=this.model.getParent(a[k]);if(null!=l&&a[k]!=b&&b!=n){var p=this.view.getState(n),q=null!=p?p.origin:m,r=this.model.getGeometry(a[k]);if(null!=r){var t=q.x-l.x,v=q.y-l.y;r=r.clone();r.translate(t,v,this.model.isEdge(a[k]));r.relative||!this.model.isVertex(a[k])||
this.isAllowNegativeCoordinates()||(r.x=Math.max(0,r.x),r.y=Math.max(0,r.y));this.model.setGeometry(a[k],r)}}b==n&&c+k>this.model.getChildCount(b)&&c--;var u=this.model.updateEdgeParent;this.model.updateEdgeParent=function(x,y){0>mxUtils.indexOf(a,x)&&u.apply(this,arguments)};this.model.add(b,a[k],c+k);this.model.updateEdgeParent=u;this.autoSizeCellsOnAdd&&this.autoSizeCell(a[k],!0);(null==h||h)&&this.isExtendParentsOnAdd(a[k])&&this.isExtendParent(a[k])&&this.extendParent(a[k]);(null==g||g)&&this.constrainChild(a[k]);
null!=d&&this.cellConnected(a[k],d,!0);null!=e&&this.cellConnected(a[k],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source",d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1){b=this.model.getChildCount(a);for(var c=0;c<b;c++)this.autoSizeCell(this.model.getChildAt(a,c))}this.getModel().isVertex(a)&&this.isAutoSizeCell(a)&&this.updateCellSize(a)};
mxGraph.prototype.removeCells=function(a,b){b=null!=b?b:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));if(b)a=this.getDeletableCells(this.addAllEdges(a));else{a=a.slice();for(var c=this.getDeletableCells(this.getAllEdges(a)),d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<c.length;e++)null!=this.view.getState(c[e])||d.get(c[e])||(d.put(c[e],!0),a.push(c[e]))}this.model.beginUpdate();try{this.cellsRemoved(a),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",
a,"includeEdges",b))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsRemoved=function(a){if(null!=a&&0<a.length){var b=this.view.scale,c=this.view.translate;this.model.beginUpdate();try{for(var d=new mxDictionary,e=mxUtils.bind(this,function(n){var p=0,q=0;for(n=this.model.getParent(n);null!=n;){var r=this.model.getGeometry(n);null==r||r.relative||this.model.isEdge(n)||(p+=r.x,q+=r.y);n=this.model.getParent(n)}return new mxPoint(p,q)}),f=0;f<a.length;f++)d.put(a[f],!0);var g=null;if(this.isContractParentsOnRemove()){g=[];var h=new mxDictionary;
for(f=0;f<a.length;f++){var k=this.model.getParent(a[f]);null==k||d.get(k)||h.get(k)||!this.isContractParent(a[f])||(h.put(k,!0),g.push(k))}}for(f=0;f<a.length;f++){var l=this.getAllEdges([a[f]]),m=mxUtils.bind(this,function(n,p){var q=this.model.getGeometry(n);if(null!=q){for(var r=this.model.getTerminal(n,p),t=!1,v=r;null!=v;){if(a[f]==v){t=!0;break}v=this.model.getParent(v)}if(t){q=q.clone();if(null!=q.setTerminalPoint)if(t=this.view.getState(n),null!=t&&null!=t.absolutePoints)r=t.absolutePoints,
v=p?0:r.length-1,q.setTerminalPoint(new mxPoint(r[v].x/b-c.x-t.origin.x,r[v].y/b-c.y-t.origin.y),p);else if(v=this.view.getState(r),null!=v)t=e(n),q.setTerminalPoint(new mxPoint(v.getCenterX()/b-c.x-t.x,v.getCenterY()/b-c.y-t.y),p);else if(v=this.model.getGeometry(r),t=e(n),null==v||v.relative||this.model.isEdge(r)){v=this.model.getParent(r);for(r=null;null!=v;){r=this.model.getGeometry(v);if(null!=r&&!r.relative&&!this.model.isEdge(v))break;r=null;v=this.model.getParent(v)}null!=r?(v=e(v),q.setTerminalPoint(new mxPoint(v.x+
r.x+r.width/2-t.x,v.y+r.y+r.height/2-t.y),p)):(t=this.model.getGeometry(n),q.setTerminalPoint(new mxPoint((null!=t?t.x:0)+(p?-60:60),null!=t?t.y:0),p))}else r=e(r),q.setTerminalPoint(new mxPoint(r.x+v.x+v.width/2-t.x,r.y+v.y+v.height/2-t.y),p);this.model.setGeometry(n,q);this.model.setTerminal(n,null,p)}}});for(h=0;h<l.length;h++)d.get(l[h])||(d.put(l[h],!0),m(l[h],!0),m(l[h],!1));this.model.remove(a[f])}if(null!=g)for(f=0;f<g.length;f++)0<this.model.getChildCount(g[f])&&this.contractParent(this.model.getChildAt(g[f],
0));this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",a))}finally{this.model.endUpdate()}}};
mxGraph.prototype.splitEdge=function(a,b,c,d,e,f,g,h){d=d||0;e=e||0;h=null!=h?h:this.model.getParent(a);var k=this.model.getTerminal(a,!0);this.model.beginUpdate();try{if(null==c){c=this.cloneCell(a);var l=this.view.getState(a),m=this.getCellGeometry(c);if(null!=m&&null!=m.points&&null!=l){var n=this.view.translate,p=this.view.scale,q=null!=f&&null!=g?mxUtils.findNearestSegment(l,f,g):mxUtils.findNearestSegment(l,(d+n.x)*p,(e+n.y)*p);m.points=m.points.slice(0,q);m=this.getCellGeometry(a);null!=m&&
null!=m.points&&(m=m.clone(),m.points=m.points.slice(q),this.model.setGeometry(a,m))}}this.cellsMoved(b,d,e,!1,!1);this.cellsAdded([c],h,this.model.getChildCount(h),k,b[0],!1);this.cellsAdded(b,h,this.model.getChildCount(h),null,null,!0);this.cellConnected(a,b[0],!0);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",a,"cells",b,"newEdge",c,"dx",d,"dy",e))}finally{this.model.endUpdate()}return c};
mxGraph.prototype.toggleCells=function(a,b,c){null==b&&(b=this.getSelectionCells());c&&(b=this.addAllEdges(b));this.model.beginUpdate();try{this.cellsToggled(b,a),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",a,"cells",b,"includeEdges",c))}finally{this.model.endUpdate()}return b};mxGraph.prototype.cellsToggled=function(a,b){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}}};
mxGraph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing(!1);this.model.beginUpdate();try{this.cellsFolded(c,a,b,d),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",a,"recurse",b,"cells",c))}finally{this.model.endUpdate()}return c};
mxGraph.prototype.cellsFolded=function(a,b,c,d){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)if((!d||this.isCellFoldable(a[e],b))&&b!=this.isCellCollapsed(a[e])){this.model.setCollapsed(a[e],b);this.swapBounds(a[e],b);this.isExtendParent(a[e])&&this.extendParent(a[e]);this.isContractParent(a[e])&&this.contractParent(a[e]);if(c){var f=this.model.getChildren(a[e]);this.cellsFolded(f,b,c)}this.constrainChild(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,
"cells",a,"collapse",b,"recurse",c))}finally{this.model.endUpdate()}}};mxGraph.prototype.swapBounds=function(a,b){if(null!=a){var c=this.model.getGeometry(a);null!=c&&(c=c.clone(),this.updateAlternateBounds(a,c,b),c.swap(),this.model.setGeometry(a,c))}};
mxGraph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b){c=this.getCurrentCellStyle(a);if(null==b.alternateBounds){var d=b;if(this.collapseToPreferredSize){var e="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled?"1":"0");a=this.getPreferredSizeForCell(a,null,e);null!=a&&(d=a,a=mxUtils.getValue(c,mxConstants.STYLE_STARTSIZE),0<a&&(d.height=Math.max(d.height,a)))}b.alternateBounds=new mxRectangle(0,0,d.width,d.height)}null!=b.alternateBounds&&(b.alternateBounds.x=
b.x,b.alternateBounds.y=b.y,e=mxUtils.toRadians(c[mxConstants.STYLE_ROTATION]||0),0!=e&&(c=b.alternateBounds.getCenterX()-b.getCenterX(),d=b.alternateBounds.getCenterY()-b.getCenterY(),a=Math.cos(e),e=Math.sin(e),b.alternateBounds.x+=a*c-e*d-c,b.alternateBounds.y+=e*c+a*d-d))}};mxGraph.prototype.addAllEdges=function(a){var b=a.slice();return mxUtils.removeDuplicates(b.concat(this.getAllEdges(a)))};
mxGraph.prototype.getAllEdges=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++){for(var d=this.model.getEdgeCount(a[c]),e=0;e<d;e++)b.push(this.model.getEdgeAt(a[c],e));d=this.model.getChildren(a[c]);b=b.concat(this.getAllEdges(d))}return b};mxGraph.prototype.updateCellSize=function(a,b){b=null!=b?b:!1;this.model.beginUpdate();try{this.cellSizeUpdated(a,b),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",a,"ignoreChildren",b))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellSizeUpdated=function(a,b){if(null!=a){this.model.beginUpdate();try{var c=this.getCellStyle(a),d=this.model.getGeometry(a);if(null!=d){var e=null,f=mxUtils.getValue(c,mxConstants.STYLE_FIXED_WIDTH,!1);f&&(e=d.width-2*parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING,2))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_LEFT,0))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_RIGHT,0)));var g="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled?
"1":"0"),h=this.getPreferredSizeForCell(a,e,g);if(null!=h){var k=this.isCellCollapsed(a);d=d.clone();if(this.isSwimlane(a)){var l=this.model.getStyle(a);null==l&&(l="");mxUtils.getValue(c,mxConstants.STYLE_HORIZONTAL,!0)?(l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,h.height+8),k&&(d.height=h.height+8),f||(d.width=h.width)):(l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,h.width+8),k&&!f&&(d.width=h.width+8),d.height=h.height);this.model.setStyle(a,l)}else{var m=this.view.createState(a),n=m.style[mxConstants.STYLE_ALIGN]||
mxConstants.ALIGN_CENTER,p=this.getVerticalAlign(m);"fixed"==m.style[mxConstants.STYLE_ASPECT]&&(h.height=Math.round(d.height*h.width*100/d.width)/100);p==mxConstants.ALIGN_BOTTOM?d.y+=d.height-h.height:p==mxConstants.ALIGN_MIDDLE&&(d.y+=Math.round((d.height-h.height)/2));d.height=h.height;f||(n==mxConstants.ALIGN_RIGHT?d.x+=d.width-h.width:n==mxConstants.ALIGN_CENTER&&(d.x+=Math.round((d.width-h.width)/2)),d.width=h.width)}if(!b&&!k){var q=this.view.getBounds(this.model.getChildren(a));if(null!=
q){var r=this.view.translate,t=this.view.scale,v=(q.x+q.width)/t-d.x-r.x;d.height=Math.max(d.height,(q.y+q.height)/t-d.y-r.y);f||(d.width=Math.max(d.width,v))}}this.cellsResized([a],[d],!1)}}}finally{this.model.endUpdate()}}};
mxGraph.prototype.getPreferredSizeForCell=function(a,b,c){c=null!=c?c:this.gridEnabled;var d=null;if(null!=a){var e=this.view.createState(a),f=e.style;if(!this.model.isEdge(a)){var g=f[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;a=d=0;null==this.getImage(e)&&null==f[mxConstants.STYLE_IMAGE]||f[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(f[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),
f[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));d+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_LEFT,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_RIGHT,2));a+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_TOP,2));a+=parseFloat(mxUtils.getValue(f,
mxConstants.STYLE_SPACING_BOTTOM,2));var h=this.getFoldingImage(e);null!=h&&(d+=h.width+8);h=this.cellRenderer.getLabelValue(e);null!=h&&0<h.length?(this.isHtmlLabel(e.cell)?null!=b&&(b+=mxSvgCanvas2D.prototype.foreignObjectPadding):h=mxUtils.htmlEntities(h,!1),h=h.replace(/\n/g,"<br>"),e=mxUtils.getSizeForString(h,g,f[mxConstants.STYLE_FONTFAMILY],b,f[mxConstants.STYLE_FONTSTYLE]),b=e.width+d,e=e.height+a,mxUtils.getValue(f,mxConstants.STYLE_HORIZONTAL,!0)||(f=e,e=b,b=f),c&&(b=this.snap(b+this.gridSize/
2),e=this.snap(e+this.gridSize/2)),d=new mxRectangle(0,0,b,e)):(c=4*this.gridSize,d=new mxRectangle(0,0,c,c))}}return d};mxGraph.prototype.resizeCell=function(a,b,c){return this.resizeCells([a],[b],c)[0]};mxGraph.prototype.resizeCells=function(a,b,c){c=null!=c?c:this.isRecursiveResize();this.model.beginUpdate();try{var d=this.cellsResized(a,b,c);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellsResized=function(a,b,c){c=null!=c?c:!1;var d=[];if(null!=a&&null!=b&&a.length==b.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)d.push(this.cellResized(a[e],b[e],!1,c)),this.isExtendParent(a[e])&&this.extendParent(a[e]),this.isContractParent(a[e])&&this.contractParent(a[e]),this.constrainChild(a[e]);this.resetEdgesOnResize&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}}return d};
mxGraph.prototype.cellResized=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e&&(e.x!=b.x||e.y!=b.y||e.width!=b.width||e.height!=b.height)){var f=e.clone();!c&&f.relative?(c=f.offset,null!=c&&(c.x+=b.x-f.x,c.y+=b.y-f.y)):(f.x=b.x,f.y=b.y);f.width=b.width;f.height=b.height;f.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(f.x=Math.max(0,f.x),f.y=Math.max(0,f.y));this.model.beginUpdate();try{d&&this.resizeChildCells(a,f),this.model.setGeometry(a,f),this.isCellCollapsed(a)||
this.constrainChildCells(a)}finally{this.model.endUpdate()}}return e};mxGraph.prototype.resizeChildCells=function(a,b){var c=this.model.getGeometry(a),d=0!=c.width?b.width/c.width:1;b=0!=c.height?b.height/c.height:1;c=this.model.getChildCount(a);for(var e=0;e<c;e++)this.scaleCell(this.model.getChildAt(a,e),d,b,!0)};mxGraph.prototype.constrainChildCells=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.constrainChild(this.model.getChildAt(a,c))};
mxGraph.prototype.scaleCell=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e){var f=this.getCurrentCellStyle(a);e=e.clone();var g=e.x,h=e.y,k=e.width,l=e.height;e.scale(b,c,"fixed"==f[mxConstants.STYLE_ASPECT]);"1"==f[mxConstants.STYLE_RESIZE_WIDTH]?e.width=k*b:"0"==f[mxConstants.STYLE_RESIZE_WIDTH]&&(e.width=k);"1"==f[mxConstants.STYLE_RESIZE_HEIGHT]?e.height=l*c:"0"==f[mxConstants.STYLE_RESIZE_HEIGHT]&&(e.height=l);this.isCellMovable(a)||(e.x=g,e.y=h);this.isCellResizable(a)||(e.width=
k,e.height=l);this.model.isVertex(a)?this.cellResized(a,e,!0,d):this.model.setGeometry(a,e)}};
mxGraph.prototype.extendParent=function(a){if(null!=a){var b=this.model.getParent(a),c=this.getCellGeometry(b);if(null!=b&&null!=c&&!this.isCellCollapsed(b)){var d=this.getCellGeometry(a);if(null!=d&&!d.relative){var e=this.getCurrentCellStyle(b);e=mxUtils.parsePadding(mxUtils.getValue(e,mxConstants.STYLE_GROUP_PADDING,0));a=this.getChildExtent(a,d);if(c.width<a.x+e.e||c.height<a.y+e.s)c=c.clone(),c.width=Math.max(c.width,a.x+e.e),c.height=Math.max(c.height,a.y+e.s),this.cellsResized([b],[c],!1)}}}};
mxGraph.prototype.getChildExtent=function(a,b){a=parseFloat(mxUtils.getValue(this.getCurrentCellStyle(a),mxConstants.STYLE_ROTATION,0));return isFinite(a)&&0!=a%360?(b=mxUtils.getBoundingBox(new mxRectangle(b.x,b.y,b.width,b.height),a),new mxPoint(Math.round(100*(b.x+b.width))/100,Math.round(100*(b.y+b.height))/100)):new mxPoint(b.x+b.width,b.y+b.height)};
mxGraph.prototype.contractParent=function(a){if(null!=a){a=this.model.getParent(a);var b=this.getCellGeometry(a);if(null!=a&&null!=b&&!this.isCellCollapsed(a)){var c=this.getCurrentCellStyle(a);c=mxUtils.parsePadding(mxUtils.getValue(c,mxConstants.STYLE_GROUP_PADDING,0));for(var d=0,e=0,f=this.model.getChildCount(a),g=0;g<f;g++){var h=this.model.getChildAt(a,g),k=this.getCellGeometry(h);null!=k&&!k.relative&&this.model.isVertex(h)&&(h=this.getChildExtent(h,k),d=Math.max(d,h.x),e=Math.max(e,h.y))}d+=
c.e;e+=c.s;0<d&&0<e&&(b.width>d||b.height>e)&&(b=b.clone(),b.width=Math.min(b.width,d),b.height=Math.min(b.height,e),this.model.setGeometry(a,b),this.isContractParent(a)&&this.contractParent(a))}}};mxGraph.prototype.importCells=function(a,b,c,d,e,f){return this.moveCells(a,b,c,!0,d,e,f)};
mxGraph.prototype.moveCells=function(a,b,c,d,e,f,g){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:!1;if(null!=a&&(0!=b||0!=c||d||null!=e)){var h=a=this.model.getTopmostCells(a);this.model.beginUpdate();try{for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);var m=mxUtils.bind(this,function(v){for(;null!=v;){if(k.get(v))return!0;v=this.model.getParent(v)}return!1}),n=[];for(l=0;l<a.length;l++){var p=this.getCellGeometry(a[l]),q=this.model.getParent(a[l]);null!=p&&p.relative&&this.model.isEdge(q)&&
(m(this.model.getTerminal(q,!0))||m(this.model.getTerminal(q,!1)))||n.push(a[l])}a=n;d&&(a=this.cloneCells(a,this.isCloneInvalidEdges(),g),null==e&&(e=this.getDefaultParent()));var r=this.isAllowNegativeCoordinates();null!=e&&this.setAllowNegativeCoordinates(!0);this.cellsMoved(a,b,c,!d&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==e,this.isExtendParentsOnMove()&&null==e);this.setAllowNegativeCoordinates(r);if(null!=e){var t=this.model.getChildCount(e);this.cellsAdded(a,e,t,null,null,
!0);if(d)for(l=0;l<a.length;l++)p=this.getCellGeometry(a[l]),q=this.model.getParent(h[l]),null!=p&&p.relative&&this.model.isEdge(q)&&this.model.contains(q)&&this.model.add(q,a[l])}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",a,"dx",b,"dy",c,"clone",d,"target",e,"event",f))}finally{this.model.endUpdate()}}return a};
mxGraph.prototype.cellsMoved=function(a,b,c,d,e,f){if(null!=a&&(0!=b||0!=c)){f=null!=f?f:!1;this.model.beginUpdate();try{d&&this.disconnectGraph(a);for(var g=0;g<a.length;g++)this.translateCell(a[g],b,c),f&&this.isExtendParent(a[g])?this.extendParent(a[g]):e&&this.constrainChild(a[g]),this.isContractParentsOnMove()&&this.isContractParent(a[g])&&this.contractParent(a[g]);this.resetEdgesOnMove&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",a,"dx",b,"dy",c,"disconnect",
d))}finally{this.model.endUpdate()}}};
mxGraph.prototype.translateCell=function(a,b,c){var d=this.model.getGeometry(a);if(null!=d&&"function"===typeof d.translate){b=parseFloat(b);c=parseFloat(c);d=d.clone();d.translate(b,c,this.model.isEdge(a));d.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(d.x=Math.max(0,parseFloat(d.x)),d.y=Math.max(0,parseFloat(d.y)));if(d.relative&&!this.model.isEdge(a)){var e=this.model.getParent(a),f=0;this.model.isVertex(e)&&(e=this.getCurrentCellStyle(e),f=mxUtils.getValue(e,mxConstants.STYLE_ROTATION,
0));0!=f&&(f=mxUtils.toRadians(-f),e=Math.cos(f),f=Math.sin(f),c=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,new mxPoint(0,0)),b=c.x,c=c.y);null==d.offset?d.offset=new mxPoint(Math.round(b),Math.round(c)):(d.offset.x=Math.round(parseFloat(d.offset.x+b)),d.offset.y=Math.round(parseFloat(d.offset.y+c)))}this.model.setGeometry(a,d)}};
mxGraph.prototype.getCellContainmentArea=function(a){if(null!=a&&!this.model.isEdge(a)){var b=this.model.getParent(a);if(null!=b&&b!=this.getDefaultParent()){var c=this.model.getGeometry(b);if(null!=c){var d=a=0,e=c.width;c=c.height;if(this.isSwimlane(b)){var f=this.getStartSize(b),g=this.getCurrentCellStyle(b);b=mxUtils.getValue(g,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var h=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0);g=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0);if(b==
mxConstants.DIRECTION_SOUTH||b==mxConstants.DIRECTION_NORTH){var k=f.width;f.width=f.height;f.height=k}if(b==mxConstants.DIRECTION_EAST&&!g||b==mxConstants.DIRECTION_NORTH&&!h||b==mxConstants.DIRECTION_WEST&&g||b==mxConstants.DIRECTION_SOUTH&&h)a=f.width,d=f.height;e-=f.width;c-=f.height}return new mxRectangle(a,d,e,c)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds};
mxGraph.prototype.constrainChild=function(a,b){if(null!=a&&(b=this.getCellGeometry(a),null!=b&&(this.isConstrainRelativeChildren()||!b.relative))){var c=this.model.getParent(a);this.getCellGeometry(c);var d=this.getMaximumGraphBounds();null!=d&&(c=this.getBoundingBoxFromGeometry([c],!1),null!=c&&(d=mxRectangle.fromRectangle(d),d.x-=c.x,d.y-=c.y));if(this.isConstrainChild(a)&&(c=this.getCellContainmentArea(a),null!=c)){var e=this.getOverlap(a);0<e&&(c=mxRectangle.fromRectangle(c),c.x-=c.width*e,c.y-=
c.height*e,c.width+=2*c.width*e,c.height+=2*c.height*e);null==d?d=c:(d=mxRectangle.fromRectangle(d),d.intersect(c))}if(null!=d){c=[a];if(!this.isCellCollapsed(a)){e=this.model.getDescendants(a);for(var f=0;f<e.length;f++)this.isCellVisible(e[f])&&c.push(e[f])}c=this.getBoundingBoxFromGeometry(c,!1);if(null!=c){b=b.clone();e=0;b.width>d.width&&(e=b.width-d.width,b.width-=e);c.x+c.width>d.x+d.width&&(e-=c.x+c.width-d.x-d.width-e);f=0;b.height>d.height&&(f=b.height-d.height,b.height-=f);c.y+c.height>
d.y+d.height&&(f-=c.y+c.height-d.y-d.height-f);c.x<d.x&&(e-=c.x-d.x);c.y<d.y&&(f-=c.y-d.y);if(0!=e||0!=f)b.relative?(null==b.offset&&(b.offset=new mxPoint),b.offset.x+=e,b.offset.y+=f):(b.x+=e,b.y+=f);this.model.setGeometry(a,b)}}}};
mxGraph.prototype.resetEdges=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);this.model.beginUpdate();try{for(c=0;c<a.length;c++){var d=this.model.getEdges(a[c]);if(null!=d)for(var e=0;e<d.length;e++){var f=this.view.getState(d[e]),g=null!=f?f.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[e],!0),h=null!=f?f.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[e],!1);b.get(g)&&b.get(h)||this.resetEdge(d[e])}this.resetEdges(this.model.getChildren(a[c]))}}finally{this.model.endUpdate()}}};
mxGraph.prototype.resetEdge=function(a){var b=this.model.getGeometry(a);null!=b&&null!=b.points&&0<b.points.length&&(b=b.clone(),b.points=[],this.model.setGeometry(a,b));return a};
mxGraph.prototype.getOutlineConstraint=function(a,b,c){if(null!=b.shape){c=this.view.getPerimeterBounds(b);var d=b.style[mxConstants.STYLE_DIRECTION];if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){c.x+=c.width/2-c.height/2;c.y+=c.height/2-c.width/2;var e=c.width;c.width=c.height;c.height=e}var f=mxUtils.toRadians(b.shape.getShapeRotation());if(0!=f){e=Math.cos(-f);f=Math.sin(-f);var g=new mxPoint(c.getCenterX(),c.getCenterY());a=mxUtils.getRotatedPoint(a,e,f,g)}g=f=1;var h=0,k=
0;if(this.getModel().isVertex(b.cell)){var l=b.style[mxConstants.STYLE_FLIPH],m=b.style[mxConstants.STYLE_FLIPV];null!=b.shape&&null!=b.shape.stencil&&(l=1==mxUtils.getValue(b.style,"stencilFlipH",0)||l,m=1==mxUtils.getValue(b.style,"stencilFlipV",0)||m);if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH)e=l,l=m,m=e;l&&(f=-1,h=-c.width);m&&(g=-1,k=-c.height)}a=new mxPoint((a.x-c.x)*f-h+c.x,(a.y-c.y)*g-k+c.y);return new mxConnectionConstraint(new mxPoint(0==c.width?0:Math.round(1E3*
(a.x-c.x)/c.width)/1E3,0==c.height?0:Math.round(1E3*(a.y-c.y)/c.height)/1E3),!1)}return null};mxGraph.prototype.getAllConnectionConstraints=function(a,b){return null!=a&&null!=a.shape&&null!=a.shape.stencil?a.shape.stencil.constraints:null};
mxGraph.prototype.getConnectionConstraint=function(a,b,c){b=null;var d=a.style[c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=d){var e=a.style[c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=e&&(b=new mxPoint(parseFloat(d),parseFloat(e)))}d=!1;var f=e=0;null!=b&&(d=mxUtils.getValue(a.style,c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),e=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),f=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DY:
mxConstants.STYLE_ENTRY_DY]),e=isFinite(e)?e:0,f=isFinite(f)?f:0);return new mxConnectionConstraint(b,d,null,e,f)};
mxGraph.prototype.setConnectionConstraint=function(a,b,c,d){if(null!=d){this.model.beginUpdate();try{null==d||null==d.point?(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:
mxConstants.STYLE_ENTRY_PERIMETER,null,[a])):null!=d.point&&(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d.point.x,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,d.point.y,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,d.dx,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,d.dy,[a]),d.perimeter?this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,
null,[a]):this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[a]))}finally{this.model.endUpdate()}}};
mxGraph.prototype.getConnectionPoint=function(a,b,c){c=null!=c?c:!0;var d=null;if(null!=a&&null!=b.point){var e=this.view.getPerimeterBounds(a),f=a.style[mxConstants.STYLE_DIRECTION],g=new mxPoint(e.getCenterX(),e.getCenterY());d=this.view.scale;f!=mxConstants.DIRECTION_NORTH&&f!=mxConstants.DIRECTION_SOUTH||e.rotate90();d=new mxPoint(e.x+b.point.x*e.width+b.dx*d,e.y+b.point.y*e.height+b.dy*d);if(this.getModel().isVertex(a.cell)){var h=1==a.style[mxConstants.STYLE_FLIPH],k=1==a.style[mxConstants.STYLE_FLIPV];
null!=a.shape&&null!=a.shape.stencil&&(h=1==mxUtils.getValue(a.style,"stencilFlipH",0)||h,k=1==mxUtils.getValue(a.style,"stencilFlipV",0)||k);if(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){var l=h;h=k;k=l}h&&(d.x=2*e.getCenterX()-d.x);k&&(d.y=2*e.getCenterY()-d.y)}e=0;null!=f&&1==mxUtils.getValue(a.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(f==mxConstants.DIRECTION_NORTH?e+=270:f==mxConstants.DIRECTION_WEST?e+=180:f==mxConstants.DIRECTION_SOUTH&&(e+=90));0!=e&&(h=f=0,
90==e?h=1:180==e?f=-1:270==e&&(h=-1),d=mxUtils.getRotatedPoint(d,f,h,g));b.perimeter&&(d=this.view.getPerimeterPoint(a,d,!1));a=a.style[mxConstants.STYLE_ROTATION]||0;0!=a&&null!=d&&(a=mxUtils.toRadians(a),f=Math.cos(a),h=Math.sin(a),d=mxUtils.getRotatedPoint(d,f,h,g))}c&&null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y));return d};
mxGraph.prototype.connectCell=function(a,b,c,d){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.cellConnected(a,b,c,d);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",a,"terminal",b,"source",c,"previous",e))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellConnected=function(a,b,c,d){if(null!=a){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.setConnectionConstraint(a,b,c,d);this.isPortsEnabled()&&(d=null,this.isPort(b)&&(d=b.getId(),b=this.getTerminalForPort(b,c)),this.setCellStyles(c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,d,[a]));this.model.setTerminal(a,b,c);this.resetEdgesOnConnect&&this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",a,"terminal",b,"source",
c,"previous",e))}finally{this.model.endUpdate()}}};
mxGraph.prototype.disconnectGraph=function(a){if(null!=a){this.model.beginUpdate();try{for(var b=this.view.scale,c=this.view.translate,d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++)if(this.model.isEdge(a[e])){var f=this.model.getGeometry(a[e]);if(null!=f){var g=this.view.getState(a[e]),h=this.view.getState(this.model.getParent(a[e]));if(null!=g&&null!=h){f=f.clone();var k=-h.origin.x,l=-h.origin.y,m=g.absolutePoints,n=this.model.getTerminal(a[e],!0);if(null!=n&&this.isCellDisconnectable(a[e],
n,!0)){for(;null!=n&&!d.get(n);)n=this.model.getParent(n);null==n&&null!=f.setTerminalPoint&&(f.setTerminalPoint(new mxPoint(m[0].x/b-c.x+k,m[0].y/b-c.y+l),!0),this.model.setTerminal(a[e],null,!0))}var p=this.model.getTerminal(a[e],!1);if(null!=p&&this.isCellDisconnectable(a[e],p,!1)){for(;null!=p&&!d.get(p);)p=this.model.getParent(p);if(null==p&&null!=f.setTerminalPoint){var q=m.length-1;f.setTerminalPoint(new mxPoint(m[q].x/b-c.x+k,m[q].y/b-c.y+l),!1);this.model.setTerminal(a[e],null,!1)}}this.model.setGeometry(a[e],
f)}}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(a){return null};mxGraph.prototype.isPort=function(a){return!1};mxGraph.prototype.getTerminalForPort=function(a,b){return this.model.getParent(a)};mxGraph.prototype.getChildOffsetForCell=function(a){return null};
mxGraph.prototype.enterGroup=function(a){a=a||this.getSelectionCell();null!=a&&this.isValidRoot(a)&&(this.view.setCurrentRoot(a),this.clearSelection(),a=mxRectangle.fromRectangle(this.getGraphBounds()),a.x-=this.view.translate.x,a.y-=this.view.translate.y,this.scrollRectToVisible(a))};
mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurrentRoot();if(null!=b){for(var c=this.model.getParent(b);c!=a&&!this.isValidRoot(c)&&this.model.getParent(c)!=a;)c=this.model.getParent(c);c==a||this.model.getParent(c)==a?this.view.setCurrentRoot(null):this.view.setCurrentRoot(c);null!=this.view.getState(b)&&(this.setSelectionCell(b),this.scrollCellToVisible(b))}};
mxGraph.prototype.home=function(){var a=this.getCurrentRoot();null!=a&&(this.view.setCurrentRoot(null),null!=this.view.getState(a)&&this.setSelectionCell(a))};mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};
mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d};
mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b,c,d,e){b=null!=b?b:!1;var f=null;if(null!=a){c=null!=c?c:a;e=null!=e?e:this.createBoundingBoxCache(c);for(var g=0;g<a.length;g++)if(b||this.model.isVertex(a[g])){var h=this.getCellGeometry(a[g]);if(null!=h){var k=this.model.getParent(a[g]),l=null;if(this.model.isEdge(a[g])){var m=function(p){null!=p&&(null==l?l=new mxRectangle(p.x,p.y,0,0):l.add(new mxRectangle(p.x,p.y,0,0)))};null==this.model.getTerminal(a[g],!0)&&m(h.getTerminalPoint(!0));
null==this.model.getTerminal(a[g],!1)&&m(h.getTerminalPoint(!1));h=h.points;if(null!=h)for(var n=0;n<h.length;n++)m(h[n]);null!=l&&this.model.isVertex(k)&&e.ancestors.get(k)&&(m=this.getParentBoundingBoxFromGeometry(k,c,d,e),null!=m&&(l.x+=m.x,l.y+=m.y))}else h.relative?this.model.isVertex(k)&&k!=this.view.currentRoot&&(m=this.getParentBoundingBoxFromGeometry(k,c,d,e),null!=m&&(l=new mxRectangle(h.x*m.width,h.y*m.height,h.width,h.height),e.ancestors.get(k)&&(l.x+=m.x,l.y+=m.y))):(l=mxRectangle.fromRectangle(h),
this.model.isVertex(k)&&e.ancestors.get(k)&&(m=this.getParentBoundingBoxFromGeometry(k,c,d,e),null!=m&&(l.x+=m.x,l.y+=m.y))),null!=l&&null!=h.offset&&(l.x+=h.offset.x,l.y+=h.offset.y),k=this.getCurrentCellStyle(a[g]),null!=l&&(k=mxUtils.getValue(k,mxConstants.STYLE_ROTATION,0),0!=k&&(l=mxUtils.getBoundingBox(l,k)));null!=l&&(d&&(k=this.getCurrentCellStyle(a[g],!0),null!=k&&(k=mxUtils.getNumber(k,mxConstants.STYLE_STROKEWIDTH,1),l.grow(k/2))),null==f?f=mxRectangle.fromRectangle(l):f.add(l))}}}return f};
mxGraph.prototype.createBoundingBoxCache=function(a){for(var b={ancestors:new mxDictionary,boxes:new mxDictionary},c=0;c<a.length;c++)b.ancestors.put(a[c],!0);return b};
mxGraph.prototype.getParentBoundingBoxFromGeometry=function(a,b,c,d){for(var e=[],f=a;null!=f&&void 0===d.boxes.get(f);){var g=this.getCellGeometry(f);d.boxes.put(f,null);e.push(f);f=this.model.getParent(f);this.model.isVertex(f)&&(d.ancestors.get(f)||null!=g&&g.relative)||(f=null)}for(f=e.length-1;0<=f;f--)d.boxes.put(e[f],this.getBoundingBoxFromGeometry([e[f]],!1,b,c,d));return d.boxes.get(a)};
mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a};
mxGraph.prototype.snapDelta=function(a,b,c,d,e){var f=this.view.translate,g=this.view.scale;!c&&this.gridEnabled?(c=this.gridSize*g*.5,d||(d=b.x-(this.snap(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:this.snap(a.x/g)*g-d),e||(b=b.y-(this.snap(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:this.snap(a.y/g)*g-b)):(c=.5*g,d||(d=b.x-(Math.round(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:Math.round(a.x/g)*g-d),e||(b=b.y-(Math.round(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:Math.round(a.y/g)*g-b));return a};
mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(0==a&&0==b){if(c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1);this.shiftPreview1=null;
this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position="absolute";this.shiftPreview1.style.overflow="visible";this.shiftPreview2=
document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var f=this.shiftPreview1;for(d=this.container.firstChild;null!=d;)e=d.nextSibling,d!=c.parentNode?f.appendChild(d):f=this.shiftPreview2,d=e;null!=this.shiftPreview1.firstChild&&(null!=c.parentNode&&c.parentNode.parentNode==this.container?this.container.insertBefore(this.shiftPreview1,c.parentNode):this.container.appendChild(this.shiftPreview1));null!=this.shiftPreview2.firstChild&&
this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=a+"px";this.shiftPreview1.style.top=b+"px";this.shiftPreview2.style.left=a+"px";this.shiftPreview2.style.top=b+"px"}this.panDx=a;this.panDy=b;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)};
mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))};mxGraph.prototype.zoomTo=function(a,b,c){this.zoom(a/this.view.scale,b,null,c)};
mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:.5;d=null!=d?d:.5;var e=mxUtils.hasScrollbars(this.container),f=2*this.getBorder(),g=this.container.clientWidth-f;f=this.container.clientHeight-f;var h=this.getGraphBounds(),k=this.view.translate,l=this.view.scale,m=a?g-h.width:0,n=b?f-h.height:0;e?(m=Math.max(0,m),n=Math.max(0,n),this.view.setTranslate(Math.floor(m*c/l-h.x/l+k.x),Math.floor(n*d/l-h.y/l+k.y)),this.container.scrollLeft=(this.container.scrollWidth-
g)/2,this.container.scrollTop=(this.container.scrollHeight-f)/2):this.view.setTranslate(a?Math.floor(k.x-h.x/l+m*c/l):k.x,b?Math.floor(k.y-h.y/l+n*d/l):k.y)};
mxGraph.prototype.zoom=function(a,b,c,d){b=null!=b?b:this.centerZoom;var e=Math.round(this.view.scale*a*100)/100;null!=c&&(e=Math.round(e*c)/c);c=this.view.getState(this.getSelectionCell());a=e/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=c)a=new mxRectangle(c.x*a,c.y*a,c.width*a,c.height*a),this.view.scale=e,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(e));else{var f=mxUtils.hasScrollbars(this.container);if(b&&!f)d=this.container.offsetWidth,f=this.container.offsetHeight,
1<a?(a=(a-1)/(2*e),d*=-a,f*=-a):(a=(1/a-1)/(2*this.view.scale),d*=a,f*=a),this.view.scaleAndTranslate(e,this.view.translate.x+d,this.view.translate.y+f);else{c=this.view.translate.x;var g=this.view.translate.y,h=this.container.scrollLeft,k=this.container.scrollTop;this.view.setScale(e);f&&!d&&(f=d=0,b&&(d=this.container.offsetWidth*(a-1)/2,f=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-c)*this.view.scale+Math.round(h*a+d),this.container.scrollTop=(this.view.translate.y-
g)*this.view.scale+Math.round(k*a+f))}}};
mxGraph.prototype.zoomToRect=function(a){var b=this.container.clientWidth/a.width/(this.container.clientHeight/a.height);a.x=Math.max(0,a.x);a.y=Math.max(0,a.y);var c=Math.min(this.container.scrollWidth,a.x+a.width),d=Math.min(this.container.scrollHeight,a.y+a.height);a.width=c-a.x;a.height=d-a.y;1>b?(b=a.height/b,c=(b-a.height)/2,a.height=b,a.y-=Math.min(a.y,c),d=Math.min(this.container.scrollHeight,a.y+a.height),a.height=d-a.y):(b*=a.width,c=(b-a.width)/2,a.width=b,a.x-=Math.min(a.x,c),c=Math.min(this.container.scrollWidth,
a.x+a.width),a.width=c-a.x);b=this.container.clientWidth/a.width;c=this.view.scale*b;mxUtils.hasScrollbars(this.container)?(this.view.setScale(c),this.container.scrollLeft=Math.round(a.x*b),this.container.scrollTop=Math.round(a.y*b)):this.view.scaleAndTranslate(c,this.view.translate.x-a.x/this.view.scale,this.view.translate.y-a.y/this.view.scale)};
mxGraph.prototype.scrollCellToVisible=function(a,b){var c=-this.view.translate.x,d=-this.view.translate.y;a=this.view.getState(a);null!=a&&(c=new mxRectangle(c+a.x,d+a.y,a.width,a.height),b&&null!=this.container&&(b=this.container.clientWidth,d=this.container.clientHeight,c.x=c.getCenterX()-b/2,c.width=b,c.y=c.getCenterY()-d/2,c.height=d),b=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(c)&&(c=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x=
b.x,this.view.translate.y=b.y,this.view.setTranslate(c.x,c.y)))};
mxGraph.prototype.scrollRectToVisible=function(a){var b=!1;if(null!=a){var c=this.container.offsetWidth,d=this.container.offsetHeight,e=Math.min(c,a.width),f=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){c=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=c.scrollLeft-a.x;d=Math.max(g-c.scrollLeft,0);0<g?c.scrollLeft-=g+2:(g=a.x+e-c.scrollLeft-c.clientWidth,0<g&&(c.scrollLeft+=g+2));e=c.scrollTop-a.y;g=Math.max(0,e-c.scrollTop);0<e?c.scrollTop-=e+2:(e=a.y+
f-c.scrollTop-c.clientHeight,0<e&&(c.scrollTop+=e+2));this.useScrollbarsForPanning||0==d&&0==g||this.view.setTranslate(d,g)}else{g=-this.view.translate.x;var h=-this.view.translate.y,k=this.view.scale;a.x+e>g+c&&(this.view.translate.x-=(a.x+e-c-g)/k,b=!0);a.y+f>h+d&&(this.view.translate.y-=(a.y+f-d-h)/k,b=!0);a.x<g&&(this.view.translate.x+=(g-a.x)/k,b=!0);a.y<h&&(this.view.translate.y+=(h-a.y)/k,b=!0);b&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return b};
mxGraph.prototype.getCellGeometry=function(a){return this.model.getGeometry(a)};mxGraph.prototype.isCellVisible=function(a){return this.model.isVisible(a)};mxGraph.prototype.isCellCollapsed=function(a){return this.model.isCollapsed(a)};mxGraph.prototype.isCellConnectable=function(a){return this.model.isConnectable(a)};mxGraph.prototype.isOrthogonal=function(a){var b=a.style[mxConstants.STYLE_ORTHOGONAL];return null!=b?b:this.isOrthogonalEdgeStyle(this.view.getEdgeStyle(a))};
mxGraph.prototype.isOrthogonalEdgeStyle=function(a){return a==mxEdgeStyle.SegmentConnector||a==mxEdgeStyle.ElbowConnector||a==mxEdgeStyle.SideToSide||a==mxEdgeStyle.TopToBottom||a==mxEdgeStyle.EntityRelation||a==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(a){var b=a.getVisibleTerminalState(!0);a=a.getVisibleTerminalState(!1);return null!=b&&b==a};mxGraph.prototype.isCloneEvent=function(a){return mxEvent.isControlDown(a)};mxGraph.prototype.isTransparentClickEvent=function(a){return!1};
mxGraph.prototype.isToggleEvent=function(a){return mxClient.IS_MAC?mxEvent.isMetaDown(a):mxEvent.isControlDown(a)};mxGraph.prototype.isGridEnabledEvent=function(a){return null!=a&&!mxEvent.isAltDown(a)};mxGraph.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a)&&!mxEvent.isAltDown(a)};mxGraph.prototype.isIgnoreTerminalEvent=function(a){return!1};mxGraph.prototype.validationAlert=function(a){mxUtils.alert(a)};
mxGraph.prototype.isEdgeValid=function(a,b,c){return null==this.getEdgeValidationError(a,b,c)};
mxGraph.prototype.getEdgeValidationError=function(a,b,c){if(null!=a&&!this.isAllowDanglingEdges()&&(null==b||null==c))return"";if(null!=a&&null==this.model.getTerminal(a,!0)&&null==this.model.getTerminal(a,!1))return null;if(!this.allowLoops&&b==c&&null!=b||!this.isValidConnection(b,c))return"";if(null!=b&&null!=c){var d="";if(!this.multigraph){var e=this.model.getEdgesBetween(b,c,!0);if(1<e.length||1==e.length&&e[0]!=a)d+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+
"\n"}e=this.model.getDirectedEdgeCount(b,!0,a);var f=this.model.getDirectedEdgeCount(c,!1,a);if(null!=this.multiplicities)for(var g=0;g<this.multiplicities.length;g++){var h=this.multiplicities[g].check(this,a,b,c,e,f);null!=h&&(d+=h)}h=this.validateEdge(a,b,c);null!=h&&(d+=h);return 0<d.length?d:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(a,b,c){return null};
mxGraph.prototype.validateGraph=function(a,b){a=null!=a?a:this.model.getRoot();b=null!=b?b:{};for(var c=!0,d=this.model.getChildCount(a),e=0;e<d;e++){var f=this.model.getChildAt(a,e),g=b;this.isValidRoot(f)&&(g={});g=this.validateGraph(f,g);null!=g?this.setCellWarning(f,g.replace(/\n/g,"<br>")):this.setCellWarning(f,null);c=c&&null==g}d="";this.isCellCollapsed(a)&&!c&&(d+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n");d=this.model.isEdge(a)?d+
(this.getEdgeValidationError(a,this.model.getTerminal(a,!0),this.model.getTerminal(a,!1))||""):d+(this.getCellValidationError(a)||"");b=this.validateCell(a,b);null!=b&&(d+=b);null==this.model.getParent(a)&&this.view.validate();return 0<d.length||!c?d:null};
mxGraph.prototype.getCellValidationError=function(a){var b=this.model.getDirectedEdgeCount(a,!0),c=this.model.getDirectedEdgeCount(a,!1);a=this.model.getValue(a);var d="";if(null!=this.multiplicities)for(var e=0;e<this.multiplicities.length;e++){var f=this.multiplicities[e];f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(b>f.max||b<f.min)?d+=f.countError+"\n":!f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(c>f.max||c<f.min)&&(d+=f.countError+"\n")}return 0<d.length?d:null};
mxGraph.prototype.validateCell=function(a,b){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(a){this.backgroundImage=a};mxGraph.prototype.getFoldingImage=function(a){if(null!=a&&this.foldingEnabled&&!this.getModel().isEdge(a.cell)){var b=this.isCellCollapsed(a.cell);if(this.isCellFoldable(a.cell,!b))return b?this.collapsedImage:this.expandedImage}return null};
mxGraph.prototype.convertValueToString=function(a){a=this.model.getValue(a);if(null!=a){if(mxUtils.isNode(a))return a.nodeName;if("function"==typeof a.toString)return a.toString()}return""};mxGraph.prototype.getLabel=function(a){var b="";if(this.labelsVisible&&null!=a){var c=this.getCurrentCellStyle(a);mxUtils.getValue(c,mxConstants.STYLE_NOLABEL,!1)||(b=this.convertValueToString(a))}return b};mxGraph.prototype.isHtmlLabel=function(a){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels};
mxGraph.prototype.setHtmlLabels=function(a){this.htmlLabels=a};mxGraph.prototype.isWrapping=function(a){var b=this.getCurrentCellStyle(a);a=this.view.getState(a);var c=b[mxConstants.STYLE_TEXT_DIRECTION];a="1"==mxUtils.getValue(b,"convertToSvg","0")&&!mxUtils.isVerticalTextDirection(c)&&(null==a||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("foreignObject").length);return"wrap"==b[a?"svgWhiteSpace":mxConstants.STYLE_WHITE_SPACE]};
mxGraph.prototype.isLabelClipped=function(a){return"hidden"==this.getCurrentCellStyle(a)[mxConstants.STYLE_OVERFLOW]};
mxGraph.prototype.getTooltip=function(a,b,c,d){var e=null;null!=a&&(null==a.control||b!=a.control.node&&b.parentNode!=a.control.node||(e=this.collapseExpandResource,e=mxUtils.htmlEntities(mxResources.get(e)||e).replace(/\\n/g,"<br>")),null==e&&null!=a.overlays&&a.overlays.visit(function(f,g){null!=e||b!=g.node&&b.parentNode!=g.node||(e=mxUtils.htmlEntities(g.overlay.toString()).replace(/\\n/g,"<br>"))}),null==e&&(c=this.selectionCellsHandler.getHandler(a.cell),null!=c&&"function"==typeof c.getTooltipForNode&&
(e=c.getTooltipForNode(b))),null==e&&(e=this.getTooltipForCell(a.cell)));return e};mxGraph.prototype.getTooltipForCell=function(a){return null!=a&&null!=a.getTooltip?a.getTooltip():this.convertValueToString(a)};mxGraph.prototype.getLinkForCell=function(a){return null};mxGraph.prototype.getLinkTargetForCell=function(a){return null};mxGraph.prototype.getCursorForMouseEvent=function(a){return this.getCursorForCell(a.getCell())};mxGraph.prototype.getCursorForCell=function(a){return null};
mxGraph.prototype.getStartSize=function(a,b){var c=new mxRectangle;a=this.getCurrentCellStyle(a,b);b=parseInt(mxUtils.getValue(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?c.height=b:c.width=b;return c};
mxGraph.prototype.getSwimlaneDirection=function(a){var b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,0),d=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,0);a=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?0:3;b==mxConstants.DIRECTION_NORTH?a--:b==mxConstants.DIRECTION_WEST?a+=2:b==mxConstants.DIRECTION_SOUTH&&(a+=1);b=mxUtils.mod(a,2);c&&1==b&&(a+=2);d&&0==b&&(a+=2);return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,
mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(a,4)]};mxGraph.prototype.getActualStartSize=function(a,b){var c=new mxRectangle;this.isSwimlane(a,b)&&(b=this.getCurrentCellStyle(a,b),a=parseInt(mxUtils.getValue(b,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),b=this.getSwimlaneDirection(b),b==mxConstants.DIRECTION_NORTH?c.y=a:b==mxConstants.DIRECTION_WEST?c.x=a:b==mxConstants.DIRECTION_SOUTH?c.height=a:c.width=a);return c};
mxGraph.prototype.getActualFooterSize=function(a,b){var c=new mxRectangle,d=this.getCurrentCellStyle(a,b),e=Math.max(0,parseInt(mxUtils.getValue(d,mxConstants.STYLE_FOOTER_SIZE,0)));0<e&&(this.isSwimlane(a,b)?(a=this.getSwimlaneDirection(d),a==mxConstants.DIRECTION_NORTH?c.height=e:a==mxConstants.DIRECTION_WEST?c.width=e:a==mxConstants.DIRECTION_SOUTH?c.y=e:c.x=e):c.height=e);return c};mxGraph.prototype.getImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_IMAGE]:null};
mxGraph.prototype.isTransparentState=function(a){var b=!1;if(null!=a){b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);b=b==mxConstants.NONE&&c==mxConstants.NONE&&null==this.getImage(a)}return b};mxGraph.prototype.getVerticalAlign=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null};
mxGraph.prototype.getIndicatorColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};mxGraph.prototype.getIndicatorShape=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_SHAPE]:null};
mxGraph.prototype.getIndicatorImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(a){this.border=a};mxGraph.prototype.isSwimlane=function(a,b){return null==a||this.model.getParent(a)==this.model.getRoot()||this.model.isEdge(a)?!1:this.getCurrentCellStyle(a,b)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer};
mxGraph.prototype.setResizeContainer=function(a){this.resizeContainer=a};mxGraph.prototype.isEnabled=function(){return this.enabled};mxGraph.prototype.setEnabled=function(a){this.enabled=a;this.fireEvent(new mxEventObject("enabledChanged","enabled",a))};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(a){this.escapeEnabled=a};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing};
mxGraph.prototype.setInvokesStopCellEditing=function(a){this.invokesStopCellEditing=a};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};mxGraph.prototype.setEnterStopsCellEditing=function(a){this.enterStopsCellEditing=a};mxGraph.prototype.isCellLocked=function(a){var b=this.model.getGeometry(a);return this.isCellsLocked()||null!=b&&this.model.isVertex(a)&&b.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked};
mxGraph.prototype.setCellsLocked=function(a){this.cellsLocked=a};mxGraph.prototype.getCloneableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellCloneable(b)}))};mxGraph.prototype.isCellCloneable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsCloneable()&&0!=a[mxConstants.STYLE_CLONEABLE]};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(a){this.cellsCloneable=a};
mxGraph.prototype.getExportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canExportCell(b)}))};mxGraph.prototype.canExportCell=function(a){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canImportCell(b)}))};mxGraph.prototype.canImportCell=function(a){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(a){return this.isCellsSelectable()};
mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(a){this.cellsSelectable=a};mxGraph.prototype.getDeletableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellDeletable(b)}))};mxGraph.prototype.isCellDeletable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsDeletable()&&0!=a[mxConstants.STYLE_DELETABLE]};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable};
mxGraph.prototype.setCellsDeletable=function(a){this.cellsDeletable=a};mxGraph.prototype.isLabelMovable=function(a){return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&this.vertexLabelsMovable)};mxGraph.prototype.getRotatableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellRotatable(b)}))};mxGraph.prototype.isCellRotatable=function(a){return 0!=this.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATABLE]};
mxGraph.prototype.getMovableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellMovable(b)}))};mxGraph.prototype.isCellMovable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsMovable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_MOVABLE]};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(a){this.cellsMovable=a};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled};
mxGraph.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(a){this.portsEnabled=a};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(a){this.gridSize=a};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(a){this.tolerance=a};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable};
mxGraph.prototype.setVertexLabelsMovable=function(a){this.vertexLabelsMovable=a};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(a){this.edgeLabelsMovable=a};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(a){this.swimlaneNesting=a};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled};
mxGraph.prototype.setSwimlaneSelectionEnabled=function(a){this.swimlaneSelectionEnabled=a};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(a){this.multigraph=a};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(a){this.allowDanglingEdges=a};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges};
mxGraph.prototype.setConnectableEdges=function(a){this.connectableEdges=a};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(a){this.cloneInvalidEdges=a};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(a){this.allowLoops=a};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove};
mxGraph.prototype.setDisconnectOnMove=function(a){this.disconnectOnMove=a};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(a){this.dropEnabled=a};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(a){this.splitEnabled=a};mxGraph.prototype.getResizableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellResizable(b)}))};
mxGraph.prototype.isCellResizable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsResizable()&&!this.isCellLocked(a)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(a){this.cellsResizable=a};mxGraph.prototype.isTerminalPointMovable=function(a,b){return!0};
mxGraph.prototype.isCellBendable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsBendable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_BENDABLE]&&!this.view.isCollapsedPointsIgnored(a,b)};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(a){this.cellsBendable=a};mxGraph.prototype.getEditableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellEditable(b)}))};
mxGraph.prototype.isCellEditable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsEditable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_EDITABLE]};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(a){this.cellsEditable=a};mxGraph.prototype.isCellDisconnectable=function(a,b,c){return this.isCellsDisconnectable()&&!this.isCellLocked(a)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable};
mxGraph.prototype.setCellsDisconnectable=function(a){this.cellsDisconnectable=a};mxGraph.prototype.isValidSource=function(a){return null==a&&this.allowDanglingEdges||null!=a&&(!this.model.isEdge(a)||this.connectableEdges)&&this.isCellConnectable(a)};mxGraph.prototype.isValidTarget=function(a){return this.isValidSource(a)};mxGraph.prototype.isValidConnection=function(a,b){return this.isValidSource(a)&&this.isValidTarget(b)};mxGraph.prototype.setConnectable=function(a){this.connectionHandler.setEnabled(a)};
mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(a){this.tooltipHandler.setEnabled(a)};mxGraph.prototype.setPanning=function(a){this.panningHandler.panningEnabled=a};mxGraph.prototype.isEditing=function(a){if(null!=this.cellEditor){var b=this.cellEditor.getEditingCell();return null==a?null!=b:a==b}return!1};mxGraph.prototype.isAutoSizeCell=function(a){a=this.getCurrentCellStyle(a);return this.isAutoSizeCells()||1==a[mxConstants.STYLE_AUTOSIZE]};
mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(a){this.autoSizeCells=a};mxGraph.prototype.isExtendParent=function(a){return!this.getModel().isEdge(a)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(a){this.extendParents=a};mxGraph.prototype.isExtendParentsOnAdd=function(a){return this.extendParentsOnAdd};
mxGraph.prototype.setExtendParentsOnAdd=function(a){this.extendParentsOnAdd=a};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(a){this.extendParentsOnMove=a};mxGraph.prototype.isContractParent=function(a){return!this.getModel().isEdge(a)&&this.isContractParents()};mxGraph.prototype.isContractParents=function(){return this.contractParents};mxGraph.prototype.setContractParents=function(a){this.contractParents=a};
mxGraph.prototype.isContractParentsOnRemove=function(){return this.contractParentsOnRemove};mxGraph.prototype.setContractParentsOnRemove=function(a){this.contractParentsOnRemove=a};mxGraph.prototype.isContractParentsOnMove=function(){return this.contractParentsOnMove};mxGraph.prototype.setContractParentsOnMove=function(a){this.contractParentsOnMove=a};mxGraph.prototype.isRecursiveResize=function(a){return this.recursiveResize};
mxGraph.prototype.setRecursiveResize=function(a){this.recursiveResize=a};mxGraph.prototype.isConstrainChild=function(a){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(a))};mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(a){this.constrainChildren=a};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren};
mxGraph.prototype.setConstrainRelativeChildren=function(a){this.constrainRelativeChildren=a};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};mxGraph.prototype.setAllowNegativeCoordinates=function(a){this.allowNegativeCoordinates=a};mxGraph.prototype.getOverlap=function(a){return this.isAllowOverlapParent(a)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(a){return!1};
mxGraph.prototype.getFoldableCells=function(a,b){return this.model.filterCells(a,mxUtils.bind(this,function(c){return this.isCellFoldable(c,b)}))};mxGraph.prototype.isCellFoldable=function(a,b){b=this.getCurrentCellStyle(a);return 0<this.model.getChildCount(a)&&0!=b[mxConstants.STYLE_FOLDABLE]};
mxGraph.prototype.isValidDropTarget=function(a,b,c){return null!=a&&!this.isCellLocked(a)&&(this.isSplitEnabled()&&this.isSplitTarget(a,b,c)||!this.model.isEdge(a)&&(this.isSwimlane(a)||0<this.model.getChildCount(a)&&!this.isCellCollapsed(a)))};
mxGraph.prototype.isSplitTarget=function(a,b,c){return this.model.isEdge(a)&&null!=b&&1==b.length&&this.isCellConnectable(b[0])&&null==this.getEdgeValidationError(a,this.model.getTerminal(a,!0),b[0])?(c=this.model.getTerminal(a,!0),a=this.model.getTerminal(a,!1),!this.model.isAncestor(b[0],c)&&!this.model.isAncestor(b[0],a)):!1};
mxGraph.prototype.getDropTarget=function(a,b,c,d){if(!this.isSwimlaneNesting())for(var e=0;e<a.length;e++)if(this.isSwimlane(a[e]))return null;e=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b));e.x-=this.panDx;e.y-=this.panDy;e=this.getSwimlaneAt(e.x,e.y);if(null==c)c=e;else if(null!=e){for(var f=this.model.getParent(e);null!=f&&this.isSwimlane(f)&&f!=c;)f=this.model.getParent(f);f==c&&(c=e)}for(;null!=c&&!this.isValidDropTarget(c,a,b)&&!this.model.isLayer(c);)c=this.model.getParent(c);
if(null==d||!d)for(var g=c;null!=g&&0>mxUtils.indexOf(a,g);)g=this.model.getParent(g);return this.model.isLayer(c)||null!=g?null:c};mxGraph.prototype.getDefaultParent=function(){var a=this.getCurrentRoot();null==a&&(a=this.defaultParent,null==a&&(a=this.model.getRoot(),a=this.model.getChildAt(a,0)));return a};mxGraph.prototype.setDefaultParent=function(a){this.defaultParent=a};mxGraph.prototype.getSwimlane=function(a){for(;null!=a&&!this.isSwimlane(a);)a=this.model.getParent(a);return a};
mxGraph.prototype.getSwimlaneAt=function(a,b,c){null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.model.getRoot()));if(null!=c)for(var d=this.model.getChildCount(c),e=0;e<d;e++){var f=this.model.getChildAt(c,e);if(null!=f){var g=this.getSwimlaneAt(a,b,f);if(null!=g)return g;if(this.isCellVisible(f)&&this.isSwimlane(f)&&(g=this.view.getState(f),this.intersects(g,a,b)))return f}}return null};
mxGraph.prototype.getCellAt=function(a,b,c,d,e,f){d=null!=d?d:!0;e=null!=e?e:!0;null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.getModel().getRoot()));if(null!=c)for(var g=this.model.getChildCount(c)-1;0<=g;g--){var h=this.model.getChildAt(c,g),k=this.getCellAt(a,b,h,d,e,f);if(null!=k)return k;if(this.isCellVisible(h)&&(e&&this.model.isEdge(h)||d&&this.model.isVertex(h))&&(k=this.view.getState(h),null!=k&&(null==f||!f(k,a,b))&&this.intersects(k,a,b)))return h}return null};
mxGraph.prototype.intersects=function(a,b,c){if(null!=a){var d=a.absolutePoints;if(null!=d){if(this.isWideEdgeShape(a.shape)){var e=this.intersectsEdgeShape(a.shape,b,c);if(null!=e)return e}e=mxUtils.getNumber(a.style,mxConstants.STYLE_STROKEWIDTH,1);e=isFinite(e)&&0<e?e*a.view.scale:0;if(this.isPointNearPolyline(d,b,c,this.tolerance+e/2,this.tolerance))return!0}else{e=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=e){d=Math.cos(-e);e=Math.sin(-e);var f=new mxPoint(a.getCenterX(),
a.getCenterY());c=mxUtils.getRotatedPoint(new mxPoint(b,c),d,e,f);b=c.x;c=c.y}if(mxUtils.contains(a,b,c))return!0}}return!1};
mxGraph.prototype.isPointNearPolyline=function(a,b,c,d,e){for(var f=-1,g=-1,h=0;h<a.length;h++)null!=a[h]&&(f=0>f?h:f,g=h);var k=null,l=!1;for(h=f;0<=h&&h<=g;h++)if(f=a[h],null!=f){if(null!=k){var m=f.x-k.x,n=f.y-k.y,p=Math.sqrt(m*m+n*n),q=0<p?((b-k.x)*m+(c-k.y)*n)/p:0;l=null==e?0:l&&0>q?-q:h==g&&q>p?q-p:0;if(0<l){if(l<=e&&Math.abs((b-k.x)*n-(c-k.y)*m)<=d*p)return!0}else if(mxUtils.ptSegDistSq(k.x,k.y,f.x,f.y,b,c)<=d*d)return!0}l=null==k;k=f}return!1};
mxGraph.prototype.isWideEdgeShape=function(a){return null!=a&&(a instanceof mxArrow||"function"===typeof a.getEdgeWidth)};
mxGraph.prototype.getEdgeShapeOutline=function(a){var b=a.points,c=a.edgeShapeOutline;if(null==b||2>b.length||0<=mxUtils.indexOf(b,null)||!(0<a.scale))return null;if(null!=c&&c.boundingBox===a.boundingBox&&c.style===a.style&&c.scale==a.scale&&c.strokewidth==a.strokewidth&&c.points.length==2*b.length){for(var d=!0,e=0;e<b.length&&d;e++)d=c.points[2*e]==b[e].x&&c.points[2*e+1]==b[e].y;if(d)return c.outline}var f=new mxAbstractCanvas2D,g=[],h=function(u,x){null!=f.path&&0<f.path.length&&g.push({path:f.path,
filled:u,width:x?f.state.strokeWidth:0})};f.format=function(u){return parseFloat(u)};f.fill=function(){h(!0,!1)};f.stroke=function(){h(!1,!0)};f.fillAndStroke=function(){h(!0,!0)};f.rect=function(u,x,y,w){f.begin();f.moveTo(u,x);f.lineTo(u+y,x);f.lineTo(u+y,x+w);f.lineTo(u,x+w);f.close()};f.roundrect=f.rect;f.ellipse=function(u,x,y,w){f.begin();f.moveTo(u+y,x+w/2);for(var A=1;16>=A;A++)f.lineTo(u+y/2+Math.cos(A*Math.PI/8)*y/2,x+w/2+Math.sin(A*Math.PI/8)*w/2);f.close()};e={};for(var k in a)Object.prototype.hasOwnProperty.call(a,
k)&&(e[k]=a[k]);try{f.setStrokeWidth(a.strokewidth),a.paintEdgeShape(f,a.getWaypoints())}catch(u){g=[]}finally{for(k in a)Object.prototype.hasOwnProperty.call(a,k)&&!Object.prototype.hasOwnProperty.call(e,k)&&delete a[k];for(k in e)a[k]!==e[k]&&(a[k]=e[k])}var l=k=null;for(e=0;e<g.length;e++){c=g[e].path;var m=[],n=null,p=null;d=0;for(var q=g[e].width,r=function(u){u=new mxRectangle(u.x-q/2,u.y-q/2,q,q);null==l?l=u:l.add(u)},t=function(u){null==n&&(n=[null!=p?p:u],m.push(n),r(n[0]));n.push(u);r(u);
p=u};d<c.length;){var v=c[d++];if(v==f.moveOp)p=new mxPoint(c[d++],c[d++]),n=null;else if(v==f.lineOp)t(new mxPoint(c[d++],c[d++]));else if(v==f.quadOp||v==f.curveOp)for(v=v==f.quadOp?2:3;0<v;v--)t(new mxPoint(c[d++],c[d++]));else if(v==f.closeOp)null!=n&&t(n[0]),n=null;else break}0<m.length&&(k=null!=k?k:{paths:[],bounds:null},k.paths.push({lines:m,filled:g[e].filled,width:g[e].width}))}null!=k&&(k.bounds=l,k.band="function"===typeof a.isOpenEnded&&a.isOpenEnded());c=[];for(e=0;e<b.length;e++)c.push(b[e].x,
b[e].y);a.edgeShapeOutline={outline:k,points:c,scale:a.scale,strokewidth:a.strokewidth,style:a.style,boundingBox:a.boundingBox};return k};
mxGraph.prototype.intersectsEdgeShape=function(a,b,c){var d=this.getEdgeShapeOutline(a);if(null==d)return null;var e=b/a.scale,f=c/a.scale;a=this.tolerance/a.scale;b=d.bounds;if(e<b.x-a||f<b.y-a||e>b.x+b.width+a||f>b.y+b.height+a)return!1;b=function(n){for(var p=!1,q=0;q<n.length;q++)for(var r=n[q],t=0,v=r.length-1;t<r.length;v=t++){var u=r[t];v=r[v];u.y>f!=v.y>f&&e<(v.x-u.x)*(f-u.y)/(v.y-u.y)+u.x&&(p=!p)}return p};for(c=0;c<d.paths.length;c++){var g=d.paths[c],h=a+g.width/2;if(g.filled&&b(g.lines)||
d.band&&1<g.lines.length&&b([[].concat.apply([],g.lines)]))return!0;for(var k=0;k<g.lines.length;k++){var l=g.lines[k],m=l[0]===l[l.length-1];g.filled&&!m&&(l=l.concat([l[0]]),m=!0);if(this.isPointNearPolyline(l,e,f,h,m?null:a))return!0}}return!1};mxGraph.prototype.hitsSwimlaneContent=function(a,b,c){var d=this.getView().getState(a);a=this.getStartSize(a);if(null!=d){var e=this.getView().getScale();b-=d.x;c-=d.y;if(0<a.width&&0<b&&b>a.width*e||0<a.height&&0<c&&c>a.height*e)return!0}return!1};
mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};mxGraph.prototype.getChildCells=function(a,b,c){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=b?b:!1,null!=c?c:!1);b=[];for(c=0;c<a.length;c++)this.isCellVisible(a[c])&&b.push(a[c]);return b};mxGraph.prototype.getConnections=function(a,b){return this.getEdges(a,b,!0,!0,!1)};
mxGraph.prototype.getIncomingEdges=function(a,b){return this.getEdges(a,b,!0,!1,!1)};mxGraph.prototype.getOutgoingEdges=function(a,b){return this.getEdges(a,b,!1,!0,!1)};
mxGraph.prototype.getEdges=function(a,b,c,d,e,f){c=null!=c?c:!0;d=null!=d?d:!0;e=null!=e?e:!0;f=null!=f?f:!1;for(var g=[],h=this.isCellCollapsed(a),k=this.model.getChildCount(a),l=0;l<k;l++){var m=this.model.getChildAt(a,l);if(h||!this.isCellVisible(m))g=g.concat(this.model.getEdges(m,c,d))}g=g.concat(this.model.getEdges(a,c,d));h=[];for(l=0;l<g.length;l++)m=this.view.getState(g[l]),k=null!=m?m.getVisibleTerminal(!0):this.view.getVisibleTerminal(g[l],!0),m=null!=m?m.getVisibleTerminal(!1):this.view.getVisibleTerminal(g[l],
!1),(e&&k==m||k!=m&&(c&&m==a&&(null==b||this.isValidAncestor(k,b,f))||d&&k==a&&(null==b||this.isValidAncestor(m,b,f))))&&h.push(g[l]);return h};mxGraph.prototype.isValidAncestor=function(a,b,c){return c?this.model.isAncestor(b,a):this.model.getParent(a)==b};
mxGraph.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[],f=new mxDictionary;if(null!=a)for(var g=0;g<a.length;g++){var h=this.view.getState(a[g]),k=null!=h?h.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[g],!0);h=null!=h?h.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[g],!1);k==b&&null!=h&&h!=b&&d?f.get(h)||(f.put(h,!0),e.push(h)):h==b&&null!=k&&k!=b&&c&&!f.get(k)&&(f.put(k,!0),e.push(k))}return e};
mxGraph.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.view.getState(d[f]),h=null!=g?g.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[f],!0);g=null!=g?g.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[f],!1);(h==a&&g==b||!c&&h==b&&g==a)&&e.push(d[f])}return e};
mxGraph.prototype.getPointForEvent=function(a,b){a=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));var c=this.view.scale,d=this.view.translate;b=0!=b?this.gridSize/2:0;a.x=this.snap(a.x/c-d.x-b);a.y=this.snap(a.y/c-d.y-b);return a};
mxGraph.prototype.getCells=function(a,b,c,d,e,f,g,h,k){f=null!=f?f:[];if(0<c||0<d||null!=g){var l=this.getModel(),m=a+c,n=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=l.getRoot()));if(null!=e)for(var p=l.getChildCount(e),q=0;q<p;q++){var r=l.getChildAt(e,q),t=this.view.getState(r);if(null!=t&&this.isCellVisible(r)&&(null==h||!h(t))){var v=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(t=mxUtils.getBoundingBox(t,v));(v=null!=g&&l.isVertex(r)&&mxUtils.intersects(g,t)||null!=g&&
l.isEdge(r)&&mxUtils.intersects(g,t)||null==g&&(l.isEdge(r)||l.isVertex(r))&&t.x>=a&&t.y+t.height<=n&&t.y>=b&&t.x+t.width<=m)&&f.push(r);v&&!k||this.getCells(a,b,c,d,r,f,g,h,k)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),h=0;h<g;h++){var k=this.model.getChildAt(c,h),l=this.view.getState(k);this.isCellVisible(k)&&null!=l&&(!d||l.x>=a)&&(!e||l.y>=b)&&f.push(k)}return f};
mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,h=0,k=0;k<f;k++){var l=e.getChildAt(a,k);if(this.model.isVertex(l)&&this.isCellVisible(l)){for(var m=this.getConnections(l,b?a:null),n=0,p=0,q=0;q<m.length;q++)this.view.getVisibleTerminal(m[q],!0)==l?n++:p++;(c&&0==n&&0<p||!c&&0==p&&0<n)&&d.push(l);m=c?p-n:n-p;m>h&&(h=m,g=l)}}0==d.length&&null!=g&&d.push(g)}return d};
mxGraph.prototype.traverse=function(a,b,c,d,e,f){if(null!=c&&null!=a&&(b=null!=b?b:!0,f=null!=f?f:!1,e=e||new mxDictionary,null==d||!e.get(d))&&(e.put(d,!0),d=c(a,d),null==d||d)&&(d=this.model.getEdgeCount(a),0<d))for(var g=0;g<d;g++){var h=this.model.getEdgeAt(a,g),k=this.model.getTerminal(h,!0)==a;b&&!f!=k||(k=this.model.getTerminal(h,!k),this.traverse(k,b,c,h,e,f))}};mxGraph.prototype.isCellSelected=function(a){return this.getSelectionModel().isSelected(a)};
mxGraph.prototype.isAncestorSelected=function(a){for(a=this.model.getParent(a);null!=a&&a!=this.getCurrentRoot();){if(this.isCellSelected(a))return!0;a=this.model.getParent(a)}return!1};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]};
mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(a){this.getSelectionModel().setCell(a)};mxGraph.prototype.setSelectionCells=function(a){this.getSelectionModel().setCells(a)};mxGraph.prototype.addSelectionCell=function(a){this.getSelectionModel().addCell(a)};mxGraph.prototype.addSelectionCells=function(a){this.getSelectionModel().addCells(a)};mxGraph.prototype.removeSelectionCell=function(a){this.getSelectionModel().removeCell(a)};
mxGraph.prototype.removeSelectionCells=function(a){this.getSelectionModel().removeCells(a)};mxGraph.prototype.selectRegion=function(a,b){a=this.getCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(a,b);return a};mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)};mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)};
mxGraph.prototype.selectCell=function(a,b,c){var d=this.selectionModel,e=0<d.cells.length?d.cells[0]:null;1<d.cells.length&&d.clear();d=null!=e?this.model.getParent(e):this.getDefaultParent();var f=this.model.getChildCount(d);null==e&&0<f?(a=this.model.getChildAt(d,0),this.setSelectionCell(a)):null!=e&&!b||null==this.view.getState(d)||null==this.model.getGeometry(d)?null!=e&&c?0<this.model.getChildCount(e)&&(a=this.model.getChildAt(e,0),this.setSelectionCell(a)):0<f&&(b=d.getIndex(e),a?(b++,a=this.model.getChildAt(d,
b%f)):(b--,a=this.model.getChildAt(d,0>b?f-1:b)),this.setSelectionCell(a)):this.getCurrentRoot()!=d&&this.setSelectionCell(d)};mxGraph.prototype.selectAll=function(a,b){a=a||this.getDefaultParent();b=b?this.model.filterDescendants(mxUtils.bind(this,function(c){return c!=a&&null!=this.view.getState(c)}),a):this.model.getChildren(a);null!=b&&this.setSelectionCells(b)};mxGraph.prototype.selectVertices=function(a,b){this.selectCells(!0,!1,a,b)};
mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)};mxGraph.prototype.selectCells=function(a,b,c,d){c=c||this.getDefaultParent();var e=mxUtils.bind(this,function(f){return null!=this.view.getState(f)&&((d||0==this.model.getChildCount(f))&&this.model.isVertex(f)&&a&&!this.model.isEdge(this.model.getParent(f))||this.model.isEdge(f)&&b)});c=this.model.filterDescendants(e,c);null!=c&&this.setSelectionCells(c)};
mxGraph.prototype.selectCellForEvent=function(a,b){var c=this.isCellSelected(a);this.isToggleEvent(b)?c?this.removeSelectionCell(a):this.addSelectionCell(a):c&&1==this.getSelectionCount()||this.setSelectionCell(a)};mxGraph.prototype.selectCellsForEvent=function(a,b){this.isToggleEvent(b)?this.addSelectionCells(a):this.setSelectionCells(a)};
mxGraph.prototype.createHandler=function(a){var b=null;if(null!=a)if(this.model.isEdge(a.cell)){b=a.getVisibleTerminalState(!0);var c=a.getVisibleTerminalState(!1),d=this.getCellGeometry(a.cell);b=this.view.getEdgeStyle(a,null!=d?d.points:null,b,c);b=this.createEdgeHandler(a,b)}else b=this.createVertexHandler(a);return b};mxGraph.prototype.createVertexHandler=function(a){return new mxVertexHandler(a)};
mxGraph.prototype.createEdgeHandler=function(a,b){return b==mxEdgeStyle.Loop||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):b==mxEdgeStyle.SegmentConnector||b==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)};
mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var b=0;b<this.mouseListeners.length;b++)if(this.mouseListeners[b]==a){this.mouseListeners.splice(b,1);break}};
mxGraph.prototype.updateMouseEvent=function(a,b){if(null==a.graphX||null==a.graphY){var c=mxUtils.convertPoint(this.container,a.getX(),a.getY());a.graphX=c.x-this.panDx;a.graphY=c.y-this.panDy;null==a.getCell()&&this.isMouseDown&&b==mxEvent.MOUSE_MOVE&&(a.state=this.view.getState(this.getCellAt(c.x,c.y,null,null,null,function(d){return null==d.shape||d.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(d.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=d.shape.fill&&
d.shape.fill!=mxConstants.NONE})))}return a};mxGraph.prototype.getStateForTouchEvent=function(a){var b=mxEvent.getClientX(a);a=mxEvent.getClientY(a);b=mxUtils.convertPoint(this.container,b,a);return this.view.getState(this.getCellAt(b.x,b.y))};
mxGraph.prototype.isEventIgnored=function(a,b,c){var d=mxEvent.isMouseEvent(b.getEvent()),e=!1;b.getEvent()==this.lastEvent?e=!0:this.lastEvent=b.getEvent();if(null!=this.eventSource&&a!=mxEvent.MOUSE_MOVE)this.removeEventSourceRedirect();else if(!mxClient.IS_GC&&null!=this.eventSource&&b.getSource()!=this.eventSource)e=!0;else if(mxClient.IS_TOUCH&&a==mxEvent.MOUSE_DOWN&&!d&&!mxEvent.isPenEvent(b.getEvent())){this.eventSource=b.getSource();var f=null;!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC||
(f=b.getEvent().pointerId);this.mouseMoveRedirect=mxUtils.bind(this,function(g){null!=f&&g.pointerId!=f||this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,this.getStateForTouchEvent(g)))});this.mouseUpRedirect=mxUtils.bind(this,function(g){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,this.getStateForTouchEvent(g)));f=null});this.mouseCancelRedirect=mxUtils.bind(this,function(g){null!=f&&g.pointerId!=f||this.cancelMouseGesture(g)});mxEvent.addGestureListeners(this.eventSource,null,
this.mouseMoveRedirect,this.mouseUpRedirect,this.mouseCancelRedirect)}this.isSyntheticEventIgnored(a,b,c)&&(e=!0);if(!mxEvent.isPopupTrigger(this.lastEvent)&&a!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail)return!0;a==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:a!=mxEvent.MOUSE_DOWN||this.isMouseDown?!e&&((!mxClient.IS_FF||a!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=d||a==mxEvent.MOUSE_DOWN&&this.isMouseDown||a==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(e=!0):(this.isMouseDown=
!0,this.isMouseTrigger=d);e||a!=mxEvent.MOUSE_DOWN||(this.lastMouseX=b.getX(),this.lastMouseY=b.getY());return e};mxGraph.prototype.removeEventSourceRedirect=function(){null!=this.eventSource&&mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect,this.mouseCancelRedirect);this.eventSource=this.mouseCancelRedirect=this.mouseUpRedirect=this.mouseMoveRedirect=null};
mxGraph.prototype.cancelMouseGesture=function(a){this.removeEventSourceRedirect();this.isMouseDown=!1;this.currentPointerId=null;this.fireDoubleClick=!1;this.lastTouchTime=0;this.tapAndHoldInProgress=this.tapAndHoldValid=!1;window.clearTimeout(this.tapAndHoldThread);null!=this.panningHandler&&(this.panningHandler.isActive()?this.panningHandler.mouseUp(this,new mxMouseEvent(a)):this.panningHandler.reset());null!=this.panningManager&&this.panningManager.stop();null!=this.graphHandler&&this.graphHandler.reset();
null!=this.connectionHandler&&this.connectionHandler.reset();null!=this.selectionCellsHandler&&this.selectionCellsHandler.reset();this.fireEvent(new mxEventObject(mxEvent.CANCEL_MOUSE_GESTURE,"event",a))};mxGraph.prototype.isSyntheticEventIgnored=function(a,b,c){c=!1;b=mxEvent.isMouseEvent(b.getEvent());this.ignoreMouseEvents&&b&&a!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=a!=mxEvent.MOUSE_UP,c=!0):mxClient.IS_FF&&!b&&a==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0);return c};
mxGraph.prototype.isEventSourceIgnored=function(a,b){var c=b.getSource(),d=null!=c.nodeName?c.nodeName.toLowerCase():"";b=!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent());return a==mxEvent.MOUSE_DOWN&&b&&("select"==d||"option"==d||"input"==d&&"checkbox"!=c.type&&"radio"!=c.type&&"button"!=c.type&&"submit"!=c.type&&"file"!=c.type)};mxGraph.prototype.getEventState=function(a){return a};
mxGraph.prototype.isPointerEventIgnored=function(a,b){var c=!1;if(mxClient.IS_ANDROID||!mxClient.IS_LINUX||!mxClient.IS_GC){var d=b.getEvent().pointerId;a==mxEvent.MOUSE_DOWN?null!=this.currentPointerId&&this.currentPointerId!=d?c=!0:null==this.currentPointerId&&(this.currentPointerId=b.getEvent().pointerId):a==mxEvent.MOUSE_MOVE?null!=this.currentPointerId&&this.currentPointerId!=d&&(c=!0):a==mxEvent.MOUSE_UP&&(this.currentPointerId=null)}return c};
mxGraph.prototype.fireMouseEvent=function(a,b,c){if(this.isEventSourceIgnored(a,b))null!=this.tooltipHandler&&this.tooltipHandler.hide();else if(this.isPointerEventIgnored(a,b))this.tapAndHoldValid=!1;else{null==c&&(c=this);b=this.updateMouseEvent(b,a);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(b.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))){var d=(new Date).getTime();if(a==mxEvent.MOUSE_DOWN&&mxEvent.isMultiTouchEvent(b.getEvent()))this.lastTouchTime=
0,this.fireDoubleClick=!1;else if(a==mxEvent.MOUSE_DOWN)if(null!=this.lastTouchEvent&&this.lastTouchEvent!=b.getEvent()&&d-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance&&2>this.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?b.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,this.dblClick(b.getEvent(),
d),d=!0):(this.fireDoubleClick=!0,this.lastTouchTime=0),d){mxEvent.consume(b.getEvent());return}}else{if(null==this.lastTouchEvent||this.lastTouchEvent!=b.getEvent())this.lastTouchCell=b.getCell(),this.lastTouchX=b.getX(),this.lastTouchY=b.getY(),this.lastTouchTime=d,this.lastTouchEvent=b.getEvent(),this.doubleClickCounter=0}else if((this.isMouseDown||a==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;d=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=!1;(null!=d||(mxEvent.isTouchEvent(b.getEvent())||
mxEvent.isPenEvent(b.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance?this.dblClick(b.getEvent(),d):mxEvent.consume(b.getEvent());return}}if(!this.isEventIgnored(a,b,c)){b.state=this.getEventState(b.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",a,"event",b));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||b.getEvent().target!=this.container){if(a==
mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(b.getEvent()))this.scrollPointToVisible(b.getGraphX(),b.getGraphY(),this.autoExtend);else if(a==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){d=this.view.scale;var e=this.view.translate;this.view.setTranslate(e.x-this.container.scrollLeft/d,e.y-this.container.scrollTop/d);this.container.scrollLeft=0;this.container.scrollTop=0}if(null!=
this.mouseListeners)for(d=[c,b],b.getEvent().preventDefault||(b.getEvent().returnValue=!0),e=0;e<this.mouseListeners.length;e++){var f=this.mouseListeners[e];a==mxEvent.MOUSE_DOWN?f.mouseDown.apply(f,d):a==mxEvent.MOUSE_MOVE?f.mouseMove.apply(f,d):a==mxEvent.MOUSE_UP&&f.mouseUp.apply(f,d)}a==mxEvent.MOUSE_UP&&this.click(b)}(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&a==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,
this.initialTouchX=b.getGraphX(),this.initialTouchY=b.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(b);this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):a==mxEvent.MOUSE_UP?this.tapAndHoldValid=this.tapAndHoldInProgress=!1:this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-b.getGraphX())<this.tolerance&&
Math.abs(this.initialTouchY-b.getGraphY())<this.tolerance);a==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(b.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing());this.consumeMouseEvent(a,b,c)}}};mxGraph.prototype.consumeMouseEvent=function(a,b,c){this.fireEvent(new mxEventObject(mxEvent.CONSUME_MOUSE_EVENT,"eventName",a,"event",b));a==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(b.getEvent())&&b.consume(!1)};
mxGraph.prototype.fireGestureEvent=function(a,b){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",a,"cell",b))};
mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.panningManager&&this.panningManager.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&
this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)};function mxCellOverlay(a,b,c,d,e,f){this.image=a;this.tooltip=b;this.align=null!=c?c:this.align;this.verticalAlign=null!=d?d:this.verticalAlign;this.offset=null!=e?e:new mxPoint;this.cursor=null!=f?f:"help"}mxCellOverlay.prototype=new mxEventSource;
mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null;mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5;
mxCellOverlay.prototype.getBounds=function(a){var b=a.view.graph.getModel().isEdge(a.cell),c=a.view.scale,d=this.image.width,e=this.image.height;if(b)if(b=a.absolutePoints,1==b.length%2)b=b[Math.floor(b.length/2)];else{var f=b.length/2;a=b[f-1];b=b[f];b=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2)}else b=new mxPoint,b.x=this.align==mxConstants.ALIGN_LEFT?a.x:this.align==mxConstants.ALIGN_CENTER?a.x+a.width/2:a.x+a.width,b.y=this.verticalAlign==mxConstants.ALIGN_TOP?a.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?
a.y+a.height/2:a.y+a.height;return new mxRectangle(Math.round(b.x-(d*this.defaultOverlap-this.offset.x)*c),Math.round(b.y-(e*this.defaultOverlap-this.offset.y)*c),d*c,e*c)};mxCellOverlay.prototype.toString=function(){return this.tooltip};function mxOutline(a,b){this.source=a;null!=b&&this.init(b)}mxOutline.prototype.source=null;mxOutline.prototype.container=null;mxOutline.prototype.enabled=!0;mxOutline.prototype.suspended=!1;mxOutline.prototype.border=14;mxOutline.prototype.opacity=.7;
mxOutline.prototype.init=function(a){this.container=a;this.updateHandler=mxUtils.bind(this,function(b,c){this.update(!0)});this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.source.addListener(mxEvent.REFRESH,this.updateHandler);a=this.source.getView();a.addListener(mxEvent.UP,this.updateHandler);a.addListener(mxEvent.DOWN,this.updateHandler);a.addListener(mxEvent.SCALE,this.updateHandler);a.addListener(mxEvent.TRANSLATE,this.updateHandler);a.addListener(mxEvent.SCALE_AND_TRANSLATE,
this.updateHandler);this.scrollHandler=mxUtils.bind(this,function(b,c){this.update(!1)});mxEvent.addListener(this.source.container,"scroll",this.scrollHandler);this.source.addListener(mxEvent.PAN,this.scrollHandler);this.update(!0)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(a){this.enabled=a};mxOutline.prototype.isSuspended=function(){return this.suspended};mxOutline.prototype.setSuspended=function(a){this.suspended=a;this.update(!0)};
mxOutline.prototype.isScrolling=function(){return this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)};
mxOutline.prototype.createSvg=function(){var a=document.createElementNS(mxConstants.NS_SVG,"svg");a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";a.style.display="block";a.style.padding=this.border+"px";a.style.boxSizing="border-box";a.style.overflow="visible";a.style.cursor="default";a.setAttribute("shape-rendering","optimizeSpeed");a.setAttribute("image-rendering","optimizeSpeed");return a};
mxOutline.prototype.addGestureListeners=function(a){var b=null,c=0,d=0,e=1,f=mxUtils.bind(this,function(k){if(this.isEnabled()){b=new mxPoint(mxEvent.getClientX(k),mxEvent.getClientY(k));var l=a.clientWidth-2*this.border,m=a.clientHeight-2*this.border,n=this.getViewBox();e=Math.max(n.width/l,n.height/m);if(mxEvent.getSource(k)!=this.viewport)if(this.isScrolling()){l-=n.width/e;m-=n.height/e;var p=this.svg.getBoundingClientRect();this.source.container.scrollLeft=n.x-l*e/2+(b.x-this.border-p.left)*
e;this.source.container.scrollTop=n.y-m*e/2+(b.y-this.border-p.top)*e}else n=this.source.view.translate,m=this.viewport.getBoundingClientRect(),l=(mxEvent.getClientX(k)-m.left)*e/this.source.view.scale,m=(mxEvent.getClientY(k)-m.top)*e/this.source.view.scale,this.source.getView().setTranslate(n.x-l,n.y-m),this.source.panGraph(0,0);mxEvent.addGestureListeners(document,null,g,h);c=this.source.container.scrollLeft;d=this.source.container.scrollTop;mxEvent.consume(k)}}),g=mxUtils.bind(this,function(k){this.isEnabled()&&
null!=b&&(this.isScrolling()?(this.source.container.scrollLeft=c+(mxEvent.getClientX(k)-b.x)*e,this.source.container.scrollTop=d+(mxEvent.getClientY(k)-b.y)*e):this.source.panGraph((b.x-mxEvent.getClientX(k))*e,(b.y-mxEvent.getClientY(k))*e),mxEvent.consume(k))}),h=mxUtils.bind(this,function(k){if(this.isEnabled()&&null!=b){if(!this.isScrolling()){var l=(mxEvent.getClientX(k)-b.x)*e/this.source.view.scale,m=(mxEvent.getClientY(k)-b.y)*e/this.source.view.scale,n=this.source.view.translate;this.source.getView().setTranslate(n.x-
l,n.y-m);this.source.panGraph(0,0)}mxEvent.removeGestureListeners(document,null,g,h);mxEvent.consume(k);b=null}});mxEvent.addGestureListeners(a,f,g,h)};mxOutline.prototype.getViewBox=function(){return this.source.getGraphBounds()};
mxOutline.prototype.updateSvg=function(){null==this.svg&&(this.svg=this.createSvg(),this.addGestureListeners(this.svg),this.container.appendChild(this.svg));var a=this.getViewBox();this.svg.setAttribute("viewBox",Math.round(a.x)+" "+Math.round(a.y)+" "+Math.round(a.width)+" "+Math.round(a.height));a=mxUtils.getLightDarkColor(null==this.source.background||this.source.background==mxConstants.NONE?this.source.defaultPageBackgroundColor:this.source.background).cssText;this.svg.style.backgroundColor=a;
this.updateDrawPane()};mxOutline.prototype.updateDrawPane=function(){null!=this.drawPane&&this.drawPane.parentNode.removeChild(this.drawPane);this.drawPane=this.source.view.getDrawPane().cloneNode(!0);this.drawPane.style.opacity=this.opacity;this.processSvg(this.drawPane);null!=this.viewport?this.svg.insertBefore(this.drawPane,this.viewport):this.svg.appendChild(this.drawPane)};
mxOutline.prototype.processSvg=function(a){var b=this.source.view.scale/this.source.view.getPixelSize();Array.prototype.slice.call(a.getElementsByTagName("*")).forEach(mxUtils.bind(this,function(c){if("text"!=c.nodeName&&"foreignObject"!=c.nodeName&&"hidden"!=c.getAttribute("visibility")&&c instanceof SVGElement){var d=parseInt(c.getAttribute("stroke-width")||1);isNaN(d)||c.setAttribute("stroke-width",Math.max(1,d/(5*b)));c.setAttribute("vector-effect","non-scaling-stroke");c.style.cursor=""}else c.parentNode.removeChild(c)}))};
mxOutline.prototype.updateViewport=function(){if(null!=this.svg){null==this.viewport&&(this.viewport=this.createViewport(),this.svg.appendChild(this.viewport));var a=this.source.container;a=new mxRectangle(a.scrollLeft,a.scrollTop,a.clientWidth,a.clientHeight);this.isScrolling()||(a.x=-this.source.panDx,a.y=-this.source.panDy);this.viewport.setAttribute("x",a.x);this.viewport.setAttribute("y",a.y);this.viewport.setAttribute("width",a.width);this.viewport.setAttribute("height",a.height)}};
mxOutline.prototype.createViewport=function(){var a=this.svg.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect");a.setAttribute("stroke-width","3");a.setAttribute("stroke",HoverIcons.prototype.arrowFill);a.setAttribute("fill",HoverIcons.prototype.arrowFill);a.setAttribute("vector-effect","non-scaling-stroke");a.setAttribute("fill-opacity",.2);a.style.cursor="move";return a};
mxOutline.prototype.update=function(a){null!=this.source&&null!=this.source.container&&(null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),this.fullUpdate=this.fullUpdate||a,this.thread=window.setTimeout(mxUtils.bind(this,function(){this.isSuspended()||(this.fullUpdate&&this.updateSvg(),this.updateViewport());this.thread=this.fullUpdate=null}),this.isScrolling()?10:0))};
mxOutline.prototype.destroy=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);null!=this.svg&&(this.svg.parentNode.removeChild(this.svg),this.svg=null);null!=this.source&&(this.source.removeListener(this.scrollHandler),this.source.removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),this.source.getModel().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.scrollHandler),this.source=null)};
function mxMultiplicity(a,b,c,d,e,f,g,h,k,l){this.source=a;this.type=b;this.attr=c;this.value=d;this.min=null!=e?e:0;this.max=null!=f?f:"n";this.validNeighbors=g;this.countError=mxResources.get(h)||h;this.typeError=mxResources.get(k)||k;this.validNeighborsAllowed=null!=l?l:!0}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null;
mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=!0;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null;
mxMultiplicity.prototype.check=function(a,b,c,d,e,f){var g="";if(this.source&&this.checkTerminal(a,c,b)||!this.source&&this.checkTerminal(a,d,b))null!=this.countError&&(this.source&&(0==this.max||e>=this.max)||!this.source&&(0==this.max||f>=this.max))&&(g+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(a,b,c,d)||(g+=this.typeError+"\n"));return 0<g.length?g:null};
mxMultiplicity.prototype.checkNeighbors=function(a,b,c,d){b=a.model.getValue(c);d=a.model.getValue(d);c=!this.validNeighborsAllowed;for(var e=this.validNeighbors,f=0;f<e.length;f++)if(this.source&&this.checkType(a,d,e[f])){c=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(a,b,e[f])){c=this.validNeighborsAllowed;break}return c};mxMultiplicity.prototype.checkTerminal=function(a,b,c){b=a.model.getValue(b);return this.checkType(a,b,this.type,this.attr,this.value)};
mxMultiplicity.prototype.checkType=function(a,b,c,d,e){return null!=b?isNaN(b.nodeType)?b==c:mxUtils.isNode(b,c,d,e):!1};
function mxLayoutManager(a){this.undoHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.beforeUndo(c.getProperty("edit"))});this.moveHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsMoved(c.getProperty("cells"),c.getProperty("event"))});this.resizeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsResized(c.getProperty("cells"),c.getProperty("bounds"),c.getProperty("previous"))});this.setGraph(a)}mxLayoutManager.prototype=new mxEventSource;
mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=!0;mxLayoutManager.prototype.enabled=!0;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(a){this.enabled=a};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling};
mxLayoutManager.prototype.setBubbling=function(a){this.bubbling=a};mxLayoutManager.prototype.getGraph=function(){return this.graph};
mxLayoutManager.prototype.setGraph=function(a){if(null!=this.graph){var b=this.graph.getModel();b.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=a;null!=this.graph&&(b=this.graph.getModel(),b.addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler),this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler))};
mxLayoutManager.prototype.hasLayout=function(a){return null!=this.getLayout(a,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(a,b){return null};mxLayoutManager.prototype.beforeUndo=function(a){this.executeLayoutForCells(this.getCellsForChanges(a.changes))};
mxLayoutManager.prototype.cellsMoved=function(a,b){if(null!=a&&null!=b){b=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var c=this.getGraph().getModel(),d=0;d<a.length;d++){var e=this.getLayout(c.getParent(a[d]),mxEvent.MOVE_CELLS);null!=e&&e.moveCell(a[d],b.x,b.y)}}};
mxLayoutManager.prototype.cellsResized=function(a,b,c){if(null!=a&&null!=b&&null!=c)for(var d=this.getGraph().getModel(),e=0;e<a.length;e++){var f=this.getLayout(d.getParent(a[e]),mxEvent.RESIZE_CELLS);null!=f&&f.resizeCell(a[e],b[e],c[e])}};mxLayoutManager.prototype.getCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)return[];d=this.getCellsForChange(d);for(var e=0;e<d.length;e++)b.push(d[e])}return b};
mxLayoutManager.prototype.getCellsForChange=function(a){return a instanceof mxChildChange?this.addCellsWithLayout(a.child,this.addCellsWithLayout(a.previous)):a instanceof mxValueChange||a instanceof mxTerminalChange||a instanceof mxGeometryChange||a instanceof mxVisibleChange||a instanceof mxStyleChange?this.addCellsWithLayout(a.cell):[]};mxLayoutManager.prototype.addCellsWithLayout=function(a,b){return this.addDescendantsWithLayout(a,this.addAncestorsWithLayout(a,b))};
mxLayoutManager.prototype.addAncestorsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&(this.hasLayout(a)&&b.push(a),this.isBubbling())){var c=this.getGraph().getModel();this.addAncestorsWithLayout(c.getParent(a),b)}return b};mxLayoutManager.prototype.addDescendantsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&this.hasLayout(a))for(var c=this.getGraph().getModel(),d=0;d<c.getChildCount(a);d++){var e=c.getChildAt(a,d);this.hasLayout(e)&&(b.push(e),this.addDescendantsWithLayout(e,b))}return b};
mxLayoutManager.prototype.executeLayoutForCells=function(a){var b=this.getGraph().getModel();b.beginUpdate();try{var c=mxUtils.sortCells(a,!1);this.layoutCells(c,!0);this.layoutCells(c.reverse(),!1)}finally{b.endUpdate()}};
mxLayoutManager.prototype.layoutCells=function(a,b){if(0<a.length){var c=this.getGraph().getModel();c.beginUpdate();try{for(var d=null,e=0;e<a.length;e++)a[e]!=c.getRoot()&&a[e]!=d&&(this.executeLayout(a[e],b),d=a[e]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",a))}finally{c.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(a,b){b=this.getLayout(a,b?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=b&&b.execute(a)};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)};
function mxSwimlaneManager(a,b,c,d){this.horizontal=null!=b?b:!0;this.addEnabled=null!=c?c:!0;this.resizeEnabled=null!=d?d:!0;this.addHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(f.getProperty("cells"))});this.resizeHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(f.getProperty("cells"))});this.setGraph(a)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager;
mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=!0;mxSwimlaneManager.prototype.horizontal=!0;mxSwimlaneManager.prototype.addEnabled=!0;mxSwimlaneManager.prototype.resizeEnabled=!0;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(a){this.enabled=a};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal};
mxSwimlaneManager.prototype.setHorizontal=function(a){this.horizontal=a};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(a){this.addEnabled=a};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(a){this.resizeEnabled=a};mxSwimlaneManager.prototype.getGraph=function(){return this.graph};
mxSwimlaneManager.prototype.setGraph=function(a){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler));this.graph=a;null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(a){return!this.getGraph().isSwimlane(a)};
mxSwimlaneManager.prototype.isCellHorizontal=function(a){return this.graph.isSwimlane(a)?(a=this.graph.getCellStyle(a),1==mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,1)):!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)this.isSwimlaneIgnored(a[c])||this.swimlaneAdded(a[c])}finally{b.endUpdate()}}};
mxSwimlaneManager.prototype.swimlaneAdded=function(a){for(var b=this.getGraph().getModel(),c=b.getParent(a),d=b.getChildCount(c),e=null,f=0;f<d;f++){var g=b.getChildAt(c,f);if(g!=a&&!this.isSwimlaneIgnored(g)&&(e=b.getGeometry(g),null!=e))break}null!=e&&(b=null!=c?this.isCellHorizontal(c):this.horizontal,this.resizeSwimlane(a,e.width,e.height,b))};
mxSwimlaneManager.prototype.cellsResized=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)if(!this.isSwimlaneIgnored(a[c])){var d=b.getGeometry(a[c]);if(null!=d){for(var e=new mxRectangle(0,0,d.width,d.height),f=a[c],g=f;null!=g;){f=g;g=b.getParent(g);var h=this.graph.isSwimlane(g)?this.graph.getStartSize(g):new mxRectangle;e.width+=h.width;e.height+=h.height}var k=null!=g?this.isCellHorizontal(g):this.horizontal;this.resizeSwimlane(f,e.width,
e.height,k)}}}finally{b.endUpdate()}}};
mxSwimlaneManager.prototype.resizeSwimlane=function(a,b,c,d){var e=this.getGraph().getModel();e.beginUpdate();try{var f=this.isCellHorizontal(a);if(!this.isSwimlaneIgnored(a)){var g=e.getGeometry(a);null!=g&&(d&&g.height!=c||!d&&g.width!=b)&&(g=g.clone(),d?g.height=c:g.width=b,e.setGeometry(a,g))}var h=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;b-=h.width;c-=h.height;var k=e.getChildCount(a);for(d=0;d<k;d++){var l=e.getChildAt(a,d);this.resizeSwimlane(l,b,c,f)}}finally{e.endUpdate()}};
mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)};
function mxTemporaryCellStates(a,b,c,d,e,f){b=null!=b?b:1;this.view=a;this.oldValidateCellState=a.validateCellState;this.oldBounds=a.getGraphBounds();this.oldStates=a.getStates();this.oldScale=a.getScale();this.oldDoRedrawShape=a.graph.cellRenderer.doRedrawShape;var g=this;null!=e&&(a.graph.cellRenderer.doRedrawShape=function(l){var m=l.shape.paint;l.shape.paint=function(n){var p=e(l);null!=p&&n.setLink(p,null!=f?f(l):null);m.apply(this,arguments);null!=p&&n.setLink(null)};g.oldDoRedrawShape.apply(a.graph.cellRenderer,
arguments);l.shape.paint=m});a.validateCellState=function(l,m){return null==l||null==d||d(l)?g.oldValidateCellState.apply(a,arguments):null};a.setStates(new mxDictionary);a.setScale(b);if(null!=c){a.resetValidationState();b=null;for(var h=0;h<c.length;h++){var k=a.getBoundingBox(a.validateCellState(a.validateCell(c[h])));null==b?b=k:b.add(k)}a.setGraphBounds(b||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null;
mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};function mxCellStatePreview(a){this.deltas=new mxDictionary;this.graph=a}mxCellStatePreview.prototype.graph=null;
mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count};mxCellStatePreview.prototype.moveState=function(a,b,c,d,e){d=null!=d?d:!0;e=null!=e?e:!0;var f=this.deltas.get(a.cell);null==f?(f={point:new mxPoint(b,c),state:a},this.deltas.put(a.cell,f),this.count++):d?(f.point.x+=b,f.point.y+=c):(f.point.x=b,f.point.y=c);e&&this.addEdges(a);return f.point};
mxCellStatePreview.prototype.show=function(a){this.deltas.visit(mxUtils.bind(this,function(b,c){this.translateState(c.state,c.point.x,c.point.y)}));this.deltas.visit(mxUtils.bind(this,function(b,c){this.revalidateState(c.state,c.point.x,c.point.y,a)}))};
mxCellStatePreview.prototype.translateState=function(a,b,c){if(null!=a){var d=this.graph.getModel();if(d.isVertex(a.cell)){a.view.updateCellState(a);var e=d.getGeometry(a.cell);0==b&&0==c||null==e||e.relative&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c)}e=d.getChildCount(a.cell);for(var f=0;f<e;f++)this.translateState(a.view.getState(d.getChildAt(a.cell,f)),b,c)}};
mxCellStatePreview.prototype.revalidateState=function(a,b,c,d){if(null!=a){var e=this.graph.getModel();e.isEdge(a.cell)&&a.view.updateCellState(a);var f=this.graph.getCellGeometry(a.cell),g=a.view.getState(e.getParent(a.cell));0==b&&0==c||null==f||!f.relative||!e.isVertex(a.cell)||null!=g&&!e.isVertex(g.cell)&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c);this.graph.cellRenderer.redraw(a);null!=d&&d(a);f=e.getChildCount(a.cell);for(g=0;g<f;g++)this.revalidateState(this.graph.view.getState(e.getChildAt(a.cell,
g)),b,c,d)}};mxCellStatePreview.prototype.addEdges=function(a){for(var b=this.graph.getModel(),c=b.getEdgeCount(a.cell),d=0;d<c;d++){var e=a.view.getState(b.getEdgeAt(a.cell,d));null!=e&&this.moveState(e,0,0)}};function mxConnectionConstraint(a,b,c,d,e){this.point=a;this.perimeter=null!=b?b:!0;this.name=c;this.dx=d?d:0;this.dy=e?e:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null;
mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null;
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.suspended||(this.updatePreview(),this.updateHint())});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(b,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(b,c){this.refreshThread&&window.clearTimeout(this.refreshThread);this.refreshThread=window.setTimeout(mxUtils.bind(this,
function(){this.refreshThread=null;if(null!=this.first&&!this.suspended){var d=this.currentDx,e=this.currentDy;this.currentDy=this.currentDx=0;this.updatePreview();this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);null!=this.pBounds||this.livePreviewUsed?(this.currentDx=d,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),this.updatePreview())):
this.reset()}}),0)});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,function(b){null==this.graph.container||"hidden"==this.graph.container.style.visibility||null==this.first||this.suspended||(b=this.graph.isCloneEvent(b)&&this.graph.isCellsCloneable()&&this.isCloneEnabled(),b!=this.cloning&&(this.cloning=b,this.checkPreview(),this.updatePreview()))});mxEvent.addListener(document,"keydown",
this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.handlesVisible=!0;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;
mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;
mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};
mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};
mxGraphHandler.prototype.isPropagateSelectionCell=function(a,b,c){var d=this.graph.model.getParent(a);return b?(b=this.graph.model.isEdge(a)?null:this.graph.getCellGeometry(a),!this.graph.isSiblingSelected(a)&&(null!=b&&b.relative||!this.graph.isSwimlane(d))):(!this.graph.isToggleEvent(c.getEvent())||!this.graph.isSiblingSelected(a)&&!this.graph.isCellSelected(a)&&!this.graph.isSwimlane(d)||this.graph.isCellSelected(d))&&(this.graph.isToggleEvent(c.getEvent())||!this.graph.isCellSelected(d))};
mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=a.getState();if(!(this.graph.isToggleEvent(a.getEvent())&&mxEvent.isAltDown(a.getEvent())||null==b||this.graph.isCellSelected(b.cell)))for(var c=this.graph.model,d=this.graph.view.getState(c.getParent(b.cell));null!=d&&!this.graph.isCellSelected(d.cell)&&(c.isVertex(d.cell)||c.isEdge(d.cell))&&this.isPropagateSelectionCell(b.cell,!0,a)&&d.cell!=this.graph.getCurrentRoot();)b=d,d=this.graph.view.getState(this.graph.getModel().getParent(b.cell));
return null!=b?b.cell:null};mxGraphHandler.prototype.isDelayedSelection=function(a,b){if(!this.graph.isToggleEvent(b.getEvent())||!mxEvent.isAltDown(b.getEvent()))for(;null!=a;){if(this.graph.selectionCellsHandler.isHandled(a))return this.graph.cellEditor.getEditingCell()!=a;a=this.graph.model.getParent(a)}return this.graph.isToggleEvent(b.getEvent())};
mxGraphHandler.prototype.selectDelayed=function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);this.selectCellForEvent(b,a)}};
mxGraphHandler.prototype.selectCellForEvent=function(a,b){var c=this.graph.view.getState(a);if(null!=c){if(!(b.isSource(c.control)||this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent()))){c=this.graph.getModel();for(var d=c.getParent(a);null!=this.graph.view.getState(d)&&(c.isVertex(d)||c.isEdge(d)&&!this.graph.isToggleEvent(b.getEvent()))&&this.isPropagateSelectionCell(a,!1,b)&&d!=this.graph.getCurrentRoot();)a=d,d=c.getParent(a)}this.graph.selectCellForEvent(a,b.getEvent())}return a};
mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){this.mouseDownX=b.getX();this.mouseDownY=b.getY();a=b.getEvent();if(!mxEvent.isMouseEvent(a)||mxEvent.isLeftMouseButton(a)){var c=mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)&&!this.graph.isSelectionEmpty();if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null!=b.getState()||c)&&!mxEvent.isMultiTouchEvent(a)){var d=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(d,b);this.cell=null;null==d&&c&&(d=this.graph.getSelectionCell());
c=this.graph.getSelectionCount();this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(d,a);mxEvent.isTouchEvent(b.getEvent())&&this.graph.isCellSelected(d)&&0<c&&(this.delayedSelection=this.blockDelayedSelection=!0);this.isMoveEnabled()&&(this.delayedSelection?this.cell=d:this.start(d,b.getX(),b.getY()),this.cellWasClicked=!0,this.graph.isCellLocked(d)||this.consumeMouseEvent(mxEvent.MOUSE_DOWN,b))}}};
mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(d){return null!=this.graph.view.getState(d)&&b.isVertex(d)&&null!=b.getGeometry(d)&&!b.getGeometry(d).relative});a=this.graph.view.getCellStates(b.filterDescendants(c,a));for(c=0;c<a.length;c++)a[c]=this.getGuideState(a[c]);return a};
mxGraphHandler.prototype.getGuideState=function(a){if(null!=a&&this.graph.getModel().isVertex(a.cell)&&90==mxUtils.mod(mxUtils.getNumber(a.style,mxConstants.STYLE_ROTATION,0),360)%180){var b=new mxCellState(a.view,a.cell,a.style);b.x=a.getCenterX()-a.height/2;b.y=a.getCenterY()-a.width/2;b.width=a.height;b.height=a.width;return b}return a};
mxGraphHandler.prototype.getCells=function(a,b){if(null==b&&!this.delayedSelection&&this.graph.isCellMovable(a))return[this.graph.getCompositeParent(a)];b=null!=b?b:this.graph.getSelectionCells();a=new mxDictionary;for(var c=[],d=0;d<b.length;d++){var e=this.graph.getCompositeParent(b[d]);null==a.get(e)&&(a.put(e,!0),c.push(e))}b=[];for(d=0;d<c.length;d++){for(e=this.graph.model.getParent(c[d]);null==a.get(e)&&null!=e;)e=this.graph.model.getParent(e);null==e&&b.push(c[d])}return this.graph.getMovableCells(b)};
mxGraphHandler.prototype.getPreviewBounds=function(a){a=this.getBoundingBox(a);null!=a&&(a.width=Math.max(0,a.width-1),a.height=Math.max(0,a.height-1),a.width<this.minimumSize?(a.x-=(this.minimumSize-a.width)/2,a.width=this.minimumSize):(a.x=Math.round(a.x),a.width=Math.ceil(a.width)),a.height<this.minimumSize?(a.y-=(this.minimumSize-a.height)/2,a.height=this.minimumSize):(a.y=Math.round(a.y),a.height=Math.ceil(a.height)));return a};
mxGraphHandler.prototype.getStateBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=mxRectangle.fromRectangle(e);c.isVertex(a[d])&&90==mxUtils.mod(mxUtils.getNumber(e.style,mxConstants.STYLE_ROTATION,0),360)%180&&(f=new mxRectangle(e.getCenterX()-e.height/2,e.getCenterY()-e.width/2,e.height,e.width));null==b?b=f:b.add(f)}}return b};
mxGraphHandler.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=e;c.isVertex(a[d])&&null!=e.shape&&null!=e.shape.boundingBox&&(f=e.shape.boundingBox);null==b?b=mxRectangle.fromRectangle(f):b.add(f)}}return b};
mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a,null,this.previewColor);a.isDashed=!0;this.htmlPreview?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()),a.pointerEvents=!1,mxClient.IS_IOS&&(a.getSvgScreenOffset=function(){return 0}));return a};
mxGraphHandler.prototype.start=function(a,b,c,d){var e=this.graph.model,f=e.getGeometry(a);if(null==this.first&&this.graph.isCellMovable(a)&&(!e.isEdge(a)||1<this.graph.getSelectionCount()||null!=f&&null!=f.points&&0<f.points.length||null==e.getTerminal(a,!0)||null==e.getTerminal(a,!1)||this.graph.allowDanglingEdges)){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=null!=d?d:this.getCells(this.cell);this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);
this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var g=this.graph.model.getParent(a),h=2>this.graph.model.getChildCount(g),k=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b<a.length;b++)null==this.graph.view.getState(a[b])||k.get(a[b])||k.put(a[b],!0);this.guide.isStateIgnored=
mxUtils.bind(this,function(l){var m=this.graph.model.getParent(l.cell);return null!=l.cell&&(!this.cloning&&this.isCellMoving(l.cell)||l.cell!=(this.target||g)&&!h&&!k.get(l.cell)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&m!=(this.target||g))})}}};
mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;c=this.graph.model.getChildCount(a);for(var e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent())&&!this.isConstrainedEvent(a):!0};
mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};
mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a,b){for(b=0;b<this.cells.length;b++)if(this.graph.model.getParent(this.cells[b])!=a)return!0;return!1};
mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1,this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0)):this.maxLivePreview>=this.cellCount&&this.allowLivePreview?this.cloning?this.livePreviewUsed=!0:this.livePreviewActive||(this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))};
mxGraphHandler.prototype.mouseMove=function(a,b){a=this.graph;var c=a.tolerance;if(null==this.first&&this.delayedSelection&&null!=this.cell&&null!=this.mouseDownX&&null!=this.mouseDownY&&(Math.abs(this.mouseDownX-b.getX())>c||Math.abs(this.mouseDownY-b.getY())>c)){this.delayedSelection=!1;this.cellWasClicked=!0;this.graph.isCellSelected(this.cell)||mxEvent.isAltDown(b.getEvent())||(this.graph.isToggleEvent(b.getEvent())?a.addSelectionCell(this.cell):this.graph.isAncestorSelected(this.cell)||a.setSelectionCell(this.cell));
var d=a.getSelectionCells();this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent())&&!a.isSelectionEmpty()||(d=d.concat(this.cell));this.start(this.cell,this.mouseDownX,this.mouseDownY,this.getCells(null,d))}d=null!=this.first?this.getDelta(b):null;if(b.isConsumed()||!a.isMouseDown||null==this.cell||null==d||null==this.bounds||this.suspended)!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||a.isMouseDown||(d=
a.getCursorForMouseEvent(b),null==d&&a.isEnabled()&&a.isCellMovable(b.getCell())&&(d=a.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=d&&null!=b.sourceState&&b.sourceState.setCursor(d));else if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{if(null!=this.shape||this.livePreviewActive||this.cloning||Math.abs(d.x)>c||Math.abs(d.y)>c){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,
3));c=a.isCloneEvent(b.getEvent())&&a.isCellsCloneable()&&this.isCloneEnabled();var e=a.isGridEnabledEvent(b.getEvent()),f=b.getCell();f=null!=f&&0>mxUtils.indexOf(this.cells,f)?f:a.getCellAt(b.getGraphX(),b.getGraphY(),null,null,null,mxUtils.bind(this,function(m,n,p){return 0<=mxUtils.indexOf(this.cells,m.cell)}));var g=!0,h=null;this.cloning=c;a.isDropEnabled()&&this.highlightEnabled&&(h=a.getDropTarget(this.cells,b.getEvent(),f,c));var k=a.getView().getState(h),l=!1;null!=k&&(c||this.isValidDropTarget(h,
b))?(this.target!=h&&(this.target=h,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),l=!0):(this.target=null,this.connectOnDrop&&null!=f&&1==this.cells.length&&a.getModel().isVertex(f)&&a.isCellConnectable(f)&&(k=a.getView().getState(f),null!=k&&(f=null==a.getEdgeValidationError(null,this.cell,f)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(f),l=!0)));null!=k&&l?this.highlight.highlight(k):this.highlight.hide();null!=this.guide&&this.useGuidesForEvent(b)?
(d=this.guide.move(this.bounds,d,e,c),g=!1):d=a.snapDelta(d,this.bounds,!e,!1,!1);null!=this.guide&&g&&this.guide.hide();this.isConstrainedEvent(b)&&(Math.abs(d.x)>Math.abs(d.y)?d.y=0:d.x=0);this.checkPreview();if(this.currentDx!=d.x||this.currentDy!=d.y)this.currentDx=d.x,this.currentDy=d.y,this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,b);mxEvent.consume(b.getEvent())}};
mxGraphHandler.prototype.isConstrainedEvent=function(a){return(null==this.target||this.graph.isCloneEvent(a.getEvent()))&&this.graph.isConstrainedEvent(a.getEvent())};mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()};
mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};
mxGraphHandler.prototype.updateLivePreview=function(a,b){if(!this.suspended){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(m,n){m=this.graph.view.getState(n.cell);m!=n&&(n.destroy(),null!=m?this.allCells.put(n.cell,m):this.allCells.remove(n.cell),n=m);if(null!=n&&(m=n.clone(),c.push([n,m]),null!=n.shape&&(null==n.shape.originalPointerEvents&&(n.shape.originalPointerEvents=n.shape.pointerEvents),n.shape.pointerEvents=!1,null!=n.text&&(null==n.text.originalPointerEvents&&
(n.text.originalPointerEvents=n.text.pointerEvents),n.text.pointerEvents=!1)),this.graph.model.isVertex(n.cell))){if(!this.cloning||this.graph.isCellCloneable(n.cell))n.x+=a,n.y+=b;this.cloning?null!=n.text&&(n.text.updateBoundingBox(),null!=n.text.boundingBox&&(n.text.boundingBox.x+=a,n.text.boundingBox.y+=b),null!=n.text.unrotatedBoundingBox&&(n.text.unrotatedBoundingBox.x+=a,n.text.unrotatedBoundingBox.y+=b)):(n.view.graph.cellRenderer.redraw(n,!0),n.view.invalidate(n.cell),n.invalid=!1,null!=
n.control&&null!=n.control.node&&(n.control.node.style.visibility="hidden"))}}));if(0==c.length)this.reset();else{for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)&&(!this.cloning||this.graph.isCellCloneable(f.cell))){var g=this.graph.getCellGeometry(f.cell),h=[];if(null!=g&&null!=g.points)for(var k=0;k<g.points.length;k++)null!=g.points[k]&&h.push(new mxPoint(g.points[k].x+a/d,g.points[k].y+b/d));k=f.visibleSourceState;var l=f.visibleTargetState;
g=c[e][1].absolutePoints;null!=g&&(null!=k&&this.isCellMoving(k.cell)?f.view.updateFixedTerminalPoint(f,k,!0,this.graph.getConnectionConstraint(f,k,!0)):(k=null==k?f.view.getFixedTerminalPoint(f,null,!0,null):null,k=null!=k?k:g[0],f.setAbsoluteTerminalPoint(new mxPoint(k.x+a,k.y+b),!0),k=null),null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=null==l?f.view.getFixedTerminalPoint(f,null,!1,null):null,l=null!=l?l:g[g.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+
a,l.y+b),!1),l=null));f.view.updatePoints(f,h,k,l);f.view.updateFloatingTerminalPoints(f,k,l);f.view.updateEdgeLabelOffset(f);f.invalid=!1;this.cloning||f.view.graph.cellRenderer.redraw(f,!0)}}this.graph.view.validate();this.redrawHandles(c);this.resetPreviewStates(c)}}};mxGraphHandler.prototype.redrawHandles=function(a){for(var b=0;b<a.length;b++){var c=this.graph.selectionCellsHandler.getHandler(a[b][0].cell);null!=c&&c.redraw(!0)}};
mxGraphHandler.prototype.resetPreviewStates=function(a){for(var b=0;b<a.length;b++)a[b][0].setState(a[b][1])};mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)};
mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))};
mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,function(a,b){null!=b.shape&&null!=b.shape.originalPointerEvents&&(b.shape.pointerEvents=b.shape.originalPointerEvents,b.shape.originalPointerEvents=null,b.shape.bounds=null,null!=b.text&&(b.text.pointerEvents=b.text.originalPointerEvents,b.text.originalPointerEvents=null));null!=b.control&&null!=b.control.node&&"hidden"==b.control.node.style.visibility&&(b.control.node.style.visibility=
"");this.cloning||null!=b.text&&b.text.updateBoundingBox();b.view.invalidate(b.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(a,b,c){if(c||this.handlesVisible!=b)for(this.handlesVisible=b,c=0;c<a.length;c++){var d=this.graph.selectionCellsHandler.getHandler(a[c]);null!=d&&(d.setHandlesVisible(b),b&&d.redraw())}};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)};
mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null!=this.cell&&null!=this.first&&null!=this.currentDx&&null!=this.currentDy&&(null!=this.shape||this.livePreviewUsed||this.cloning)){a=this.graph;var c=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=c&&a.getModel().isVertex(c)&&a.isCellConnectable(c)&&a.isEdgeValid(null,this.cell,c))a.connectionHandler.connect(this.cell,c,b.getEvent());else{var d=a.getView().scale;c=this.roundLength(this.currentDx/
d);d=this.roundLength(this.currentDy/d);var e=this.target;a.isSplitEnabled()&&a.isSplitTarget(e,this.cells,b.getEvent())?a.splitEdge(e,this.cells,null,c,d,b.getGraphX(),b.getGraphY()):this.moveCells(this.cells,c,d,this.cloning,this.target,b.getEvent())}}else this.isSelectEnabled()&&this.delayedSelection&&!this.blockDelayedSelection&&null!=this.cell&&this.selectDelayed(b);this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,b);this.reset()};
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0));this.destroyShapes();this.removeHint();this.delayedSelection=this.blockDelayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=this.suspended=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.pBounds=this.allCells=
null};mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);d=Math.sin(-d);var e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);!this.graph.isCellSelected(this.cell)&&this.graph.isCellSelected(g)&&(g=this.graph.getModel().getParent(g));null==e&&null!=f&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&
this.removeEmptyParents){for(var h=new mxDictionary,k=0;k<a.length;k++)h.put(a[k],!0);for(k=0;k<a.length;k++){var l=this.graph.model.getParent(a[k]);null==l||h.get(l)||(h.put(l,!0),g.push(l))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(k=0;k<g.length;k++)this.shouldRemoveParent(g[k])&&b.push(g[k]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])};
mxGraphHandler.prototype.shouldRemoveParent=function(a){a=this.graph.view.getState(a);return null!=a&&(this.graph.model.isEdge(a.cell)||this.graph.model.isVertex(a.cell))&&this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)&&this.graph.isTransparentState(a)};
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};
mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.graph.removeListener(this.refreshHandler),this.refreshHandler=null);mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes();
this.removeHint()};
function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");b==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(c)&&(this.start(c),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",c)),c.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){this.isPinchEnabled()&&(b=
c.getProperty("event"),mxEvent.isConsumed(b)||"gesturestart"!=b.type?"gestureend"==b.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(b))}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addGestureListeners(document,
null,null,this.mouseUpListener),mxEvent.addListener(document,"mouseleave",this.mouseUpListener))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1;
mxPanningHandler.prototype.panningEnabled=!0;mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled};
mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(b)||mxEvent.isControlDown(b)&&mxEvent.isShiftDown(b)||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)};
mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,b){this.mouseDownEvent=b;!b.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(b)&&(this.start(b),this.consumePanningTrigger(b))};
mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()};
mxPanningHandler.prototype.mouseMove=function(a,b){this.dx=b.getX()-this.startX;this.dy=b.getY()-this.startY;this.active?(this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",b))):this.panningTrigger&&(a=this.active,this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!a&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,
"event",b)));(this.active||this.panningTrigger)&&b.consume()};mxPanningHandler.prototype.mouseUp=function(a,b){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){a=this.graph.getView().scale;var c=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(c.x+this.dx/a,c.y+this.dy/a)}b.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",b))}this.reset()};
mxPanningHandler.prototype.zoomGraph=function(a){var b=Math.round(this.initialScale*a.scale*100)/100;null!=this.minScale&&(b=Math.max(this.minScale,b));null!=this.maxScale&&(b=Math.min(this.maxScale,b));this.graph.view.scale!=b&&(this.graph.zoomTo(b),mxEvent.consume(a))};mxPanningHandler.prototype.reset=function(){this.panningTrigger=this.graph.isMouseDown=!1;this.mouseDownEvent=null;this.active=!1;this.dy=this.dx=null};
mxPanningHandler.prototype.panGraph=function(a,b){this.graph.getView().setTranslate(a,b)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeGestureListeners(document,null,null,this.mouseUpListener);mxEvent.removeListener(document,"mouseleave",this.mouseUpListener)};
function mxPopupMenuHandler(a,b){null!=a&&(this.graph=a,this.factoryMethod=b,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(c,d){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=!0;
mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.graph.tooltipHandler.hide()}))};
mxPopupMenuHandler.prototype.getTriggerPoint=function(){var a=this.graph.view.scale,b=this.graph.view.translate;return new mxPoint(this.triggerX/a-b.x,this.triggerY/a-b.y)};mxPopupMenuHandler.prototype.isSelectOnPopup=function(a){return this.selectOnPopup};
mxPopupMenuHandler.prototype.mouseDown=function(a,b){this.isEnabled()&&!mxEvent.isMultiTouchEvent(b.getEvent())&&(this.hideMenu(),this.triggerX=b.getGraphX(),this.triggerY=b.getGraphY(),this.screenX=mxEvent.getMainEvent(b.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(b.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(b),this.inTolerance=!0)};
mxPopupMenuHandler.prototype.mouseMove=function(a,b){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(b.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(b.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)};
mxPopupMenuHandler.prototype.mouseUp=function(a,b,c){a=null==c;c=null!=c?c:mxUtils.bind(this,function(e){var f=mxUtils.getScrollOrigin();this.popup(b.getX()+f.x+1,b.getY()+f.y+1,e,b.getEvent())});if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var d=this.getCellForPopupEvent(b);this.graph.isEnabled()&&this.isSelectOnPopup(b)&&null!=d&&!this.graph.isCellSelected(d)?this.graph.setSelectionCell(d):this.clearSelectionOnBackground&&null==d&&this.graph.clearSelection();
this.graph.tooltipHandler.hide();c(d);a&&b.consume()}this.inTolerance=this.popupTrigger=!1};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){return a.getCell()};mxPopupMenuHandler.prototype.documentKeyDown=function(a){null==this.returnFocus&&this.isMenuShowing()&&!this.isTextInputEvent(a)&&mxUtils.isAncestorNode(this.graph.container,mxEvent.getSource(a))&&(this.returnFocus=this.graph.container);mxPopupMenu.prototype.documentKeyDown.apply(this,arguments)};
mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)};function mxCellMarker(a,b,c,d){mxEventSource.call(this);null!=a&&(this.graph=a,this.validColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=c?c:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=d?d:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(a))}mxUtils.extend(mxCellMarker,mxEventSource);
mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=!0;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=!1;mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(a){this.enabled=a};mxCellMarker.prototype.isEnabled=function(){return this.enabled};
mxCellMarker.prototype.setHotspot=function(a){this.hotspot=a};mxCellMarker.prototype.getHotspot=function(){return this.hotspot};mxCellMarker.prototype.setHotspotEnabled=function(a){this.hotspotEnabled=a};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return null!=this.validState};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};
mxCellMarker.prototype.reset=function(){this.validState=null;null!=this.markedState&&(this.markedState=null,this.unmark())};mxCellMarker.prototype.process=function(a){var b=null;this.isEnabled()&&(b=this.getState(a),this.setCurrentState(b,a));return b};
mxCellMarker.prototype.setCurrentState=function(a,b,c){var d=null!=a?this.isValidState(a):!1;c=null!=c?c:this.getMarkerColor(b.getEvent(),a,d);this.validState=d?a:null;if(a!=this.markedState||c!=this.currentColor)this.currentColor=c,null!=a&&null!=this.currentColor?(this.markedState=a,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark())};
mxCellMarker.prototype.markCell=function(a,b){a=this.graph.getView().getState(a);null!=a&&(this.currentColor=null!=b?b:this.validColor,this.markedState=a,this.mark())};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(a){return!0};
mxCellMarker.prototype.getMarkerColor=function(a,b,c){return c?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(a){var b=this.graph.getView(),c=this.getCell(a);b=this.getStateToMark(b.getState(c));return null!=b&&this.intersects(b,a)?b:null};mxCellMarker.prototype.getCell=function(a){return a.getCell()};mxCellMarker.prototype.getStateToMark=function(a){return a};
mxCellMarker.prototype.intersects=function(a,b){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,b.getGraphX(),b.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.highlight.destroy()};
function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.redrawHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!1)});this.refreshHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!0)});this.graph.addListener(mxEvent.EDITING_STOPPED,this.redrawHandler);this.graph.addListener(mxEvent.EDITING_STARTED,this.redrawHandler);this.graph.getSelectionModel().addListener(mxEvent.CHANGE,
this.redrawHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);
mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)};
mxSelectionCellsHandler.prototype.isHandled=function(a){return null!=this.getHandler(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};
mxSelectionCellsHandler.prototype.refresh=function(a){var b=this.handlers;this.handlers=new mxDictionary;var c=mxUtils.sortCells(this.getHandledSelectionCells(),!1);if(!a&&0<this.graph.graphHandler.maxCells&&0<this.graph.getSelectionCount()){var d=b.getCount();0<d&&(a=d<=this.graph.graphHandler.maxCells!=this.graph.getSelectionCount()<=this.graph.graphHandler.maxCells)}d=[this.graph,this.graph.getView(),this.graph.getModel()];for(var e=0;e<d.length;e++)d[e].beginRemoveListeners();try{for(e=0;e<c.length;e++){var f=
this.graph.view.getState(c[e]);if(null!=f){var g=b.remove(c[e]);null!=g&&(g.state!=f?(g.destroy(),g=null):this.isHandlerActive(g)||(a&&g.refresh(),g.redraw()));null!=g&&this.handlers.put(c[e],g)}}b.visit(mxUtils.bind(this,function(h,k){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",k.state));k.destroy()}))}finally{for(e=0;e<d.length;e++)d[e].endRemoveListeners()}for(e=0;e<c.length;e++)f=this.graph.view.getState(c[e]),null!=f&&(g=this.handlers.get(c[e]),null==g?(g=this.graph.createHandler(f),
this.fireEvent(new mxEventObject(mxEvent.ADD,"state",f)),this.handlers.put(c[e],g)):g.updateParentHighlight())};mxSelectionCellsHandler.prototype.isHandlerActive=function(a){return null!=a.index};mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);if(null!=b){var c=b.index,d=b.startX,e=b.startY;b.destroy();b=this.graph.createHandler(a);null!=b&&(this.handlers.put(a.cell,b),null!=c&&null!=d&&null!=e&&b.start(d,e,c))}};
mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseDown.apply(e,c)})}};mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseMove.apply(e,c)})}};
mxSelectionCellsHandler.prototype.mouseUp=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseUp.apply(e,c)})}};
mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.redrawHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.graph.removeListener(this.redrawHandler),this.refreshHandler=this.redrawHandler=null)};
function mxConnectionHandler(a,b){mxEventSource.call(this);null!=a&&(this.graph=a,this.factoryMethod=b,this.init(),this.escapeHandler=mxUtils.bind(this,function(c,d){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=!0;mxConnectionHandler.prototype.moveIconFront=!1;mxConnectionHandler.prototype.moveIconBack=!1;
mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=!1;mxConnectionHandler.prototype.enabled=!0;mxConnectionHandler.prototype.select=!0;mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=!1;mxConnectionHandler.prototype.ignoreMouseDown=!1;mxConnectionHandler.prototype.first=null;
mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=!1;mxConnectionHandler.prototype.outlineConnect=!1;mxConnectionHandler.prototype.livePreview=!1;mxConnectionHandler.prototype.cursor=null;
mxConnectionHandler.prototype.insertBeforeSource=!1;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(a){this.enabled=a};mxConnectionHandler.prototype.isInsertBefore=function(a,b,c,d,e){return this.insertBeforeSource&&b!=c&&this.graph.model.getParent(a)==this.graph.model.getParent(b)};mxConnectionHandler.prototype.isCreateTarget=function(a){return this.createTarget};
mxConnectionHandler.prototype.setCreateTarget=function(a){this.createTarget=a};mxConnectionHandler.prototype.createShape=function(){var a=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);a.dialect=mxConstants.DIALECT_SVG;a.scale=this.graph.view.scale;a.svgStrokeTolerance=0;a.pointerEvents=!1;a.isDashed=!0;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,null);return a};
mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,function(a){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell));null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()});this.graph.getModel().addListener(mxEvent.CHANGE,
this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,function(a){this.reset()});this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)};
mxConnectionHandler.prototype.isConnectableCell=function(a){return!0};
mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);a.hotspotEnabled=!0;a.getCell=mxUtils.bind(this,function(b){var c=mxCellMarker.prototype.getCell.apply(a,arguments);this.error=null;null==c&&null!=this.currentPoint&&(c=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y));if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}if(this.graph.isSwimlane(c)&&
null!=this.currentPoint&&this.graph.hitsSwimlaneContent(c,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(c))c=null;null!=c?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,c),null!=this.error&&0==this.error.length&&(c=null,this.isCreateTarget(b.getEvent())&&(this.error=null))):this.isValidSource(c,b)||(c=null):!this.isConnecting()||this.isCreateTarget(b.getEvent())||this.graph.allowDanglingEdges||(this.error="");return c});a.isValidState=
mxUtils.bind(this,function(b){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)});a.getMarkerColor=mxUtils.bind(this,function(b,c,d){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null});a.intersects=mxUtils.bind(this,function(b,c){return null!=this.connectImage||this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};
mxConnectionHandler.prototype.start=function(a,b,c,d){this.previous=a;this.first=new mxPoint(b,c);this.edgeState=null!=d?d:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=a;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape};mxConnectionHandler.prototype.isValidSource=function(a,b){return this.graph.isValidSource(a)};
mxConnectionHandler.prototype.isValidTarget=function(a){return!0};mxConnectionHandler.prototype.validateConnection=function(a,b){return this.isValidTarget(b)?this.graph.getEdgeValidationError(null,a,b):""};mxConnectionHandler.prototype.getConnectImage=function(a){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(a){return null!=a.text&&a.text.node.parentNode==this.graph.container?!0:this.moveIconFront};
mxConnectionHandler.prototype.createIcons=function(a){var b=this.getConnectImage(a);if(null!=b&&null!=a){this.iconState=a;var c=[],d=new mxRectangle(0,0,b.width,b.height),e=new mxImageShape(d,b.src,null,null,0);e.preserveImageAspect=!1;this.isMoveIconToFrontForState(a)?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=e.node.previousSibling&&e.node.parentNode.insertBefore(e.node,
e.node.parentNode.firstChild));e.node.style.cursor=mxConstants.CURSOR_CONNECT;var f=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:a});b=mxUtils.bind(this,function(g){mxEvent.isConsumed(g)||(this.icon=e,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,f())))});mxEvent.redirectMouseEvents(e.node,this.graph,f,b);c.push(e);this.redrawIcons(c,this.iconState);return c}return null};
mxConnectionHandler.prototype.redrawIcons=function(a,b){null!=a&&null!=a[0]&&null!=b&&(b=this.getIconPosition(a[0],b),a[0].bounds.x=b.x,a[0].bounds.y=b.y,a[0].redraw())};
mxConnectionHandler.prototype.getIconPosition=function(a,b){var c=this.graph.getView().scale,d=b.getCenterX(),e=b.getCenterY();if(this.graph.isSwimlane(b.cell)){var f=this.graph.getStartSize(b.cell);d=0!=f.width?b.x+f.width*c/2:d;e=0!=f.height?b.y+f.height*c/2:e;f=mxUtils.toRadians(mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION)||0);0!=f&&(c=Math.cos(f),f=Math.sin(f),b=new mxPoint(b.getCenterX(),b.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(d,e),c,f,b),d=e.x,e=e.y)}return new mxPoint(d-
a.bounds.width/2,e-a.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var a=0;a<this.icons.length;a++)this.icons[a].destroy();this.iconState=this.selectedIcon=this.icon=this.icons=null}};mxConnectionHandler.prototype.isStartEvent=function(a){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)};
mxConnectionHandler.prototype.mouseDown=function(a,b){this.mouseDownCounter++;this.isEnabled()&&this.graph.isEnabled()&&!b.isConsumed()&&!this.isConnecting()&&this.isStartEvent(b)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(b.getGraphX(),
b.getGraphY()),this.edgeState=this.createEdgeState(b),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState&&(a=this.graph.getPointForEvent(b.getEvent()),this.edgeState.cell.geometry.setTerminalPoint(a,!0)),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),b.consume());this.selectedIcon=this.icon;this.icon=null};
mxConnectionHandler.prototype.isImmediateConnectSource=function(a){return!this.graph.isCellMovable(a.cell)};mxConnectionHandler.prototype.createEdgeState=function(a){return null};
mxConnectionHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||
0));return this.outlineConnect&&(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))};
mxConnectionHandler.prototype.updateCurrentState=function(a,b){this.constraintHandler.update(a,null==this.first,!1,null==this.first||a.isSource(this.marker.highlight.shape)?null:b);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",
this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(a.getEvent())?(this.marker.reset(),this.currentState=
null):(this.marker.process(a),this.currentState=this.marker.getValidState());null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var c=this.isOutlineConnectEvent(a);null!=this.currentState&&c&&(a.isSource(this.marker.highlight.shape)&&(b=new mxPoint(a.getGraphX(),a.getGraphY())),c=this.graph.getOutlineConstraint(b,this.currentState,a),this.constraintHandler.setFocus(a,this.currentState,!1),this.constraintHandler.currentConstraint=
c,this.constraintHandler.currentPoint=b);this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(b=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(a.getCell())&&
this.marker.getValidState()!=a.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0};
mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y};
mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}};
mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);a=this.graph.getView();var c=a.scale,d=a.translate;a=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(a=new mxPoint((this.graph.snap(a.x/c-d.x)+d.x)*c,(this.graph.snap(a.y/c-d.y)+d.y)*c));
this.snapToPreview(b,a);this.currentPoint=a;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,a);if(null!=this.first){var e=null;c=a;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(e=this.constraintHandler.currentConstraint,
c=this.constraintHandler.currentPoint.clone()):null!=this.previous&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&(d=new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),null!=this.sourceConstraint&&(d=this.first),Math.abs(d.x-a.x)<Math.abs(d.y-a.y)?a.x=d.x:a.y=d.y);d=this.first;if(null!=this.selectedIcon){var f=this.selectedIcon.bounds.width,g=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(f=this.getIconPosition(this.selectedIcon,
this.currentState),this.selectedIcon.bounds.x=f.x,this.selectedIcon.bounds.y=f.y):(f=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,f,g),this.selectedIcon.bounds=f);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(c,e),c=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],d=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(f=this.getTargetPerimeterPoint(this.currentState,
b),null!=f&&(c=f)),null==this.sourceConstraint&&null!=this.previous&&(f=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:c,b),null!=f&&(d=f)));if(null==this.currentState&&this.movePreviewAway){f=d;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(e=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=e&&(f=e));e=c.x-f.x;f=c.y-f.y;g=Math.sqrt(e*e+f*f);if(0==g)return;this.originalPoint=c.clone();c.x-=4*e/
g;c.y-=4*f/g}else this.originalPoint=null;null==this.shape&&(e=Math.abs(b.getGraphX()-this.first.x),f=Math.abs(b.getGraphY()-this.first.y),e>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,a));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(a=[d],null!=this.waypoints&&(a=a.concat(this.waypoints)),a.push(c),this.shape.points=a),this.drawPreview());
null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=
this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){a=!1;c=b.getSource();for(d=0;d<this.icons.length&&!a;d++)a=c==this.icons[d].node||c.parentNode==this.icons[d].node;a||this.updateIcons(this.currentState,this.icons,b)}}};
mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]);
this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));a=null;if(null!=this.waypoints)for(a=[],b=0;b<this.waypoints.length;b++){var c=this.waypoints[b].clone();
this.convertWaypoint(c);a[b]=c}this.graph.view.updatePoints(this.edgeState,a,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};
mxConnectionHandler.prototype.getTargetPerimeterPoint=function(a,b){b=null;var c=a.view,d=c.getPerimeterFunction(a);if(null!=d){var e=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());a=d(c.getPerimeterBounds(a),this.edgeState,e,!1);null!=a&&(b=a)}else b=new mxPoint(a.getCenterX(),a.getCenterY());return b};
mxConnectionHandler.prototype.getSourcePerimeterPoint=function(a,b,c){c=null;var d=a.view,e=d.getPerimeterFunction(a),f=new mxPoint(a.getCenterX(),a.getCenterY());if(null!=e){var g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),h=Math.PI/180*-g;0!=g&&(b=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(h),Math.sin(h),f));a=e(d.getPerimeterBounds(a),a,b,!1);null!=a&&(0!=g&&(a=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),Math.cos(-h),Math.sin(-h),f)),c=a)}else c=f;return c};
mxConnectionHandler.prototype.updateIcons=function(a,b,c){};mxConnectionHandler.prototype.isStopEvent=function(a){return null!=a.getState()};
mxConnectionHandler.prototype.addWaypointForEvent=function(a){var b=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY()),c=Math.abs(b.x-this.first.x);b=Math.abs(b.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(c>this.graph.tolerance||b>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),c=this.graph.view.scale,b=new mxPoint(this.graph.snap(a.getGraphX()/c)*c,this.graph.snap(a.getGraphY()/c)*c),this.waypoints.push(b)};
mxConnectionHandler.prototype.checkConstraints=function(a,b){return null==a||null==b||null==a.point||null==b.point||!a.point.equals(b.point)||a.dx!=b.dx||a.dy!=b.dy||a.perimeter!=b.perimeter};
mxConnectionHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(b)){this.addWaypointForEvent(b);b.consume();return}a=this.sourceConstraint;var c=this.constraintHandler.currentConstraint,d=null!=this.previous?this.previous.cell:null,e=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(e=this.constraintHandler.currentFocus.cell);null==e&&null!=this.currentState&&(e=this.currentState.cell);
null!=this.error||null!=d&&null!=e&&d==e&&!this.checkConstraints(a,c)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,b.getEvent()),null!=this.error&&0<this.error.length&&this.graph.validationAlert(this.error)):this.connect(d,e,b.getEvent(),b.getCell());this.destroyIcons();b.consume()}null!=this.first&&this.reset()};
mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor="");this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.sourceConstraint=this.error=this.previous=this.edgeState=this.currentPoint=this.originalPoint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))};
mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error);null!=this.edgeState&&(this.edgeState.shape=this.shape,this.graph.cellRenderer.postConfigureShape(this.edgeState),this.edgeState.shape=null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(a){this.shape.strokewidth=this.getEdgeWidth(a);this.shape.stroke=this.getEdgeColor(a)};mxConnectionHandler.prototype.getEdgeColor=function(a){return a?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR};
mxConnectionHandler.prototype.getEdgeWidth=function(a){return a?3:1};
mxConnectionHandler.prototype.connect=function(a,b,c,d){if(null!=b||this.isCreateTarget(c)||this.graph.allowDanglingEdges){var e=this.graph.getModel(),f=!1,g=null;e.beginUpdate();try{if(null!=a&&null==b&&!this.graph.isIgnoreTerminalEvent(c)&&this.isCreateTarget(c)&&(b=this.createTargetVertex(c,a),null!=b)){d=this.graph.getDropTarget([b],c,d);f=!0;if(null!=d&&this.graph.getModel().isEdge(d))d=this.graph.getDefaultParent();else{var h=this.graph.getView().getState(d);if(null!=h){var k=e.getGeometry(b);
k.x-=h.origin.x;k.y-=h.origin.y}}this.graph.addCell(b,d)}var l=this.graph.getDefaultParent(),m=this.graph.getReferenceTerminal(a),n=this.graph.getReferenceTerminal(b),p=l;null!=m&&null!=n?p=e.getNearestCommonAncestor(m,n):null!=m&&(p=e.getParent(m));null==p||e.isEdge(p)||p==e.getRoot()||(l=p);n=m=null;null!=this.edgeState&&(m=this.edgeState.cell.value,n=this.edgeState.cell.style);g=this.insertEdge(l,null,m,a,b,n);if(null!=g){this.graph.setConnectionConstraint(g,a,!0,this.sourceConstraint);this.graph.setConnectionConstraint(g,
b,!1,this.constraintHandler.currentConstraint);null!=this.edgeState&&e.setGeometry(g,this.edgeState.cell.geometry);if(this.isInsertBefore(g,a,b,c,d)&&(null==this.constraintHandler.currentConstraint||this.constraintHandler.currentConstraint.perimeter)){for(k=a;null!=k.parent&&null!=k.geometry&&k.geometry.relative&&k.parent!=g.parent;)k=this.graph.model.getParent(k);null!=k&&null!=k.parent&&k.parent==g.parent&&e.add(l,g,k.parent.getIndex(k))}var q=e.getGeometry(g);null==q&&(q=new mxGeometry,q.relative=
!0,e.setGeometry(g,q));if(null!=this.waypoints&&0<this.waypoints.length){var r=this.graph.view.scale,t=this.graph.view.translate;h=this.graph.getView().getState(e.getParent(g));var v=null!=h?h.origin:new mxPoint;q.points=[];for(a=0;a<this.waypoints.length;a++){var u=this.waypoints[a];q.points.push(new mxPoint(u.x/r-t.x-v.x,u.y/r-t.y-v.y))}}if(null==b){var x=this.graph.view.translate;r=this.graph.view.scale;u=null!=this.originalPoint?new mxPoint(this.originalPoint.x/r-x.x,this.originalPoint.y/r-x.y):
new mxPoint(this.currentPoint.x/r-x.x,this.currentPoint.y/r-x.y);u.x-=this.graph.panDx/this.graph.view.scale;u.y-=this.graph.panDy/this.graph.view.scale;h=this.graph.getView().getState(e.getParent(g));null!=h&&(u.x-=h.origin.x,u.y-=h.origin.y);q.setTerminalPoint(u,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",g,"terminal",b,"event",c,"target",d,"terminalInserted",f))}}catch(y){mxLog.show(),mxLog.debug(y.message)}finally{e.endUpdate()}this.select&&this.selectCells(g,f?b:null)}};
mxConnectionHandler.prototype.selectCells=function(a,b){this.graph.setSelectionCell(a)};mxConnectionHandler.prototype.insertEdge=function(a,b,c,d,e,f){if(null==this.factoryMethod)return this.graph.insertEdge(a,b,c,d,e,f);b=this.createEdge(c,d,e,f);return this.graph.addEdge(b,a,d,e)};
mxConnectionHandler.prototype.createTargetVertex=function(a,b){for(a=this.graph.getCellGeometry(b);null!=a&&a.relative;)b=this.graph.getModel().getParent(b),a=this.graph.getCellGeometry(b);var c=this.graph.cloneCell(b);a=this.graph.getModel().getGeometry(c);if(null!=a){var d=this.graph.view.translate,e=this.graph.view.scale,f=new mxPoint(this.currentPoint.x/e-d.x,this.currentPoint.y/e-d.y);a.x=Math.round(f.x-a.width/2-this.graph.panDx/e);a.y=Math.round(f.y-a.height/2-this.graph.panDy/e);f=this.getAlignmentTolerance();
if(0<f){var g=this.graph.view.getState(b);null!=g&&(b=g.x/e-d.x,d=g.y/e-d.y,Math.abs(b-a.x)<=f&&(a.x=Math.round(b)),Math.abs(d-a.y)<=f&&(a.y=Math.round(d)))}}return c};mxConnectionHandler.prototype.getAlignmentTolerance=function(a){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance};
mxConnectionHandler.prototype.createEdge=function(a,b,c,d){var e=null;null!=this.factoryMethod&&(e=this.factoryMethod(b,c,d));null==e&&(e=new mxCell(a||""),e.setEdge(!0),e.setStyle(d),a=new mxGeometry,a.relative=!0,e.setGeometry(a));return e};
mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null);null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),
this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)};
function mxConstraintHandler(a){this.graph=a;this.resetHandler=mxUtils.bind(this,function(b,c){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()});this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT,
this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=!0;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(a){this.enabled=a};
mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null);this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null};mxConstraintHandler.prototype.getTolerance=function(a){return this.graph.getTolerance()};
mxConstraintHandler.prototype.getImageForConstraint=function(a,b,c){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(a,b){return!1};mxConstraintHandler.prototype.isStateIgnored=function(a,b){return!1};mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusPoints=this.focusIcons=null}};
mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)};mxConstraintHandler.prototype.isKeepFocusEvent=function(a){return mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())};
mxConstraintHandler.prototype.getCellForEvent=function(a,b){var c=a.getCell();null!=c||null==b||a.getGraphX()==b.x&&a.getGraphY()==b.y||(c=this.graph.getCellAt(b.x,b.y));null==c||this.graph.isCellConnectable(c)||(a=this.graph.getModel().getParent(c),this.graph.getModel().isVertex(a)&&this.graph.isCellConnectable(a)&&(c=a));return this.graph.isCellLocked(c)?null:c};
mxConstraintHandler.prototype.update=function(a,b,c,d){if(this.isEnabled()&&!this.isEventIgnored(a)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var e=this.getTolerance(a),f=null!=d?d.x:a.getGraphX(),g=null!=d?d.y:a.getGraphY();f=new mxRectangle(f-e,g-e,2*e,2*e);e=new mxRectangle(a.getGraphX()-e,a.getGraphY()-e,2*e,2*e);var h=this.graph.view.getState(this.getCellForEvent(a,
d));this.isKeepFocusEvent(a)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==h&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,e)||h==this.currentFocus||(this.currentFocus=this.currentFocusArea=null,this.setFocus(a,h,b));a=this.currentPoint=this.currentConstraint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==h||this.currentFocus==h)){g=e.getCenterX();for(var k=e.getCenterY(),l=0;l<this.focusIcons.length;l++){var m=g-this.focusIcons[l].bounds.getCenterX(),
n=k-this.focusIcons[l].bounds.getCenterY();m=m*m+n*n;if((this.intersects(this.focusIcons[l],e,b,c)||null!=d&&this.intersects(this.focusIcons[l],f,b,c))&&(null==a||m<a)){this.currentConstraint=this.constraints[l];this.currentPoint=this.focusPoints[l];a=m;m=this.focusIcons[l].bounds.clone();m.grow(mxConstants.HIGHLIGHT_SIZE+1);--m.width;--m.height;if(null==this.focusHighlight){n=this.createHighlightShape();n.dialect=mxConstants.DIALECT_SVG;n.pointerEvents=!1;n.init(this.graph.getView().getOverlayPane());
this.focusHighlight=n;var p=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:h});mxEvent.redirectMouseEvents(n.node,this.graph,p)}this.focusHighlight.bounds=m;this.focusHighlight.redraw()}}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentPoint=this.currentFocus=this.currentConstraint=null};
mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var a=this.graph.view.getState(this.currentFocus.cell);if(null!=a){this.currentFocus=a;this.currentFocusArea=new mxRectangle(a.x,a.y,a.width,a.height);for(var b=0;b<this.constraints.length;b++)if(null!=this.focusIcons[b]){var c=this.graph.getConnectionPoint(a,this.constraints[b]),d=this.getImageForConstraint(a,this.constraints[b],c);d=new mxRectangle(Math.round(c.x-d.width/2),
Math.round(c.y-d.height/2),d.width,d.height);this.focusIcons[b].bounds=d;this.focusIcons[b].redraw();this.currentFocusArea.add(this.focusIcons[b].bounds);this.focusPoints[b]=c}}}};
mxConstraintHandler.prototype.setFocus=function(a,b,c){this.constraints=null!=b&&!this.isStateIgnored(b,c)&&this.graph.isCellConnectable(b.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(b,c)||[]:[]:null;if(null!=this.constraints){this.currentFocus=b;this.currentFocusArea=new mxRectangle(b.x,b.y,b.width,b.height);if(null!=this.focusIcons){for(c=0;c<this.focusIcons.length;c++)this.focusIcons[c].destroy();this.focusPoints=this.focusIcons=null}this.focusPoints=[];this.focusIcons=[];for(c=
0;c<this.constraints.length;c++){var d=this.graph.getConnectionPoint(b,this.constraints[c]),e=this.getImageForConstraint(b,this.constraints[c],d),f=e.src;e=new mxRectangle(Math.round(d.x-e.width/2),Math.round(d.y-e.height/2),e.width,e.height);f=new mxImageShape(e,f);f.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;f.preserveImageAspect=!1;f.init(this.graph.getView().getDecoratorPane());null!=f.node.previousSibling&&f.node.parentNode.insertBefore(f.node,
f.node.parentNode.firstChild);e=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:b});f.redraw();mxEvent.redirectMouseEvents(f.node,this.graph,e);this.currentFocusArea.add(f.bounds);this.focusIcons.push(f);this.focusPoints.push(d)}this.currentFocusArea.grow(this.getTolerance(a))}else this.destroyIcons(),this.destroyFocusHighlight()};
mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConstraintHandler.prototype.intersects=function(a,b,c,d){return mxUtils.intersects(a.bounds,b)};
mxConstraintHandler.prototype.destroy=function(){this.reset();null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null);null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)};
function mxRubberband(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");if(b==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(c)){b=mxUtils.getOffset(this.graph.container);var d=mxUtils.getScrollOrigin(this.graph.container);d.x-=b.x;d.y-=b.y;this.start(c.getX()+d.x,c.getY()+d.y);c.consume(!1)}}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler=
mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.graph.addListener(mxEvent.CANCEL_MOUSE_GESTURE,this.gestureHandler))}mxUtils.extend(mxRubberband,mxEventSource);mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=!0;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;
mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0;mxRubberband.prototype.fadeOut=!1;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(a){this.enabled=a};mxRubberband.prototype.isForceRubberbandEvent=function(a){return mxEvent.isAltDown(a.getEvent())&&!mxEvent.isShiftDown(a.getEvent())};
mxRubberband.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null==b.getState()||this.graph.isCellLocked(b.getCell()))&&!mxEvent.isMultiTouchEvent(b.getEvent())){a=mxUtils.getOffset(this.graph.container);var c=mxUtils.getScrollOrigin(this.graph.container);c.x-=a.x;c.y-=a.y;this.start(b.getX()+c.x,b.getY()+c.y);b.consume(!1)}};
mxRubberband.prototype.start=function(a,b){function c(e){e=new mxMouseEvent(e);var f=mxUtils.convertPoint(d,e.getX(),e.getY());e.graphX=f.x;e.graphY=f.y;return e}this.first=new mxPoint(a,b);var d=this.graph.container;this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,c(e))});this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,c(e))});mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)};
mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container);a=mxUtils.getOffset(this.graph.container);c.x-=a.x;c.y-=a.y;a=b.getX()+c.x;c=b.getY()+c.y;var d=this.first.x-a,e=this.first.y-c,f=this.graph.tolerance;if(null!=this.div||Math.abs(d)>f||Math.abs(e)>f)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,c),b.consume()}};
mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);var a=this.sharedDiv;mxClient.IS_SVG&&this.fadeOut&&(this.sharedDiv=null);return a};mxRubberband.prototype.isActive=function(a,b){return null!=this.div&&"none"!=this.div.style.display};
mxRubberband.prototype.mouseUp=function(a,b){a=this.isActive();this.reset();a&&(this.execute(b.getEvent()),b.consume())};mxRubberband.prototype.execute=function(a){var b=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(b,a)};
mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&this.fadeOut){var a=this.div;mxUtils.setPrefixedStyle(a.style,"transition","all 0.2s linear");a.style.pointerEvents="none";a.style.opacity=0;window.setTimeout(function(){a.parentNode.removeChild(a)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null;
this.fireEvent(new mxEventObject(mxEvent.RESET))};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint();this.fireEvent(new mxEventObject(mxEvent.UPDATE,"x",this.x,"y",this.y,"width",this.width,"height",this.height))};
mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,b=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,b);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,b)-this.y;this.div.style.left=this.x+0+"px";this.div.style.top=this.y+0+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}};
mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.graph.removeListener(this.gestureHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,b,c,d){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;this.shape=null!=d?d:null;this.init()}
mxHandle.prototype.cursor="default";mxHandle.prototype.image=null;mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,b,c){};mxHandle.prototype.execute=function(a){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])};
mxHandle.prototype.processEvent=function(a){var b=this.graph.view.scale,c=this.graph.view.translate;c=new mxPoint(a.getGraphX()/b-c.x,a.getGraphY()/b-c.y);null!=this.shape&&null!=this.shape.bounds&&(c.x-=this.shape.bounds.width/b/4,c.y-=this.shape.bounds.height/b/4);b=-mxUtils.toRadians(this.getRotation());var d=-mxUtils.toRadians(this.getTotalRotation())-b;c=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(c,b),this.ignoreGrid||!this.graph.isGridEnabledEvent(a.getEvent())),d));this.setPosition(this.state.getPaintBounds(),
c,a);this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.graph.cellRenderer.configureShape(this.state);this.graph.cellRenderer.redraw(this.state,!0)};mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0};mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0};
mxHandle.prototype.init=function(){var a=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(a));this.initShape(a)};mxHandle.prototype.createShape=function(a){a=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(a,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxHandle.prototype.initShape=function(a){a&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor};
mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var a=this.getPosition(this.state.getPaintBounds());if(null!=a){var b=mxUtils.toRadians(this.getTotalRotation());a=this.rotatePoint(this.flipPoint(a),b);b=this.graph.view.scale;var c=this.graph.view.translate;this.shape.bounds.x=Math.floor((a.x+c.x)*b-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((a.y+c.y)*b-this.shape.bounds.height/2);this.shape.redraw()}}};
mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(a,b){var c=this.state.getCellBounds();c=new mxPoint(c.getCenterX(),c.getCenterY());return mxUtils.getRotatedPoint(a,Math.cos(b),Math.sin(b),c)};
mxHandle.prototype.flipPoint=function(a){if(null!=this.state.shape){var b=this.state.getCellBounds();this.state.shape.flipH&&(a.x=2*b.x+b.width-a.x);this.state.shape.flipV&&(a.y=2*b.y+b.height-a.y)}return a};mxHandle.prototype.snapPoint=function(a,b){b||(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));return a};mxHandle.prototype.setVisible=function(a){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=a?"":"none")};
mxHandle.prototype.reset=function(){this.setVisible(!0);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)};
function mxVertexHandler(a){null!=a&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate());this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=!1;
mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=!0;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=!0;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=!1;mxVertexHandler.prototype.parentHighlightEnabled=!1;mxVertexHandler.prototype.rotationRaster=!0;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=!1;mxVertexHandler.prototype.movePreviewToFront=!1;
mxVertexHandler.prototype.manageSizers=!1;mxVertexHandler.prototype.constrainGroupByChildren=!1;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0;
mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=mxConstants.DIALECT_SVG;this.selectionBorder.svgStrokeTolerance=0;this.selectionBorder.pointerEvents=!1;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||
"0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX);this.refresh();this.redraw();this.constrainGroupByChildren&&this.updateMinBounds()};
mxVertexHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)};
mxVertexHandler.prototype.refresh=function(){null!=this.selectionBorder&&(this.selectionBorder.strokewidth=this.getSelectionStrokeWidth(),this.selectionBorder.isDashed=this.isSelectionDashed(),this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw());null!=this.sizers&&this.destroySizers();this.isHandlesVisible()&&(this.sizers=this.createSizers());null!=this.customHandles&&this.destroyCustomHandles();this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles())};
mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)};mxVertexHandler.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]};mxVertexHandler.prototype.isCenteredEvent=function(a,b){return!1};mxVertexHandler.prototype.createCustomHandles=function(){return null};
mxVertexHandler.prototype.updateMinBounds=function(){var a=this.graph.getChildCells(this.state.cell);if(0<a.length&&(this.minBounds=this.graph.view.getBounds(a),null!=this.minBounds)){a=this.state.view.scale;var b=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=a;this.minBounds.y/=a;this.minBounds.width/=a;this.minBounds.height/=a;this.x0=this.state.x/a-b.x;this.y0=this.state.y/a-b.y}};
mxVertexHandler.prototype.getSelectionBounds=function(a){return new mxRectangle(Math.round(a.x),Math.round(a.y),Math.round(a.width),Math.round(a.height))};mxVertexHandler.prototype.createParentHighlightShape=function(a){return this.createSelectionShape(a)};
mxVertexHandler.prototype.createEdgeParentHighlightShape=function(a){var b=new a.shape.constructor;b.outline=!0;b.apply(a);b.points=a.absolutePoints.slice();b.scale=a.view.scale;b.isDashed=mxConstants.EDGE_SELECTION_DASHED;b.stroke=mxConstants.EDGE_SELECTION_COLOR;b.strokewidth=mxConstants.EDGE_SELECTION_STROKEWIDTH/b.scale/b.scale;b.isShadow=!1;return b};
mxVertexHandler.prototype.createSelectionShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a};mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.VERTEX_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};
mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED};
mxVertexHandler.prototype.createSizer=function(a,b,c,d){c=c||mxConstants.HANDLE_SIZE;c=new mxRectangle(0,0,c,c);d=this.createSizerShape(c,b,d,this.handleImage);d.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(--d.bounds.height,--d.bounds.width,d.dialect=mxConstants.DIALECT_STRICTHTML,d.init(this.graph.container)):(d.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,d.init(this.graph.getView().getOverlayPane()));
mxEvent.redirectMouseEvents(d.node,this.graph,this.state);this.graph.isEnabled()&&d.setCursor(a);this.isSizerVisible(b)||(d.visible=!1);return d};mxVertexHandler.prototype.isSizerVisible=function(a){return!0};
mxVertexHandler.prototype.createSizerShape=function(a,b,c,d){return null!=d?(a=new mxRectangle(a.x,a.y,d.width,d.height),a=new mxImageShape(a,d.src),a.preserveImageAspect=!1,a):b==mxEvent.ROTATION_HANDLE?new mxEllipse(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxVertexHandler.prototype.moveSizerTo=function(a,b,c){null!=a&&(a.bounds.x=Math.floor(b-a.bounds.width/2),a.bounds.y=Math.floor(c-a.bounds.height/2),null!=a.node&&"none"!=a.node.style.display&&a.redraw())};
mxVertexHandler.prototype.getHandleForEvent=function(a){var b=mxEvent.isMouseEvent(a.getEvent())?1:this.tolerance,c=this.allowHandleBoundsCheck&&0<b?new mxRectangle(a.getGraphX()-b,a.getGraphY()-b,2*b,2*b):null;b=mxUtils.bind(this,function(e){var f=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;f=null!=f?new mxRectangle(a.getGraphX()-Math.floor(f/2),a.getGraphY()-Math.floor(f/2),f,f):c;return null!=e&&(a.isSource(e)||e.intersectsRectangle(f))});
if(b(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(b(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var d=0;d<this.sizers.length;d++)if(b(this.sizers[d]))return d;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=this.customHandles.length-1;0<=d;d--)if(null!=this.customHandles[d]&&b(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;return null};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!0};
mxVertexHandler.prototype.mouseDown=function(a,b){b.isConsumed()||!this.graph.isEnabled()||mxEvent.isAltDown(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())||mxEvent.isMouseEvent(b.getEvent())&&!mxEvent.isLeftMouseButton(b.getEvent())||(a=this.getHandleForEvent(b),null!=a&&(this.start(b.getGraphX(),b.getGraphY(),a),b.consume()))};mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke};
mxVertexHandler.prototype.start=function(a,b,c){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetY=this.childOffsetX=0,this.index=c,this.startX=a,this.startY=b,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{a=this.state.view.graph.model;b=a.getParent(this.state.cell);this.state.view.currentRoot!=b&&(a.isVertex(b)||a.isEdge(b))&&
(this.parentState=this.state.view.graph.view.getState(b));this.selectionBorder.node.style.display=c==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder())this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):
(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container));c==mxEvent.ROTATION_HANDLE&&(b=this.getRotationHandlePosition(),a=b.x-this.state.getCenterX(),b=b.y-this.state.getCenterY(),this.startAngle=0!=a?180*Math.atan(b/a)/Math.PI+90:0,this.startDist=Math.sqrt(a*a+b*b));if(this.livePreviewActive)for(this.hideSizers(),c==mxEvent.ROTATION_HANDLE?null!=this.rotationShape&&(this.rotationShape.node.style.display=""):c==mxEvent.LABEL_HANDLE?null!=this.labelShape&&(this.labelShape.node.style.display=
""):null!=this.sizers&&null!=this.sizers[c]?this.sizers[c].node.style.display="":c<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-c]&&this.customHandles[mxEvent.CUSTOM_HANDLE-c].setVisible(!0),c=this.graph.getEdges(this.state.cell),this.edgeHandlers=[],a=0;a<c.length;a++)b=this.graph.selectionCellsHandler.getHandler(c[a]),null!=b&&this.edgeHandlers.push(b)}};
mxVertexHandler.prototype.createGhostPreview=function(){var a=this.graph.cellRenderer.createShape(this.state);a.init(this.graph.view.getOverlayPane());a.scale=this.state.view.scale;a.bounds=this.bounds;a.outline=!0;return a};
mxVertexHandler.prototype.setHandlesVisible=function(a){this.handlesVisible=a;if(null!=this.sizers)for(var b=0;b<this.sizers.length;b++)this.sizers[b].node.style.display=a?"":"none";if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)null!=this.customHandles[b]&&this.customHandles[b].setVisible(a)};mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)};
mxVertexHandler.prototype.checkTolerance=function(a){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(a.getEvent())||Math.abs(a.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(a.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)};mxVertexHandler.prototype.updateHint=function(a){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(a){return Math.round(10*a)/10};
mxVertexHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};
mxVertexHandler.prototype.mouseMove=function(a,b){b.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(b)||b.consume(!1):(this.checkTolerance(b),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-this.index]&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state),
this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(b):(this.index==mxEvent.ROTATION_HANDLE?
this.rotateVertex(b):this.resizeVertex(b),this.updateHint(b))),b.consume())};mxVertexHandler.prototype.isGhostPreview=function(){return 0<this.state.view.graph.model.getChildCount(this.state.cell)};
mxVertexHandler.prototype.moveLabel=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.graph.view.translate,d=this.graph.view.scale;this.graph.isGridEnabledEvent(a.getEvent())&&(b.x=(this.graph.snap(b.x/d-c.x)+c.x)*d,b.y=(this.graph.snap(b.y/d-c.y)+c.y)*d);this.moveSizerTo(this.labelShape,b.x,b.y)};
mxVertexHandler.prototype.rotateVertex=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.state.x+this.state.width/2-b.x,d=this.state.y+this.state.height/2-b.y;this.currentAlpha=0!=c?180*Math.atan(d/c)/Math.PI+90:0>d?180:0;0<c&&(this.currentAlpha-=180);this.currentAlpha-=this.startAngle;this.rotationRaster&&this.graph.isGridEnabledEvent(a.getEvent())?(c=b.x-this.state.getCenterX(),d=b.y-this.state.getCenterY(),a=Math.sqrt(c*c+d*d),a=2>a-this.startDist?15:25>a-this.startDist?5:1,this.currentAlpha=
Math.round(this.currentAlpha/a)*a):this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();this.livePreviewActive&&this.redrawHandles()};
mxVertexHandler.prototype.resizeVertex=function(a){var b=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=new mxPoint(a.getGraphX(),a.getGraphY()),e=this.graph.view.translate,f=this.graph.view.scale,g=Math.cos(-c),h=Math.sin(-c),k=d.x-this.startX,l=d.y-this.startY;d=h*k+g*l;k=g*k-h*l;l=d;g=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(g,k/f,l/f,this.index,this.graph.isGridEnabledEvent(a.getEvent()),
1,new mxPoint(0,0),this.isConstrainedEvent(a),this.isCenteredEvent(this.state,a));g.relative||(h=this.graph.getMaximumGraphBounds(),null!=h&&null!=this.parentState&&(h=mxRectangle.fromRectangle(h),h.x-=(this.parentState.x-e.x*f)/f,h.y-=(this.parentState.y-e.y*f)/f),this.graph.isConstrainChild(this.state.cell)&&(d=this.graph.getCellContainmentArea(this.state.cell),null!=d&&(k=this.graph.getOverlap(this.state.cell),0<k&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*k,d.y-=d.height*k,d.width+=2*d.width*
k,d.height+=2*d.height*k),null==h?h=d:(h=mxRectangle.fromRectangle(h),h.intersect(d)))),null!=h&&(this.unscaledBounds.x<h.x&&(this.unscaledBounds.width-=h.x-this.unscaledBounds.x,this.unscaledBounds.x=h.x),this.unscaledBounds.y<h.y&&(this.unscaledBounds.height-=h.y-this.unscaledBounds.y,this.unscaledBounds.y=h.y),this.unscaledBounds.x+this.unscaledBounds.width>h.x+h.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-h.x-h.width),this.unscaledBounds.y+this.unscaledBounds.height>
h.y+h.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-h.y-h.height)));d=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:e.x*f)+this.unscaledBounds.x*f,(null!=this.parentState?this.parentState.y:e.y*f)+this.unscaledBounds.y*f,this.unscaledBounds.width*f,this.unscaledBounds.height*f);g.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y);g=Math.cos(c);
h=Math.sin(c);c=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());k=c.x-b.x;l=c.y-b.y;b=g*k-h*l-k;c=h*k+g*l-l;k=this.bounds.x-this.state.x;l=this.bounds.y-this.state.y;e=g*k-h*l;g=h*k+g*l;this.bounds.x+=b;this.bounds.y+=c;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+b/f);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+c/f);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height);
this.graph.isCellCollapsed(this.state.cell)||0==b&&0==c?this.childOffsetY=this.childOffsetX=0:(this.childOffsetX=this.state.x-this.bounds.x+e,this.childOffsetY=this.state.y-this.bounds.y+g);d.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(a),null!=this.preview?this.drawPreview():this.updateParentHighlight())};
mxVertexHandler.prototype.updateLivePreview=function(a){a=this.graph.view.scale;var b=this.graph.view.translate,c=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/a-b.x,this.state.y/a-b.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;b=this.state.absoluteOffset;new mxPoint(b.x,b.y);this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;b=this.graph.getCellGeometry(this.state.cell);if(null!=b){var d=
b.offset||this.EMPTY_POINT;null==d||b.relative||(this.state.absoluteOffset.x=this.state.view.scale*d.x,this.state.absoluteOffset.y=this.state.view.scale*d.y);this.state.view.updateVertexLabelOffset(this.state)}b=this.state.cell.geometry.width;d=this.state.cell.geometry.height;this.state.cell.geometry.width=this.roundLength(this.bounds.width/a);this.state.cell.geometry.height=this.roundLength(this.bounds.height/a);this.state.view.graph.cellRenderer.redraw(this.state,!0);this.state.cell.geometry.width=
b;this.state.cell.geometry.height=d;this.state.view.invalidate(this.state.cell);this.state.invalid=!1;this.state.view.validate();this.redrawHandles();this.movePreviewToFront&&this.moveToFront();null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden");this.state.setState(c)};
mxVertexHandler.prototype.moveToFront=function(){if(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node)};
mxVertexHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.state){var c=new mxPoint(b.getGraphX(),b.getGraphY());a=this.index;this.index=null;null==this.ghostPreview&&this.state.view.invalidate(this.state.cell,!1,!1);this.graph.getModel().beginUpdate();try{if(a<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]){var d=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-a].active=!1;this.customHandles[mxEvent.CUSTOM_HANDLE-
a].execute(b);null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]&&(this.state.style=d,this.customHandles[mxEvent.CUSTOM_HANDLE-a].positionChanged())}}else if(a==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var e=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=e&&this.rotateCell(this.state.cell,e)}else this.rotateClick();else{var f=this.graph.isGridEnabledEvent(b.getEvent()),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),
h=Math.cos(-g),k=Math.sin(-g),l=c.x-this.startX,m=c.y-this.startY;d=k*l+h*m;l=h*l-k*m;m=d;var n=this.graph.view.scale,p=this.isRecursiveResize(this.state,b);this.resizeCell(this.state.cell,this.roundLength(l/n),this.roundLength(m/n),a,f,this.isConstrainedEvent(b),p)}}finally{this.graph.getModel().endUpdate()}this.state.invalid&&this.state.view.validate();b.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return this.graph.isRecursiveResize(this.state)};
mxVertexHandler.prototype.rotateClick=function(){};
mxVertexHandler.prototype.rotateCell=function(a,b,c){if(0!=b){var d=this.graph.getModel();if(d.isVertex(a)||d.isEdge(a)){if(!d.isEdge(a)){var e=(this.graph.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATION]||0)+b;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,e,[a])}e=this.graph.getCellGeometry(a);if(null!=e){var f=this.graph.getCellGeometry(c);null==f||d.isEdge(c)||(e=e.clone(),e.rotate(b,new mxPoint(f.width/2,f.height/2)),d.setGeometry(a,e));if(d.isVertex(a)&&!e.relative||d.isEdge(a))for(c=
d.getChildCount(a),e=0;e<c;e++)this.rotateCell(d.getChildAt(a,e),b,a)}}}};
mxVertexHandler.prototype.reset=function(){null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display="");this.index=this.inTolerance=this.currentAlpha=null;null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);if(this.livePreviewActive&&null!=this.sizers){for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&&
(this.sizers[a].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&(this.customHandles[a].active?(this.customHandles[a].active=!1,this.customHandles[a].reset()):this.customHandles[a].setVisible(!0));null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),
this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview());this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=!0;this.livePreviewActive=this.unscaledBounds=null};
mxVertexHandler.prototype.resizeCell=function(a,b,c,d,e,f,g){b=this.graph.model.getGeometry(a);null!=b&&(d==mxEvent.LABEL_HANDLE?(c=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),g=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0),d=Math.cos(c),e=Math.sin(c),c=this.graph.view.scale,d=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/c),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/c)),d,e),g||
(d.y=-d.y),b=b.clone(),null==b.offset?b.offset=d:(b.offset.x+=d.x,b.offset.y+=d.y),this.graph.model.setGeometry(a,b)):null!=this.unscaledBounds&&(c=this.graph.view.scale,0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(a,Math.round(this.childOffsetX/c),Math.round(this.childOffsetY/c)),this.graph.resizeCell(a,this.unscaledBounds,g)))};
mxVertexHandler.prototype.moveChildren=function(a,b,c){for(var d=this.graph.getModel(),e=d.getChildCount(a),f=0;f<e;f++){var g=d.getChildAt(a,f),h=this.graph.getCellGeometry(g);null!=h&&(h=h.clone(),h.translate(b,c),d.setGeometry(g,h))}};
mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,h,k){e=null!=e?e&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var l=a.width,m=a.height,n=a.x-g.x*f,p=n+l;a=a.y-g.y*f;var q=a+m,r=n+l/2,t=a+m/2,v=e&&null!=this.state?mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360):0;v=0!=v&&!isNaN(v);
4<d?(q+=c,q=e?v?a+this.graph.snap((q-a)/f)*f:this.graph.snap(q/f)*f:Math.round(q/f)*f):3>d&&(a+=c,a=e?v?q-this.graph.snap((q-a)/f)*f:this.graph.snap(a/f)*f:Math.round(a/f)*f);if(0==d||3==d||5==d)n+=b,n=e?v?p-this.graph.snap((p-n)/f)*f:this.graph.snap(n/f)*f:Math.round(n/f)*f;else if(2==d||4==d||7==d)p+=b,p=e?v?n+this.graph.snap((p-n)/f)*f:this.graph.snap(p/f)*f:Math.round(p/f)*f;e=p-n;c=q-a;h&&(h=this.graph.getCellGeometry(this.state.cell),null!=h&&(h=h.width/h.height,1==d||2==d||7==d||6==d?e=c*h:
c=e/h,0==d&&(n=p-e,a=q-c)));if(k){e+=e-l;c+=c-m;if(v){if(0==d||3==d||5==d||2==d||4==d||7==d)e=this.graph.snap(e/f)*f;if(3>d||4<d)c=this.graph.snap(c/f)*f}n+=r-(n+e/2);a+=t-(a+c/2)}0>e&&(n+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(n+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y)));return d};
mxVertexHandler.prototype.redraw=function(a){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();a||this.redrawHandles()};
mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*b||this.bounds.height<2*this.sizers[0].bounds.height+2*b)&&(b/=2,a.x=this.sizers[0].bounds.width+b,a.y=this.sizers[0].bounds.height+b);return a};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds};
mxVertexHandler.prototype.redrawHandles=function(){var a=this.getSizerBounds(),b=this.tolerance;this.verticalOffset=this.horizontalOffset=0;if(null!=this.customHandles)for(var c=0;c<this.customHandles.length;c++)if(null!=this.customHandles[c]){var d=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw();this.customHandles[c].shape.node.style.display=d;this.customHandles[c].shape.node.style.visibility=this.handlesVisible&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[c])&&
!this.graph.isEditing()?"":"hidden"}if(null!=a&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&8<=this.sizers.length){c=this.getHandlePadding();this.horizontalOffset=c.x;this.verticalOffset=c.y;if(0!=this.horizontalOffset||0!=this.verticalOffset)a=new mxRectangle(a.x,a.y,a.width,a.height),a.x-=this.horizontalOffset/2,a.width+=this.horizontalOffset,a.y-=this.verticalOffset/2,a.height+=this.verticalOffset;8<=this.sizers.length&&(a.width<2*this.sizers[0].bounds.width+
2*b||a.height<2*this.sizers[0].bounds.height+2*b?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var e=a.x+a.width,f=a.y+a.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],e,f);else if(b=a.x+a.width/2,
c=a.y+a.height/2,8<=this.sizers.length){var g="nw-resize n-resize ne-resize e-resize se-resize s-resize sw-resize w-resize".split(" "),h=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");d=Math.cos(h);var k=Math.sin(h),l=Math.round(4*h/Math.PI);h=new mxPoint(a.getCenterX(),a.getCenterY());var m=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),d,k,h);this.moveSizerTo(this.sizers[0],m.x,m.y);this.sizers[0].setCursor(g[mxUtils.mod(0+l,g.length)]);m.x=b;m.y=a.y;m=mxUtils.getRotatedPoint(m,
d,k,h);this.moveSizerTo(this.sizers[1],m.x,m.y);this.sizers[1].setCursor(g[mxUtils.mod(1+l,g.length)]);m.x=e;m.y=a.y;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[2],m.x,m.y);this.sizers[2].setCursor(g[mxUtils.mod(2+l,g.length)]);m.x=a.x;m.y=c;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[3],m.x,m.y);this.sizers[3].setCursor(g[mxUtils.mod(7+l,g.length)]);m.x=e;m.y=c;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[4],m.x,m.y);this.sizers[4].setCursor(g[mxUtils.mod(3+
l,g.length)]);m.x=a.x;m.y=f;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[5],m.x,m.y);this.sizers[5].setCursor(g[mxUtils.mod(6+l,g.length)]);m.x=b;m.y=f;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[6],m.x,m.y);this.sizers[6].setCursor(g[mxUtils.mod(5+l,g.length)]);m.x=e;m.y=f;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[7],m.x,m.y);this.sizers[7].setCursor(g[mxUtils.mod(4+l,g.length)]);a=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,
!0);m.x=b+this.state.absoluteOffset.x;m.y=c+(a?1:-1)*this.state.absoluteOffset.y;m=mxUtils.getRotatedPoint(m,d,k,h);this.moveSizerTo(this.sizers[8],m.x,m.y)}else 2<=this.state.width&&2<=this.state.height&&null!=this.state.absoluteOffset?this.moveSizerTo(this.sizers[0],b+this.state.absoluteOffset.x,c+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}if(null!=this.sizers)for(c=0;c<this.sizers.length;c++)this.sizers[c].node.style.visibility=this.isHandlesVisible()?
"":"hidden";null!=this.rotationShape&&(h=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(h),k=Math.sin(h),h=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,k,h),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,m.x,m.y),this.rotationShape.node.style.visibility=!this.state.view.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&
this.isRotationHandleVisible()?"":"hidden"));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw()};mxVertexHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()};
mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))};
mxVertexHandler.prototype.destroyParentHighlight=function(){null!=this.parentHighlight.state&&(delete this.parentHighlight.state.parentHighlight,delete this.parentHighlight.state);this.parentHighlight.destroy();this.parentHighlight=null};
mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var a=this.isParentHighlightVisible(),b=this.graph.model.getParent(this.state.cell),c=this.graph.view.getState(b);if(null!=this.parentHighlight)if(this.graph.model.isVertex(b)&&a){var d=this.parentHighlight.bounds;null==c||d.x==c.x&&d.y==c.y&&d.width==c.width&&d.height==c.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(c),this.parentHighlight.redraw())}else this.graph.model.isEdge(b)&&a&&(null==c||this.parentHighlight.scale==
c.view.scale&&mxUtils.equalPoints(this.parentHighlight.points,c.absolutePoints))||this.destroyParentHighlight();null==this.parentHighlight&&this.parentHighlightEnabled&&a&&((a=this.graph.model.isEdge(b))||this.graph.model.isVertex(b))&&null!=c&&null==c.parentHighlight&&(this.parentHighlight=a?this.createEdgeParentHighlightShape(c):this.createParentHighlightShape(c),this.parentHighlight.dialect=mxConstants.DIALECT_SVG,this.parentHighlight.svgStrokeTolerance=0,this.parentHighlight.pointerEvents=!1,
this.parentHighlight.rotation=Number(c.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),c.parentHighlight=this.parentHighlight,this.parentHighlight.state=c)}};
mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()};
mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds};
mxVertexHandler.prototype.createSizers=function(){var a=this.graph.isCellResizable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell),b=[];if(a||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var c=0;a&&(this.singleSizer||(b.push(this.createSizer("nw-resize",c++)),b.push(this.createSizer("n-resize",c++)),b.push(this.createSizer("ne-resize",c++)),b.push(this.createSizer("w-resize",c++)),b.push(this.createSizer("e-resize",c++)),b.push(this.createSizer("sw-resize",
c++)),b.push(this.createSizer("s-resize",c++))),b.push(this.createSizer("se-resize",c++)));a=this.graph.model.getGeometry(this.state.cell);null==a||a.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!a&&2>this.state.width&&2>this.state.height&&
(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape));null==this.rotationShape&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),b.push(this.rotationShape));return b};
mxVertexHandler.prototype.destroyCustomHandles=function(){if(null!=this.customHandles){for(var a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&this.customHandles[a].destroy();this.customHandles=null}};mxVertexHandler.prototype.destroySizers=function(){if(null!=this.sizers){for(var a=0;a<this.sizers.length;a++)this.sizers[a].destroy();this.rotationShape=this.sizers=null}};mxVertexHandler.prototype.isDestroyed=function(){return null==this.selectionBorder};
mxVertexHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.labelShape=null;this.removeHint();this.destroySizers();this.destroyCustomHandles()};
function mxEdgeHandler(a){null!=a&&null!=a.shape&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){b=null!=this.index;this.reset();b&&this.graph.cellRenderer.redraw(this.state,!1,a.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null;
mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=!0;mxEdgeHandler.prototype.addEnabled=!1;mxEdgeHandler.prototype.removeEnabled=!1;mxEdgeHandler.prototype.dblClickRemoveEnabled=!1;mxEdgeHandler.prototype.mergeRemoveEnabled=!1;mxEdgeHandler.prototype.straightRemoveEnabled=!1;mxEdgeHandler.prototype.virtualBendsEnabled=!1;mxEdgeHandler.prototype.virtualBendOpacity=40;
mxEdgeHandler.prototype.parentHighlightEnabled=!1;mxEdgeHandler.prototype.preferHtml=!1;mxEdgeHandler.prototype.allowHandleBoundsCheck=!0;mxEdgeHandler.prototype.snapToTerminals=!1;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=!1;mxEdgeHandler.prototype.manageLabelHandle=!1;mxEdgeHandler.prototype.livePreview=!1;mxEdgeHandler.prototype.livePreviewActive=!1;mxEdgeHandler.prototype.previewHandle=null;
mxEdgeHandler.prototype.hiddenHandles=null;
mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.svgStrokeTolerance=0;this.shape.pointerEvents=!1;mxEvent.redirectMouseEvents(this.shape.node,this.graph,
this.state);this.graph.isCellMovable(this.state.cell)&&this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var a=this.state.getVisibleTerminalState(!0);null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container);this.preferHtml||(a=this.state.getVisibleTerminalState(!1),null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container))}this.updateParentHighlight();
this.refresh();this.redraw()};mxEdgeHandler.prototype.createLabelShape=function(){var a=this.createLabelHandleShape();this.initBend(a);return a};mxEdgeHandler.prototype.getConstraintHandler=function(){null==this.constraintHandler&&(this.constraintHandler=this.createConstraintHandler());return this.constraintHandler};mxEdgeHandler.prototype.createConstraintHandler=function(){return new mxConstraintHandler(this.graph)};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible;
mxEdgeHandler.prototype.destroyParentHighlight=mxVertexHandler.prototype.destroyParentHighlight;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null};
mxEdgeHandler.prototype.isVirtualBendsEnabled=function(a){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)};mxEdgeHandler.prototype.isCellEnabled=function(a){return!0};mxEdgeHandler.prototype.isAddPointEvent=function(a){return mxEvent.isShiftDown(a)};
mxEdgeHandler.prototype.isRemovePointEvent=function(a){return mxEvent.isShiftDown(a)};mxEdgeHandler.prototype.getSelectionPoints=function(a){return a.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a};mxEdgeHandler.prototype.createEdgeParentHighlightShape=mxVertexHandler.prototype.createEdgeParentHighlightShape;
mxEdgeHandler.prototype.createSelectionShape=function(a){a=new this.state.shape.constructor;a.outline=!0;a.apply(this.state);a.isDashed=this.isSelectionDashed();a.stroke=this.getSelectionColor();a.isShadow=!1;return a};mxEdgeHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.EDGE_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH};
mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(a){return!0};mxEdgeHandler.prototype.getCellAt=function(a,b){return this.outlineConnect?null:this.graph.getCellAt(a,b)};
mxEdgeHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph),b=this;a.getCell=function(c){var d=mxCellMarker.prototype.getCell.apply(this,arguments);d!=b.state.cell&&null!=d||null==b.currentPoint||(d=b.getTerminalCellAt(b.currentPoint.x,b.currentPoint.y));if(null!=d&&!this.graph.isCellConnectable(d)){var e=this.graph.getModel().getParent(d);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(d=e)}e=b.graph.getModel();if(this.graph.isSwimlane(d)&&null!=b.currentPoint&&
this.graph.hitsSwimlaneContent(d,b.currentPoint.x,b.currentPoint.y)||!b.isConnectableCell(d)||d==b.state.cell||null!=d&&!b.graph.connectableEdges&&e.isEdge(d)||e.isAncestor(b.state.cell,d))d=null;this.graph.isCellConnectable(d)||(d=null);return d};a.isValidState=function(c){var d=b.graph.getModel();d=b.graph.view.getTerminalPort(c,b.graph.view.getState(d.getTerminal(b.state.cell,!b.isSource)),!b.isSource);d=null!=d?d.cell:null;b.error=b.validateConnection(b.isSource?c.cell:d,b.isSource?d:c.cell);
return null==b.error};return a};mxEdgeHandler.prototype.validateConnection=function(a,b){return this.graph.getEdgeValidationError(this.state.cell,a,b)};
mxEdgeHandler.prototype.createBends=function(){var a=this.state.cell,b=[];if(null!=this.abspoints)for(var c=0;c<this.abspoints.length;c++)if(this.isHandleVisible(c)){var d=c==this.abspoints.length-1,e=0==c||d;(e||this.graph.isCellBendable(a))&&mxUtils.bind(this,function(f){var g=this.createHandleShape(f,null,f==this.abspoints.length-1);this.initBend(g,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,f)})));this.isHandleEnabled(c)&&g.setCursor(e?
mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE);b.push(g);e||(this.points.push(new mxPoint(0,0)),g.node.style.visibility="hidden")})(c)}return b};mxEdgeHandler.prototype.createVirtualBends=function(){var a=[];if(null!=this.abspoints&&0<this.abspoints.length&&this.graph.isCellBendable(this.state.cell))for(var b=1;b<this.abspoints.length;b++)mxUtils.bind(this,function(c){this.initBend(c);c.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);a.push(c)})(this.createHandleShape());return a};
mxEdgeHandler.prototype.isHandleEnabled=function(a){return!0};mxEdgeHandler.prototype.isHandleVisible=function(a){return this.edgeStyle!=mxEdgeStyle.EntityRelation||0==a||a==this.abspoints.length-1};
mxEdgeHandler.prototype.createHandleShape=function(a){if(null!=this.handleImage)return a=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src),a.preserveImageAspect=!1,a;a=mxConstants.HANDLE_SIZE;this.preferHtml&&--a;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var a=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);a.preserveImageAspect=!1;return a}a=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};
mxEdgeHandler.prototype.initBend=function(a,b){this.preferHtml?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(a.node,this.graph,this.state,null,null,null,b);mxClient.IS_TOUCH&&a.node.setAttribute("pointer-events","none")};
mxEdgeHandler.prototype.getHandleForEvent=function(a){var b=null;if(null!=this.state){var c=function(g){if(null!=g&&(a.isSource(g)||g.intersectsRectangle(e))){var h=a.getGraphX()-g.bounds.getCenterX();g=a.getGraphY()-g.bounds.getCenterY();h=h*h+g*g;if(null==f||h<=f)return f=h,!0}return!1},d=mxEvent.isMouseEvent(a.getEvent())?0:2*this.tolerance,e=this.allowHandleBoundsCheck?new mxRectangle(a.getGraphX()-d,a.getGraphY()-d,d,d):null,f=null;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=
this.customHandles.length-1;0<=d;d--)if(c(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;null!=this.state.text&&(a.isSource(this.state.text)||c(this.labelShape))&&(b=mxEvent.LABEL_HANDLE);if(null!=this.bends)for(d=0;d<this.bends.length;d++)c(this.bends[d])&&(b=d);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(a))for(d=0;d<this.virtualBends.length;d++)c(this.virtualBends[d])&&(b=mxEvent.VIRTUAL_HANDLE-d)}return b};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!0};
mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!0};
mxEdgeHandler.prototype.mouseDown=function(a,b){if((!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent()))&&this.graph.isCellEditable(this.state.cell)){a=this.getHandleForEvent(b);if(null!=this.bends&&null!=this.bends[a]){var c=this.bends[a].bounds;this.snapPoint=new mxPoint(c.getCenterX(),c.getCenterY())}if(this.addEnabled&&null==a&&this.isAddPointEvent(b.getEvent()))this.addPoint(this.state,b.getEvent()),b.consume();else if(null!=a&&!b.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&&
this.isRemovePointEvent(b.getEvent()))this.removePoint(this.state,a);else if(a!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(b.getCell()))a<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-a].node,100),this.mouseDownX=b.getX(),this.mouseDownY=b.getY(),this.handle=a;mxEvent.isShiftDown(b.getEvent())||b.consume()}}};
mxEdgeHandler.prototype.start=function(a,b,c){this.startX=a;this.startY=b;this.isSource=null==this.bends?!1:0==c;this.isTarget=null==this.bends?!1:c==this.bends.length-1;this.isLabel=c==mxEvent.LABEL_HANDLE;this.labelOffset=null;this.isLabel&&null!=this.label&&(a=mxUtils.convertPoint(this.graph.container,a,b),this.labelOffset=new mxPoint(this.label.x-a.x,this.label.y-a.y));if(this.isSource||this.isTarget){if(a=this.state.cell,b=this.graph.model.getTerminal(a,this.isSource),null==b&&this.graph.isTerminalPointMovable(a,
this.isSource)||null!=b&&this.graph.isCellDisconnectable(a,b,this.isSource))this.index=c}else this.index=c;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(c=0;c<this.customHandles.length;c++)c!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[c].setVisible(!1)};mxEdgeHandler.prototype.clonePreviewState=function(a,b){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return 2};
mxEdgeHandler.prototype.updateHint=function(a,b){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(a){return this.snapToTerminals&&!mxEvent.isAltDown(a.getEvent())};mxEdgeHandler.prototype.snapToGuides=function(a,b,c,d){return!1};
mxEdgeHandler.prototype.getPointForEvent=function(a){var b=this.graph.getView(),c=b.scale,d=new mxPoint(this.roundLength(a.getGraphX()/c)*c,this.roundLength(a.getGraphY()/c)*c),e=this.getSnapToTerminalTolerance(),f=!1,g=!1;if(0<e&&this.isSnapToTerminalsEvent(a)){var h=function(m){null!=m&&k.call(this,new mxPoint(b.getRoutingCenterX(m),b.getRoutingCenterY(m)))},k=function(m){if(null!=m){var n=m.x;Math.abs(d.x-n)<e&&(d.x=n,f=!0);m=m.y;Math.abs(d.y-m)<e&&(d.y=m,g=!0)}};h.call(this,this.state.getVisibleTerminalState(!0));
h.call(this,this.state.getVisibleTerminalState(!1));h=this.state.absolutePoints;if(null!=h)for(var l=0;l<h.length;l++)(0<l||!this.state.isFloatingTerminalPoint(!0))&&(l<h.length-1||!this.state.isFloatingTerminalPoint(!1))&&k.call(this,this.state.absolutePoints[l])}this.snapToGuides(d,a,f,g)&&(g=f=!0);this.graph.isGridEnabledEvent(a.getEvent())&&(a=b.translate,f||(d.x=(this.graph.snap(d.x/c-a.x)+a.x)*c),g||(d.y=(this.graph.snap(d.y/c-a.y)+a.y)*c));return d};
mxEdgeHandler.prototype.getPreviewTerminalState=function(a){var b=this.getConstraintHandler();b.update(a,this.isSource,!0,a.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(null!=b.currentFocus&&null!=b.currentConstraint)return null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==b.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(b.currentFocus.cell,
"transparent"),a=this.graph.getModel(),a=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(a.getTerminal(this.state.cell,!this.isSource)),!this.isSource),a=null!=a?a.cell:null,this.error=this.validateConnection(this.isSource?b.currentFocus.cell:a,this.isSource?a:b.currentFocus.cell),a=null,null==this.error&&(a=b.currentFocus),(null!=this.error||null!=a&&!this.isCellEnabled(a.cell))&&b.reset(),a;if(this.graph.isIgnoreTerminalEvent(a.getEvent()))return this.marker.reset(),null;this.marker.process(a);
a=this.marker.getValidState();null==a||this.isCellEnabled(a.cell)||(b.reset(),this.marker.reset());return this.marker.getValidState()};
mxEdgeHandler.prototype.getPreviewPoints=function(a,b){var c=this.graph.getCellGeometry(this.state.cell);c=null!=c.points?c.points.slice():null;var d=new mxPoint(a.x,a.y),e=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(c=null);else if(this.convertPoint(d,!1),null==c)c=[d];else{this.index<=mxEvent.VIRTUAL_HANDLE&&c.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,d);if(!this.isSource&&!this.isTarget){for(var f=0;f<this.bends.length;f++)if(f!=this.index){var g=this.bends[f];null!=
g&&mxUtils.contains(g.bounds,a.x,a.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?c.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):c.splice(this.index-1,1),e=c)}if(null==e&&this.straightRemoveEnabled&&(null==b||!mxEvent.isAltDown(b.getEvent()))){b=this.graph.tolerance*this.graph.tolerance;f=this.state.absolutePoints.slice();f[this.index]=a;var h=this.state.getVisibleTerminalState(!0);null!=h&&(g=this.graph.getConnectionConstraint(this.state,h,!0),null==g||null==this.graph.getConnectionPoint(h,g))&&(f[0]=new mxPoint(h.view.getRoutingCenterX(h),
h.view.getRoutingCenterY(h)));h=this.state.getVisibleTerminalState(!1);null!=h&&(g=this.graph.getConnectionConstraint(this.state,h,!1),null==g||null==this.graph.getConnectionPoint(h,g))&&(f[f.length-1]=new mxPoint(h.view.getRoutingCenterX(h),h.view.getRoutingCenterY(h)));g=this.index;0<g&&g<f.length-1&&mxUtils.ptSegDistSq(f[g-1].x,f[g-1].y,f[g+1].x,f[g+1].y,a.x,a.y)<b&&(c.splice(g-1,1),e=c)}}null==e&&this.index>mxEvent.VIRTUAL_HANDLE&&(c[this.index-1]=d)}return null!=e?e:c};
mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||0));return this.outlineConnect&&
(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))};
mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d,e){var f=this.isSource?c:this.state.getVisibleTerminalState(!0),g=this.isTarget?c:this.state.getVisibleTerminalState(!1),h=this.graph.getConnectionConstraint(a,f,!0),k=this.graph.getConnectionConstraint(a,g,!1),l=this.getConstraintHandler(),m=l.currentConstraint;null==m&&e&&(null!=c?(d.isSource(this.marker.highlight.shape)&&(b=new mxPoint(d.getGraphX(),d.getGraphY())),m=this.graph.getOutlineConstraint(b,c,d),l.setFocus(d,c,this.isSource),
l.currentConstraint=m,l.currentPoint=b):m=new mxConnectionConstraint);if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var n=this.graph.view.scale;null!=l.currentConstraint&&null!=l.currentFocus?(this.marker.highlight.shape.stroke=e?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/n/n,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=
this.graph.isCellConnectable(d.getCell())&&this.marker.getValidState()!=d.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/n/n,this.marker.highlight.repaint())}this.isSource?h=m:this.isTarget&&(k=m);if(this.isSource||this.isTarget)null!=m&&null!=m.point?(a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=m.point.x,a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=m.point.y):
(delete a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);a.setVisibleTerminalState(f,!0);a.setVisibleTerminalState(g,!1);this.isSource&&null==f||a.view.updateFixedTerminalPoint(a,f,!0,h);this.isTarget&&null==g||a.view.updateFixedTerminalPoint(a,g,!1,k);(this.isSource||this.isTarget)&&null==c&&(a.setAbsoluteTerminalPoint(b,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?
null:""));a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)};mxEdgeHandler.prototype.getTerminalCellAt=function(a,b){var c=this.graph.getModel(),d=this.state.cell;return this.graph.getCellAt(a,b,null,null,null,function(e){return c.isAncestor(d,e.cell)})};
mxEdgeHandler.prototype.getTerminalEvent=function(a){var b=a.getCell();null!=b&&this.graph.getModel().isAncestor(this.state.cell,b)&&(b=new mxMouseEvent(a.getEvent(),this.graph.view.getState(this.getTerminalCellAt(a.getGraphX(),a.getGraphY()))),b.graphX=a.getGraphX(),b.graphY=a.getGraphY(),a=b);return a};
mxEdgeHandler.prototype.isLivePreviewEvent=function(a){return this.livePreview&&null!=this.state.shape&&(this.isLabel||!this.cloneEnabled||!this.graph.isCloneEvent(a.getEvent())||this.graph.isIgnoreTerminalEvent(a.getEvent())||!this.graph.isCellsCloneable())};
mxEdgeHandler.prototype.updateLivePreview=function(a){var b=this.state,c=null!=a?a.absolutePoints:null;if(null!=a&&(null==c||2>c.length||null==c[0]||null==c[c.length-1]))this.resetLivePreview();else{c=new mxCellState;c.setState(b);this.livePreviewActive=!0;try{null!=a?(a.view.updateEdgeBounds(a),a.view.updateEdgeLabelOffset(a),b.setState(a),this.graph.cellRenderer.redraw(b,!0),this.redrawChildren(b)):null!=this.label&&(b.absoluteOffset=new mxPoint(this.label.x,this.label.y),this.graph.cellRenderer.redrawLabel(b,
!1))}finally{b.setState(c)}}};mxEdgeHandler.prototype.redrawChildren=function(a){for(var b=this.graph.getModel(),c=b.getChildCount(a.cell),d=0;d<c;d++){var e=a.view.getState(b.getChildAt(a.cell,d));null!=e&&(a.view.updateCellState(e),this.graph.cellRenderer.redraw(e,!0))}};mxEdgeHandler.prototype.resetLivePreview=function(){if(this.livePreviewActive){this.livePreviewActive=!1;var a=this.state;null!=a&&null!=a.shape&&a.view.getState(a.cell)==a&&(this.graph.cellRenderer.redraw(a,!0),this.redrawChildren(a))}};
mxEdgeHandler.prototype.getPreviewHandle=function(){var a=null;this.isLabel?a=this.labelShape:null!=this.index&&this.index<=mxEvent.VIRTUAL_HANDLE?a=null!=this.virtualBends?this.virtualBends[mxEvent.VIRTUAL_HANDLE-this.index]:null:null!=this.index&&this.index<=mxEvent.CUSTOM_HANDLE?(a=null!=this.customHandles?this.customHandles[mxEvent.CUSTOM_HANDLE-this.index]:null,a=null!=a?a.shape:null):null!=this.index&&0<=this.index&&(a=null!=this.bends?this.bends[this.index]:null);return a};
mxEdgeHandler.prototype.redrawPreviewHandles=function(){var a=this.getPreviewHandle(),b=this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE;if(null==this.previewHandle&&null!=a){var c=[this.labelShape].concat(this.bends||[],this.virtualBends||[]);this.previewHandle=a;this.hiddenHandles=[];if(null!=this.customHandles)for(var d=0;d<this.customHandles.length;d++)null!=this.customHandles[d]&&c.push(this.customHandles[d].shape);for(d=0;d<c.length;d++)null!=c[d]&&c[d]!=a&&null!=c[d].node&&
"none"!=c[d].node.style.display&&(c[d].node.style.display="none",this.hiddenHandles.push(c[d]));b||(a.pointerEvents=!1,a.node.style.pointerEvents="none")}null==a||b||this.isLabel||null==this.abspoints||(c=this.isSource?this.abspoints[0]:this.isTarget?this.abspoints[this.abspoints.length-1]:this.currentPoint,null!=c&&(d=a.bounds,a.bounds=new mxRectangle(Math.floor(c.x-d.width/2),Math.floor(c.y-d.height/2),d.width,d.height),a.redraw()));b||null==this.shape||null==this.shape.node||(this.shape.node.style.display=
this.livePreviewActive?"none":"")};mxEdgeHandler.prototype.resetPreviewHandles=function(){var a=this.previewHandle;if(null!=a){for(var b=0;b<this.hiddenHandles.length;b++)null!=this.hiddenHandles[b].node&&(this.hiddenHandles[b].node.style.display="");this.hiddenHandles=this.previewHandle=null;null!=a.node&&"none"==a.node.style.pointerEvents&&(delete a.pointerEvents,a.node.style.pointerEvents="");null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="")}};
mxEdgeHandler.prototype.mouseMove=function(a,b){if(null!=this.index&&null!=this.marker){a=this.getConstraintHandler();var c=b;this.isLabel&&null!=this.labelOffset&&(c=new mxMouseEvent(b.getEvent(),b.getState()),c.graphX=b.getGraphX()+this.labelOffset.x,c.graphY=b.getGraphY()+this.labelOffset.y);this.currentPoint=this.getPointForEvent(c);this.error=null;null!=this.snapPoint&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&null==a.currentFocus&&a.currentFocus!=this.state&&
(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y);if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none"),this.livePreview&&
this.redrawPreviewHandles());else{if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y,this.isLivePreviewEvent(b)&&this.updateLivePreview();else{c=this.getTerminalEvent(b);this.points=this.getPreviewPoints(this.currentPoint,b);var d=this.isSource||this.isTarget?this.getPreviewTerminalState(c):null;if(null!=a.currentConstraint&&null!=a.currentFocus&&null!=a.currentPoint)this.currentPoint=a.currentPoint.clone();else if(this.outlineConnect){var e=this.isSource||this.isTarget?
this.isOutlineConnectEvent(c):!1;e?d=this.marker.highlight.state:null!=d&&d!=c.getState()&&this.graph.isCellConnectable(c.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),d=null)}null==d||this.isCellEnabled(d.cell)||(d=null,this.marker.reset());a=this.clonePreviewState(this.currentPoint,null!=d?d.cell:null);this.updatePreviewState(a,this.currentPoint,d,c,e);this.setPreviewColor(null==this.error?this.marker.validColor:
this.marker.invalidColor);this.abspoints=a.absolutePoints;this.active=!0;this.updateHint(b,this.currentPoint,a);this.isLivePreviewEvent(b)?this.updateLivePreview(a):this.resetLivePreview()}this.livePreview&&this.redrawPreviewHandles()}this.drawPreview();mxEvent.consume(b.getEvent());b.consume()}else mxEvent.isShiftDown(b.getEvent())||null==this.handle||null==this.mouseDownX||null==this.mouseDownY||(e=this.graph.tolerance,(Math.abs(this.mouseDownX-b.getX())>e||Math.abs(this.mouseDownY-b.getY())>e)&&
this.start(this.mouseDownX,this.mouseDownY,this.handle))};
mxEdgeHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");a=this.state.cell;var c=this.index;this.index=null;if(b.getX()!=this.startX||b.getY()!=this.startY){var d=!this.graph.isIgnoreTerminalEvent(b.getEvent())&&this.cloneEnabled&&this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(c<=mxEvent.CUSTOM_HANDLE&&
c>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){var e=this.graph.getModel();e.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-c].execute(b),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{e.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget)if(c=null,null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&
(c=this.constraintHandler.currentFocus.cell),null==c&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(c=this.marker.validState.cell),null!=c){e=this.graph.getModel();var f=e.getParent(a);e.beginUpdate();try{if(d){var g=e.getGeometry(a),h=this.graph.cloneCell(a);e.add(f,h,e.getChildCount(f));null!=g&&(g=g.clone(),e.setGeometry(h,g));var k=e.getTerminal(a,!this.isSource);
this.graph.connectCell(h,k,!this.isSource);a=h}a=this.connect(a,c,this.isSource,d,b)}finally{e.endUpdate()}}else this.graph.isAllowDanglingEdges()&&(g=this.abspoints[this.isSource?0:this.abspoints.length-1],g.x=this.roundLength(g.x/this.graph.view.scale-this.graph.view.translate.x),g.y=this.roundLength(g.y/this.graph.view.scale-this.graph.view.translate.y),h=this.graph.getView().getState(this.graph.getModel().getParent(a)),null!=h&&(g.x-=h.origin.x,g.y-=h.origin.y),g.x-=this.graph.panDx/this.graph.view.scale,
g.y-=this.graph.panDy/this.graph.view.scale,a=this.changeTerminalPoint(a,g,this.isSource,d));else this.active?a=this.changePoints(a,this.points,d):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(b.getEvent())&&this.graph.selectCellForEvent(this.state.cell,b.getEvent());null!=this.marker&&(this.reset(),a!=this.state.cell&&this.graph.setSelectionCell(a));b.consume()}else null==this.handle||null==this.bends||mxEvent.isAltDown(b.getEvent())||
0!=this.handle&&this.handle!=this.bends.length-1||(c=this.state.getVisibleTerminal(0==this.handle),null!=c&&(this.graph.selectCellForEvent(c,b.getEvent()),b.consume()));this.mouseDownY=this.mouseDownX=this.handle=null};
mxEdgeHandler.prototype.reset=function(){this.resetPreviewHandles();this.resetLivePreview();this.active&&this.refresh();this.snapPoint=this.mouseDownY=this.mouseDownX=this.startY=this.startX=this.handle=this.points=this.label=this.index=this.error=null;this.isLabel=!1;this.labelOffset=null;this.active=this.isTarget=this.isSource=!1;null!=this.marker&&this.marker.reset();null!=this.constraintHandler&&this.constraintHandler.reset();if(null!=this.customHandles)for(var a=this.customHandles,b=0;b<a.length;b++)null!=
a[b]&&a[b].reset();this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(a){null!=this.shape&&(this.shape.stroke=a)};
mxEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate();b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x);a.y=this.roundLength(a.y/c-d.y);b=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));null!=b&&(a.x-=b.origin.x,a.y-=b.origin.y);return a};
mxEdgeHandler.prototype.moveLabel=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a.cell);if(null!=e){var f=this.graph.getView().scale;e=e.clone();if(e.relative){var g=this.graph.getView().getRelativePoint(a,b,c);e.x=Math.round(1E4*g.x)/1E4;e.y=Math.round(g.y);e.offset=new mxPoint(0,0);g=this.graph.view.getPoint(a,e);e.offset=new mxPoint(Math.round((b-g.x)/f),Math.round((c-g.y)/f))}else{var h=a.absolutePoints;g=h[0];h=h[h.length-1];null!=g&&null!=h&&(e.offset=new mxPoint(Math.round((b-
(g.x+(h.x-g.x)/2))/f),Math.round((c-(g.y+(h.y-g.y)/2))/f)),e.x=0,e.y=0)}d.setGeometry(a.cell,e)}};mxEdgeHandler.prototype.connect=function(a,b,c,d,e){d=this.graph.getModel();d.beginUpdate();try{var f=null!=this.constraintHandler?this.constraintHandler.currentConstraint:null;null==f&&(f=new mxConnectionConstraint);this.graph.connectCell(a,b,c,f)}finally{d.endUpdate()}return a};
mxEdgeHandler.prototype.changeTerminalPoint=function(a,b,c,d){var e=this.graph.getModel();e.beginUpdate();try{if(d){var f=e.getParent(a),g=e.getTerminal(a,!c);a=this.graph.cloneCell(a);e.add(f,a,e.getChildCount(f));e.setTerminal(a,g,!c)}var h=e.getGeometry(a);null!=h&&(h=h.clone(),h.setTerminalPoint(b,c),e.setGeometry(a,h),this.graph.connectCell(a,null,c,new mxConnectionConstraint))}finally{e.endUpdate()}return a};
mxEdgeHandler.prototype.changePoints=function(a,b,c){var d=this.graph.getModel();d.beginUpdate();try{if(c){var e=d.getParent(a),f=d.getTerminal(a,!0),g=d.getTerminal(a,!1);a=this.graph.cloneCell(a);d.add(e,a,d.getChildCount(e));d.setTerminal(a,f,!0);d.setTerminal(a,g,!1)}var h=d.getGeometry(a);null!=h&&(h=h.clone(),h.points=b,d.setGeometry(a,h))}finally{d.endUpdate()}return a};
mxEdgeHandler.prototype.addPoint=function(a,b){var c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),d=this.graph.isGridEnabledEvent(b);this.convertPoint(c,d);this.addPointAt(a,c.x,c.y);mxEvent.consume(b)};
mxEdgeHandler.prototype.addPointAt=function(a,b,c){var d=this.graph.getCellGeometry(a.cell);b=new mxPoint(b,c);if(null!=d){d=d.clone();var e=this.graph.view.translate;c=this.graph.view.scale;e=new mxPoint(e.x*c,e.y*c);var f=this.graph.model.getParent(this.state.cell);this.graph.model.isVertex(f)&&(e=this.graph.view.getState(f),e=new mxPoint(e.x,e.y));c=mxUtils.findNearestSegment(a,b.x*c+e.x,b.y*c+e.y);null==d.points?d.points=[b]:d.points.splice(c,0,b);this.graph.getModel().setGeometry(a.cell,d);this.refresh();
this.redraw()}};mxEdgeHandler.prototype.removePoint=function(a,b){if(0<b&&b<this.abspoints.length-1){var c=this.graph.getCellGeometry(this.state.cell);null!=c&&null!=c.points&&(c=c.clone(),c.points.splice(b-1,1),this.graph.getModel().setGeometry(a.cell,c),this.refresh(),this.redraw())}};
mxEdgeHandler.prototype.getHandleFillColor=function(a){a=0==a;var b=this.state.cell,c=this.graph.getModel().getTerminal(b,a),d=mxConstants.HANDLE_FILLCOLOR;null!=c&&!this.graph.isCellDisconnectable(b,c,a)||null==c&&!this.graph.isTerminalPointMovable(b,a)?d=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=c&&this.graph.isCellDisconnectable(b,c,a)&&(d=mxConstants.CONNECT_HANDLE_FILLCOLOR);return d};
mxEdgeHandler.prototype.redraw=function(a){if(null!=this.state&&null!=this.state.absolutePoints){this.abspoints=this.state.absolutePoints.slice();var b=this.graph.getModel().getGeometry(this.state.cell);if(null!=b&&(b=b.points,null!=this.bends&&0<this.bends.length&&null!=b)){null==this.points&&(this.points=[]);for(var c=1;c<this.bends.length-1;c++)null!=this.bends[c]&&null!=this.abspoints[c]&&(this.points[c-1]=b[c-1])}this.drawPreview();a||this.redrawHandles()}};
mxEdgeHandler.prototype.isTerminalHandleVisible=function(a){return!0};
mxEdgeHandler.prototype.redrawHandles=function(){var a=this.state.cell;if(null!=this.labelShape){var b=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-b.width/2),Math.round(this.label.y-b.height/2),b.width,b.height);b=this.graph.getLabel(a);this.labelShape.visible=null!=b&&0<b.length&&this.graph.isCellEditable(this.state.cell)&&this.graph.isLabelMovable(a)&&this.isHandlesVisible()}if(null!=
this.abspoints&&null!=this.bends&&0<this.bends.length){var c=this.abspoints.length-1;a=this.abspoints[0];var d=a.x,e=a.y;b=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);this.bends[0].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!0)?"":"hidden";c=this.abspoints[c];
d=c.x;e=c.y;var f=this.bends.length-1;b=this.bends[f].bounds;this.bends[f].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[f].fill=this.getHandleFillColor(f);this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.bends[f].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!1)?"":"hidden";this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(c=
this.abspoints[0],a=0;a<this.virtualBends.length;a++)null!=this.virtualBends[a]&&null!=this.abspoints[a+1]&&(d=this.abspoints[a+1],b=this.virtualBends[a],b.bounds=new mxRectangle(Math.floor(c.x+(d.x-c.x)/2-b.bounds.width/2),Math.floor(c.y+(d.y-c.y)/2-b.bounds.height/2),b.bounds.width,b.bounds.height),b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),c=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds),b.node.style.visibility=this.isHandlesVisible()?"":"hidden");null!=this.labelShape&&
this.labelShape.redraw();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)b=this.customHandles[a].shape.node.style.display,this.customHandles[a].redraw(),this.customHandles[a].shape.node.style.display=b,this.customHandles[a].shape.node.style.visibility=!this.graph.isEditing()&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[a])?"":"hidden"};mxEdgeHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()};
mxEdgeHandler.prototype.setHandlesVisible=function(a){if(null!=this.bends)for(var b=0;b<this.bends.length;b++)null!=this.bends[b]&&(this.bends[b].node.style.display=a?"":"none");if(null!=this.virtualBends)for(b=0;b<this.virtualBends.length;b++)null!=this.virtualBends[b]&&(this.virtualBends[b].node.style.display=a?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=a?"":"none");if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)};
mxEdgeHandler.prototype.setInnerBendsOpacity=function(a,b,c){var d=this.graph.getCellGeometry(this.state.cell);if(null!=d&&(null==d.points||0==d.points.length))for(;b<c;b++)null!=a[b]&&mxUtils.setOpacity(a[b].node,this.virtualBendOpacity)};
mxEdgeHandler.prototype.redrawInnerBends=function(a,b){for(a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){b=this.abspoints[a].x;var c=this.abspoints[a].y,d=this.bends[a].bounds;this.bends[a].bounds=new mxRectangle(Math.round(b-d.width/2),Math.round(c-d.height/2),d.width,d.height);if(this.manageLabelHandle)this.checkLabelHandle(this.bends[a].bounds);else if(null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[a].bounds,this.labelShape.bounds)){d=
mxConstants.HANDLE_SIZE+3;var e=mxConstants.HANDLE_SIZE+3;this.bends[a].bounds=new mxRectangle(Math.round(b-d/2),Math.round(c-e/2),d,e)}this.bends[a].redraw();this.bends[a].node.style.visibility=this.isHandlesVisible()?"":"hidden"}else this.bends[a].destroy(),this.bends[a]=null};mxEdgeHandler.prototype.checkLabelHandle=function(a){if(null!=this.labelShape){var b=this.labelShape.bounds;mxUtils.intersects(a,b)&&(a.getCenterY()<b.getCenterY()?b.y=a.y+a.height:b.y=a.y-b.height)}};
mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var a=this.labelShape.bounds,b=new mxRectangle(Math.round(this.label.x-a.width/2),Math.round(this.label.y-a.height/2),a.width,a.height);this.labelShape.bounds.equals(b)||(this.labelShape.bounds=b,this.labelShape.redraw())}null==this.shape||mxUtils.equalPoints(this.shape.points,this.abspoints)||(this.shape.apply(this.state),this.shape.points=this.abspoints.slice(),this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(),
this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw());this.updateParentHighlight()}catch(c){}};mxEdgeHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)};
mxEdgeHandler.prototype.refresh=function(){if(null!=this.state){var a=this.state.getVisibleTerminalState(!0),b=this.state.getVisibleTerminalState(!1),c=this.graph.getCellGeometry(this.state.cell);this.edgeStyle=null!=c?this.graph.view.getEdgeStyle(this.state,c.points,a,b):null;this.abspoints=this.getSelectionPoints(this.state);this.points=[];null!=this.shape&&(this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.isShadow=!1,this.shape.redraw());null!=
this.bends&&(this.destroyBends(this.bends),this.bends=null);this.isHandlesVisible()&&(this.bends=this.createBends());null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=null);this.isHandlesVisible()&&this.edgeStyle!=mxEdgeStyle.EntityRelation&&(this.virtualBends=this.createVirtualBends());null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=null);this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles());null!=this.labelShape&&
(this.labelShape.destroy(),this.labelShape=null);this.isHandlesVisible()&&(this.labelShape=this.createLabelShape(),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))}};mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape};mxEdgeHandler.prototype.destroyBends=function(a){if(null!=a)for(var b=0;b<a.length;b++)null!=a[b]&&a[b].destroy()};
mxEdgeHandler.prototype.destroy=function(){this.resetLivePreview();null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.parentHighlight&&this.destroyParentHighlight();
this.destroyBends(this.virtualBends);this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};function mxElbowEdgeHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=!0;mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"";
mxElbowEdgeHandler.prototype.createBends=function(){var a=[],b=this.createHandleShape(0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);a.push(this.createVirtualBend(mxUtils.bind(this,function(c){!mxEvent.isConsumed(c)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,c),mxEvent.consume(c))})));this.points.push(new mxPoint(0,0));b=this.createHandleShape(2,null,!0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);return a};
mxElbowEdgeHandler.prototype.createVirtualBends=function(){return null};mxElbowEdgeHandler.prototype.createVirtualBend=function(a){var b=this.createHandleShape();this.initBend(b,a);b.setCursor(this.getCursorForBend());this.graph.isCellBendable(this.state.cell)||(b.node.style.display="none");return b};
mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"};
mxElbowEdgeHandler.prototype.getTooltipForNode=function(a){var b=null;null==this.bends||null==this.bends[1]||a!=this.bends[1].node&&a.parentNode!=this.bends[1].node||(b=this.doubleClickOrientationResource,b=mxResources.get(b)||b);return b};
mxElbowEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate(),e=this.state.origin;b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x-e.x);a.y=this.roundLength(a.y/c-d.y-e.y);return a};
mxElbowEdgeHandler.prototype.redrawInnerBends=function(a,b){var c=this.graph.getModel().getGeometry(this.state.cell),d=this.state.absolutePoints,e=null;1<d.length?(a=d[1],b=d[d.length-2]):null!=c.points&&0<c.points.length&&(e=d[0]);e=null==e?new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2):new mxPoint(this.graph.getView().scale*(e.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(e.y+this.graph.getView().translate.y+this.state.origin.y));b=this.bends[1].bounds;a=b.width;
b=b.height;a=new mxRectangle(Math.round(e.x-a/2),Math.round(e.y-b/2),a,b);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(a=mxConstants.HANDLE_SIZE+3,b=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(e.x-a/2),Math.floor(e.y-b/2),a,b));this.bends[1].bounds=a;this.bends[1].redraw();this.setInnerBendsOpacity(this.bends,1,2);this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)};
function mxEdgeSegmentHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler);
mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var a=this.state.absolutePoints;if(null!=a){var b=Math.max(1,this.graph.view.scale);if(2==a.length||3==a.length&&(Math.abs(a[0].x-a[1].x)<b&&Math.abs(a[1].x-a[2].x)<b||Math.abs(a[0].y-a[1].y)<b&&Math.abs(a[1].y-a[2].y)<b)){b=a[0].x+(a[a.length-1].x-a[0].x)/2;var c=a[0].y+(a[a.length-1].y-a[0].y)/2;a=[a[0],new mxPoint(b,c),new mxPoint(b,c),a[a.length-1]]}}return a};
mxEdgeSegmentHandler.prototype.getPreviewPoints=function(a){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var b=this.getCurrentPoints(),c=this.convertPoint(b[0].clone(),!1);a=this.convertPoint(a.clone(),!1);for(var d=[],e=1;e<b.length;e++){var f=this.convertPoint(b[e].clone(),!1);e==this.index&&(1>Math.abs(c.x-f.x)&&(c.x=a.x,f.x=a.x),1>Math.abs(c.y-f.y)&&(c.y=a.y,f.y=a.y));e<b.length-1&&d.push(f);c=f}if(1==d.length){b=this.state.getVisibleTerminalState(!0);
c=this.state.getVisibleTerminalState(!1);f=this.state.view.getScale();var g=this.state.view.getTranslate();e=d[0].x*f+g.x;f=d[0].y*f+g.y;if(null!=b&&mxUtils.contains(b,e,f)||null!=c&&mxUtils.contains(c,e,f))d=[a,a]}return d};
mxEdgeSegmentHandler.prototype.updatePreviewState=function(a,b,c,d){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){b=this.convertPoint(b.clone(),!1);for(var e=a.absolutePoints,f=e[0],g=e[1],h=[],k=2;k<e.length;k++){var l=e[k];0==Math.round(f.x-g.x)&&0==Math.round(g.x-l.x)||0==Math.round(f.y-g.y)&&0==Math.round(g.y-l.y)||h.push(this.convertPoint(g.clone(),!1));f=g;g=l}f=this.state.getVisibleTerminalState(!0);g=this.state.getVisibleTerminalState(!1);
k=this.state.absolutePoints;if(0==h.length&&(0==Math.round(e[0].x-e[e.length-1].x)||0==Math.round(e[0].y-e[e.length-1].y)))h=[b,b];else if(5==e.length&&2==h.length&&null!=f&&null!=g&&null!=k&&0==Math.round(k[0].x-k[k.length-1].x)){h=this.graph.getView();k=h.getScale();l=h.getTranslate();e=h.getRoutingCenterY(f)/k-l.y;var m=this.graph.getConnectionConstraint(a,f,!0);null!=m&&(m=this.graph.getConnectionPoint(f,m),null!=m&&(this.convertPoint(m,!1),e=m.y));h=h.getRoutingCenterY(g)/k-l.y;if(k=this.graph.getConnectionConstraint(a,
g,!1))m=this.graph.getConnectionPoint(g,k),null!=m&&(this.convertPoint(m,!1),h=m.y);h=[new mxPoint(b.x,e),new mxPoint(b.x,h)]}this.points=h;a.view.updateFixedTerminalPoints(a,f,g);a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g);0<h.length&&this.isDefaultRoute(a,f,g)&&(this.points=[])}};
mxEdgeSegmentHandler.prototype.isDefaultRoute=function(a,b,c){var d=a.clone();d.view.updateFixedTerminalPoints(d,b,c);d.view.updatePoints(d,null,b,c);d.view.updateFloatingTerminalPoints(d,b,c);a=this.getRoutePoints(a.absolutePoints);d=this.getRoutePoints(d.absolutePoints);if(null==a||null==d||a.length!=d.length)return!1;for(b=0;b<a.length;b++)if(!this.isSameRoutePoint(a[b],d[b]))return!1;return!0};
mxEdgeSegmentHandler.prototype.getRoutePoints=function(a){if(null==a||2>a.length)return null;for(var b=[],c=0;c<a.length;c++){if(null==a[c])return null;var d=this.convertPoint(a[c].clone(),!1);if(0==b.length||!this.isSameRoutePoint(b[b.length-1],d)){for(;1<b.length&&this.isSegmentPoint(b[b.length-2],b[b.length-1],d);)b.pop();b.push(d)}}return b};mxEdgeSegmentHandler.prototype.isSameRoutePoint=function(a,b){return 1>Math.abs(a.x-b.x)&&1>Math.abs(a.y-b.y)};
mxEdgeSegmentHandler.prototype.isSegmentPoint=function(a,b,c){return 1>Math.abs(a.x-b.x)&&1>Math.abs(b.x-c.x)&&0<=(b.y-a.y)*(c.y-b.y)||1>Math.abs(a.y-b.y)&&1>Math.abs(b.y-c.y)&&0<=(b.x-a.x)*(c.x-b.x)};
mxEdgeSegmentHandler.prototype.changePoints=function(a,b,c){var d=this.graph.getModel().getGeometry(a);null!=b&&0==b.length&&(b=null);return null!=b||c||null==d||null!=d.points&&0!=d.points.length?mxElbowEdgeHandler.prototype.changePoints.call(this,a,b,c):(this.graph.getView().invalidate(a),this.graph.getView().validate(a),a)};
mxEdgeSegmentHandler.prototype.connect=function(a,b,c,d,e){var f=this.graph.getModel(),g=f.getGeometry(a),h=null;if(null!=g&&null!=g.points&&0<g.points.length){var k=this.abspoints,l=k[0],m=k[1];h=[];for(var n=2;n<k.length;n++){var p=k[n];0==Math.round(l.x-m.x)&&0==Math.round(m.x-p.x)||0==Math.round(l.y-m.y)&&0==Math.round(m.y-p.y)||h.push(this.convertPoint(m.clone(),!1));l=m;m=p}}f.beginUpdate();try{null!=h&&(g=f.getGeometry(a),null!=g&&(g=g.clone(),g.points=h,f.setGeometry(a,g))),a=mxEdgeHandler.prototype.connect.apply(this,
arguments)}finally{f.endUpdate()}return a};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(a){return null};mxEdgeSegmentHandler.prototype.start=function(a,b,c){mxEdgeHandler.prototype.start.apply(this,arguments);null==this.bends||null==this.bends[c]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[c].node,100)};
mxEdgeSegmentHandler.prototype.createBends=function(){var a=[],b=this.getCurrentPoints();if(null!=b){var c=this.createHandleShape(0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c);if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var d=0;d<b.length-1;d++){c=this.createVirtualBend();a.push(c);var e=0==Math.round(b[d].x-b[d+1].x);0==Math.round(b[d].y-b[d+1].y)&&d<b.length-2&&(e=0==Math.round(b[d].x-b[d+2].x));c.setCursor(e?"col-resize":
"row-resize");this.points.push(new mxPoint(0,0))}}c=this.createHandleShape(b.length,null,!0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c)}return a};mxEdgeSegmentHandler.prototype.createVirtualBends=function(){return null};
mxEdgeSegmentHandler.prototype.redrawInnerBends=function(a,b){if(this.graph.isCellBendable(this.state.cell)){var c=this.getCurrentPoints();if(null!=c&&1<c.length){var d=!1;if(4==c.length&&0==Math.round(c[1].x-c[2].x)&&0==Math.round(c[1].y-c[2].y))if(d=!0,0==Math.round(c[0].y-c[c.length-1].y)){var e=c[0].x+(c[c.length-1].x-c[0].x)/2;c[1]=new mxPoint(e,c[1].y);c[2]=new mxPoint(e,c[2].y)}else e=c[0].y+(c[c.length-1].y-c[0].y)/2,c[1]=new mxPoint(c[1].x,e),c[2]=new mxPoint(c[2].x,e);for(e=0;e<c.length-
1;e++)null!=this.bends[e+1]&&(a=c[e],b=c[e+1],a=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2),b=this.bends[e+1].bounds,this.bends[e+1].bounds=new mxRectangle(Math.floor(a.x-b.width/2),Math.floor(a.y-b.height/2),b.width,b.height),this.bends[e+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[e+1].bounds));d?(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity)):this.setInnerBendsOpacity(this.bends,1,c.length)}}};
function mxKeyHandler(a,b){null!=a&&(this.graph=a,this.target=b||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.altKeys=[],this.altShiftKeys=[],this.controlAltKeys=[],this.controlAltShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(c){this.keyDown(c)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler))}mxKeyHandler.SHIFT=1;mxKeyHandler.CONTROL=2;mxKeyHandler.ALT=4;mxKeyHandler.prototype.graph=null;
mxKeyHandler.prototype.target=null;mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null;mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.altKeys=null;mxKeyHandler.prototype.altShiftKeys=null;mxKeyHandler.prototype.controlAltKeys=null;mxKeyHandler.prototype.controlAltShiftKeys=null;mxKeyHandler.prototype.enabled=!0;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};
mxKeyHandler.prototype.setEnabled=function(a){this.enabled=a};mxKeyHandler.prototype.bindKey=function(a,b,c){c=this.getKeys(c||0);null!=b?c[a]=b:delete c[a]};mxKeyHandler.prototype.bindShiftKey=function(a,b){this.bindKey(a,b,mxKeyHandler.SHIFT)};mxKeyHandler.prototype.bindControlKey=function(a,b){this.bindKey(a,b,mxKeyHandler.CONTROL)};mxKeyHandler.prototype.bindControlShiftKey=function(a,b){this.bindKey(a,b,mxKeyHandler.CONTROL|mxKeyHandler.SHIFT)};
mxKeyHandler.prototype.getKeys=function(a){return[this.normalKeys,this.shiftKeys,this.controlKeys,this.controlShiftKeys,this.altKeys,this.altShiftKeys,this.controlAltKeys,this.controlAltShiftKeys][a]};mxKeyHandler.prototype.getModifiers=function(a){return(mxEvent.isShiftDown(a)?mxKeyHandler.SHIFT:0)|(this.isControlDown(a)?mxKeyHandler.CONTROL:0)|(mxEvent.isAltDown(a)?mxKeyHandler.ALT:0)};mxKeyHandler.prototype.isControlDown=function(a){return mxEvent.isControlDown(a)};
mxKeyHandler.prototype.getFunction=function(a){var b=null!=a?this.getKeys(this.getModifiers(a)):null;return null!=b?b[a.keyCode]:null};mxKeyHandler.prototype.isGraphEvent=function(a){var b=mxEvent.getSource(a);return b==this.target||b.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(a)?!0:mxUtils.isAncestorNode(this.graph.container,b)};
mxKeyHandler.prototype.keyDown=function(a){if(this.isEnabledForEvent(a))if(27==a.keyCode)this.escape(a);else if(!this.isEventIgnored(a)){var b=this.getFunction(a);null!=b&&(b(a),mxEvent.consume(a))}};mxKeyHandler.prototype.isEnabledForEvent=function(a){return this.graph.isEnabled()&&!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(a){return this.graph.isEditing()};
mxKeyHandler.prototype.escape=function(a){this.graph.isEscapeEnabled()&&this.graph.escape(a)};mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null);this.target=null};function mxTooltipHandler(a,b){null!=a&&(this.graph=a,this.delay=b||500,this.graph.addMouseListener(this))}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;
mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=!0;mxTooltipHandler.prototype.showOnPenHover=!0;mxTooltipHandler.prototype.hideOnHover=!1;mxTooltipHandler.prototype.destroyed=!1;mxTooltipHandler.prototype.enabled=!1;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(a){this.enabled=a};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};
mxTooltipHandler.prototype.setHideOnHover=function(a){this.hideOnHover=a};mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){"A"!=mxEvent.getSource(a).nodeName&&this.hideTooltip()})))};mxTooltipHandler.prototype.getStateForEvent=function(a){return a.getState()};
mxTooltipHandler.prototype.mouseDown=function(a,b){this.reset(b,!1);this.hideTooltip()};mxTooltipHandler.prototype.mouseMove=function(a,b){if(b.getX()!=this.lastX||b.getY()!=this.lastY)this.reset(b,!0),a=this.getStateForEvent(b),(this.isHideOnHover()||a!=this.state||b.getSource()!=this.node&&(!this.stateSource||null!=a&&this.stateSource==(b.isSource(a.shape)||!b.isSource(a.text))))&&this.hideTooltip();this.lastX=b.getX();this.lastY=b.getY()};
mxTooltipHandler.prototype.mouseUp=function(a,b){this.reset(b,!0);this.hideTooltip()};mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)};mxTooltipHandler.prototype.isPenHoverEvent=function(a){return"pointermove"==a.type&&0==a.buttons};
mxTooltipHandler.prototype.reset=function(a,b,c){var d=a.getEvent(),e=this.showOnPenHover&&mxEvent.isPenEvent(d);if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(d)||e)if(this.resetTimer(),b=b&&(!this.ignoreTouchEvents||!e||this.isPenHoverEvent(d)),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var f=a.getSource(),g=a.getX(),h=a.getY(),k=a.isSource(c.shape)||a.isSource(c.text);this.thread=window.setTimeout(mxUtils.bind(this,
function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var l=this.graph.getTooltip(c,f,g,h);this.show(l,g,h);this.state=c;this.node=f;this.stateSource=k}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerText="")};
mxTooltipHandler.prototype.show=function(a,b,c){if(!this.destroyed&&null!=a&&0<a.length){null==this.div&&this.init();var d=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=b+d.x+"px";this.div.style.top=c+mxConstants.TOOLTIP_VERTICAL_OFFSET+d.y+"px";mxUtils.isNode(a)?(this.div.style.whiteSpace="",this.div.innerText="",this.div.appendChild(a)):(this.div.style.whiteSpace="pre-line",this.div.innerHTML=a);this.div.style.visibility="";mxUtils.fit(this.div)}};
mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)};function mxCellTracker(a,b,c){mxCellMarker.call(this,a,b);this.graph.addMouseListener(this);null!=c&&(this.getCell=c)}mxUtils.extend(mxCellTracker,mxCellMarker);mxCellTracker.prototype.mouseDown=function(a,b){};
mxCellTracker.prototype.mouseMove=function(a,b){this.isEnabled()&&this.process(b)};mxCellTracker.prototype.mouseUp=function(a,b){};mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))};
function mxCellHighlight(a,b,c,d){null!=a&&(this.graph=a,this.highlightColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=c?c:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=d?d:!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var e=this.graph.view.getState(this.state.cell);null==e?this.hide():(this.state=e,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,
this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null;
mxCellHighlight.prototype.spacing=0;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(a){this.highlightColor=a;null!=this.shape&&(this.shape.stroke=a)};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)};
mxCellHighlight.prototype.createShape=function(){var a=this.graph.cellRenderer.createShape(this.state);a.svgStrokeTolerance=this.graph.tolerance;a.points=this.state.absolutePoints;a.apply(this.state);a.stroke=this.highlightColor;a.opacity=this.opacity;a.isDashed=this.dashed;a.isShadow=!1;a.dialect=mxConstants.DIALECT_SVG;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,this.state);this.graph.dialect!=mxConstants.DIALECT_SVG?a.pointerEvents=!1:a.svgPointerEvents=
"stroke";return a};mxCellHighlight.prototype.getStrokeWidth=function(a){return this.strokeWidth};
mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||
"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),this.shape.redraw())};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(a){this.state!=a&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=a,null!=this.state&&this.drawHighlight())};
mxCellHighlight.prototype.isHighlightAt=function(a,b){var c=!1;if(null!=this.shape&&null!=document.elementFromPoint)for(a=document.elementFromPoint(a,b);null!=a;){if(a==this.shape.node){c=!0;break}a=a.parentNode}return c};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);null!=this.shape&&(this.shape.destroy(),this.shape=null)};
var mxCodecRegistry={codecs:Object.create(null),aliases:Object.create(null),register:function(a){if(null!=a){var b=a.getName();mxCodecRegistry.codecs[b]=a;var c=mxUtils.getFunctionName(a.template.constructor);c!=b&&mxCodecRegistry.addAlias(c,b)}return a},addAlias:function(a,b){mxCodecRegistry.aliases[a]=b},getCodec:function(a){var b=null;if(null!=a){b=mxUtils.getFunctionName(a);var c=mxCodecRegistry.aliases[b];null!=c&&(b=c);b=mxCodecRegistry.codecs[b];if(null==b)try{b=new mxObjectCodec(new a),mxCodecRegistry.register(b)}catch(d){}}return b}};
function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.duplicates=Object.create(null);this.objects=Object.create(null)}mxCodec.allowlist=null;mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.duplicates=null;mxCodec.prototype.encoding=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.maxDepth=256;mxCodec.prototype.depth=0;
mxCodec.prototype.putObject=function(a,b){return null!=this.duplicates[a]?(null!=window.console&&console.error(this.duplicates[a]),b):this.objects[a]=b};mxCodec.prototype.getObject=function(a){var b=null;null!=a&&(b=this.objects[a],null==b&&(b=this.lookup(a),null==b&&(a=this.getElementById(a),null!=a&&(b=this.decode(a)))));return b};mxCodec.prototype.lookup=function(a){return null};mxCodec.prototype.getElementById=function(a){this.updateElements();return this.elements[a]};
mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=Object.create(null),null!=this.document.documentElement&&this.addElement(this.document.documentElement))};
mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var b=a.getAttribute("id");null!=b&&(null==this.elements[b]?this.elements[b]=a:this.elements[b]!=a&&(this.duplicates[b]="Duplicate ID '"+b+"'",null!=window.console&&console.error("mxCodec.addElement: "+this.duplicates[b])))}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling};mxCodec.prototype.isObjectIgnored=function(a){return null==a};
mxCodec.prototype.getId=function(a){var b=null;null==a||this.isObjectIgnored(a)||(b=this.reference(a),null==b&&a instanceof mxCell&&(b=a.getId(),null==b&&(b=mxCellPath.create(a),0==b.length&&(b="root"))));return b};mxCodec.prototype.reference=function(a){return null};
mxCodec.prototype.encode=function(a){var b=null;if(null!=a&&null!=a.constructor&&!this.isObjectIgnored(a)){var c=mxCodecRegistry.getCodec(a.constructor);if(null!=c)if(null==this.encoding&&(this.encoding=[]),0<=mxUtils.indexOf(this.encoding,a))null!=window.console&&console.error("mxCodec.encode: Cyclic reference to "+mxUtils.getFunctionName(a.constructor));else{this.encoding.push(a);try{b=c.encode(this,a)}finally{this.encoding.pop()}}else mxUtils.isNode(a)?b=mxUtils.importNode(this.document,a,!0):
mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return b};mxCodec.prototype.decode=function(a,b){this.updateElements();var c=null;null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT&&(c=this.getConstructor(a.nodeName),c=mxCodecRegistry.getCodec(c),null!=c?c=c.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as")));return c};
mxCodec.prototype.decodeAs=function(a,b,c){var d=null;null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT&&(d=this.getConstructor(a.nodeName),null!=d&&(d===b||d.prototype instanceof b)?d=this.decode(a,c):(null!=window.console&&console.error("mxCodec.decodeAs: "+a.nodeName+" decoded as "+mxUtils.getFunctionName(b)),this.updateElements(),d=mxCodecRegistry.getCodec(b).decode(this,a)));return d instanceof b?d:null};
mxCodec.prototype.isConstructorAllowed=function(a){return null==mxCodec.allowlist||0<=mxUtils.indexOf(mxCodec.allowlist,a)};mxCodec.prototype.getConstructor=function(a){var b=null;try{this.isConstructorAllowed(a)&&(b=window[a])}catch(c){}return b};mxCodec.prototype.encodeCell=function(a,b,c){if(!this.isObjectIgnored(a)){var d=this.encode(a);null!=d&&b.appendChild(d);if(null==c||c)for(c=a.getChildCount(),d=0;d<c;d++)this.encodeCell(a.getChildAt(d),b)}};
mxCodec.prototype.isCellCodec=function(a){return null!=a&&"function"==typeof a.isCellCodec?a.isCellCodec():!1};mxCodec.prototype.decodeCell=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=mxCodecRegistry.getCodec(a.nodeName);if(!this.isCellCodec(c))for(var d=a.firstChild;null!=d&&!this.isCellCodec(c);)c=mxCodecRegistry.getCodec(d.nodeName),d=d.nextSibling;this.isCellCodec(c)||(c=mxCodecRegistry.getCodec(mxCell));c=c.decode(this,a);b&&null!=c&&this.insertIntoGraph(c)}return c};
mxCodec.prototype.insertIntoGraph=function(a){var b=a.parent,c=a.getTerminal(!0),d=a.getTerminal(!1);a.setTerminal(null,!1);a.setTerminal(null,!0);a.parent=null;if(null!=b){if(b==a)throw Error(b.id+": Self Reference");b.insert(a)}null!=c&&c.insertEdge(a,!0);null!=d&&d.insertEdge(a,!1)};mxCodec.prototype.setAttribute=function(a,b,c){null!=b&&null!=c&&a.setAttribute(b,c)};
function mxObjectCodec(a,b,c,d){this.template=a;this.exclude=null!=b?b:[];this.idrefs=null!=c?c:[];this.mapping=null!=d?d:{};this.reverse={};for(var e in this.mapping)this.reverse[this.mapping[e]]=e}mxObjectCodec.allowEval=!1;mxObjectCodec.allowInclude=!1;mxObjectCodec.isPollutionKey=function(a){return"__proto__"==a||"constructor"==a||"prototype"==a};mxObjectCodec.inheritedNames=new WeakMap;mxObjectCodec.isIndex=function(a){var b=a.charCodeAt(0);return(45==b||48<=b&&57>=b)&&mxUtils.isInteger(a)};
mxObjectCodec.getInheritedNames=function(a){var b=mxObjectCodec.inheritedNames.get(a);if(null==b){b=[];for(var c in a)("function"!=typeof a[c]||mxObjectCodec.isIndex(c))&&b.push(c);mxObjectCodec.inheritedNames.set(a,b)}return b};mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null;mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.fieldTypes=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};
mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(a){if(null!=a){var b=this.reverse[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.getAttributeName=function(a){if(null!=a){var b=this.mapping[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.isExcluded=function(a,b,c,d){return b==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,b)};
mxObjectCodec.prototype.isReference=function(a,b,c,d){return 0<=mxUtils.indexOf(this.idrefs,b)};mxObjectCodec.prototype.encode=function(a,b){var c=a.document.createElement(this.getName());b=this.beforeEncode(a,b,c);this.encodeObject(a,b,c);return this.afterEncode(a,b,c)};
mxObjectCodec.prototype.encodeObject=function(a,b,c){a.setAttribute(c,"id",a.getId(b));for(var d=this.getMemberNames(a,b),e=[],f=0;f<d.length;f++){var g=d[f],h=b[g],k=mxObjectCodec.isIndex(g);null==h||!k&&"function"==typeof h||this.isExcluded(b,g,h,!0)||(k?this.encodeValue(a,b,null,h,c):e.push({name:g,value:h}))}e.sort(function(l,m){return l.name<m.name?-1:l.name>m.name?1:0});for(f=0;f<e.length;f++)this.encodeValue(a,b,e[f].name,e[f].value,c)};
mxObjectCodec.prototype.getMemberNames=function(a,b){var c=[];if(a.encodeDefaults)for(var d in b)c.push(d);else if(c=Object.keys(b),a=Object.getPrototypeOf(b),null!=a)for(a=mxObjectCodec.getInheritedNames(a),d=0;d<a.length;d++)Object.prototype.hasOwnProperty.call(b,a[d])||c.push(a[d]);return c};
mxObjectCodec.prototype.encodeValue=function(a,b,c,d,e){if(null!=d){if(this.isReference(b,c,d,!0)){var f=a.getId(d);if(null==f){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+c+"="+d);return}d=f}f=this.template[c];if(null==c||a.encodeDefaults||f!=d)c=this.getAttributeName(c),this.writeAttribute(a,b,c,d,e)}};mxObjectCodec.prototype.writeAttribute=function(a,b,c,d,e){"object"!=typeof d?this.writePrimitiveAttribute(a,b,c,d,e):this.writeComplexAttribute(a,b,c,d,e)};
mxObjectCodec.prototype.writePrimitiveAttribute=function(a,b,c,d,e){d=this.convertAttributeToXml(a,b,c,d,e);null==c?(b=a.document.createElement("add"),"function"==typeof d?b.appendChild(a.document.createTextNode(d)):a.setAttribute(b,"value",d),e.appendChild(b)):"function"!=typeof d&&a.setAttribute(e,c,d)};
mxObjectCodec.prototype.writeComplexAttribute=function(a,b,c,d,e){a=a.encode(d);null!=a?(null!=c&&a.setAttribute("as",c),e.appendChild(a)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+c+": "+d)};mxObjectCodec.prototype.convertAttributeToXml=function(a,b,c,d){this.isBooleanAttribute(a,b,c,d)&&(d=1==d?"1":"0");return d};mxObjectCodec.prototype.isBooleanAttribute=function(a,b,c,d){return"undefined"==typeof d.length&&(1==d||0==d)};
mxObjectCodec.prototype.convertAttributeFromXml=function(a,b,c){var d=b.value;this.isNumericAttribute(a,b,c)&&(d=parseFloat(d),isNaN(d)||!isFinite(d))&&(d=0);return d};mxObjectCodec.prototype.isNumericAttribute=function(a,b,c){return c.constructor==mxGeometry&&("x"==b.name||"y"==b.name||"width"==b.name||"height"==b.name)||c.constructor==mxPoint&&("x"==b.name||"y"==b.name)||mxUtils.isNumeric(b.value)};mxObjectCodec.prototype.beforeEncode=function(a,b,c){return b};
mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};
mxObjectCodec.prototype.decode=function(a,b,c){var d=b.getAttribute("id"),e=null!=d?a.objects[d]:null;if(null==e)if(a.depth>=a.maxDepth)e=null,null!=window.console&&console.error("mxObjectCodec.decode: Maximum depth "+a.maxDepth+" exceeded for "+b.nodeName);else if(null==c||c instanceof this.template.constructor){e=c||this.cloneTemplate();null!=d&&a.putObject(d,e);a.depth++;try{b=this.beforeDecode(a,b,e),this.decodeNode(a,b,e),e=this.afterDecode(a,b,e)}finally{a.depth--}}else e=null,null!=window.console&&
console.error("mxObjectCodec.decode: Cannot decode "+b.nodeName+" into "+typeof c);return e};mxObjectCodec.prototype.decodeNode=function(a,b,c){null!=b&&(this.decodeAttributes(a,b,c),this.decodeChildren(a,b,c))};mxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]};
mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};
mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};
mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);if("add"==b.nodeName)a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)));else{var f=null!=this.fieldTypes&&null!=d?this.fieldTypes[d]:null;a=null!=f?a.decodeAs(b,f,e):a.decode(b,e)}try{this.addObjectValue(c,d,a,e)}catch(g){null!=window.console&&console.error(g.message+" "+b.nodeName+
(null!=d?" as "+d:""))}}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){if(mxObjectCodec.isPollutionKey(b))return null;a=a[b];if(a instanceof Array&&0<a.length||"function"===typeof a)a=null;return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d&&!mxObjectCodec.isPollutionKey(b)&&("function"!==typeof a[b]||"function"===typeof c))if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");};
mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b&&mxObjectCodec.allowInclude)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(c,d,e){return"value"!==d.nodeName&&"style"!==d.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(c,d,e,f){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||f&&"value"==d&&mxUtils.isNode(e)};a.afterEncode=function(c,d,e){if(null!=
d.value&&mxUtils.isNode(d.value)){var f=e;e=mxUtils.importNode(c.document,d.value,!0);e.appendChild(f);c=f.getAttribute("id");e.setAttribute("id",c);f.removeAttribute("id")}return e};a.normalizeUserObject=function(c){if(!mxUtils.isNode(c)){var d=c.localName;if(null!=mxCodecRegistry.codecs[d]||null!=mxCodecRegistry.aliases[d])d="UserObject";d=c.ownerDocument.createElementNS(null,d);for(var e=0;e<c.attributes.length;e++){var f=c.attributes[e];"xmlns"!=f.name&&d.setAttributeNS(f.namespaceURI,f.name,
f.value)}for(;null!=c.firstChild;)d.appendChild(c.firstChild);c=d}return c};a.beforeDecode=function(c,d,e){var f=d,g=this.getName();d.nodeName!=g?(f=d.getElementsByTagName(g)[0],f=null!=f&&f.parentNode==d?f:null,e.value=this.normalizeUserObject(this.cloneUserObject(d,f)),d=e.value.getAttribute("id"),null!=d&&(e.setId(d),e.value.removeAttribute("id"))):e.setId(d.getAttribute("id"));if(null!=f)for(d=0;d<this.idrefs.length;d++){g=this.idrefs[d];var h=f.getAttribute(g);if(null!=h){var k=c.objects[h]||
c.lookup(h);if(null==k){var l=c.getElementById(h);if(null!=l){var m=mxCodecRegistry.codecs[l.nodeName];null==m||c.isCellCodec(m)?k=(m||this).decode(c,l):null!=window.console&&console.error("mxCellCodec.beforeDecode: "+this.idrefs[d]+" "+h+" is not a cell for cell "+e.getId())}else null!=window.console&&console.error("mxCellCodec.beforeDecode: "+this.idrefs[d]+" "+h+" not found for cell "+e.getId())}null==k||k instanceof mxCell||(null!=window.console&&console.error("mxCellCodec.beforeDecode: "+this.idrefs[d]+
" "+h+" is not a cell for cell "+e.getId()),k=null);e[g]=k}}return f};a.cloneUserObject=function(c,d){if(null==d)return c.cloneNode(!0);for(var e=[d],f=0;2>f;f++)for(var g=0==f?d.previousSibling:d.nextSibling;null!=g&&g.nodeType==mxConstants.NODETYPE_TEXT;)0==mxUtils.trim(mxUtils.getTextContent(g)).length&&e.push(g),g=0==f?g.previousSibling:g.nextSibling;d=c.cloneNode(!1);for(c=c.firstChild;null!=c;)0>mxUtils.indexOf(e,c)&&d.appendChild(c.cloneNode(!0)),c=c.nextSibling;return d};a.isIgnoredAttribute=
function(c,d,e){return mxObjectCodec.prototype.isIgnoredAttribute.apply(this,arguments)||0<=mxUtils.indexOf(this.idrefs,d.nodeName)};a.fieldTypes=Object.create(null);a.fieldTypes.geometry=mxGeometry;var b=mxCodecRegistry.getCodec(mxGeometry);b.fieldTypes=Object.create(null);b.fieldTypes.sourcePoint=mxPoint;b.fieldTypes.targetPoint=mxPoint;b.fieldTypes.offset=mxPoint;b.fieldTypes.alternateBounds=mxRectangle;return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphModel);a.enableStyleCompression=!1;a.defaultRootId="0";a.encodeObject=function(b,c,d){var e=b.document.createElement("root");b.encodeCell(c.getRoot(),e);d.appendChild(e);this.enableStyleCompression&&(b=this.encodeResources(b,e,b.document.createElement("defs")),0<b.childNodes.length&&e.parentNode.insertBefore(b,e))};a.encodeResources=function(b,c,d){c=c.getElementsByTagName("mxCell");for(var e={},f=0;f<c.length;f++)this.compressCellStyle(b,
d,e,c[f]);return d};a.compressCellStyle=function(b,c,d,e){var f=e.getAttribute("style");if(null!=f&&(-1!==f.indexOf("=data:")||-1!==f.indexOf("=stencil("))){var g=f.split(";");for(f=0;f<g.length;f++){var h=g[f].indexOf("="),k=g[f].substring(0,h),l=g[f].substring(h+1);("image"===k&&l.startsWith("data:image/")||"shape"===k&&l.startsWith("stencil("))&&mxUtils.bind(this,function(m,n){this.addResource(b,c,l,d,function(p){g[n]=m+"=def("+p+")";e.setAttribute("style",g.join(";"))})})(k,f)}}};a.addResource=
function(b,c,d,e,f){var g=e[d];null!=g?(null==g.id&&(g.id=c.getElementsByTagName("*").length,c.appendChild(g.elt),g.fn(g.id),delete g.elt,delete g.fn),f(g.id)):(b=b.document.createElement("def"),e[d]={elt:b,fn:f,id:null},b.setAttribute("data",d))};a.decodeChild=function(b,c,d){"defs"==c.nodeName?this.decodeResources(b,c,d):"root"==c.nodeName&&this.decodeRoot(b,c,d)};a.decodeAttributes=function(b,c,d){};a.decodeResources=function(b,c,d){d=c.parentNode.getElementsByTagName("mxCell");c=c.getElementsByTagName("def");
for(var e=0;e<d.length;e++)this.decompressCellStyle(b,c,d[e])};a.decompressCellStyle=function(b,c,d){b=d.getAttribute("style");if(null!=b&&-1!==b.indexOf("=def(")){b=b.split(";");for(var e=[],f=0;f<b.length;f++){var g=b[f].indexOf("="),h=b[f].substring(0,g);g=b[f].substring(g+1);if("image"!==h&&"shape"!==h||!g.startsWith("def("))e.push(b[f]);else{g=g.substring(g.indexOf("(")+1,g.length-1);var k=/^\d+$/.test(g)?c[g]:null;null!=k?e.push(h+"="+k.getAttribute("data")):null!=window.console&&console.error("mxModelCodec.decodeChild: Invalid reference "+
g+" in cell "+d.getAttribute("id"))}}d.setAttribute("style",e.join(";"))}};a.decodeRoot=function(b,c,d){var e=[];for(c=c.firstChild;null!=c;){var f=b.decodeCell(c);null!=f&&e.push(f);c=c.nextSibling}b=[];for(c=0;c<e.length;c++)null==e[c].getParent()&&b.push(e[c]);e=this.selectRoot(b);null!=e&&(this.adoptOrphanedCells(b,e),d.setRoot(e))};a.selectRoot=function(b){for(var c=null,d=0;d<b.length&&null==c;d++)b[d].getId()==this.defaultRootId&&(c=b[d]);for(d=0;d<b.length&&null==c;d++)b[d].isVertex()||b[d].isEdge()||
(c=b[d]);return null!=c?c:0<b.length?b[0]:null};a.adoptOrphanedCells=function(b,c){for(var d=0<c.getChildCount()?c.getChildAt(0):null,e=0;e<b.length;e++)b[e]!=c&&(null!=d&&d.insert(b[e]),null!=window.console&&console.warn("mxModelCodec.decodeRoot: cell without a parent: "+b[e].getId()+(null!=d?" moved into layer "+d.getId():" ignored")))};return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxRootChange,["model","previous","root"]);a.afterEncode=function(b,c,d){b.encodeCell(c.root,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.root=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;)d=e.nextSibling,b.decodeCell(e),e.parentNode.removeChild(e),e=d}return c};a.afterDecode=function(b,c,
d){d.previous=d.root;return d};return a}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);a.isReference=function(b,c,d,e){return"child"!=c||e&&!b.model.contains(b.previous)?0<=mxUtils.indexOf(this.idrefs,c):!0};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&null!=d&&("previous"==c||"parent"==c)&&!b.model.contains(d)};a.afterEncode=function(b,c,d){this.isReference(c,"child",c.child,!0)?d.setAttribute("child",
b.getId(c.child)):b.encodeCell(c.child,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.child=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;){d=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_ELEMENT){var f=e.getAttribute("id");null==b.lookup(f)&&b.decodeCell(e)}e.parentNode.removeChild(e);e=d}}else e=c.getAttribute("child"),d.child=b.getObject(e);return c};
a.afterDecode=function(b,c,d){null!=d.child&&(null!=d.child.parent&&null!=d.previous&&d.child.parent!=d.previous&&(d.previous=d.child.parent),d.child.parent=d.previous,d.previous=d.parent,d.previousIndex=d.index);return d};return a}());mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);a.afterDecode=function(b,c,d){d.previous=d.terminal;return d};return a}());
var mxGenericChangeCodec=function(a,b){a=new mxObjectCodec(a,["model","previous"],["cell"]);a.afterDecode=function(c,d,e){mxUtils.isNode(e.cell)&&(e.cell=c.decodeCell(e.cell,!1));e.previous=e[b];return e};return a};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry"));
mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))}());
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphView);a.encode=function(b,c){mxUtils.deprecated("mxGraphViewCodec");return this.encodeCell(b,c,c.graph.getModel().getRoot())};a.encodeCell=function(b,c,d){var e=c.graph.getModel(),f=c.getState(d),g=e.getParent(d);if(null==g||null!=f){var h=e.getChildCount(d),k=c.graph.getCellGeometry(d),l=null;g==e.getRoot()?l="layer":null==g?l="graph":e.isEdge(d)?l="edge":0<h&&null!=k?l="group":e.isVertex(d)&&(l="vertex");if(null!=l){var m=b.document.createElement(l);
null!=c.graph.getLabel(d)&&(m.setAttribute("label",c.graph.getLabel(d)),c.graph.isHtmlLabel(d)&&m.setAttribute("html",!0));if(null==g){var n=c.getGraphBounds();null!=n&&(m.setAttribute("x",Math.round(n.x)),m.setAttribute("y",Math.round(n.y)),m.setAttribute("width",Math.round(n.width)),m.setAttribute("height",Math.round(n.height)));m.setAttribute("scale",c.scale)}else if(null!=f&&null!=k){for(n in f.style)g=f.style[n],"function"==typeof g&&"object"==typeof g&&(g=mxStyleRegistry.getName(g)),null!=g&&
"function"!=typeof g&&"object"!=typeof g&&m.setAttribute(n,g);g=f.absolutePoints;if(null!=g&&0<g.length){k=Math.round(g[0].x)+","+Math.round(g[0].y);for(n=1;n<g.length;n++)k+=" "+Math.round(g[n].x)+","+Math.round(g[n].y);m.setAttribute("points",k)}else m.setAttribute("x",Math.round(f.x)),m.setAttribute("y",Math.round(f.y)),m.setAttribute("width",Math.round(f.width)),m.setAttribute("height",Math.round(f.height));n=f.absoluteOffset;null!=n&&(0!=n.x&&m.setAttribute("dx",Math.round(n.x)),0!=n.y&&m.setAttribute("dy",
Math.round(n.y)))}for(n=0;n<h;n++)f=this.encodeCell(b,c,e.getChildAt(d,n)),null!=f&&m.appendChild(f)}}return m};return a}());
var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxStylesheet);a.encode=function(b,c){var d=b.document.createElement(this.getName()),e;for(e in c.styles){var f=c.styles[e],g=b.document.createElement("add");if(null!=e){g.setAttribute("as",e);for(var h in f){var k=this.getStringValue(h,f[h]);if(null!=k){var l=b.document.createElement("add");l.setAttribute("value",k);l.setAttribute("as",h);g.appendChild(l)}}0<g.childNodes.length&&d.appendChild(g)}}return d};a.getStringValue=
function(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){if(null!=d&&!(d instanceof this.template.constructor))return null!=window.console&&console.error("mxStylesheetCodec.decode: Cannot decode "+c.nodeName+" into "+typeof d),null;d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=
c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var h=f.getAttribute("as");if("add"==f.nodeName){var k=mxUtils.getTextContent(f);null!=k&&0<k.length&&mxStylesheetCodec.allowEval?k=mxUtils.eval(k):(k=f.getAttribute("value"),mxUtils.isNumeric(k)&&(k=parseFloat(k)));null!=k&&(g[h]=k)}else"remove"==f.nodeName&&
delete g[h]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
Editor=function(a,b,c,e,f){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=e||this.createGraph(b,c);this.graph.chromeless=this.chromeless;this.editable=null!=f?f:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(h,k){this.status=h;this.statusFunction=
k;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=function(){return this.status};this.graphChangeListener=function(h,k){h=null!=k?k.getProperty("edit"):null;null!=h&&h.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;
mxConstants.CENTIMETERS=5;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;Editor.pageCounter=0;(function(){try{for(var a=window;null!=a.opener&&"undefined"!==typeof a.opener.Editor&&!isNaN(a.opener.Editor.pageCounter)&&a.opener!=a;)a=a.opener;null!=a&&(a.Editor.pageCounter++,Editor.pageCounter=a.Editor.pageCounter)}catch(b){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';
Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4=";
Editor.menuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTI0MHYtODBoNzIwdjgwSDEyMFptMC0yMDB2LTgwaDcyMHY4MEgxMjBabTAtMjAwdi04MGg3MjB2ODBIMTIwWiIvPjwvc3ZnPg==";Editor.moveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=";
Editor.zoomInImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWm0tNDAtNjB2LTgwaC04MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+";
Editor.zoomOutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWk0yODAtNTQwdi04MGgyMDB2ODBIMjgwWiIvPjwvc3ZnPg==";
Editor.fullscreenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtMjAwaDgwdjEyMGgxMjB2ODBIMTIwWm01MjAgMHYtODBoMTIwdi0xMjBoODB2MjAwSDY0MFpNMTIwLTY0MHYtMjAwaDIwMHY4MEgyMDB2MTIwaC04MFptNjQwIDB2LTEyMEg2NDB2LTgwaDIwMHYyMDBoLTgwWiIvPjwvc3ZnPg==";Editor.fullscreenExitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTEyMHYtMTIwSDEyMHYtODBoMjAwdjIwMGgtODBabTQwMCAwdi0yMDBoMjAwdjgwSDcyMHYxMjBoLTgwWk0xMjAtNjQwdi04MGgxMjB2LTEyMGg4MHYyMDBIMTIwWm01MjAgMHYtMjAwaDgwdjEyMGgxMjB2ODBINjQwWiIvPjwvc3ZnPg==";
Editor.zoomFitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTMyMHEtNjYgMC0xMTMtNDd0LTQ3LTExM3EwLTY2IDQ3LTExM3QxMTMtNDdxNjYgMCAxMTMgNDd0NDcgMTEzcTAgNjYtNDcgMTEzdC0xMTMgNDdabTAtODBxMzMgMCA1Ni41LTIzLjVUNTYwLTQ4MHEwLTMzLTIzLjUtNTYuNVQ0ODAtNTYwcS0zMyAwLTU2LjUgMjMuNVQ0MDAtNDgwcTAgMzMgMjMuNSA1Ni41VDQ4MC00MDBabTAtODBaTTIwMC0xMjBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDB2LTE2MGg4MHYxNjBoMTYwdjgwSDIwMFptNDAwIDB2LTgwaDE2MHYtMTYwaDgwdjE2MHEwIDMzLTIzLjUgNTYuNVQ3NjAtMTIwSDYwMFpNMTIwLTYwMHYtMTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTYwdjgwSDIwMHYxNjBoLTgwWm02NDAgMHYtMTYwSDYwMHYtODBoMTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2MTYwaC04MFoiLz48L3N2Zz4=";
Editor.layersImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTExOCAxMjAtMzk4bDY2LTUwIDI5NCAyMjggMjk0LTIyOCA2NiA1MC0zNjAgMjgwWm0wLTIwMkwxMjAtNjAwbDM2MC0yODAgMzYwIDI4MC0zNjAgMjgwWm0wLTI4MFptMCAxNzggMjMwLTE3OC0yMzAtMTc4LTIzMCAxNzggMjMwIDE3OFoiLz48L3N2Zz4=";Editor.editImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMGg1N2wzOTEtMzkxLTU3LTU3LTM5MSAzOTF2NTdabS04MCA4MHYtMTcwbDUyOC01MjdxMTItMTEgMjYuNS0xN3QzMC41LTZxMTYgMCAzMSA2dDI2IDE4bDU1IDU2cTEyIDExIDE3LjUgMjZ0NS41IDMwcTAgMTYtNS41IDMwLjVUODE3LTY0N0wyOTAtMTIwSDEyMFptNjQwLTU4NC01Ni01NiA1NiA1NlptLTE0MSA4NS0yOC0yOSA1NyA1Ny0yOS0yOFoiLz48L3N2Zz4=";
Editor.duplicateImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI0MHEtMzMgMC01Ni41LTIzLjVUMjgwLTMyMHYtNDgwcTAtMzMgMjMuNS01Ni41VDM2MC04ODBoMzYwcTMzIDAgNTYuNSAyMy41VDgwMC04MDB2NDgwcTAgMzMtMjMuNSA1Ni41VDcyMC0yNDBIMzYwWm0wLTgwaDM2MHYtNDgwSDM2MHY0ODBaTTIwMC04MHEtMzMgMC01Ni41LTIzLjVUMTIwLTE2MHYtNTYwaDgwdjU2MGg0NDB2ODBIMjAwWm0xNjAtMjQwdi00ODAgNDgwWiIvPjwvc3ZnPg==";
Editor.crossImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMiAxOSA2LjQxeiIvPjwvc3ZnPg==";Editor.trashImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHEtMzMgMC01Ni41LTIzLjVUMjAwLTIwMHYtNTIwaC00MHYtODBoMjAwdi00MGgyNDB2NDBoMjAwdjgwaC00MHY1MjBxMCAzMy0yMy41IDU2LjVUNjgwLTEyMEgyODBabTQwMC02MDBIMjgwdjUyMGg0MDB2LTUyMFpNMzYwLTI4MGg4MHYtMzYwaC04MHYzNjBabTE2MCAwaDgwdi0zNjBoLTgwdjM2MFpNMjgwLTcyMHY1MjAtNTIwWiIvPjwvc3ZnPg==";
Editor.hiddenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNS0uNTkgMS4yMi0xLjQyIDIuMjctMi40MSAzLjEybDEuNDEgMS40MWMxLjM5LTEuMjMgMi40OS0yLjc3IDMuMTgtNC41M0MyMS4yNyA3LjExIDE3IDQgMTIgNGMtMS4yNyAwLTIuNDkuMi0zLjY0LjU3bDEuNjUgMS42NUMxMC42NiA2LjA5IDExLjMyIDYgMTIgNnptLTEuMDcgMS4xNEwxMyA5LjIxYy41Ny4yNSAxLjAzLjcxIDEuMjggMS4yOGwyLjA3IDIuMDdjLjA4LS4zNC4xNC0uNy4xNC0xLjA3QzE2LjUgOS4wMSAxNC40OCA3IDEyIDdjLS4zNyAwLS43Mi4wNS0xLjA3LjE0ek0yLjAxIDMuODdsMi42OCAyLjY4QzMuMDYgNy44MyAxLjc3IDkuNTMgMSAxMS41IDIuNzMgMTUuODkgNyAxOSAxMiAxOWMxLjUyIDAgMi45OC0uMjkgNC4zMi0uODJsMy40MiAzLjQyIDEuNDEtMS40MUwzLjQyIDIuNDUgMi4wMSAzLjg3em03LjUgNy41bDIuNjEgMi42MWMtLjA0LjAxLS4wOC4wMi0uMTIuMDItMS4zOCAwLTIuNS0xLjEyLTIuNS0yLjUgMC0uMDUuMDEtLjA4LjAxLS4xM3ptLTMuNC0zLjRsMS43NSAxLjc1Yy0uMjMuNTUtLjM2IDEuMTUtLjM2IDEuNzggMCAyLjQ4IDIuMDIgNC41IDQuNSA0LjUuNjMgMCAxLjIzLS4xMyAxLjc3LS4zNmwuOTguOThjLS44OC4yNC0xLjguMzgtMi43NS4zOC0zLjc5IDAtNy4xNy0yLjEzLTguODItNS41LjctMS40MyAxLjcyLTIuNjEgMi45My0zLjUzeiIvPjwvc3ZnPg==";
Editor.visibleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNUMxOS4xNyAxNC44NyAxNS43OSAxNyAxMiAxN3MtNy4xNy0yLjEzLTguODItNS41QzQuODMgOC4xMyA4LjIxIDYgMTIgNm0wLTJDNyA0IDIuNzMgNy4xMSAxIDExLjUgMi43MyAxNS44OSA3IDE5IDEyIDE5czkuMjctMy4xMSAxMS03LjVDMjEuMjcgNy4xMSAxNyA0IDEyIDR6bTAgNWMxLjM4IDAgMi41IDEuMTIgMi41IDIuNVMxMy4zOCAxNCAxMiAxNHMtMi41LTEuMTItMi41LTIuNVMxMC42MiA5IDEyIDltMC0yYy0yLjQ4IDAtNC41IDIuMDItNC41IDQuNVM5LjUyIDE2IDEyIDE2czQuNS0yLjAyIDQuNS00LjVTMTQuNDggNyAxMiA3eiIvPjwvc3ZnPg==";
Editor.lockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PGcgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBvcGFjaXR5PSIuODciLz48L2c+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2djJINmMtMS4xIDAtMiAuOS0yIDJ2MTBjMCAxLjEuOSAyIDIgMmgxMmMxLjEgMCAyLS45IDItMlYxMGMwLTEuMS0uOS0yLTItMnpNOSA2YzAtMS42NiAxLjM0LTMgMy0zczMgMS4zNCAzIDN2Mkg5VjZ6bTkgMTRINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+";
Editor.unlockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2aDJjMC0xLjY2IDEuMzQtMyAzLTNzMyAxLjM0IDMgM3YySDZjLTEuMSAwLTIgLjktMiAydjEwYzAgMS4xLjkgMiAyIDJoMTJjMS4xIDAgMi0uOSAyLTJWMTBjMC0xLjEtLjktMi0yLTJ6bTAgMTJINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+";
Editor.printImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjQwLTY0MHYtMTIwSDMyMHYxMjBoLTgwdi0yMDBoNDgwdjIwMGgtODBabS00ODAgODBoNjQwLTY0MFptNTYwIDEwMHExNyAwIDI4LjUtMTEuNVQ3NjAtNTAwcTAtMTctMTEuNS0yOC41VDcyMC01NDBxLTE3IDAtMjguNSAxMS41VDY4MC01MDBxMCAxNyAxMS41IDI4LjVUNzIwLTQ2MFptLTgwIDI2MHYtMTYwSDMyMHYxNjBoMzIwWm04MCA4MEgyNDB2LTE2MEg4MHYtMjQwcTAtNTEgMzUtODUuNXQ4NS0zNC41aDU2MHE1MSAwIDg1LjUgMzQuNVQ4ODAtNTIwdjI0MEg3MjB2MTYwWm04MC0yNDB2LTE2MHEwLTE3LTExLjUtMjguNVQ3NjAtNTYwSDIwMHEtMTcgMC0yOC41IDExLjVUMTYwLTUyMHYxNjBoODB2LTgwaDQ4MHY4MGg4MFoiLz48L3N2Zz4=";
Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE3LjY1IDYuMzVDMTYuMiA0LjkgMTQuMjEgNCAxMiA0Yy00LjQyIDAtNy45OSAzLjU4LTcuOTkgOHMzLjU3IDggNy45OSA4YzMuNzMgMCA2Ljg0LTIuNTUgNy43My02aC0yLjA4Yy0uODIgMi4zMy0zLjA0IDQtNS42NSA0LTMuMzEgMC02LTIuNjktNi02czIuNjktNiA2LTZjMS42NiAwIDMuMTQuNjkgNC4yMiAxLjc4TDEzIDExaDdWNGwtMi4zNSAyLjM1eiIvPjwvc3ZnPg==";
Editor.backImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTcuNTEgMy44N0wxNS43MyAyLjEgNS44NCAxMmw5LjkgOS45IDEuNzctMS43N0w5LjM4IDEybDguMTMtOC4xM3oiLz48L3N2Zz4=";Editor.closeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTIgMkM2LjQ3IDIgMiA2LjQ3IDIgMTJzNC40NyAxMCAxMCAxMCAxMC00LjQ3IDEwLTEwUzE3LjUzIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTMuNTktMTNMMTIgMTAuNTkgOC40MSA3IDcgOC40MSAxMC41OSAxMiA3IDE1LjU5IDguNDEgMTcgMTIgMTMuNDEgMTUuNTkgMTcgMTcgMTUuNTkgMTMuNDEgMTIgMTcgOC40MXoiLz48L3N2Zz4=";
Editor.closeBlackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjZweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjZweCI+PGVsbGlwc2UgY3g9IjEyIiBjeT0iMTIiIHJ4PSI5IiByeT0iOSIgc3Ryb2tlPSJub25lIiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjU5IDhMMTIgMTAuNTkgOS40MSA4IDggOS40MSAxMC41OSAxMiA4IDE0LjU5IDkuNDEgMTYgMTIgMTMuNDEgMTQuNTkgMTYgMTYgMTQuNTkgMTMuNDEgMTIgMTYgOS40MSAxNC41OSA4ek0xMiAyQzYuNDcgMiAyIDYuNDcgMiAxMnM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTBTMTcuNTMgMiAxMiAyem0wIDE4Yy00LjQxIDAtOC0zLjU5LTgtOHMzLjU5LTggOC04IDggMy41OSA4IDgtMy41OSA4LTggOHoiLz48L3N2Zz4=";
Editor.minusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEwIDI1LjV2LTNoMjh2M1oiLz48L3N2Zz4=";Editor.plusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==";Editor.addBoxImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMTYwaDE2MHYtODBINTIwdi0xNjBoLTgwdjE2MEgyODB2ODBoMTYwdjE2MFpNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTAtNTYwdjU2MC01NjBaIi8+PC9zdmc+";
Editor.shapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjAwLTM2MFpNMzIwLTI0MnExMCAxIDE5LjUgMS41dDIwLjUuNXExMSAwIDIwLjUtLjVUNDAwLTI0MnY4Mmg0MDB2LTQwMGgtODJxMS0xMCAxLjUtMTkuNXQuNS0yMC41cTAtMTEtLjUtMjAuNVQ3MTgtNjQwaDgycTMzIDAgNTYuNSAyMy41VDg4MC01NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDgwMC04MEg0MDBxLTMzIDAtNTYuNS0yMy41VDMyMC0xNjB2LTgyWm00MC03OHEtMTE3IDAtMTk4LjUtODEuNVQ4MC02MDBxMC0xMTcgODEuNS0xOTguNVQzNjAtODgwcTExNyAwIDE5OC41IDgxLjVUNjQwLTYwMHEwIDExNy04MS41IDE5OC41VDM2MC0zMjBabTAtODBxODMgMCAxNDEuNS01OC41VDU2MC02MDBxMC04My01OC41LTE0MS41VDM2MC04MDBxLTgzIDAtMTQxLjUgNTguNVQxNjAtNjAwcTAgODMgNTguNSAxNDEuNVQzNjAtNDAwWm0wLTIwMFoiLz48L3N2Zz4=";
Editor.formatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMzUyLTUyMiA4Ni04Ny01Ni01Ny00NCA0NC01Ni01NiA0My00NC00NS00NS04NyA4NyAxNTkgMTU4Wm0zMjggMzI5IDg3LTg3LTQ1LTQ1LTQ0IDQzLTU2LTU2IDQzLTQ0LTU3LTU2LTg2IDg2IDE1OCAxNTlabTI0LTU2NyA1NyA1Ny01Ny01N1pNMjkwLTEyMEgxMjB2LTE3MGwxNzUtMTc1TDgwLTY4MGwyMDAtMjAwIDIxNiAyMTYgMTUxLTE1MnExMi0xMiAyNy0xOHQzMS02cTE2IDAgMzEgNnQyNyAxOGw1MyA1NHExMiAxMiAxOCAyN3Q2IDMxcTAgMTYtNiAzMC41VDgxNi02NDdMNjY1LTQ5NWwyMTUgMjE1TDY4MC04MCA0NjUtMjk1IDI5MC0xMjBabS05MC04MGg1NmwzOTItMzkxLTU3LTU3LTM5MSAzOTJ2NTZabTQyMC00MTktMjktMjkgNTcgNTctMjgtMjhaIi8+PC9zdmc+";
Editor.freehandImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+PHBhdGggZD0iTTQuNSw4YzEuMDQsMCwyLjM0LTEuNSw0LjI1LTEuNWMxLjUyLDAsMi43NSwxLjIzLDIuNzUsMi43NWMwLDIuMDQtMS45OSwzLjE1LTMuOTEsNC4yMkM1LjQyLDE0LjY3LDQsMTUuNTcsNCwxNyBjMCwxLjEsMC45LDIsMiwydjJjLTIuMjEsMC00LTEuNzktNC00YzAtMi43MSwyLjU2LTQuMTQsNC42Mi01LjI4YzEuNDItMC43OSwyLjg4LTEuNiwyLjg4LTIuNDdjMC0wLjQxLTAuMzQtMC43NS0wLjc1LTAuNzUgQzcuNSw4LjUsNi4yNSwxMCw0LjUsMTBDMy4xMiwxMCwyLDguODgsMiw3LjVDMiw1LjQ1LDQuMTcsMi44Myw1LDJsMS40MSwxLjQxQzUuNDEsNC40Miw0LDYuNDMsNCw3LjVDNCw3Ljc4LDQuMjIsOCw0LjUsOHogTTgsMjEgbDMuNzUsMGw4LjA2LTguMDZsLTMuNzUtMy43NUw4LDE3LjI1TDgsMjF6IE0xMCwxOC4wOGw2LjA2LTYuMDZsMC45MiwwLjkyTDEwLjkyLDE5TDEwLDE5TDEwLDE4LjA4eiBNMjAuMzcsNi4yOSBjLTAuMzktMC4zOS0xLjAyLTAuMzktMS40MSwwbC0xLjgzLDEuODNsMy43NSwzLjc1bDEuODMtMS44M2MwLjM5LTAuMzksMC4zOS0xLjAyLDAtMS40MUwyMC4zNyw2LjI5eiIvPjwvc3ZnPg==";
Editor.undoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTIwMHYtODBoMjg0cTYzIDAgMTA5LjUtNDBUNzIwLTQyMHEwLTYwLTQ2LjUtMTAwVDU2NC01NjBIMzEybDEwNCAxMDQtNTYgNTYtMjAwLTIwMCAyMDAtMjAwIDU2IDU2LTEwNCAxMDRoMjUycTk3IDAgMTY2LjUgNjNUODAwLTQyMHEwIDk0LTY5LjUgMTU3VDU2NC0yMDBIMjgwWiIvPjwvc3ZnPg==";Editor.redoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzk2LTIwMHEtOTcgMC0xNjYuNS02M1QxNjAtNDIwcTAtOTQgNjkuNS0xNTdUMzk2LTY0MGgyNTJMNTQ0LTc0NGw1Ni01NiAyMDAgMjAwLTIwMCAyMDAtNTYtNTYgMTA0LTEwNEgzOTZxLTYzIDAtMTA5LjUgNDBUMjQwLTQyMHEwIDYwIDQ2LjUgMTAwVDM5Ni0yODBoMjg0djgwSDM5NloiLz48L3N2Zz4=";
Editor.outlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTE1IDIxLTYtMi4xLTQuNjUgMS44cS0uNS4yLS45MjUtLjExM1EzIDIwLjI3NSAzIDE5Ljc1di0xNHEwLS4zMjUuMTg4LS41NzUuMTg3LS4yNS41MTItLjM3NUw5IDNsNiAyLjEgNC42NS0xLjhxLjUtLjIuOTI1LjExMi40MjUuMzEzLjQyNS44Mzh2MTRxMCAuMzI1LS4xODguNTc1LS4xODcuMjUtLjUxMi4zNzVabS0xLTIuNDVWNi44NWwtNC0xLjR2MTEuN1ptMiAwIDMtMVY1LjdsLTMgMS4xNVpNNSAxOC4zbDMtMS4xNVY1LjQ1bC0zIDFaTTE2IDYuODV2MTEuN1ptLTgtMS40djExLjdaIi8+PC9zdmc+";
Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDEydjdINXYtN0gzdjdjMCAxLjEuOSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMnYtN2gtMnptLTYgLjY3bDIuNTktMi41OEwxNyAxMS41bC01IDUtNS01IDEuNDEtMS40MUwxMSAxMi42N1YzaDJ2OS42N3oiLz48L3N2Zz4=";Editor.compareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTE1Ljg1IDQwLTIuMS0yLjEgNi4wNS02LjA1SDR2LTNoMTUuOGwtNi4wNS02LjA1IDIuMS0yLjEgOS42NSA5LjY1Wm0xNi4zLTEyLjctOS42NS05LjY1TDMyLjE1IDhsMi4xIDIuMS02LjA1IDYuMDVINDR2M0gyOC4ybDYuMDUgNi4wNVoiLz48L3N2Zz4=";
Editor.expandMoreImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTEyIDE1LjM3NS02LTYgMS40LTEuNCA0LjYgNC42IDQuNi00LjYgMS40IDEuNFoiLz48L3N2Zz4=";Editor.expandLessImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTcuNCAxNS4zNzUtMS40LTEuNCA2LTYgNiA2LTEuNCAxLjQtNC42LTQuNloiLz48L3N2Zz4=";Editor.gearImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTkuMjUgMjItLjQtMy4ycS0uMzI1LS4xMjUtLjYxMi0uMy0uMjg4LS4xNzUtLjU2My0uMzc1TDQuNyAxOS4zNzVsLTIuNzUtNC43NSAyLjU3NS0xLjk1UTQuNSAxMi41IDQuNSAxMi4zMzd2LS42NzVxMC0uMTYyLjAyNS0uMzM3TDEuOTUgOS4zNzVsMi43NS00Ljc1IDIuOTc1IDEuMjVxLjI3NS0uMi41NzUtLjM3NS4zLS4xNzUuNi0uM2wuNC0zLjJoNS41bC40IDMuMnEuMzI1LjEyNS42MTMuMy4yODcuMTc1LjU2Mi4zNzVsMi45NzUtMS4yNSAyLjc1IDQuNzUtMi41NzUgMS45NXEuMDI1LjE3NS4wMjUuMzM3di42NzVxMCAuMTYzLS4wNS4zMzhsMi41NzUgMS45NS0yLjc1IDQuNzUtMi45NS0xLjI1cS0uMjc1LjItLjU3NS4zNzUtLjMuMTc1LS42LjNsLS40IDMuMlptMi44LTYuNXExLjQ1IDAgMi40NzUtMS4wMjVRMTUuNTUgMTMuNDUgMTUuNTUgMTJxMC0xLjQ1LTEuMDI1LTIuNDc1UTEzLjUgOC41IDEyLjA1IDguNXEtMS40NzUgMC0yLjQ4OCAxLjAyNVE4LjU1IDEwLjU1IDguNTUgMTJxMCAxLjQ1IDEuMDEyIDIuNDc1UTEwLjU3NSAxNS41IDEyLjA1IDE1LjVabTAtMnEtLjYyNSAwLTEuMDYyLS40MzgtLjQzOC0uNDM3LS40MzgtMS4wNjJ0LjQzOC0xLjA2MnEuNDM3LS40MzggMS4wNjItLjQzOHQxLjA2My40MzhxLjQzNy40MzcuNDM3IDEuMDYydC0uNDM3IDEuMDYycS0uNDM4LjQzOC0xLjA2My40MzhaTTEyIDEyWm0tMSA4aDEuOTc1bC4zNS0yLjY1cS43NzUtLjIgMS40MzgtLjU4OC42NjItLjM4NyAxLjIxMi0uOTM3bDIuNDc1IDEuMDI1Ljk3NS0xLjctMi4xNS0xLjYyNXEuMTI1LS4zNS4xNzUtLjczOC4wNS0uMzg3LjA1LS43ODd0LS4wNS0uNzg4cS0uMDUtLjM4Ny0uMTc1LS43MzdsMi4xNS0xLjYyNS0uOTc1LTEuNy0yLjQ3NSAxLjA1cS0uNTUtLjU3NS0xLjIxMi0uOTYzLS42NjMtLjM4Ny0xLjQzOC0uNTg3TDEzIDRoLTEuOTc1bC0uMzUgMi42NXEtLjc3NS4yLTEuNDM3LjU4Ny0uNjYzLjM4OC0xLjIxMy45MzhMNS41NSA3LjE1bC0uOTc1IDEuNyAyLjE1IDEuNnEtLjEyNS4zNzUtLjE3NS43NS0uMDUuMzc1LS4wNS44IDAgLjQuMDUuNzc1dC4xNzUuNzVsLTIuMTUgMS42MjUuOTc1IDEuNyAyLjQ3NS0xLjA1cS41NS41NzUgMS4yMTMuOTYyLjY2Mi4zODggMS40MzcuNTg4WiIvPjwvc3ZnPg==";
Editor.extensionImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0iTTguOCAyMUg1cS0uODI1IDAtMS40MTMtLjU4N1EzIDE5LjgyNSAzIDE5di0zLjhxMS4yIDAgMi4xLS43NjIuOS0uNzYzLjktMS45MzggMC0xLjE3NS0uOS0xLjkzOFE0LjIgOS44IDMgOS44VjZxMC0uODI1LjU4Ny0xLjQxMlE0LjE3NSA0IDUgNGg0cTAtMS4wNS43MjUtMS43NzVRMTAuNDUgMS41IDExLjUgMS41cTEuMDUgMCAxLjc3NS43MjVRMTQgMi45NSAxNCA0aDRxLjgyNSAwIDEuNDEzLjU4OFEyMCA1LjE3NSAyMCA2djRxMS4wNSAwIDEuNzc1LjcyNS43MjUuNzI1LjcyNSAxLjc3NSAwIDEuMDUtLjcyNSAxLjc3NVEyMS4wNSAxNSAyMCAxNXY0cTAgLjgyNS0uNTg3IDEuNDEzUTE4LjgyNSAyMSAxOCAyMWgtMy44cTAtMS4yNS0uNzg3LTIuMTI1UTEyLjYyNSAxOCAxMS41IDE4dC0xLjkxMi44NzVROC44IDE5Ljc1IDguOCAyMVpNNSAxOWgyLjEyNXEuNi0xLjY1IDEuOTI1LTIuMzI1UTEwLjM3NSAxNiAxMS41IDE2cTEuMTI1IDAgMi40NS42NzUgMS4zMjUuNjc1IDEuOTI1IDIuMzI1SDE4di02aDJxLjIgMCAuMzUtLjE1LjE1LS4xNS4xNS0uMzUgMC0uMi0uMTUtLjM1UTIwLjIgMTIgMjAgMTJoLTJWNmgtNlY0cTAtLjItLjE1LS4zNS0uMTUtLjE1LS4zNS0uMTUtLjIgMC0uMzUuMTVRMTEgMy44IDExIDR2Mkg1djIuMnExLjM1LjUgMi4xNzUgMS42NzVROCAxMS4wNSA4IDEyLjVxMCAxLjQyNS0uODI1IDIuNlQ1IDE2LjhabTcuNzUtNy43NVoiLz48L3N2Zz4=";
Editor.colorDropperImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTYgNDJ2LTguNGwxOC44NS0xOC44NS0zLjYtMy42TDIzLjMgOS4xbDQuNiA0LjZMMzUgNi42cS41NS0uNTUgMS4xNzUtLjU1dDEuMTc1LjU1bDQuMDUgNC4wNXEuNTUuNTUuNTUgMS4xNzVUNDEuNCAxM2wtNy4xIDcuMSA0LjYgNC42LTIuMDUgMi4wNS0zLjYtMy42TDE0LjQgNDJabTMtM2g0LjM1TDMxLjEgMjEuMjVsLTQuMzUtNC4zNUw5IDM0LjY1Wm0yMy4xNS0yMSA2LjItNi4yLTIuMTUtMi4xNS02LjIgNi4yWm0wIDBMMzAgMTUuODUgMzIuMTUgMThaIi8+PC9zdmc+";
Editor.magnifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik03ODQtMTIwIDUzMi0zNzJxLTMwIDI0LTY5IDM4dC04MyAxNHEtMTA5IDAtMTg0LjUtNzUuNVQxMjAtNTgwcTAtMTA5IDc1LjUtMTg0LjVUMzgwLTg0MHExMDkgMCAxODQuNSA3NS41VDY0MC01ODBxMCA0NC0xNCA4M3QtMzggNjlsMjUyIDI1Mi01NiA1NlpNMzgwLTQwMHE3NSAwIDEyNy41LTUyLjVUNTYwLTU4MHEwLTc1LTUyLjUtMTI3LjVUMzgwLTc2MHEtNzUgMC0xMjcuNSA1Mi41VDIwMC01ODBxMCA3NSA1Mi41IDEyNy41VDM4MC00MDBaIi8+PC9zdmc+";
Editor.sendImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik0xMjAtMTYwdi02NDBsNzYwIDMyMC03NjAgMzIwWm04MC0xMjAgNDc0LTIwMC00NzQtMjAwdjE0MGwyNDAgNjAtMjQwIDYwdjE0MFptMCAwdi00MDAgNDAwWiIvPjwvc3ZnPg==";Editor.micImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTQwMHEtNTAgMC04NS0zNXQtMzUtODV2LTI0MHEwLTUwIDM1LTg1dDg1LTM1cTUwIDAgODUgMzV0MzUgODV2MjQwcTAgNTAtMzUgODV0LTg1IDM1Wm0tNDAgMzIwdi0xMjNxLTEwNC0xNC0xNzItOTN0LTY4LTE4NGg4MHEwIDgzIDU4LjUgMTQxLjVUNDgwLTI4MHE4MyAwIDE0MS41LTU4LjVUNjgwLTQ4MGg4MHEwIDEwNS02OCAxODR0LTE3MiA5M3YxMjNoLTgwWiIvPjwvc3ZnPg==";
Editor.sparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjkyLDI2Mi45MSwyMTYuNCwxNDkuNzdhOSw5LDAsMCwwLTE2LjgsMEwxNTYuMDgsMjYyLjkxYTksOSwwLDAsMS01LjE3LDUuMTdMMzcuNzcsMzExLjZhOSw5LDAsMCwwLDAsMTYuOGwxMTMuMTQsNDMuNTJhOSw5LDAsMCwxLDUuMTcsNS4xN0wxOTkuNiw0OTAuMjNhOSw5LDAsMCwwLDE2LjgsMGw0My41Mi0xMTMuMTRhOSw5LDAsMCwxLDUuMTctNS4xN0wzNzguMjMsMzI4LjRhOSw5LDAsMCwwLDAtMTYuOEwyNjUuMDksMjY4LjA4QTksOSwwLDAsMSwyNTkuOTIsMjYyLjkxWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iNDAiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTogIzE4MWExYjsiLz4KPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjMwIi8+Cjxwb2x5Z29uIHBvaW50cz0iNDI2LjY3IDExNy4zMyA0MDAgNDggMzczLjMzIDExNy4zMyAzMDQgMTQ0IDM3My4zMyAxNzAuNjcgNDAwIDI0MCA0MjYuNjcgMTcwLjY3IDQ5NiAxNDQgNDI2LjY3IDExNy4zMyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMzAiLz4KPC9zdmc+";
Editor.thinSparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0yNTkuOTIsMjYyLjkxLDIxNi40LDE0OS43N2E5LDksMCwwLDAtMTYuOCwwTDE1Ni4wOCwyNjIuOTFhOSw5LDAsMCwxLTUuMTcsNS4xN0wzNy43NywzMTEuNmE5LDksMCwwLDAsMCwxNi44bDExMy4xNCw0My41MmE5LDksMCwwLDEsNS4xNyw1LjE3TDE5OS42LDQ5MC4yM2E5LDksMCwwLDAsMTYuOCwwbDQzLjUyLTExMy4xNGE5LDksMCwwLDEsNS4xNy01LjE3TDM3OC4yMywzMjguNGE5LDksMCwwLDAsMC0xNi44TDI2NS4wOSwyNjguMDhBOSw5LDAsMCwxLDI1OS45MiwyNjIuOTFaIiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyNCIgZGF0YS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U9IiIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOiAjMTgxYTFiOyIvPgogICAgPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+CiAgICA8cG9seWdvbiBwb2ludHM9IjQyNi42NyAxMTcuMzMgNDAwIDQ4IDM3My4zMyAxMTcuMzMgMzA0IDE0NCAzNzMuMzMgMTcwLjY3IDQwMCAyNDAgNDI2LjY3IDE3MC42NyA0OTYgMTQ0IDQyNi42NyAxMTcuMzMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+Cjwvc3ZnPg==";
Editor.layoutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNjAwLTE2MHYtODBINDQwdi0yMDBoLTgwdjgwSDgwdi0yNDBoMjgwdjgwaDgwdi0yMDBoMTYwdi04MGgyODB2MjQwSDYwMHYtODBoLTgwdjMyMGg4MHYtODBoMjgwdjI0MEg2MDBabTgwLTgwaDEyMHYtODBINjgwdjgwWk0xNjAtNDQwaDEyMHYtODBIMTYwdjgwWm01MjAtMjAwaDEyMHYtODBINjgwdjgwWm0wIDQwMHYtODAgODBaTTI4MC00NDB2LTgwIDgwWm00MDAtMjAwdi04MCA4MFoiLz48L3N2Zz4=";
Editor.arrowRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4=";Editor.arrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTM2MCAyODAtNTYwaDQwMEw0ODAtMzYwWiIvPjwvc3ZnPg==";
Editor.arrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjgwLTQwMCAyMDAtMjAwIDIwMCAyMDBIMjgwWiIvPjwvc3ZnPg==";Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTE2MHEtMTM0IDAtMjI3LTkzdC05My0yMjdxMC0xMzQgOTMtMjI3dDIyNy05M3E2OSAwIDEzMiAyOC41VDcyMC02OTB2LTExMGg4MHYyODBINTIwdi04MGgxNjhxLTMyLTU2LTg3LjUtODhUNDgwLTcyMHEtMTAwIDAtMTcwIDcwdC03MCAxNzBxMCAxMDAgNzAgMTcwdDE3MCA3MHE3NyAwIDEzOS00NHQ4Ny0xMTZoODRxLTI4IDEwNi0xMTQgMTczdC0xOTYgNjdaIi8+PC9zdmc+";
Editor.checkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzgyLTI0MCAxNTQtNDY4bDU3LTU3IDE3MSAxNzEgMzY3LTM2NyA1NyA1Ny00MjQgNDI0WiIvPjwvc3ZnPg==";Editor.dockRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0xMjAtODB2LTU2MEgyMDB2NTYwaDEyMFptODAgMGgzNjB2LTU2MEg0MDB2NTYwWm0tODAgMEgyMDBoMTIwWiIvPjwvc3ZnPg==";
Editor.toFrontImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI4MHEtMzMgMC01Ni41LTIzLjVUMjgwLTM2MHYtNDAwcTAtMzMgMjMuNS01Ni41VDM2MC04NDBoNDAwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODBIMzYwWm0wLTgwaDQwMHYtNDAwSDM2MHY0MDBaTTIwMC0yMDB2ODBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDBoODBabS04MC04MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0xNjAgNDgwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+";
Editor.toBackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNDgwaDgwdjQ4MGg0ODB2ODBIMjAwWm0xNjAtMjQwdjgwcS0zMyAwLTU2LjUtMjMuNVQyODAtMzYwaDgwWm0tODAtODB2LTgwaDgwdjgwaC04MFptMC0xNjB2LTgwaDgwdjgwaC04MFptODAtMTYwaC04MHEwLTMzIDIzLjUtNTYuNVQzNjAtODQwdjgwWm04MCA0ODB2LTgwaDgwdjgwaC04MFptMC00ODB2LTgwaDgwdjgwaC04MFptMTYwIDB2LTgwaDgwdjgwaC04MFptMCA0ODB2LTgwaDgwdjgwaC04MFptMTYwLTQ4MHYtODBxMzMgMCA1Ni41IDIzLjVUODQwLTc2MGgtODBabTAgNDAwaDgwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODB2LTgwWm0wLTgwdi04MGg4MHY4MGgtODBabTAtMTYwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+";
Editor.fillColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjQ3LTkwNCA1Ny01NiAzNDMgMzQzcTIzIDIzIDIzIDU3dC0yMyA1N0w0NTctMzEzcS0yMyAyMy01NyAyM3QtNTctMjNMMTUzLTUwM3EtMjMtMjMtMjMtNTd0MjMtNTdsMTkwLTE5MS05Ni05NlptMTUzIDE1M0wyMDktNTYwaDM4Mkw0MDAtNzUxWm0zNjAgNDcxcS0zMyAwLTU2LjUtMjMuNVQ2ODAtMzYwcTAtMjEgMTIuNS00NXQyNy41LTQ1cTktMTIgMTktMjV0MjEtMjVxMTEgMTIgMjEgMjV0MTkgMjVxMTUgMjEgMjcuNSA0NXQxMi41IDQ1cTAgMzMtMjMuNSA1Ni41VDc2MC0yODBaTTgwIDB2LTE2MGg4MDBWMEg4MFoiLz48L3N2Zz4=";
Editor.strokeColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNjAtMzIwaDU2bDMxMi0zMTEtMjktMjktMjgtMjgtMzExIDMxMnY1NlptLTgwIDgwdi0xNzBsNDQ4LTQ0N3ExMS0xMSAyNS41LTE3dDMwLjUtNnExNiAwIDMxIDZ0MjcgMThsNTUgNTZxMTIgMTEgMTcuNSAyNnQ1LjUgMzFxMCAxNS01LjUgMjkuNVQ3NzctNjg3TDMzMC0yNDBIMTYwWm01NjAtNTA0LTU2LTU2IDU2IDU2Wk02MDgtNjMxbC0yOS0yOS0yOC0yOCA1NyA1N1oiLz48L3N2Zz4=";
Editor.fontColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNDAtMjgwIDIxMC01NjBoMTAwbDIxMCA1NjBoLTk2bC01MC0xNDRIMzY4bC01MiAxNDRoLTk2Wm0xNzYtMjI0aDE2OGwtODItMjMyaC00bC04MiAyMzJaIi8+PC9zdmc+";Editor.backgroundColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm01MDQtNDgwTDQ4MC01ODQgMzIwLTQyNGwxMDMgMTA0IDE2MS0xNjBabS00Ny0xNjAgMTAzIDEwMyAxNjAtMTU5LTEwNC0xMDQtMTU5IDE2MFptLTg0LTI5IDIxNiAyMTYtMTg5IDE5MHEtMjQgMjQtNTYuNSAyNFQzNjctMjYzbC0yNyAyM0gxNDBsMTI2LTEyNXEtMjQtMjQtMjUtNTcuNXQyMy01Ny41bDE4OS0xODlabTAgMCAxODctMTg3cTI0LTI0IDU2LjUtMjR0NTYuNSAyNGwxMDQgMTAzcTI0IDI0IDI0IDU2LjVUODU3LTY0MEw2NjktNDUzIDQ1My02NjlaIi8+PC9zdmc+";
Editor.shadowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTgwcS0zMyAwLTU2LjUtMjMuNVQ4MC0xNjB2LTQ4MHEwLTMzIDIzLjUtNTYuNVQxNjAtNzIwaDgwdi04MHEwLTMzIDIzLjUtNTYuNVQzMjAtODgwaDQ4MHEzMyAwIDU2LjUgMjMuNVQ4ODAtODAwdjQ4MHEwIDMzLTIzLjUgNTYuNVQ4MDAtMjQwaC04MHY4MHEwIDMzLTIzLjUgNTYuNVQ2NDAtODBIMTYwWm0xNjAtMjQwaDQ4MHYtNDgwSDMyMHY0ODBaIi8+PC9zdmc+";
Editor.boldImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjcyLTIwMHYtNTYwaDIyMXE2NSAwIDEyMCA0MHQ1NSAxMTFxMCA1MS0yMyA3OC41VDYwMi00OTFxMjUgMTEgNTUuNSA0MXQzMC41IDkwcTAgODktNjUgMTI0LjVUNTAxLTIwMEgyNzJabTEyMS0xMTJoMTA0cTQ4IDAgNTguNS0yNC41VDU2Ni0zNzJxMC0xMS0xMC41LTM1LjVUNDk0LTQzMkgzOTN2MTIwWm0wLTIyOGg5M3EzMyAwIDQ4LTE3dDE1LTM4cTAtMjQtMTctMzl0LTQ0LTE1aC05NXYxMDlaIi8+PC9zdmc+";
Editor.italicImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtMTAwaDE2MGwxMjAtMzYwSDMyMHYtMTAwaDQwMHYxMDBINTgwTDQ2MC0zMDBoMTQwdjEwMEgyMDBaIi8+PC9zdmc+";Editor.underlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHYtODBoNTYwdjgwSDIwMFptMjgwLTE2MHEtMTAxIDAtMTU3LTYzdC01Ni0xNjd2LTMzMGgxMDN2MzM2cTAgNTYgMjggOTF0ODIgMzVxNTQgMCA4Mi0zNXQyOC05MXYtMzM2aDEwM3YzMzBxMCAxMDQtNTYgMTY3dC0xNTcgNjNaIi8+PC9zdmc+";
Editor.strikethroughImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDg2LTE2MHEtNzYgMC0xMzUtNDV0LTg1LTEyM2w4OC0zOHExNCA0OCA0OC41IDc5dDg1LjUgMzFxNDIgMCA3Ni0yMHQzNC02NHEwLTE4LTctMzN0LTE5LTI3aDExMnE1IDE0IDcuNSAyOC41VDY5NC0zNDBxMCA4Ni02MS41IDEzM1Q0ODYtMTYwWk04MC00ODB2LTgwaDgwMHY4MEg4MFptNDAyLTMyNnE2NiAwIDExNS41IDMyLjVUNjc0LTY3NGwtODggMzlxLTktMjktMzMuNS01MlQ0ODQtNzEwcS00MSAwLTY4IDE4LjVUMzg2LTY0MGgtOTZxMi02OSA1NC41LTExNy41VDQ4Mi04MDZaIi8+PC9zdmc+";
Editor.verticalTextImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MGgtODB2LTUyOGwtNDIgNDItNTYtNTYgMTM4LTEzOCAxNDAgMTM4LTU4IDU2LTQyLTQydjUyOFpNNTYwLTI3NiAxMjAtNDQwdi04MGw0NDAtMTY0djc2bC0xMTIgMzh2MTc4bDExMiA0MHY3NlpNMzg0LTQxNHYtMTMybC0xODIgNjR2NGwxODIgNjRaIi8+PC9zdmc+";Editor.alignLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDQ4MHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNDgwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+";
Editor.alignCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4=";Editor.alignRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4=";
Editor.alignJustifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+";Editor.alignTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHYtODBoNjQwdjgwSDE2MFptMjgwIDY0MHYtNDA4TDMzNi00MjRsLTU2LTU2IDIwMC0yMDAgMjAwIDIwMC01NiA1Ni0xMDQtMTA0djQwOGgtODBaIi8+PC9zdmc+";
Editor.alignMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0xNjhsLTY0IDY0LTU2LTU2IDE2MC0xNjAgMTYwIDE2MC01NiA1Ni02NC02NHYxNjhoLTgwWk0xNjAtNDQwdi04MGg2NDB2ODBIMTYwWm0zMjAtMTIwTDMyMC03MjBsNTYtNTYgNjQgNjR2LTE2OGg4MHYxNjhsNjQtNjQgNTYgNTYtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.alignBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTEyMHYtODBoNjQwdjgwSDE2MFptMzIwLTE2MEwyODAtNDgwbDU2LTU2IDEwNCAxMDR2LTQwOGg4MHY0MDhsMTA0LTEwNCA1NiA1Ni0yMDAgMjAwWiIvPjwvc3ZnPg==";
Editor.alignHorizontalLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwMGg4MHY4MDBIODBabTE2MC0yMDB2LTEyMGg0MDB2MTIwSDI0MFptMC0yODB2LTEyMGg2NDB2MTIwSDI0MFoiLz48L3N2Zz4=";Editor.alignHorizontalCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0yMDBIMjQwdi0xMjBoMjAwdi0xNjBIMTIwdi0xMjBoMzIwdi0yMDBoODB2MjAwaDMyMHYxMjBINTIwdjE2MGgyMDB2MTIwSDUyMHYyMDBoLTgwWiIvPjwvc3ZnPg==";
Editor.alignHorizontalRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTgwdi04MDBoODB2ODAwaC04MFpNMzIwLTI4MHYtMTIwaDQwMHYxMjBIMzIwWk04MC01NjB2LTEyMGg2NDB2MTIwSDgwWiIvPjwvc3ZnPg==";Editor.alignVerticalTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTgwdi02NDBoMTIwdjY0MEgyODBabTI4MC0yNDB2LTQwMGgxMjB2NDAwSDU2MFpNODAtODAwdi04MGg4MDB2ODBIODBaIi8+PC9zdmc+";
Editor.alignVerticalMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHYtMzIwSDgwdi04MGgyMDB2LTMyMGgxMjB2MzIwaDE2MHYtMjAwaDEyMHYyMDBoMjAwdjgwSDY4MHYyMDBINTYwdi0yMDBINDAwdjMyMEgyODBaIi8+PC9zdmc+";Editor.alignVerticalBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwaDgwMHY4MEg4MFptMjAwLTE2MHYtNjQwaDEyMHY2NDBIMjgwWm0yODAgMHYtNDAwaDEyMHY0MDBINTYwWiIvPjwvc3ZnPg==";
Editor.subscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTI4MGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTMyMHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtMjQwaC04MHY0MGgxMjB2NDBINzYwWm0tNTI1LTgwIDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS01MzFsMTg2IDI5MUg2MThMNDgyLTQ1N2gtNEwzNDItMjQwSDIzNVoiLz48L3N2Zz4=";
Editor.superscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTYwMHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTcyMGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTc2MHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtNjgwaC04MHY0MGgxMjB2NDBINzYwWk0yMzUtMTYwbDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS00NTFsMTg2IDI5MUg2MThMNDgyLTM3N2gtNEwzNDItMTYwSDIzNVoiLz48L3N2Zz4=";
Editor.orderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTgwdi02MGgxMDB2LTMwaC02MHYtNjBoNjB2LTMwSDEyMHYtNjBoMTIwcTE3IDAgMjguNSAxMS41VDI4MC0yODB2NDBxMCAxNy0xMS41IDI4LjVUMjQwLTIwMHExNyAwIDI4LjUgMTEuNVQyODAtMTYwdjQwcTAgMTctMTEuNSAyOC41VDI0MC04MEgxMjBabTAtMjgwdi0xMTBxMC0xNyAxMS41LTI4LjVUMTYwLTUxMGg2MHYtMzBIMTIwdi02MGgxMjBxMTcgMCAyOC41IDExLjVUMjgwLTU2MHY3MHEwIDE3LTExLjUgMjguNVQyNDAtNDUwaC02MHYzMGgxMDB2NjBIMTIwWm02MC0yODB2LTE4MGgtNjB2LTYwaDEyMHYyNDBoLTYwWm0xODAgNDQwdi04MGg0ODB2ODBIMzYwWm0wLTI0MHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBaIi8+PC9zdmc+";
Editor.unorderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTIwMHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBabTAtMjQwdi04MGg0ODB2ODBIMzYwWk0yMDAtMTYwcS0zMyAwLTU2LjUtMjMuNVQxMjAtMjQwcTAtMzMgMjMuNS01Ni41VDIwMC0zMjBxMzMgMCA1Ni41IDIzLjVUMjgwLTI0MHEwIDMzLTIzLjUgNTYuNVQyMDAtMTYwWm0wLTI0MHEtMzMgMC01Ni41LTIzLjVUMTIwLTQ4MHEwLTMzIDIzLjUtNTYuNVQyMDAtNTYwcTMzIDAgNTYuNSAyMy41VDI4MC00ODBxMCAzMy0yMy41IDU2LjVUMjAwLTQwMFptMC0yNDBxLTMzIDAtNTYuNS0yMy41VDEyMC03MjBxMC0zMyAyMy41LTU2LjVUMjAwLTgwMHEzMyAwIDU2LjUgMjMuNVQyODAtNzIwcTAgMzMtMjMuNSA1Ni41VDIwMC02NDBaIi8+PC9zdmc+";
Editor.indentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0wIDQ0MHYtMzIwbDE2MCAxNjAtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.outdentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0xNjAgNDQwTDEyMC00ODBsMTYwLTE2MHYzMjBaIi8+PC9zdmc+";
Editor.removeFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtNTI4LTU0Ni05My05My0xMjEtMTIxaDQ4NnYxMjBINTY4bC00MCA5NFpNNzkyLTU2IDQ2MC0zODhsLTgwIDE4OEgyNDlsMTE5LTI4MEw1Ni03OTJsNTYtNTYgNzM2IDczNi01NiA1NloiLz48L3N2Zz4=";Editor.textFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtODBoNTYwdjgwSDIwMFptNzYtMTYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4=";
Editor.codeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTI0MCA4MC00ODBsMjQwLTI0MCA1NyA1Ny0xODQgMTg0IDE4MyAxODMtNTYgNTZabTMyMCAwLTU3LTU3IDE4NC0xODQtMTgzLTE4MyA1Ni01NiAyNDAgMjQwLTI0MCAyNDBaIi8+PC9zdmc+";Editor.linkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MEgyODBxLTgzIDAtMTQxLjUtNTguNVQ4MC00ODBxMC04MyA1OC41LTE0MS41VDI4MC02ODBoMTYwdjgwSDI4MHEtNTAgMC04NSAzNXQtMzUgODVxMCA1MCAzNSA4NXQ4NSAzNWgxNjB2ODBaTTMyMC00NDB2LTgwaDMyMHY4MEgzMjBabTIwMCAxNjB2LTgwaDE2MHE1MCAwIDg1LTM1dDM1LTg1cTAtNTAtMzUtODV0LTg1LTM1SDUyMHYtODBoMTYwcTgzIDAgMTQxLjUgNTguNVQ4ODAtNDgwcTAgODMtNTguNSAxNDEuNVQ2ODAtMjgwSDUyMFoiLz48L3N2Zz4=";
Editor.lightDarkLinkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwSDI4MHEtODMgMC0xNDEuNS01OC41VDgwLTQ4MHEwLTgzIDU4LjUtMTQxLjVUMjgwLTY4MGgxNjB2ODBIMjgwcS01MCAwLTg1IDM1dC0zNSA4NXEwIDUwIDM1IDg1dDg1IDM1aDE2MHY4MFpNMzIwLTQ0MHYtODBoMzIwdjgwSDMyMFptMjAwIDE2MHYtODBoMTYwcTUwIDAgODUtMzV0MzUtODVxMC01MC0zNS04NXQtODUtMzVINTIwdi04MGgxNjBxODMgMCAxNDEuNSA1OC41VDg4MC00ODBxMCA4My01OC41IDE0MS41VDY4MC0yODBINTIwWiIvPjwvc3ZnPg==";
Editor.tooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMjQwaC04MHYyNDBabTY4LjUtMzMxLjVRNTIwLTYyMyA1MjAtNjQwdC0xMS41LTI4LjVRNDk3LTY4MCA0ODAtNjgwdC0yOC41IDExLjVRNDQwLTY1NyA0NDAtNjQwdDExLjUgMjguNVE0NjMtNjAwIDQ4MC02MDB0MjguNS0xMS41Wk00ODAtODBxLTgzIDAtMTU2LTMxLjVUMTk3LTE5N3EtNTQtNTQtODUuNS0xMjdUODAtNDgwcTAtODMgMzEuNS0xNTZUMTk3LTc2M3E1NC01NCAxMjctODUuNVQ0ODAtODgwcTgzIDAgMTU2IDMxLjVUNzYzLTc2M3E1NCA1NCA4NS41IDEyN1Q4ODAtNDgwcTAgODMtMzEuNSAxNTZUNzYzLTE5N3EtNTQgNTQtMTI3IDg1LjVUNDgwLTgwWm0wLTgwcTEzNCAwIDIyNy05M3Q5My0yMjdxMC0xMzQtOTMtMjI3dC0yMjctOTNxLTEzNCAwLTIyNyA5M3QtOTMgMjI3cTAgMTM0IDkzIDIyN3QyMjcgOTNabTAtMzIwWiIvPjwvc3ZnPg==";
Editor.lightDarkTooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwaDgwdi0yNDBoLTgwdjI0MFptNjguNS0zMzEuNVE1MjAtNjIzIDUyMC02NDB0LTExLjUtMjguNVE0OTctNjgwIDQ4MC02ODB0LTI4LjUgMTEuNVE0NDAtNjU3IDQ0MC02NDB0MTEuNSAyOC41UTQ2My02MDAgNDgwLTYwMHQyOC41LTExLjVaTTQ4MC04MHEtODMgMC0xNTYtMzEuNVQxOTctMTk3cS01NC01NC04NS41LTEyN1Q4MC00ODBxMC04MyAzMS41LTE1NlQxOTctNzYzcTU0LTU0IDEyNy04NS41VDQ4MC04ODBxODMgMCAxNTYgMzEuNVQ3NjMtNzYzcTU0IDU0IDg1LjUgMTI3VDg4MC00ODBxMCA4My0zMS41IDE1NlQ3NjMtMTk3cS01NCA1NC0xMjcgODUuNVQ0ODAtODBabTAtODBxMTM0IDAgMjI3LTkzdDkzLTIyN3EwLTEzNC05My0yMjd0LTIyNy05M3EtMTM0IDAtMjI3IDkzdC05MyAyMjdxMCAxMzQgOTMgMjI3dDIyNyA5M1ptMC0zMjBaIi8+PC9zdmc+";
Editor.lightDarkNoteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik0yNDAtMTIwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMjAwdi01NjBxMC0zMyAyMy41LTU2LjVUMjQwLTg0MGg0ODBxMzMgMCA1Ni41IDIzLjVUODAwLTc2MHYzNjBMNTIwLTEyMEgyNDBabTAtODBoMjA3di0yMzNoMjUzdi0zMjdIMjQwdjU2MFptODAtMzYwdi04MGgzMjB2ODBIMzIwWm0wIDE2MHYtODBoMTIwdjgwSDMyMFoiLz48L3N2Zz4=";
Editor.imageImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTQwLTgwaDQ4MEw1NzAtNDgwIDQ1MC0zMjBsLTkwLTEyMC0xMjAgMTYwWm0tNDAgODB2LTU2MCA1NjBaIi8+PC9zdmc+";
Editor.horizontalRuleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTQ0MHYtODBoNjQwdjgwSDE2MFoiLz48L3N2Zz4=";Editor.tableImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0yNDAtMjQwSDIwMHYxNjBoMjQwdi0xNjBabTgwIDB2MTYwaDI0MHYtMTYwSDUyMFptLTgwLTgwdi0xNjBIMjAwdjE2MGgyNDBabTgwIDBoMjQwdi0xNjBINTIwdjE2MFpNMjAwLTY4MGg1NjB2LTgwSDIwMHY4MFoiLz48L3N2Zz4=";
Editor.spacingImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTgwIDgwLTI0MGwxNjAtMTYwIDU3IDU2LTY0IDY0aDQ5NGwtNjMtNjQgNTYtNTYgMTYwIDE2MEw3MjAtODBsLTU3LTU2IDY0LTY0SDIzM2w2MyA2NC01NiA1NlptMzYtMzYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4=";Editor.addColumnLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTIwMHYtNTYwSDU2MHY1NjBoMjQwWm0tNjQwIDgwdi0xNjBoODB2ODBoMjQwdi01NjBIMjQwdjgwaC04MHYtMTYwaDcyMHY3MjBIMTYwWm0zMjAtMzYwWm04MCAwaC04MCA4MFptMCAwWk0xNjAtMzYwdi04MEg4MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+";
Editor.addColumnRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHY1NjBoMjQwdi01NjBIMTYwWk04MC0xMjB2LTcyMGg3MjB2MTYwaC04MHYtODBINDgwdjU2MGgyNDB2LTgwaDgwdjE2MEg4MFptNDAwLTM2MFptLTgwIDBoODAtODBabTAgMFptMzIwIDEyMHYtODBoLTgwdi04MGg4MHYtODBoODB2ODBoODB2ODBoLTgwdjgwaC04MFoiLz48L3N2Zz4=";Editor.removeColumnImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIiB0cmFuc2Zvcm09InJvdGF0ZSg5MCkgc2NhbGUoMSwtMSkiPjxwYXRoIGQ9Ik01NjAtMjgwSDEyMHYtNDAwaDcyMHYxMjBoLTgwdi00MEgyMDB2MjQwaDM2MHY4MFptLTM2MC04MHYtMjQwIDI0MFptNDQwIDEwNCA4NC04NC04NC04NCA1Ni01NiA4NCA4NCA4NC04NCA1NiA1Ni04MyA4NCA4MyA4NC01NiA1Ni04NC04My04NCA4My01Ni01NloiLz48L3N2Zz4=";
Editor.addRowAboveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTE2MGg1NjB2LTI0MEgyMDB2MjQwWm02NDAgODBIMTIwdi03MjBoMTYwdjgwaC04MHYyNDBoNTYwdi0yNDBoLTgwdi04MGgxNjB2NzIwWk00ODAtNDgwWm0wIDgwdi04MCA4MFptMCAwWm0tNDAtMjQwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg==";Editor.addRowBelowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTU2MGg1NjB2LTI0MEgyMDB2MjQwWm0tODAgNDAwdi03MjBoNzIwdjcyMEg2ODB2LTgwaDgwdi0yNDBIMjAwdjI0MGg4MHY4MEgxMjBabTM2MC0zMjBabTAtODB2ODAtODBabTAgMFpNNDQwLTgwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg==";
Editor.removeRowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTYwLTI4MEgxMjB2LTQwMGg3MjB2MTIwaC04MHYtNDBIMjAwdjI0MGgzNjB2ODBabS0zNjAtODB2LTI0MCAyNDBabTQ0MCAxMDQgODQtODQtODQtODQgNTYtNTYgODQgODQgODQtODQgNTYgNTYtODMgODQgODMgODQtNTYgNTYtODQtODMtODQgODMtNTYtNTZaIi8+PC9zdmc+";Editor.autosizeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAtNDB2LTI0MGg4MHYtNDAwSDQwdi0yNDBoMjQwdjgwaDQwMHYtODBoMjQwdjI0MGgtODB2NDAwaDgwdjI0MEg2ODB2LTgwSDI4MHY4MEg0MFptMjQwLTE2MGg0MDB2LTgwaDgwdi00MDBoLTgwdi04MEgyODB2ODBoLTgwdjQwMGg4MHY4MFptMzItMTIwIDEzNi0zNjBoNjRsMTM2IDM2MGgtNjJsLTMyLTkySDQwOGwtMzIgOTJoLTY0Wm0xMTQtMTQ0aDEwOGwtNTItMTUwaC00bC01MiAxNTBaTTEyMC03NjBoODB2LTgwaC04MHY4MFptNjQwIDBoODB2LTgwaC04MHY4MFptMCA2NDBoODB2LTgwaC04MHY4MFptLTY0MCAwaDgwdi04MGgtODB2ODBabTgwLTY0MFptNTYwIDBabTAgNTYwWm0tNTYwIDBaIi8+PC9zdmc+";
Editor.checkmarkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjJweCIgaGVpZ2h0PSIxOHB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQgMCkiIGQ9Ik03LjE4MSwxNS4wMDdhMSwxLDAsMCwxLS43OTMtMC4zOTFMMy4yMjIsMTAuNUExLDEsMCwxLDEsNC44MDgsOS4yNzRMNy4xMzIsMTIuM2w2LjA0NC04Ljg2QTEsMSwwLDEsMSwxNC44Myw0LjU2OWwtNi44MjMsMTBhMSwxLDAsMCwxLS44LjQzN0g3LjE4MVoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4=";
Editor.swapImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTQ0MHYtMjg3TDIxNy02MjRsLTU3LTU2IDIwMC0yMDAgMjAwIDIwMC01NyA1Ni0xMDMtMTAzdjI4N2gtODBaTTYwMC04MCA0MDAtMjgwbDU3LTU2IDEwMyAxMDN2LTI4N2g4MHYyODdsMTAzLTEwMyA1NyA1Nkw2MDAtODBaIi8+PC9zdmc+";Editor.copyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTIwMEgzMjBxLTMzIDAtNTYuNS0yMy41VDI0MC0yODB2LTU2MHEwLTMzIDIzLjUtNTYuNVQzMjAtOTIwaDI4MGwyNDAgMjQwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3NjAtMjAwWk01NjAtNjQwdi0yMDBIMzIwdjU2MGg0NDB2LTM2MEg1NjBaTTE2MC00MHEtMzMgMC01Ni41LTIzLjVUODAtMTIwdi01NjBoODB2NTYwaDQ0MHY4MEgxNjBabTE2MC04MDB2MjAwLTIwMCA1NjAtNTYwWiIvPjwvc3ZnPg==";
Editor.pasteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTY4cTEzLTM2IDQzLjUtNTh0NjguNS0yMnEzOCAwIDY4LjUgMjJ0NDMuNSA1OGgxNjhxMzMgMCA1Ni41IDIzLjVUODQwLTc2MHY1NjBxMCAzMy0yMy41IDU2LjVUNzYwLTEyMEgyMDBabTAtODBoNTYwdi01NjBoLTgwdjEyMEgyODB2LTEyMGgtODB2NTYwWm0yODAtNTYwcTE3IDAgMjguNS0xMS41VDUyMC04MDBxMC0xNy0xMS41LTI4LjVUNDgwLTg0MHEtMTcgMC0yOC41IDExLjVUNDQwLTgwMHEwIDE3IDExLjUgMjguNVQ0ODAtNzYwWiIvPjwvc3ZnPg==";
Editor.doubleArrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjk2LTIyNC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWm0wLTI0MC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWiIvPjwvc3ZnPg==";Editor.doubleArrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTIwMCAyNDAtNDQwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWm0wLTI0MEwyNDAtNjgwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWiIvPjwvc3ZnPg==";
Editor.opacityImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDgwLTEyMHEtMTMzIDAtMjI2LjUtOTJUMTYwLTQzNnEwLTY1IDI1LTEyMS41VDI1NC02NThsMjI2LTIyMiAyMjYgMjIycTQ0IDQ0IDY5IDEwMC41VDgwMC00MzZxMCAxMzItOTMuNSAyMjRUNDgwLTEyMFpNMjQyLTQwMGg0NzRxMTItNzItMTMuNS0xMjNUNjUwLTYwMEw0ODAtNzY4IDMxMC02MDBxLTI3IDI2LTUzIDc3dC0xNSAxMjNaIi8+PC9zdmc+";Editor.shareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNMjQwLTgwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMTYwdi00MDBxMC0zMyAyMy41LTU2LjVUMjQwLTY0MGgxMjB2ODBIMjQwdjQwMGg0ODB2LTQwMEg2MDB2LTgwaDEyMHEzMyAwIDU2LjUgMjMuNVQ4MDAtNTYwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3MjAtODBIMjQwWm0yMDAtMjQwdi00NDdsLTY0IDY0LTU2LTU3IDE2MC0xNjAgMTYwIDE2MC01NiA1Ny02NC02NHY0NDdoLTgwWiIvPjwvc3ZnPg==";
Editor.roughFillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hachure",dispName:"Hachure",res:"hachure"},{val:"solid",dispName:"Solid",res:"solid"},{val:"zigzag",dispName:"Zigzag",res:"zigzag"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"Zigzag Line",res:"zigzagLine"}];
Editor.fillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hatch",dispName:"Hatch",res:"hatch"},{val:"solid",dispName:"Solid",res:"solid"},{val:"dots",dispName:"Dots",res:"dots"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"Zigzag Line",res:"zigzagLine"}];Editor.themes=[];Editor.ctrlKey=mxClient.IS_MAC?"⌘":"Ctrl";Editor.altKey=mxClient.IS_MAC?"⌥":"Alt";Editor.shiftKey=mxClient.IS_MAC?"⇧":"Shift";
Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.suppressNewWindows=null!=window.urlParams&&"1"==urlParams.suppressNewWindows;Editor.popupsAllowed=(null!=window.urlParams?"1"!=urlParams.noDevice:!0)&&!Editor.suppressNewWindows;Editor.simpleLabels=!1;Editor.optimizeHtmlLabels=!1;Editor.fastRendering=!0;Editor.enableNativeClipboard=window==window.top&&null!=navigator.clipboard&&null!=navigator.clipboard.read;Editor.sketchMode=!1;Editor.darkMode=!1;
Editor.currentTheme=uiTheme;Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.lightColor="#ffffff";Editor.lightColorVar="--ge-light-color";Editor.systemColors=!1;Editor.getShapeForegroundColor=function(){return"light-dark("+(Editor.systemColors?"CanvasText":"#000000")+", var("+Editor.lightColorVar+", "+Editor.lightColor+"))"};
Editor.getShapeBackgroundColor=function(){return"light-dark("+(Editor.systemColors?"Canvas":"#ffffff")+", var("+Editor.darkColorVar+", "+Editor.darkColor+"))"};Editor.pageBackgroundColor="#ffffff";Editor.darkPageBackgroundColor=null;Editor.getDefaultPageBackgroundColor=function(){return"light-dark("+Editor.pageBackgroundColor+", "+(null!=Editor.darkPageBackgroundColor?Editor.darkPageBackgroundColor:Editor.darkColor)+")"};Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;
Editor.removeImageMetadata=!0;Editor.showConnectHandle=!1;Editor.enableInlineToolbar=!0;Editor.enableShapeInlineToolbar=null;Editor.defaultTransparentGroups=!1;Editor.enableAutoRotateLabels=!0;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isShapeInlineToolbarEnabled=function(){return null!=Editor.enableShapeInlineToolbar?Editor.enableShapeInlineToolbar:"simple"==Editor.currentTheme};Editor.isPngDataUrl=function(a){return null!=a&&"data:image/png;"==a.substring(0,15)};
Editor.isJpgDataUrl=function(a){return null!=a&&("data:image/jpg;"==a.substring(0,15)||"data:image/jpeg;"==a.substring(0,16))};Editor.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};Editor.isJpgData=function(a){return 2<a.length&&255==a.charCodeAt(0)&&216==a.charCodeAt(1)};
Editor.stripImageMetadata=function(a,b){if(null!=a&&b&&(Editor.isJpgDataUrl(a)||Editor.isPngDataUrl(a))){b=a.indexOf(",")+1;var c=a.substring(b),e=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0),f=new ArrayBuffer(e.length),h=new Uint8Array(f);for(c=0;c<e.length;c++)h[c]=e.charCodeAt(c);h=null;try{Editor.isJpgData(e)?h=Editor.stripJpgMetadata(f):Editor.isPngData(e)&&(h=Editor.stripPngMetadata(f))}catch(k){}if(null!=h){e="";for(c=0;c<h.length;c++)e+=String.fromCharCode(h[c]);a=a.substring(0,
b)+btoa(e)}}return a};
Editor.stripJpgMetadata=function(a){var b=new DataView(a),c=[];c.push(new Uint8Array(a,0,2));for(var e=2;e<a.byteLength-1;){var f=b.getUint16(e);if(65498===f){c.push(new Uint8Array(a,e));break}if(65488<=f&&65497>=f)c.push(new Uint8Array(a,e,2)),e+=2;else{var h=b.getUint16(e+2),k=65506===f;65505===f||k||c.push(new Uint8Array(a,e,2+h));e+=2+h}}a=c.reduce(function(t,C){return t+C.length},0);a=new Uint8Array(a);b=0;c=$jscomp.makeIterator(c);for(e=c.next();!e.done;e=c.next())e=e.value,a.set(e,b),b+=e.length;
return a};
Editor.stripPngMetadata=function(a){var b=new DataView(a),c=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),e=[];e.push(new Uint8Array(a,0,8));for(var f=8;f<a.byteLength;){var h=b.getUint32(f),k=String.fromCharCode(b.getUint8(f+4),b.getUint8(f+5),b.getUint8(f+6),b.getUint8(f+7));h=8+h+4;c.has(k)||e.push(new Uint8Array(a,f,h));f+=h;if("IEND"===k)break}a=e.reduce(function(t,C){return t+C.length},0);a=new Uint8Array(a);b=0;e=$jscomp.makeIterator(e);for(c=e.next();!c.done;c=e.next())c=c.value,a.set(c,
b),b+=c.length;return a};Editor.convertHtmlToText=function(a){if(null!=a){var b=document.createElement("div");b.innerHTML=Graph.sanitizeHtml(a);return mxUtils.extractTextWithWhitespace(b.childNodes)}return null};
Editor.extractGraphModelFromText=function(a){function b(h){var k=h.indexOf("```");0<=k&&(h=h.substring(0,k));return h}function c(h){var k=h.lastIndexOf("```");0<=k&&(h=h.substring(k+3));return h}var e=a.indexOf("<mxGraphModel "),f=a.indexOf("</mxGraphModel>");0>e&&(e=a.indexOf("<mxGraphModel>"));return 0<=e&&f>e?[mxUtils.trim(b(a.substring(0,e))),a.substring(e,f+15),mxUtils.trim(c(a.substring(f+15)))]:[a,"",""]};
Editor.repairTruncatedXml=function(a){var b=a.indexOf("<mxfile");0>b&&(b=a.indexOf("<mxGraphModel"));0>b&&(b=0);for(var c=[],e=b,f=!1,h=b;h<a.length;){var k=a.indexOf("<",h);if(0>k){f=0<c.length;break}if("\x3c!--"==a.substring(k,k+4)){h=a.indexOf("--\x3e",k+4);if(0>h){f=!0;break}h+=3}else if("<![CDATA["==a.substring(k,k+9)){h=a.indexOf("]]\x3e",k+9);if(0>h){f=!0;break}h+=3}else{var t=null;h=-1;for(var C=k+1;C<a.length;C++){var A=a.charAt(C);if(null!=t)A==t&&(t=null);else if('"'==A||"'"==A)t=A;else if(">"==
A){h=C;break}}if(0>h){f=!0;break}e=a.charAt(k+1);if("/"==e){if(e=/^<\/\s*([^\s>]+)/.exec(a.substring(k,h)),null!=e)for(k=c.length-1;0<=k;k--)if(c[k]==e[1]){c.splice(k);break}}else"?"!=e&&"!"!=e&&"/"!=a.charAt(h-1)&&(e=/^<\s*([^\s\/>]+)/.exec(a.substring(k,h)),null!=e&&c.push(e[1]));h+=1}e=h}if(!f&&0==c.length||e<=b)return null;a=a.substring(0,e);for(b=c.length-1;0<=b;b--)a+="</"+c[b]+">";return a};
Editor.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),e=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(e,mxUtils.bind(this,function(f,h,k){f=e.substring(f+8,f+8+k);if("zTXt"==h){k=f.indexOf(String.fromCharCode(0));var t=f.substring(0,k);if("mxGraphModel"==t||"mxfile"==t){f=Graph.stringToArrayBuffer(f.substring(k+2));k=null;try{k=pako.inflate(f,{to:"string"})}catch(C){k=pako.inflateRaw(f,{to:"string"})}k=null!=k?k.replace(/\+/g," "):
null;null!=k&&0<k.length&&(b=k)}}else"tEXt"==h&&(f=f.split(String.fromCharCode(0)),1<f.length&&("mxGraphModel"==f[0]||"mxfile"==f[0])&&(b=f[1]));if(null!=b||"IDAT"==h)return!0}))}catch(f){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};
Editor.getLabelForStylename=function(a){var b=a.match(/^([A-Za-z]*)(\d*)$/);null!=b&&1<b.length&&(a=mxUtils.trim(b[1].replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(c){return c.toUpperCase()}).replace(/Color[s]?/g,"")),a=mxUtils.trim(a+(0<b[2].length?" ("+b[2]+")":"")));return a};
Editor.soundex=function(a){if(null==a||0==a.length)return"";var b=[],c=1;b[0]=a[0].toUpperCase();for(var e=1,f=a.length;e<f;e++){var h=a[e].toUpperCase().charCodeAt(0)-65;if(0<=h&&25>=h&&"0"!="01230120022455012603010202"[h]&&("01230120022455012603010202"[h]!=b[c-1]&&(b[c]="01230120022455012603010202"[h],c++),3<c))break}if(3>=c)for(;3>=c;)b[c]="0",c++;return b.join("")};
Editor.initKeyboardButton=function(a,b,c){a.setAttribute("role","button");a.setAttribute("tabindex","0");c||mxEvent.preventDefault(a);mxEvent.addListener(a,"keydown",function(e){13!=e.keyCode&&32!=e.keyCode||mxEvent.isAltDown(e)||mxEvent.isControlDown(e)||mxEvent.isMetaDown(e)||(null!=b?b(e):Editor.clickWithKeyboard(a,e),mxEvent.consume(e))});c=function(){a.setAttribute("aria-disabled",a.hasAttribute("disabled")||a.classList.contains("mxDisabled")?"true":"false")};c();null!=window.MutationObserver&&
(new MutationObserver(c)).observe(a,{attributes:!0,attributeFilter:["disabled","class"]})};
Editor.keepFocusInList=function(a){var b=!1;mxEvent.addListener(a,"focusin",function(){b=!0});mxEvent.addListener(a,"focusout",function(c){null==c.relatedTarget||mxUtils.isAncestorNode(a,c.relatedTarget)||(b=!1)});null!=window.MutationObserver&&(new MutationObserver(function(c){if(b&&(null==document.activeElement||document.activeElement==document.body))for(var e=0;e<c.length;e++)for(var f=0;f<c[e].addedNodes.length;f++){var h=c[e].addedNodes[f];if(h.nodeType==mxConstants.NODETYPE_ELEMENT&&mxUtils.isAncestorNode(a,
h)&&(h=0<=h.tabIndex&&null!=h.getAttribute("tabindex")?[h]:Dialog.getTabStops(h),0<h.length)){h[0].focus();return}}})).observe(a,{childList:!0,subtree:!0})};Editor.addFocusRing=function(a,b){a.classList.add("geFocusLabel");mxEvent.addListener(a,"focus",function(){var c=!0;try{c=a.matches(":focus-visible")}catch(e){}b.classList.toggle("geFocusRing",c)});mxEvent.addListener(a,"blur",function(){b.classList.remove("geFocusRing")})};
Editor.clickWithKeyboard=function(a,b){a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,shiftKey:mxEvent.isShiftDown(b)}))};
Editor.createKeyboardGrid=function(a,b,c){function e(x){for(var I=0;I<k.length;I++){var M=mxUtils.indexOf(k[I].controls,x);if(0<=M)return{row:I,key:k[I].key,column:M}}return null}function f(x){for(var I=null,M=0;M<k.length&&null==I;M++)k[M].key===x.key&&(I=k[M]);null==I&&null!=x.row&&0<k.length&&(I=k[Math.min(x.row,k.length-1)]);return null!=I&&0<I.controls.length?I.controls[Math.min(x.column,I.controls.length-1)]:null}function h(x){null!=t&&t!=x&&("INPUT"==t.nodeName||c?t.setAttribute("tabindex",
"-1"):t.removeAttribute("tabindex"));t=x;null!=x&&(x.setAttribute("tabindex","0"),C=e(x))}var k=[],t=null,C=null,A=null;c&&mxEvent.addListener(a,"focusin",function(x){x=mxEvent.getSource(x);x!=t&&null!=e(x)&&h(x)});mxEvent.addListener(a,"keydown",function(x){var I=mxEvent.getSource(x),M=e(I);if(!(null==M||I.isContentEditable||mxEvent.isAltDown(x)||mxEvent.isControlDown(x)||mxEvent.isMetaDown(x))){var P=null;if(null!=b&&b(x,I,M.key,M.column))mxEvent.consume(x);else if(!mxEvent.isShiftDown(x)&&35<=
x.keyCode&&40>=x.keyCode){I=36==x.keyCode?0:35==x.keyCode?k.length-1:M.row+(38==x.keyCode?-1:40==x.keyCode?1:0);var Q=M.column+(37==x.keyCode?-1:39==x.keyCode?1:0);0<=I&&I<k.length&&0<=Q&&Q<k[I].controls.length?P=k[I].controls[Q]:0<=I&&I<k.length&&Q==M.column&&(P=k[I].controls[k[I].controls.length-1]);null!=P&&(h(P),P.focus(),mxEvent.consume(x))}else if(13==x.keyCode||32==x.keyCode&&"INPUT"!=I.nodeName)Editor.clickWithKeyboard(I,x),mxEvent.consume(x)}});return{begin:function(){A=e(document.activeElement);
k=[]},addRow:function(x,I){for(var M=0;M<I.length;M++)("INPUT"==I[M].nodeName||c&&!I[M].hasAttribute("tabindex"))&&I[M].setAttribute("tabindex","-1"),c&&I[M].classList.add("geDirectionalStop");k.push({key:x,controls:I})},end:function(x,I){var M=null!=C?f(C):null;null==M&&0<k.length&&(M=f({key:x,column:I||0})||k[0].controls[0]);h(M);null!=A&&(x=f(A),null!=x&&(h(x),x.focus()));A=null}}};
Editor.selectFilename=function(a){var b=a.value.lastIndexOf(".");if(0<b){var c=a.value.substring(b+1);"drawio"!=c&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],c)&&(c=a.value.lastIndexOf(".drawio.",b),0<c&&(b=c))}b=0<b?b:a.value.length;Editor.selectSubstring(a,0,b)};
Editor.selectSubstring=function(a,b,c){a.focus();"undefined"!=typeof a.selectionStart?(a.selectionStart=b,a.selectionEnd=c):document.selection&&document.selection.createRange&&(a.select(),a=document.selection.createRange(),a.collapse(!0),a.moveEnd("character",c),a.moveStart("character",b),a.select())};
Editor.toUnit=function(a,b){return b==mxConstants.INCHES?Math.round(1E3*a/mxConstants.PIXELS_PER_INCH)/1E3:b==mxConstants.MILLIMETERS?Math.round(1E3*a/mxConstants.PIXELS_PER_MM)/1E3:b==mxConstants.METERS?Math.round(1E5*a/(1E3*mxConstants.PIXELS_PER_MM))/1E5:b==mxConstants.CENTIMETERS?Math.round(1E4*a/(10*mxConstants.PIXELS_PER_MM))/1E4:Math.round(10*a)/10};
Editor.fromUnit=function(a,b,c){b==mxConstants.INCHES?a*=mxConstants.PIXELS_PER_INCH:b==mxConstants.MILLIMETERS?a*=mxConstants.PIXELS_PER_MM:b==mxConstants.METERS?a=a*mxConstants.PIXELS_PER_MM*1E3:b==mxConstants.CENTIMETERS&&(a=a*mxConstants.PIXELS_PER_MM*10);return c?a:Math.round(10*a)/10};
Editor.getCursorMoveStep=function(a){return a==mxConstants.MILLIMETERS||a==mxConstants.CENTIMETERS?.1*mxConstants.PIXELS_PER_MM:a==mxConstants.INCHES?.01*mxConstants.PIXELS_PER_INCH:a==mxConstants.METERS?.1*mxConstants.PIXELS_PER_MM:1};mxUtils.extend(Editor,mxEventSource);Editor.prototype.originalNoForeignObject=mxClient.NO_FO;
Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0;Editor.prototype.appName=document.title;
Editor.prototype.editBlankUrl=window.location.origin+window.location.pathname;Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(a){this.autosave=a;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(a){return this.editBlankUrl+a};
Editor.prototype.editAsNew=function(a,b,c,e){b=null!=b?"?title="+encodeURIComponent(b):"";c?b+=(0<b.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(b+=(0<b.length?"&":"?")+"ui="+urlParams.ui);null!=e&&(b+=(0<b.length?"&":"?")+"page-id="+encodeURIComponent(e));if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(b)+"#R"+encodeURIComponent(a));else{var f=null,h=mxUtils.bind(this,function(t){"ready"==t.data&&t.source==f&&(mxEvent.removeListener(window,
"message",h),f.postMessage(a,"*"))});c=b.substring(1).split("&");e={client:1};for(b=0;b<c.length;b++){var k=c[b].split("=");e[k[0]]=k[1]||""}mxEvent.addListener(window,"message",h);f=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(e)),null,!0)}};Editor.prototype.createGraph=function(a,b){a=new Graph(null,b,null,null,a);a.transparentBackground=!1;this.chromeless||(a.isBlankLink=function(c){return!this.isExternalProtocol(c)});return a};
Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(null==window.urlParams||"0"!=urlParams.tooltips);this.graph.setConnectable(this.graph.defaultConnectable);this.graph.connectionArrowsEnabled=this.graph.defaultConnectionArrowsEnabled;this.graph.foldingEnabled=this.graph.defaultFoldingEnabled;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible=
this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.setMeasureScale(null);this.graph.setBackgroundGradient(null);this.updateGraphComponents();this.graph.view.setScale(1)};
Editor.prototype.readGraphState=function(a){this.savedGraphState={};if(Editor.preserveViewState){var b=a.getAttribute("dx"),c=a.getAttribute("dy");null!=b&&(this.savedGraphState.dx=b);null!=c&&(this.savedGraphState.dy=c)}b=a.getAttribute("grid");if(null==b||""==b)b=this.graph.defaultGridEnabled?"1":"0";null!=urlParams.grid&&(this.savedGraphState.grid=b);this.graph.gridEnabled=(null!=urlParams.grid?"0"!=urlParams.grid:"0"!=b)&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=Graph.parseGridSize(a.getAttribute("gridSize"));
this.graph.graphHandler.guidesEnabled="0"!=a.getAttribute("guides");this.graph.setTooltips("0"!=a.getAttribute("tooltips")&&(null==window.urlParams||"0"!=urlParams.tooltips));b=a.getAttribute("connect");null!=b&&null!=Editor.config&&null!=Editor.config.defaultConnectable&&(this.savedGraphState.connect=b);this.graph.setConnectable(null==b||null!=Editor.config&&null!=Editor.config.defaultConnectable?this.graph.defaultConnectable:"0"!=b);b=a.getAttribute("arrows");null!=b&&null!=Editor.config&&null!=
Editor.config.defaultConnectionArrowsEnabled&&(this.savedGraphState.arrows=b);this.graph.connectionArrowsEnabled=null==b||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?this.graph.defaultConnectionArrowsEnabled:"0"!=b;b=a.getAttribute("fold");null!=b&&null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled&&(this.savedGraphState.fold=b);this.graph.foldingEnabled=null==b||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?this.graph.defaultFoldingEnabled:
"0"!=b;this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);b=parseFloat(a.getAttribute("pageScale"));!isNaN(b)&&0<b?this.graph.pageScale=b:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:null!=urlParams.pv?(b=a.getAttribute("page"),this.savedGraphState.page=b,this.graph.pageVisible="0"!=urlParams.pv):
(b=a.getAttribute("page"),this.graph.pageVisible=null!=b?"0"!=b:this.graph.defaultPageVisible);this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;b=parseFloat(a.getAttribute("pageWidth"));c=parseFloat(a.getAttribute("pageHeight"));isNaN(b)||isNaN(c)||(this.graph.pageFormat=new mxRectangle(0,0,b,c));this.graph.setMeasureScale(a.getAttribute("measureScale"));b=a.getAttribute("background");this.graph.background=null!=b&&0<b.length?b:null;this.graph.setBackgroundGradient(a.getAttribute("backgroundGradient"),
a.getAttribute("backgroundGradientDirection"))};
Editor.prototype.setGraphXml=function(a){if(null!=a){var b=new mxCodec(a.ownerDocument);if("mxGraphModel"==a.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(a),this.updateGraphComponents(),b.decode(a,this.graph.getModel())}finally{this.graph.model.endUpdate()}}else if("root"==a.nodeName){this.resetGraph();var c=b.document.createElement("mxGraphModel");c.appendChild(a);b.decode(c,this.graph.getModel());this.updateGraphComponents()}else throw{message:mxResources.get("cannotOpenFile"),
node:a,toString:function(){return this.message}};}else this.resetGraph(),this.graph.model.clear();this.fireEvent(new mxEventObject("resetGraphView"))};
Editor.prototype.getGraphXml=function(a){if(null!=a?a:1){var b=new mxCodec(mxUtils.createXmlDocument());a=b.encode(this.graph.getModel());b.document.appendChild(a)}else a=this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));b=this.savedGraphState||{};if(null!=b.dx||null!=b.dy)null!=b.dx&&a.setAttribute("dx",b.dx),null!=b.dy&&a.setAttribute("dy",b.dy);else if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100*
this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",null!=b.grid?b.grid:this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize",this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",null!=b.connect?b.connect:this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",null!=
b.arrows?b.arrows:this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",null!=b.fold?b.fold:this.graph.foldingEnabled?"1":"0");a.setAttribute("page",null!=b.page?b.page:this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width);a.setAttribute("pageHeight",this.graph.pageFormat.height);b=Graph.parseMeasureScale(this.graph.measureScale);1!=b&&a.setAttribute("measureScale",b);null!=this.graph.background&&a.setAttribute("background",
this.graph.background);b=Graph.parseBackgroundGradient(this.graph.backgroundGradient,this.graph.backgroundGradientDirection);null!=b.color&&(a.setAttribute("backgroundGradient",b.color),null!=b.direction&&a.setAttribute("backgroundGradientDirection",b.direction));return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};
Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a};
Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(e,f){b.undoableEditHappened(f.getProperty("edit"))};var c=mxUtils.bind(this,function(e,f){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,c);a.getView().addListener(mxEvent.UNDO,c);c=function(e,f){e=f.getProperty("edit").changes;e=a.getSelectionCellsForChanges(e);f=!1;if(0<e.length){for(var h=[],k=0;k<e.length;k++)null!=a.view.getState(e[k])&&(h.push(e[k]),
f||(a.scrollCellToVisible(e[k]),f=!0));a.setSelectionCells(h)}};b.addListener(mxEvent.UNDO,c);b.addListener(mxEvent.REDO,c);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};
OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)};
function Dialog(a,b,c,e,f,h,k,t,C,A,x){this.editorUi=a;this.returnFocus=this.getReturnFocus();null==this.bg&&(this.bg=a.createDiv("geBackground"));f&&null!=document.body&&document.body.appendChild(this.bg);t=a.createDiv(C?"geTransDialog":"geDialog");t.style.width=c+48+"px";null!=e&&(t.style.height=e+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==a.embedViewport||(t.style.left=a.embedViewport.x+a.embedViewport.width/2+"px",t.style.top=a.embedViewport.y+a.embedViewport.height/2+
"px");t.appendChild(b);t.setAttribute("role","dialog");f&&t.setAttribute("aria-modal","true");c=b.querySelector("h3, .geDialogTitle");null!=c?(""==c.id&&(c.id="geDialogTitle"+Dialog.titleCount++),t.setAttribute("aria-labelledby",c.id)):null!=b.getAttribute("aria-label")&&(t.setAttribute("aria-label",b.getAttribute("aria-label")),b.removeAttribute("aria-label"));null!=document.body&&document.body.appendChild(t);null==e&&(t.style.height=b.scrollHeight+48+"px");if(h&&(b=document.createElement("div"),
b.className="geButton",b.setAttribute("title",mxResources.get("close")),b.style.backgroundImage="url("+Editor.crossImage+")",b.style.position="absolute",b.style.top="0px",b.style.right="0px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),Editor.initKeyboardButton(b),t.appendChild(b),!x)){var I=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(M){I=!0}),null,mxUtils.bind(this,function(M){I&&(a.hideDialog(!0),I=!1)}))}this.onDialogClose=k;this.container=
t;f&&this.installFocusTrap();null!=A&&this.addResizeHandler(A);a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.titleCount=0;Dialog.prototype.getReturnFocus=function(){var a=document.activeElement,b=null;try{null==a||a==document.body||this.editorUi.isTextInputElement(a)||mxUtils.isAncestorNode(this.editorUi.editor.graph.container,a)||!a.matches(":focus-visible")||(b=a)}catch(c){}return b};Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";
Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9ImhFile truncated at 1 MB.