text: (function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define('hardcore0.0.33',[],t):'object'==typeof exports?exports['hardcore0.0.33']=t():e['hardcore0.0.33']=t()})('undefined'==typeof self?this:self,function(){var _Mathabs=Math.abs,_Mathmin=Math.min,_Mathsqrt=Math.sqrt,_Mathcos=Math.cos,_Mathsin=Math.sin,_MathPI=Math.PI,_Mathmax=Math.max;return function(e){function t(o){if(a[o])return a[o].exports;var i=a[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var a={};return t.m=e,t.c=a,t.d=function(e,a,o){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var a=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(a,'a',a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='http://static.365trtd.com/hardcore/',t(t.s=13)}([function(e){'use strict';var t=e.exports={checkPhone:function(){return!navigator||!!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)},guid:function(){function e(){return(0|65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+'-'+e()+'-'+e()+'-'+e()+'-'+e()+e()+e()},getElementByAttr:function(e,t,a,o){for(var r=e.getElementsByTagName(t),d=[],l=0;l<r.length;l++)r[l].getAttribute(a)==o&&d.push(r[l]);return d},clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},nodeInfo:function(e){var t='Node '+e.key+': '+e.text+'\n';return t+=e.group?'member of '+e.group:'top-level node',t},linkInfo:function(e){return'Link:\nfrom '+e.from+' to '+e.to},groupInfo:function(e){var t=e.adornedPart,a=t.memberParts.count,o=0;return t.memberParts.each(function(e){e instanceof go.Link&&o++}),'Group '+t.data.key+': '+t.data.text+'\n'+a+' members including '+o+' links'},queue:function(){this.data=[],this.enqueue=function(e){this.data.unshift(e)},this.dequeue=function(){this.data.pop()}},tdTravelTdpDataWidth:function(e,a,o,i){var r=new t.queue;void 0,r.enqueue(e);for(var d=null;!r.isEmpty();)if(d=r.dequeue(),o.push(i(d)),d.isparent){var l=a.findNodeDataForKey(d.isparent);if(l)for(r.enqueue(l);l.next&&l.next!=l.key&&(l=a.findNodeDataForKey(l.next),l);)r.enqueue(l)}},tdTravelTdpData:function(e,a,o,i){if(e)try{o.push(i(e))}catch(t){return}else return;if(e.isparent){var r=a.findNodeDataForKey(e.isparent);t.tdTravelTdpData(r,a,o,i)}if(e.next&&e.next!=e.key){var d=a.findNodeDataForKey(e.next);t.tdTravelTdpData(d,a,o,i)}},deleteOldData:function(e){var t,a;for(var o in window.localStorage)if(window.localStorage.hasOwnProperty(o)&&o.startsWith('TDCurrent'))try{t=JSON.parse(window.localStorage.getItem(o)),a=new Date().getTime()-t.modelData.updatedAt,a/1e3>86400*e&&(window.localStorage.removeItem(o))}catch(t){continue}},saveModelToLocalStorage:function(e,a){if(a.modelData.updatedAt=new Date().getTime(),!!window.localStorage){t.deleteOldData(3);try{window.localStorage.setItem('TDCurrent'+e,a.toJson())}catch(a){t.deleteOldData(1)}}},checkModel:function(e){function a(t){var a=e.findNodeDataForKey(t);return a?'exist':'not exist'}var o=e.nodeDataArray,i=e.findNodeDataForKey(1);t.tdTravelTdpData(i,e,[],function(e){'check key:'+e.key+',level:'+e.level+',parent:'+e.parent+','+('isparent:'+e.isparent+',prev:'+e.prev+',next:'+e.next);e.next&&'not exist'==a(e.next)&&void 0,e.isparent&&'not exist'==a(e.isparent)&&void 0,e.parent&&'not exist'==a(e.parent)&&void 0,e.prev&&'not exist'==a(e.prev)&&void 0})},tdTransToNum:function(e,t){1>=arguments.length&&(t=0);var a=t;try{return a=parseFloat(e),a}catch(t){return a}},simulateEnterWithAlt:function(t){var a=t.diagram;if(a.currentTool.currentTextEditor){var o=function(t){var e=t;if(e.which&&(13==e.keyCode&&e.altKey||10==e.keyCode&&e.ctrlKey||13==e.keyCode&&e.shiftKey||10==e.keyCode&&e.shiftKey)){var o=this.selectionStart,i=this.selectionEnd,r=this.value;return this.value=r.slice(0,o)+'\n'+r.slice(i),this.selectionStart=this.selectionEnd=o+1,!1}return!!(13!=e.keyCode||e.altKey)||(a.currentTool.isActive&&a.currentTool.acceptText(go.TextEditingTool.LostFocus),!1)};a.currentTool.currentTextEditor.mainElement.onkeypress=null,a.currentTool.currentTextEditor.mainElement.onkeypress=o;var i=a.currentTool.currentTextEditor.mainElement.value;e.exports.checkPhone()&&(a.currentTool.currentTextEditor.mainElement.selectionStart=i.length,a.currentTool.currentTextEditor.mainElement.selectionEnd=i.length)}},travelParts:function(e,t){var a=e.diagram;t(e);var o=e.containingGroup;o&&o.data.parent==e.data.key&&t(o);for(var i=[e],r,d,l,s;0<i.length;)if(r=i.pop(),r.data.isparent)for(l=a.findNodeForKey(r.data.isparent),d=r.findLinksTo(l).first(),t(d),t(l),o=l.containingGroup,o&&o.data.parent==l.data.key&&t(o),i.push(l);l.data.next;)s=a.findNodeForKey(l.data.next),d=l.findLinksTo(s).first(),t(d),t(s),o=s.containingGroup,o&&o.data.parent==s.data.key&&t(o),i.push(s),l=s}}},function(e){'use strict';function t(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var a=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),o=go.GraphObject.make;void 0,go.GraphObject.defineBuilder('CircleButton',function(){function t(t,e){var a=t.diagram.findObjectAt(t.documentPoint,function(e){for(;null!==e.panel;){if(e.isActionable)return e;e=e.panel}return e},function(t){return t===e});return null!==a}var e='#F5F5F5',a='#BDBDBD',o=2.76142374915397,i=2.761423749153969,r=go.GraphObject.make(go.Panel,'Auto',{isActionable:!0,enabledChanged:function(e,t){var a=e.findObject('ButtonBorder');null!==a&&(a.fill=t?e._buttonFillNormal:e._buttonFillDisabled)},cursor:'pointer',_buttonFillNormal:e,_buttonStrokeNormal:a,_buttonFillOver:'#E0E0E0',_buttonStrokeOver:'#9E9E9E',_buttonFillPressed:'#BDBDBD',_buttonStrokePressed:'#9E9E9E',_buttonFillDisabled:'#E5E5E5'},go.GraphObject.make(go.Shape,{name:'ButtonBorder',figure:'Circle',spot1:new go.Spot(0,0,o,i),spot2:new go.Spot(1,1,-o,-i),parameter1:2,parameter2:2,fill:e,stroke:a}));return r.mouseEnter=function(t,e){if(e.isEnabledObject()){var a=e.findObject('ButtonBorder');if(a instanceof go.Shape){var o=e._buttonFillOver;e._buttonFillNormal=a.fill,a.fill=o,o=e._buttonStrokeOver,e._buttonStrokeNormal=a.stroke,a.stroke=o}}},r.mouseLeave=function(t,e){if(e.isEnabledObject()){var a=e.findObject('ButtonBorder');a instanceof go.Shape&&(a.fill=e._buttonFillNormal,a.stroke=e._buttonStrokeNormal)}},r.actionDown=function(t,e){if(e.isEnabledObject()&&null!==e._buttonFillPressed&&0===t.button){var a=e.findObject('ButtonBorder');if(a instanceof go.Shape){var o=t.diagram,i=o.skipsUndoManager;o.skipsUndoManager=!0;var r=e._buttonFillPressed;e._buttonFillOver=a.fill,a.fill=r,r=e._buttonStrokePressed,e._buttonStrokeOver=a.stroke,a.stroke=r,o.skipsUndoManager=i}}},r.actionUp=function(a,e){if(e.isEnabledObject()&&null!==e._buttonFillPressed&&0===a.button){var o=e.findObject('ButtonBorder');if(o instanceof go.Shape){var i=a.diagram,r=i.skipsUndoManager;i.skipsUndoManager=!0,t(a,e)?(o.fill=e._buttonFillOver,o.stroke=e._buttonStrokeOver):(o.fill=e._buttonFillNormal,o.stroke=e._buttonStrokeNormal),i.skipsUndoManager=r}}},r.actionCancel=function(a,e){if(e.isEnabledObject()&&null!==e._buttonFillPressed){var o=e.findObject('ButtonBorder');if(o instanceof go.Shape){var i=a.diagram,r=i.skipsUndoManager;i.skipsUndoManager=!0,t(a,e)?(o.fill=e._buttonFillOver,o.stroke=e._buttonStrokeOver):(o.fill=e._buttonFillNormal,o.stroke=e._buttonStrokeNormal),i.skipsUndoManager=r}}},r.actionMove=function(a,e){if(e.isEnabledObject()&&null!==e._buttonFillPressed){var o=a.diagram;if(0===o.firstInput.button&&(o.currentTool.standardMouseOver(),t(a,e))){var i=e.findObject('ButtonBorder');if(i instanceof go.Shape){var r=o.skipsUndoManager;o.skipsUndoManager=!0;var d=e._buttonFillPressed;i.fill!==d&&(i.fill=d),d=e._buttonStrokePressed,i.stroke!==d&&(i.stroke=d),o.skipsUndoManager=r}}}},r});var i=function(){function e(a){t(this,e);this;this.diagram=a.diagram,this.nodeProperties=this.getNodeProperties(),this.binding=this.getBinding()}return a(e,[{key:'getTooTip',value:function(){this;return o('ToolTip',{"Border.fill":'whitesmoke',"Border.stroke":'black'},new go.Binding('visible','',function(e){return null!=e.remark}),o(go.TextBlock,{maxSize:new go.Size(400,NaN),font:'24px bold',wrap:go.TextBlock.WrapFit,margin:5},new go.Binding('text','',function(e){return e.remark||''})))}},{key:'getNodeProperties',value:function(){var e=this,t=this.diagram;return{}}},{key:'getNodeSelectionAdornmentTemplate',value:function(){return o(go.Adornment,'Auto',o(go.Shape,'Rectangle',{fill:null,stroke:'dodgerblue',strokeWidth:3}),o(go.Placeholder))}},{key:'getBinding',value:function(){return[new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('copyable','copyable').makeTwoWay()]}},{key:'getTextBuild',value:function(){return o(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.4),font:'bold 18px \u5E7C\u5706',editable:!0,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Uniform},new go.Binding('textAlign','textAlign',function(e){return-1<['start','center','end'].indexOf(e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return helpers.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return helpers.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e-30}).ofObject('main'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay())}},{key:'getNodeTemplate',value:function(){var e=this;return o(go.Node,e.nodeProperties,e.binding)}},{key:'click',value:function(t,e){e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)}},{key:'doubleClick',value:function(t,e){t.diagram.__trtd.selectText(t,e)}},{key:'mouseOver',value:function(t,e){t.diagram.__trtd.showNodeRemarkTips(t,e)}},{key:'mouseLeave',value:function(t){t.diagram.__trtd.removeNodeRemarkTips()}},{key:'mouseDragEnter',value:function(t,e){var a=e.part,o=t.diagram.selection.first();if(o instanceof go.Node&&'3'!=o.category&&'text'!=o.category&&1!=o.key){var i=a.findObject('SHAPE');i&&(i._prevFill=i.fill,i.fill='darkred')}}},{key:'mouseDragLeave',value:function(t,e){var a=e.part,o=a.findObject('SHAPE');o&&o._prevFill&&(o.fill=o._prevFill)}},{key:'mouseDrop',value:function(t,e){var a=e.part,o=t.diagram.selection.first();if(o instanceof go.Node&&'3'!=o.data.category&&'text'!=o.data.category&&1!=o.data.key)if(a.data.isparent){for(var i=t.diagram.findNodeForKey(a.data.isparent);i.data.next;)i=t.diagram.findNodeForKey(i.data.next);if(i.data.key==o.data.key)return;t.diagram.__trtd.setNodeAsSibling(o,i)}else t.diagram.__trtd.setNodeAsChildren(o,a)}}]),e}();e.exports=i},function(e){'use strict';function t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var a=go.GraphObject.make;e.exports=function(e){return a(go.Node,'Auto',t({name:'NODE',_controlExpand:!0,layerName:'Background',zOrder:20,locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,rotateObjectName:'SHAPE',doubleClick:function(t,e){void 0,e.diagram.__trtd.nodeDoubleClickListener&&e.diagram.__trtd.nodeDoubleClickListener(e)},click:function(t,e){void 0,e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},selectable:!0,movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:e.__trtd.nodeContextMenu,selectionAdornmentTemplate:function(){var e=go.GraphObject.make;return e(go.Adornment,'Spot',e(go.Panel,'Auto',e(go.Shape,{fill:null,stroke:'blue',strokeWidth:1}),e(go.Placeholder)),e(go.Panel,'Vertical',{name:'ButtonIcon1',alignment:new go.Spot(0,1,-20,20),alignmentFocus:go.Spot.Center,width:60,height:60,isActionable:!0},e(go.Shape,'Circle',{fill:'rgba(1,1,1,0)',strokeWidth:0,stroke:'green',width:50,height:50})))}()},'contextMenu',function(){var e=go.GraphObject.make;return e(go.Adornment,'Vertical',e('ContextMenuButton',e(go.TextBlock,'\u5220\u9664'),{click:function(t){t.diagram.commandHandler.deleteSelection()}}),e('ContextMenuButton',e(go.TextBlock,'\u5C45\u4E2D'),{click:function(){centerPicture()}}),e('ContextMenuButton',e(go.TextBlock,'\u7B49\u5BBD\u9AD8'),{click:function(){equalWidthHeightPicture()}}),e('ContextMenuButton',e(go.TextBlock,'\u539F\u59CB\u6BD4\u4F8B',{stroke:'gray'}),{click:function(){}}),e('ContextMenuButton',e(go.TextBlock,'\u81F3\u4E8E\u9876\u5C42'),{click:function(){bringToLayer('Foreground')}}),e('ContextMenuButton',e(go.TextBlock,'\u81F3\u4E8E\u5E95\u5C42'),{click:function(){bringToLayer('Background')}}),e('ContextMenuButton',e(go.TextBlock,'\u4E0A\u79FB\u4E00\u5C42'),{click:function(){bringToLayer(null)}}),e('ContextMenuButton',e(go.TextBlock,'\u56FA\u5B9A',new go.Binding('text','',function(e,t){var a=t.part;return a.data.selectable==void 0?'\u56FA\u5B9A':a.data.selectable?'\u56FA\u5B9A':'\u53D6\u6D88\u56FA\u5B9A'})),{name:'fixnode',click:function(t,e){var a=e.diagram,o=e.part;a.startTransaction(),a.model.setDataProperty(o.data,'selectable',o.data.selectable!=void 0&&!o.data.selectable),a.commitTransaction()}}))}()),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),a(go.TextBlock,new go.Binding('text','text')),a(go.Picture,{name:'SHAPE'},{successFunction:function(e){e.width&&e.height||e.part.data.width&&e.part.data.height||(e.width=e.element.width,e.height=e.element.height)}},{sourceCrossOrigin:function(){return''}},new go.Binding('source','picture',function(e){return e+'?'+Date.now()}).makeTwoWay(function(e){return e?(e=e.replace(/\?.*$/g,''),e):''}),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('angle','pictureangle').makeTwoWay(),new go.Binding('opacity','opacity',function(e){return e?parseFloat(e):1}).makeTwoWay(function(e){return e})))}},function(e){'use strict';var t=go.GraphObject.make;e.exports=function(){var e={figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:1,stroke:'rgba(0,0,0,0)',fontSize:15,font:'sans-serif'};return t(go.Node,'Spot',{_controlExpand:!0,layerName:'Foreground',movable:!0,locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,location:new go.Point(0,0),toMaxLinks:1,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,contextMenu:t(go.Adornment),doubleClick:function(t,e){t.diagram.__trtd.selectText(t,e)}},new go.Binding('locationSpot','locationSpot',function(e){return go.Spot.parse(e)}).makeTwoWay(function(e){return go.Spot.stringify(e)}),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),t(go.Shape,{strokeDashArray:null,name:'SHAPE',figure:'Rectangle',fill:'rgba(0,0,0,0)',fromLinkable:!0,toLinkable:!0,cursor:'pointer',minSize:new go.Size(50,50),strokeWidth:2,stroke:'rgba(0,0,0,0)',portId:'',width:150},new go.Binding('strokeDashArray','strokeDashArray',function(e){return[e.split()[0],e.split()[1]]}).makeTwoWay(function(e){return e[0]+' '+e[1]}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),{figure:e.figure,fill:e.fill,strokeWidth:e.strokeWidth,stroke:e.stroke}),t(go.Shape,{name:'SHAPE_Back',figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:0},new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('height','height',function(e){return e}).ofObject('SHAPE')),t(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'bold 18px \u5E7C\u5706',editable:!0,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Fill},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return helpers.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return helpers.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()))}},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){if(t.diagram.model.setDataProperty(e,'strokeWidth',t.diagram.__trtd.tdCurrentTheme.borderWidth),t.diagram.model.setDataProperty(e,'stroke',t.diagram.__trtd.tdCurrentTheme.borderColor),null==t.diagram.__trtd.tdCurrentTheme.colorRange)t.diagram.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0]);else if(t.diagram.__trtd.tdCurrentTheme.colorRange instanceof Array){var a='white';a=e.level>=t.diagram.__trtd.tdCurrentTheme.colorRange.length?t.diagram.__trtd.tdCurrentTheme.colorRange[e.level%t.diagram.__trtd.tdCurrentTheme.colorRange.length]:t.diagram.__trtd.tdCurrentTheme.colorRange[e.level],t.diagram.model.setDataProperty(e,'fill',a)}else if('random'!=t.diagram.__trtd.tdCurrentTheme.colorRange)'white'==t.diagram.__trtd.tdCurrentTheme.colorRange?t.diagram.model.setDataProperty(e,'fill','white'):t.diagram.model.setDataProperty(e,'fill','rgba(0,0,0,0)');else if(e.prev){var o=t.diagram.findNodeForKey(e.prev);o?t.diagram.model.setDataProperty(e,'fill',o.data.fill):t.diagram.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0])}else t.diagram.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0]);return e}function l(e,t,a){var o=t,i;for(a||(a=0);o.parent&&!(o.level==a);)i=e.findNodeDataForKey(o.parent),i&&(o=i);return o}function s(e,t){for(var a=t.diagram,o=e;o.data.parent&&o.data.parent!=t.data.key;)o=a.findNodeForKey(o.data.parent);return null!=o.data.parent}function c(e){if(null!=e.data.parent){var t=e.diagram,a=e.diagram.model;if(e.data.prev){var o=t.findNodeForKey(e.data.prev);if(e.data.next){var i=t.findNodeForKey(e.data.next);a.setDataProperty(o.data,'next',i.data.key),a.setDataProperty(i.data,'prev',o.data.key);var r=o.findLinksTo(e).first();a.setToKeyForLinkData(r.data,i.data.key);var r=e.findLinksTo(i).first();a.removeLinkData(r.data)}else{a.setDataProperty(o.data,'next',null);var r=o.findLinksTo(e).first();a.removeLinkData(r.data)}}else{var d=t.findNodeForKey(e.data.parent);if(e.data.next){var i=t.findNodeForKey(e.data.next);a.setDataProperty(d.data,'isparent',i.data.key),a.setDataProperty(i.data,'prev',null);var r=d.findLinksTo(e).first();a.setToKeyForLinkData(r.data,i.data.key),r=e.findLinksTo(i).first(),a.removeLinkData(r.data)}else{if(!d)return;a.setDataProperty(d.data,'isparent',null);var r=d.findLinksTo(e).first();r&&a.removeLinkData(r.data);var l=d.containingGroup;l&&(a.setDataProperty(d.data,'group',l.data.group),a.removeNodeData(l.data))}}a.setDataProperty(e.data,'parent',null),a.setDataProperty(e.data,'prev',null),a.setDataProperty(e.data,'next',null)}}function g(e,t){var a=t.diagram,o=a.__trtd.tdCurrentTheme;return null!=o.linkColor&&a.model.setDataProperty(e,'color',o.linkColor),e}function m(e,t){if(null==e.data.group&&null!=e.data.isparent){var a=o.findNodeForKey(e.data.isparent);if(a){var o=e.diagram,i=o.model,r={isGroup:!0,parent:e.data.key,key:'g_'+e.data.key,group:t,level:e.data.level};i.addNodeData(r),i.setDataProperty(e.data,'group',r.key);var d=a.containingGroup;for(d?i.setDataProperty(d.data,'group',r.key):i.setDataProperty(a.data,'group',r.key);a.data.next;)a=o.findNodeForKey(a.data.next),d=a.containingGroup,d?i.setDataProperty(d.data,'group',r.key):i.setDataProperty(a.data,'group',r.key)}}}function p(t,e){var a=t.diagram,o=t.diagram,i=o.selection.first();if(i){var r=l(o.model,i.data,0);o.startTransaction('ControlAutoLayout'),S.tdTravelTdpData(r,o.model,[],function(t){o.findNodeForKey(t.key).containingGroup&&o.findNodeForKey(t.key).containingGroup.layout&&(o.findNodeForKey(t.key).containingGroup.layout.isInitial=e,o.findNodeForKey(t.key).containingGroup.layout.isOngoing=e)}),r.group&&o.findNodeForKey(r.group)?(o.findNodeForKey(r.group).layout.isInitial=e,o.findNodeForKey(r.group).layout.isOngoing=e):(o.layout.isInitial=e,o.layout.isOngoing=e)}else o.nodes.each(function(t){o.findNodeForKey(t.data.key).layout&&(o.findNodeForKey(t.data.key).layout.isInitial=e,o.findNodeForKey(t.data.key).layout.isOngoing=e)}),o.layout.isInitial=e,o.layout.isOngoing=e;o.commitTransaction('ControlAutoLayout')}function u(e){if(e){var t=e.containingGroup;t&&(t.layout.isInitial=!0,t.layout.isOngoing=!0)}}function y(e,t){var a=t.diagram.__trtd.tdCurrentTheme;return a.groupStrokeWidth&&t.diagram.model.setDataProperty(e,'strokeWidth',a.groupStrokeWidth),a.groupStroke&&(e.stroke=a.groupStroke,t.diagram.model.setDataProperty(e,'stroke',a.groupStroke)),a.groupColor&&(e.fill=a.groupColor,t.diagram.model.setDataProperty(e,'fill',a.groupColor)),e}function h(e){if(e.data.isparent){var t=e.location.copy(),a=new go.Point(0,0),o=e.diagram.findNodeForKey(e.data.isparent),i=o.location.copy(),r=new go.Point(i.x-t.x,i.y-t.y),d=r.copy().rotate(-90),l=new go.Point(d.x+t.x,d.y+t.y);return l}var t=e.location.copy(),s=f(e.actualBounds.width+100,225);return t.offset(s[0],s[1]),t}function k(e,t){var a=t.location.copy(),o=e.location.copy(),i=new go.Point(o.x-a.x,o.y-a.y),r=new go.Point(0,0),d=20;if(e.data.next){var l=e.diagram.findNodeForKey(e.data.next),s=l.location.copy(),c=new go.Point(s.x-a.x,s.y-a.y),g=new go.Point((i.x+c.x)/2,(i.y+c.y)/2),m=r.directionPoint(g)-r.directionPoint(i);g=i.rotate(m);var p=f(d,r.directionPoint(g));g.offset(p[0],p[1]);var u=new go.Point(g.x+a.x,g.y+a.y);return u}if(e.data.prev&&e.diagram.findNodeForKey(e.data.prev)){var y=e.diagram.findNodeForKey(e.data.prev).location.copy(),h=new go.Point(y.x-a.x,y.y-a.y),m=r.directionPoint(i)-r.directionPoint(h);45<m&&(m=45)}else var m=60;var k=i.rotate(m),p=f(d,r.directionPoint(k));return k.offset(p[0],p[1]),k=new go.Point(k.x+a.x,k.y+a.y),k}function f(e,t){var a,o;return 0<=t&&90>=t?(a=e*_Mathsin(t*_MathPI/180),o=e*_Mathcos(t*_MathPI/180),[o,a]):90<t&&180>=t?(a=e*_Mathsin((180-t)*_MathPI/180),o=e*_Mathcos((180-t)*_MathPI/180),[-o,a]):180<t&&270>=t?(a=e*_Mathsin((t-180)*_MathPI/180),o=e*_Mathcos((t-180)*_MathPI/180),[-o,-a]):270<t&&360>=t?(a=e*_Mathsin((360-t)*_MathPI/180),o=e*_Mathcos((360-t)*_MathPI/180),[o,-a]):void 0}function x(e,t,a){var o=a.diagram;if(e.next){var i=o.model.findNodeDataForKey(e.next);return t.push(i),x(i,t,a)}return t}var T=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),b=a(14),S=a(0),v=a(10).Trtd,w=a(12),P=a(7),B=a(2),D=a(5),N=a(3),A=a(6),C=a(30),W=go.GraphObject.make,O=['#FFBFBF','#E9BFFF','#D1FF72','#00A2E8','#99D9EA'],G=function(e){function t(e,a){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a));return r.config=a,r.modelChangedListener=a.modelChangedListener,r.type=a.type,r.diagram={},r.model=a.model,r.initDiagramBase(e,a),r.initDiagram(e,a),r.initListener(),r.model&&r.initModel(),r}return r(t,e),T(t,[{key:'initDiagram',value:function(e,t){var a=Object.assign({},t.diagramConfig);this.diagram.setProperties(a),this.addNodeTemplate(),this.addLinkTemplate(),this.addGroupTemplate()}},{key:'getTdData',value:function(){return this.diagram.model.toJson()}},{key:'getDefaultCustomMenuDivStr',value:function(){return'\n        <ul>\n            <li trtd_action="addFollower"><a class="i18n" data-lang="insertsl">\u63D2\u5165\u540C\u7EA7\u8282\u70B9</a></li>\n            <li trtd_action="startNewSpiral"><a class="i18n" data-lang="icn">\u63D2\u5165\u5B50\u8282\u70B9</a></li>\n            <li trtd_action="apiDuplicateNode"><a class="i18n" data-lang="duplicateNode">\u590D\u5236\u8282\u70B9</a></li>\n            <li trtd_action="apiDeleteSelection"><a class="i18n" data-lang="remove">\u5220\u9664</a></li>\n            <li trtd_action="orderChildNode"><a class="i18n" data-lang="ordernode">\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearOrderChildNode"><a class="i18n" data-lang="clearordernode">\u53D6\u6D88\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearNodeTextMenu"><a class="i18n" data-lang="emptynodetext">\u6E05\u7A7A\u8282\u70B9\u6587\u672C</a></li>\n            <li trtd_action="apiInsertTianpanNode"><a class="i18n" data-lang="insertnodetianpan">\u63D2\u5165\u5929\u76D8\u8282\u70B9</a></li>\n            <li trtd_action="addTextNode"><a class="i18n" data-lang="inserttext">\u63D2\u5165\u6587\u672C</a></li>\n            <li trtd_action="locateRootNodeMenu"><a class="i18n" data-lang="locaterootnode">\u5B9A\u4F4D\u6839\u8282\u70B9</a></li>\n            <li trtd_action="showAllNodesMenu"><a class="i18n" data-lang="displayallnodes">\u663E\u793A\u6240\u6709\u8282\u70B9</a></li>\n            <li trtd_action="fixPictureMenu"><a class="i18n" data-lang="fixnode">\u56FA\u5B9A\u8282\u70B9</a></li>\n            <li trtd_action="activePictureMenu"><a class="i18n" data-lang="cancelfix">\u53D6\u6D88\u56FA\u5B9A</a></li>\n\n            <li trtd_action="delYunpanAxis"><a class="i18n" data-lang="cancelfix">\u5220\u9664 CTRL+DEL</a></li>\n            <li trtd_action="addYunpanAxis"><a class="i18n" data-lang="cancelfix">\u589E\u52A0 CTRL+X/Y</a></li>\n        </ul>\n        '}},{key:'getShowContextMenus',value:function(e){var t='';if(e){if('autoText'==e.data.category)return'apiDeleteSelection';if('picGroup'==e.data.category)return'apiDeleteSelection';'8'==e.data.category&&(t='apiDeleteSelection,'),'text'==e.data.category&&(t='apiDeleteSelection,apiDuplicateNode'),'3'==e.data.category&&(t='apiDeleteSelection,',t+=e.selectable?',fixPictureMenu':',activePictureMenu'),('0'==e.data.category||'1'==e.data.category||'2'==e.data.category||''==e.data.category)&&(t='apiDeleteSelection,apiDuplicateNode,addFollower,startNewSpiral,orderChildNode,clearOrderChildNode'),('yunpanx'==e.data.category||'yunpany'==e.data.category)&&(t='delYunpanAxis,addYunpanAxis')}else t='addTextNode,apiInsertTianpanNode';return t}},{key:'apiInsertTianpanNode',value:function(){var e=this.diagram;e.startTransaction();var t={key:S.guid(),text:'\u53CC\u51FB\u7F16\u8F91\u5185\u5BB9',level:0,radius:100,fill:'white',category:'0',strokeWidth:2,stroke:'black',font:'bold 18px \u5E7C\u5706',textStroke:'black',newAdd:!0,angle:5};t.loc=go.Point.stringify(e.lastInput.documentPoint),e.model.addNodeData(t),e.commitTransaction()}},{key:'fixPictureMenu',value:function(){var e=this.diagram,t=e.findPartAt(e.lastInput.documentPoint,!1);e.startTransaction(),e.model.setDataProperty(t.data,'selectable',void 0!=t.data.selectable&&!t.data.selectable),e.commitTransaction()}},{key:'activePictureMenu',value:function(){this.fixPictureMenu()}},{key:'addTextNode',value:function(e){var t=this.diagram;t.startTransaction();var a={text:e||w.trans('blankText'),category:'autoText'};a.loc=go.Point.stringify(t.lastInput.documentPoint),t.model.addNodeData(a),t.commitTransaction()}},{key:'guid',value:function(){function e(){return(0|65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+'-'+e()+'-'+e()+'-'+e()+'-'+e()+e()+e()}},{key:'initModel',value:function(e){e&&(this.model=e);var t=go.Model.fromJson(this.model);'dipan'==t.modelData.currentType&&(t.nodeDataArray=t.nodeDataArray.filter(function(e){if(!e.isGroup)return delete e.group,!0}),t.linkDataArray=[]),t.modelData.currentType||(t.modelData.currentType=this.type),-1<['jin','shui','wheel','huo'].indexOf(this.type)&&(t.modelData.currentType='tianpan'),this.diagram.layout.isInitial=!1,t.modelData.type=this.type;for(var a=0;a<t.nodeDataArray.length;a++)'waveGroup'==t.nodeDataArray[a].category&&(!t.nodeDataArray[a].centerTextAngle&&(t.nodeDataArray[a].centerTextAngle='independent'),!t.nodeDataArray[a].centerTextMode&&(t.nodeDataArray[a].centerTextMode='independent'),!t.nodeDataArray[a].maxOlive&&(t.nodeDataArray[a].maxOlive=50)),'yunGroup'==t.nodeDataArray[a].category&&(!t.nodeDataArray[a].shapeStrokes&&(t.nodeDataArray[a].shapeStrokes=['RGBA(237,28,36,0.3)','RGBA(255,192,0,0.3)','RGBA(255,255,0,0.3)','RGBA(146,208,80,0.3)','RGBA(192,200,250,0.3)','RGBA(255,178,125,0.3)','RGBA(209,110,210,0.3)','RGBA(248,163,62,0.3)','RGBA(248,161,164,0.3)','RGBA(244,115,120,0.3)']),!t.nodeDataArray[a].beginSpark&&(t.nodeDataArray[a].beginSpark='line'),null==t.nodeDataArray[a].showShape&&(t.nodeDataArray[a].showShape=!0)),'shape'==t.nodeDataArray[a].category&&'background'==t.nodeDataArray[a].role&&(t.nodeDataArray[a].visible=!0),t.nodeDataArray[a].role&&-1<t.nodeDataArray[a].role.indexOf('labelText')&&(t.nodeDataArray[a].movable=!0),'labelGroup'==t.nodeDataArray[a].category&&(t.nodeDataArray[a].selectable=!1);this.diagram.model=t,this.diagram.updateAllTargetBindings()}},{key:'loadModel',value:function(e){this.diagram.animationManager.isEnabled=!1,this.initModel(e)}},{key:'initListener',value:function(){}},{key:'addGroupTemplate',value:function(){this.diagram.groupTemplateMap.add('',W(go.Group,'Auto',{layerName:'Background',selectable:!1,pickable:!1,locationSpot:go.Spot.Center,ungroupable:!0,alignment:go.Spot.Center,click:function(){},contextClick:function(){},alignmentFocus:go.Spot.Center,selectionAdornmentTemplate:W(go.Adornment,'Spot',W(go.Panel,'Auto',W(go.Shape,'Circle',{stroke:'dodgerblue',strokeWidth:2,fill:null},new go.Binding('width','',function(){var e=myDiagram.selection.first();if(e instanceof go.Group)return e.actualBounds.width}),new go.Binding('height','',function(){var e=myDiagram.selection.first();if(e instanceof go.Group)return e.actualBounds.height})),W(go.Placeholder)),W(go.Panel,'Horizontal',{alignment:go.Spot.Top,alignmentFocus:go.Spot.Bottom})),copyable:!1},{layout:W(b,{isRealtime:!1,radius:NaN,clockwise:!0,isInitial:!1}),layoutConditions:go.Part.LayoutStandard&~go.Part.LayoutNodeSized&~go.Part.LayoutAdded},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),W(go.Panel,'Auto',W(go.Shape,'Circle',{name:'SHAPE',fill:'rgba(212,230,188,0)',stroke:null,spot1:new go.Spot(.01,.01),spot2:new go.Spot(.99,.99)},new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),new go.Binding('desiredSize','radius',function(e){var t=parseInt(e?e:100),a=new go.Size(t,t);return a}).makeTwoWay(function(e){return e.width})),W(go.Placeholder,{margin:0}))))}},{key:'addNodeTemplate',value:function(){var e=this,t=this.diagram;this.addNodeTemplateBase(),t.nodeTemplateMap.add('0',P(this.diagram)),t.nodeTemplateMap.add('1',P(this.diagram)),t.nodeTemplateMap.add('2',P(this.diagram)),t.nodeTemplateMap.add('3',B(this.diagram)),t.nodeTemplateMap.add('4',D(this.diagram)),t.nodeTemplateMap.add('',P(this.diagram)),t.nodeTemplateMap.add('8',A(this.diagram))}},{key:'addLinkTemplate',value:function(){this.diagram.linkTemplateMap.add('',C(this.diagram))}},{key:'setNodeAsChildren',value:function(e,t){if(!s(t,e)&&t.data.isparent!=e.data.key){var a=e.diagram,o=e.diagram.model;if(o.startTransaction('setNodeAsChildren'),c(e),t.data.isparent){var i=a.findNodeForKey(t.data.isparent);o.setDataProperty(t.data,'isparent',e.data.key),o.setDataProperty(i.data,'prev',e.data.key),o.setDataProperty(e.data,'next',i.data.key),o.setDataProperty(e.data,'parent',t.data.key);var r=t.findLinksTo(i).first();o.setToKeyForLinkData(r.data,e.data.key);var d=o.copyLinkData(r.data);d.from=e.data.key,d.to=i.data.key,o.addLinkData(d)}else{o.setDataProperty(t.data,'isparent',e.data.key),o.setDataProperty(e.data,'next',null),o.setDataProperty(e.data,'parent',t.data.key);var d={from:t.data.key,to:e.data.key,level:t.data.level+1,isTreeLink:!0};d.strokeWidth=2,g(d,e),o.addLinkData(d);var l={isGroup:!0,group:t.data.group,parent:t.data.key,key:'g_'+t.data.key,level:t.data.level};o.addNodeData(l),o.setDataProperty(t.data,'group',l.key)}var p=e.containingGroup;p&&p.data.parent==e.data.key?o.setDataProperty(p.data,'group',t.data.group):null==e.data.parent&&null!=e.data.isparent?m(e,t.data.group):o.setDataProperty(e.data,'group',t.data.group);var u=e.data.level-t.data.level-1;S.travelParts(e,function(e){o.setDataProperty(e.data,'level',e.data.level-u)}),o.commitTransaction('setNodeAsChildren')}}},{key:'setNodeAsSibling',value:function(e,t){if(!s(t,e)&&t.data.next!=e.data.key){var a=e.diagram,o=e.diagram.model;if(o.startTransaction('setNodeAsSibling'),c(e),null!=t.data.next){var i=a.findNodeForKey(t.data.next);o.setDataProperty(t.data,'next',e.data.key),o.setDataProperty(e.data,'next',i.data.key),o.setDataProperty(e.data,'prev',t.data.key),o.setDataProperty(i.data,'prev',e.data.key),o.setDataProperty(e.data,'parent',t.data.parent);var r=t.findLinksTo(i).first();o.setToKeyForLinkData(r.data,e.data.key);var d=o.copyLinkData(r.data);d.from=e.data.key,d.to=i.data.key,o.addLinkData(d)}else{o.setDataProperty(t.data,'next',e.data.key),o.setDataProperty(e.data,'next',null),o.setDataProperty(e.data,'prev',t.data.key),o.setDataProperty(e.data,'parent',t.data.parent),o.setDataProperty(e.data,'fill',t.data.fill);var l=t.findLinksInto().first(),d=o.copyLinkData(l.data);d.from=t.data.key,d.to=e.data.key,o.addLinkData(d)}var g=e.data.level-t.data.level;S.travelParts(e,function(e){o.setDataProperty(e.data,'level',e.data.level-g)});var p=e.containingGroup,u=a.findNodeForKey(t.data.parent);if(p&&p.data.parent==e.data.key?o.setDataProperty(e.containingGroup.data,'group',u.data.group):null==e.data.parent&&null!=e.data.isparent?m(e,u.data.group):o.setDataProperty(e.data,'group',u.data.group),u&&u.containingGroup){var y=u.containingGroup;y&&(y.layout.isOngoing=!0,y.layout.isValidLayout=!1)}o.commitTransaction('setNodeAsSibling')}}},{key:'setNodeAsChildren',value:function(e,t){if(!s(t,e)&&t.data.isparent!=e.data.key){var a=e.diagram,o=e.diagram.model;if(o.startTransaction('setNodeAsChildren'),c(e),t.data.isparent){var i=a.findNodeForKey(t.data.isparent);o.setDataProperty(t.data,'isparent',e.data.key),o.setDataProperty(i.data,'prev',e.data.key),o.setDataProperty(e.data,'next',i.data.key),o.setDataProperty(e.data,'parent',t.data.key);var r=t.findLinksTo(i).first();o.setToKeyForLinkData(r.data,e.data.key);var d=o.copyLinkData(r.data);d.from=e.data.key,d.to=i.data.key,o.addLinkData(d)}else{o.setDataProperty(t.data,'isparent',e.data.key),o.setDataProperty(e.data,'next',null),o.setDataProperty(e.data,'parent',t.data.key);var d={from:t.data.key,to:e.data.key,level:t.data.level+1,isTreeLink:!0};d.strokeWidth=2,g(d,e),o.addLinkData(d);var l={isGroup:!0,group:t.data.group,parent:t.data.key,key:'g_'+t.data.key,level:t.data.level};o.addNodeData(l),o.setDataProperty(t.data,'group',l.key)}var p=e.containingGroup;p&&p.data.parent==e.data.key?o.setDataProperty(p.data,'group',t.data.group):null==e.data.parent&&null!=e.data.isparent?m(e,t.data.group):o.setDataProperty(e.data,'group',t.data.group);var u=e.data.level-t.data.level-1;S.travelParts(e,function(e){o.setDataProperty(e.data,'level',e.data.level-u)}),o.commitTransaction('setNodeAsChildren')}}},{key:'deleteSelection',value:function(t){var e=this.diagram,a=e.commandHandler,o=e.selection.first();if(o&&!(o instanceof go.Group)&&1!=o.data.key&&'g_1'!=o.data.key){for(var r=null,d=['next','prev','parent'],l=0;l<d.length;l++)if(o.data[d[l]]){r=e.findNodeForKey(o.data[d[l]]);break}e.startTransaction('deleteSelection1');try{if(o instanceof go.Link)return;e.startTransaction('sub'),'autoText'==o.data.category?e.model.removeNodeData(o.data):this.deleteNode(o,t),e.commitTransaction('sub'),go.CommandHandler.prototype.deleteSelection.call(a)}catch(t){return void e.commitTransaction('deleteSelection1')}e.commitTransaction('deleteSelection1'),r&&e.select(r)}}},{key:'deleteNode',value:function(e){var t=this.diagram,a=null;if(e instanceof go.Group&&e.memberParts.each(function(e){e.data.isparent&&(a=e)}),e=null==a?e:a,e instanceof go.Node){var o=e.findNodesInto().first()?e.findNodesInto().first():null,i=e.data.next?t.findNodeForKey(e.data.next):null;if(i)var r=i.findLinksInto().first();else var r=null;var d=e.findLinksInto().first(),l={};l=JSON.parse(JSON.stringify(e.data));var s=e.findLinksInto().first()?e.findLinksInto().first().data:null,c={};if(s&&delete s.points,c=JSON.parse(JSON.stringify(s)),delete c.__gohashid,delete c.points,e.data.group)var g=t.findNodeForKey(e.data.group);else var g=null;try{if(e.data.isparent){var m=[],p=[];t.nodes.each(function(t){t.isMemberOf(g)&&t.data.key!=e.data.key&&(m.push(t.data),0<t.findLinksInto().count&&p.push(t.findLinksInto().first().data))}),a&&m.push(e.data),t.model.removeNodeDataCollection(m),t.model.removeLinkDataCollection(p),t.model.removeNodeData(g.data)}if(null!=o){if(o.data.key!=l.parent)t.model.setDataProperty(o.data,'next',null==i?null:i.data.key),null!=i&&(c.from=o.data.key,c.to=i.data.key,t.model.setDataProperty(i.data,'prev',o.data.key),t.model.addLinkData(c));else if(null==i){var u=t.findNodeForKey(o.data.group),y=t.findNodeForKey(o.data.parent);'Root'!==o.data.category&&(y?t.model.setDataProperty(o.data,'group',y.data.group):u&&u.data.group?t.model.setDataProperty(o.data,'group',u.data.group):t.model.setDataProperty(o.data,'group',void 0)),t.model.setDataProperty(o.data,'isparent',void 0),u&&t.model.removeNodeData(u.data)}else c.from=o.data.key,c.to=i.data.key,t.model.setDataProperty(i.data,'prev',void 0),t.model.addLinkData(c),t.model.setDataProperty(t.model.findNodeDataForKey(l.parent),'isparent',i.data.key);d&&t.model.removeLinkData(d.data),r&&t.model.removeLinkData(r.data)}}catch(e){}}t.isModified=!0}},{key:'addLevelNodeData',value:function(e){var t=null==window.localStorage.getItem('isautolayout')||'true'==window.localStorage.getItem('isautolayout'),a=e.diagram,o='tianpan',i=e.data.next,r=(a.model.nodeDataArray.length+1).toString(),l={key:r,text:w.trans('dce'),color:'yellow'};a.model.makeNodeDataKeyUnique(l),r=l.key;var s=null,c=null,m=a.model.findNodeDataForKey(e.data.parent).group;e.findNodesOutOf().each(function(t){t.data.level==e.data.level&&(s=t)});var c=null;e.findLinksOutOf().each(function(t){t.data.level==e.data.level&&(c=t)}),a.model.startTransaction(),l=d(l,e);null!=s&&(l.next=s.data.key,a.model.setDataProperty(s.data,'prev',l.key)),m&&(l.group=m),l.level=e.data.level,(l.radius=e.data.radius,l.fill=e.data.fill),l.parent=e.data.parent,l.prev=e.data.key,l.strokeWidth=e.data.strokeWidth,l.stroke=e.data.stroke,l.font=e.data.font,l.textStroke=e.findObject('TEXT').stroke,e.data.figure&&(l.figure=e.data.figure),l.loc=e.data.loc;var p=e.location.copy();if(e.data.parent){var u=a.findNodeForKey(e.data.parent);u&&(p=k(e,u))}l.loc=go.Point.stringify(p),e.data.width&&(l.width=e.data.width),e.data.height&&(l.height=e.data.height),l.category=e.data.category,l.newAdd=!0,a.model.addNodeData(l);var y={from:e.data.key,to:l.key};if(y.level=e.data.level,y.color=l.fill,y.isTreeLink=!0,y=g(y,e),y.strokeWidth=2,e.findLinksInto()&&e.findLinksInto().first()?(y.color=e.findLinksInto().first().data.color,y.strokeWidth=e.findLinksInto().first().data.strokeWidth,y.toArrow=e.findLinksInto().first().data.toArrow,y.strokeDashArray=e.findLinksInto().first().data.strokeDashArray):y=g(y,e),'dipan'==o,a.model.addLinkData(y,e),a.model.setDataProperty(e.data,'next',r),null!=c){var h={};delete c.data.points,h=JSON.parse(JSON.stringify(c.data)),delete h.__gohashid,delete h.points,h.from=l.key,h.to=c.data.to,a.model.removeLinkData(c.data),a.model.addLinkData(h)}return a.model.commitTransaction(),a.isModified=!0,l}},{key:'addFollower',value:function(t,a){if(!t)var t=this.diagram.lastInput;var o=t.diagram,i=o.selection.first();if(i){var r=i.diagram;if(null!==i&&i instanceof go.Node&&!(i instanceof go.Group)&&0!=i.findLinksInto().count){if(o.toolManager.textEditingTool.isActive){var d=o.selection.first().findObject('TEXT');d.text=o.toolManager.textEditingTool.currentTextEditor.innerText,o.toolManager.textEditingTool.stopTool()}3<=i.data.level?(p(t,!1),u(i)):p(t,!0),o.model.startTransaction('all');var l=this.addLevelNodeData(i);if(o.model.commitTransaction('all'),'undefined'!=typeof a&&!0==a){var s=r.findNodeForData(l);s&&r.select(s),o.isModified=!0;var d=o.selection.first().findObject('TEXT');d&&o.commandHandler.editTextBlock(d),S.simulateEnterWithAlt(t)}}}}},{key:'startNewSpiral',value:function(t){var a=this.diagram,o=a.lastInput,e=a.selection.first();if(e){var i=e.diagram;if(null!==e&&e instanceof go.Node&&!(e instanceof go.Group)&&!(e.data.isparent&&a.findNodeForKey(e.data.isparent)&&!a.findNodeForKey(e.data.isparent).visible)){2<=e.data.level?(p(o,!1),u(e)):p(o,!0),a.startTransaction(),a.startTransaction('addChildNodeData');var r=this.addChildNodeData(e);if(a.commitTransaction('addChildNodeData'),a.commitTransaction(),'undefined'!=typeof t&&!0==t){var d=a.findNodeForData(r);d&&a.centerRect(d.actualBounds),i.select(d);var l=a.selection.first().findObject('TEXT');l&&a.commandHandler.editTextBlock(l),S.simulateEnterWithAlt(o)}}}}},{key:'addChildNodeData',value:function(e){var t=null==window.localStorage.getItem('isautolayout')||'true'==window.localStorage.getItem('isautolayout'),a=e.diagram,o=arguments[1]?arguments[1]:null,i='tianpan';i='tianpan';var r=(a.model.nodeDataArray.length+1).toString(),l={key:r,text:w.trans('dce')};a.model.makeNodeDataKeyUnique(l),r=l.key;var s=a.findNodeForKey(e.data.isparent),c=null;if(e.findLinksOutOf().each(function(t){t.data.level>e.data.level&&(c=t)}),l.level=e.data.level+1,l.parent=e.data.key,l.prev=void 0,e.data.isparent&&null!=s&&(l.next=s.data.key,a.model.setDataProperty(s.data,'prev',l.key)),null!=o&&(l.istemp=!0,l.text=''),l.radius=0==e.data.level?_Mathmax(.75*e.data.radius,100):e.data.radius?_Mathmax(e.data.radius-5,50):_Mathmax(InitialFontSize-10*e.data.level,50),null!=s&&e.containingGroup&&(l.group=e.containingGroup.data.key),null==s){var m={isGroup:!0,group:e.data.group,parent:e.data.key,fill:'rgba(0,0,0,0)',stroke:'rgba(0,0,0,0)',strokeWidth:0,level:e.data.level};m=y(m,e),a.model.addNodeData(m),a.model.setGroupKeyForNodeData(e.data,m.key),l.group=m.key}l.fill=O[l.level%5],l.category=e.data.category,l.loc=go.Point.stringify(h(e)),l.strokeWidth=2,e.data.figure&&(l.figure=e.data.figure),e.data.picture&&(l.picture=e.data.picture),e.data.width&&(l.width=e.data.width),e.data.height&&(l.height=e.data.height),l=d(l,e),l.font=e.data.font,l.textStroke=e.findObject('TEXT').stroke,a.model.setDataProperty(e.data,'isparent',r),l.newAdd=!0,a.model.addNodeData(l);var p={from:e.data.key,to:l.key,level:l.level,isTreeLink:!0,strokeWidth:2},u=null;if(u=e.findLinksInto().first(),null==c?null==u?p=g(p,e):(p.toArrow=u.data.toArrow,p.strokeDashArray=u.data.strokeDashArray,p.color=u.data.color,p.strokeWidth=2):(p.toArrow=c.data.toArrow,p.strokeDashArray=c.data.strokeDashArray,p.color=c.data.color,p.strokeWidth=2),('dipan'==e.data.category||'Root'==e.data.category)&&(p.category='dipan'),a.model.addLinkData(p),null!=c){var k={};delete c.data.points,k=JSON.parse(JSON.stringify(c.data)),delete k.__gohashid,delete k.points,k.from=l.key,k.to=c.data.to,a.model.removeLinkData(c.data),a.model.addLinkData(k)}return'tianpan'==i,a.isModified=!0,l}},{key:'moveWithinNodes',value:function(e){var t=this.diagram,a=t.selection.first();if(a){if(!a)return void t.select(t.findNodeForKey(1));switch(e){case'left':if(a.data.prev){var o=t.findNodeForKey(a.data.prev);o&&t.select(o)}break;case'up':if(a.data.parent){var o=t.findNodeForKey(a.data.parent);o&&t.select(o)}break;case'right':if(a.data.next){var o=t.findNodeForKey(a.data.next);o&&t.select(o)}break;case'down':if(a.data.isparent){var o=t.findNodeForKey(a.data.isparent);o&&t.select(o)}}}}},{key:'selectText',value:function(t){var e=this.diagram,a=e.selection.first();if(a){var o=e.selection.first().findObject('TEXT');o&&e.commandHandler.editTextBlock(o),S.simulateEnterWithAlt(t)}}},{key:'dokeyDownFn',value:function(t){var e=this.diagram,a=this,o=this.diagram,t=o.lastInput,i=o.commandHandler;if(t.event.altKey){if('Q'==t.key)return void autoLayoutAll();if('R'==t.key)return void centerNode();if('C'==t.key)return void centerCurrentNode();if('A'==t.key)return void zoomToFit()}if(65<=t.event.keyCode&&90>=t.event.keyCode&&!t.event.altKey&&!t.event.ctrlKey&&!t.event.shiftKey)return t.bubbles=!1,this.selectText(t,e),!0;if(13===t.event.keyCode){var r=o.selection.first();r&&r.data.parent&&this.addFollower(t,!0),r&&!r.data.parent&&a.startNewSpiral(!0)}else 9===t.event.keyCode?a.startNewSpiral(!0):'t'===t.key?i.canCollapseSubGraph()?i.collapseSubGraph():i.canExpandSubGraph()&&i.expandSubGraph():'Del'==t.key?t.diagram.commandHandler.deleteSelection():113==t.event.keyCode?this.selectText(t,e):37==t.event.keyCode?this.moveWithinNodes('left',e):38==t.event.keyCode?this.moveWithinNodes('up',e):39==t.event.keyCode?this.moveWithinNodes('right',e):40==t.event.keyCode?this.moveWithinNodes('down',e):go.CommandHandler.prototype.doKeyDown.call(i);t.bubbles=!1}},{key:'downloadImage',value:function(){var e=this.diagram,t=e.makeImageData({scale:1,background:'#ffffff',type:'image/png',maxSize:new go.Size(9e3,9e3)});return t}},{key:'getNodeSelectionAdornmentTemplate',value:function(){return W(go.Adornment,'Spot',W(go.Panel,'Auto',W(go.Shape,{figure:'Circle',fill:'rgba(255,0,120,0.2)',stroke:'#767678',strokeWidth:12},new go.Binding('stroke','',function(t){return t.stroke?tinycolor(t.stroke).saturate().toString():'#767678'}),new go.Binding('strokeWidth','',function(t){return t.strokeWidth?t.strokeWidth+5:6}),new go.Binding('width','',function(t){return t.radius||150}),new go.Binding('height','',function(t){return t.radius||150})),W(go.Placeholder)),W('Button',{name:'AddChild',toolTip:W(go.Adornment,'Auto',W(go.Shape,{fill:'#FFFFCC'}),W(go.TextBlock,{textAlign:'center',margin:new go.Margin(8,4,4,4)},new go.Binding('text','',function(){return'\u589E\u52A0\u5B50\u8282\u70B9'}))),alignment:go.Spot.Top,alignmentFocus:go.Spot.Bottom,width:30,height:30,click:function(t){t.diagram.__trtd.startNewSpiral()}},W(go.Shape,'PlusLine',{stroke:'#770077',desiredSize:new go.Size(15,15)})),W('Button',{name:'AddLevel',toolTip:W(go.Adornment,'Auto',W(go.Shape,{fill:'#FFFFCC'}),W(go.TextBlock,{textAlign:'center',margin:new go.Margin(8,4,4,4)},new go.Binding('text','',function(){return'\u589E\u52A0\u540C\u7EA7\u8282\u70B9'}))),alignment:new go.Spot(1,.5,15,0),width:30,height:30,click:function(t){t.diagram.__trtd.addFollower(t)}},W(go.Shape,'PlusLine',{stroke:'#227700',desiredSize:new go.Size(15,15)}),new go.Binding('visible','level',function(e){return 0!=e})))}},{key:'orderChildNode',value:function(){var e=this.diagram,t=[],a=e.selection.first();if(a){if(e.startTransaction(),a.data.isparent){var o=e.model.findNodeDataForKey(a.data.isparent);t.push(o),x(o,t,this);for(var r=/^(\d+\、+)|(\d+\.+)/g,d=0;d<t.length;d++)r.test(t[d].text)?e.model.setDataProperty(t[d],'text',t[d].text.replace(r,d+1+'.')):''==t[d].text?e.model.setDataProperty(t[d],'text',d+1):e.model.setDataProperty(t[d],'text',d+1+'.'+t[d].text)}else;e.commitTransaction()}}},{key:'clearOrderChildNode',value:function(){var e=this.diagram,t=[],a=e.selection.first();if(a){if(e.startTransaction(),a.data.isparent){var o=e.model.findNodeDataForKey(a.data.isparent);t.push(o),x(o,t,this);for(var r=/^(\d+\、+)|(\d+\.+)/g,d=0;d<t.length;d++)r.test(t[d].text)&&e.model.setDataProperty(t[d],'text',t[d].text.replace(r,''))}else;e.commitTransaction()}}}]),t}(v);G.go=go,e.exports=G},function(e){'use strict';var t=go.GraphObject.make;e.exports=function(e){return t(go.Node,'Auto',{_controlExpand:!0,layerName:'default',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!1,doubleClick:function(t,e){interactions.selectText(t,e)},layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:t(go.Adornment),selectionAdornmentTemplate:e.__trtd.getNodeSelectionAdornmentTemplate()},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),t(go.Panel,'Spot',t(go.Picture,{name:'SHAPE'},{sourceCrossOrigin:function(){return'Anonymous'}},new go.Binding('source','picture',function(e){return e+'?'+Date.now()}).makeTwoWay(function(e){return e?(e=e.replace(/\?.*$/g,''),e):''}),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e})),t(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'bold 18px \u5E7C\u5706',stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Fill},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('maxSize','width',function(e){var t=1.4142135623730951*(e/2);return new go.Size(t,t)}).ofObject('SHAPE'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay())),{toolTip:t(go.Adornment,'Auto',t(go.Shape,{fill:'#FFFFCC'}),t(go.TextBlock,{margin:4},new go.Binding('text','',function(e){return e.text})))})}},function(e,t,a){'use strict';function o(t){var e=t.diagram;e.startTransaction();var a={text:'\u53CC\u51FB\u7F16\u8F91\u6587\u672C',category:'text'};a.loc=go.Point.stringify(e.lastInput.documentPoint),e.model.addNodeData(a),e.commitTransaction()}var i=go.GraphObject.make,r=a(8);e.exports=function(e){return i(go.Node,'Spot',{name:'NODE',_controlExpand:!0,layerName:'Background',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'BACKGROUND',resizable:!0,resizeObjectName:'BACKGROUND',rotatable:!0,rotateObjectName:'BACKGROUND',click:function(){},doubleClick:function(t){o(t)},selectable:!0,selectionObjectName:'BACKGROUND',movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:i(go.Adornment)},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),i(go.Shape,{name:'SHAPE',geometryString:r.threeWheel,fill:'black',strokeWidth:5,stroke:'black',minSize:new go.Size(50,50)},new go.Binding('fill','fill').makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('desiredSize','desiredSize',function(e){return e}).ofObject('BACKGROUND'),new go.Binding('angle','angle',function(e){return e}).ofObject('BACKGROUND'),new go.Binding('geometryString','geometryValue',function(e){return r[e]})),i(go.Shape,'Rectangle',{name:'BACKGROUND',fill:'rgba(1,1,1,0)',stroke:'rgba(1,1,1,0)'},new go.Binding('desiredSize','desiredSize',function(e,t){return e?go.Size.parse(e):t.part.findObject('SHAPE').measuredBounds.size}).makeTwoWay(function(e){return go.Size.stringify(e)}),new go.Binding('angle','angle').makeTwoWay(function(e){return e})))}},function(e){'use strict';var t=go.GraphObject.make;e.exports=function(a){var e={figure:'Circle',fill:'white',strokeWidth:2,stroke:'black',fontSize:15,font:'sans-serif'};return t(go.Node,'Spot',{_controlExpand:!0,layerName:'default',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!1,location:new go.Point(0,0),click:function(t,e){void 0,e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},doubleClick:function(t,e){t.diagram.__trtd.selectText(t,e)},toMaxLinks:1,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:a.__trtd.nodeResizeAdornmentTemplate(),contextMenu:t(go.Adornment),selectionAdornmentTemplate:a.__trtd.getNodeSelectionAdornmentTemplate(),mouseOver:function(t,e){a.__trtd.showNodeRemarkTips(t,e)},mouseLeave:function(){a.__trtd.removeNodeRemarkTips()},mouseDragEnter:function(t,e){var a=e.part,o=t.diagram.selection.first();if(o instanceof go.Node&&'3'!=o.category&&'text'!=o.category&&1!=o.key){var i=a.findObject('SHAPE');i&&(i._prevFill=i.fill,i.fill='darkred')}},mouseDragLeave:function(t,e){var a=e.part,o=a.findObject('SHAPE');o&&o._prevFill&&(o.fill=o._prevFill)},mouseDrop:function(t,e){var a=e.part,o=t.diagram.selection.first();if(o instanceof go.Node&&'3'!=o.data.category&&'text'!=o.data.category&&1!=o.data.key)if(a.data.isparent){for(var i=t.diagram.findNodeForKey(a.data.isparent);i.data.next;)i=t.diagram.findNodeForKey(i.data.next);if(i.data.key==o.data.key)return;t.diagram.__trtd.setNodeAsSibling(o,i)}else t.diagram.__trtd.setNodeAsChildren(o,a)}},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),t(go.Shape,{strokeDashArray:null,name:'SHAPE',figure:'Circle',fill:'rgba(0,0,0,0)',fromLinkable:!0,toLinkable:!0,cursor:'pointer',minSize:new go.Size(50,50),strokeWidth:2,stroke:'black',portId:''},new go.Binding('strokeDashArray','strokeDashArray',function(e){try{var t=[parseInt(e.split(' ')[0]),parseInt(e.split(' ')[1])]}catch(t){var t=null}return t}).makeTwoWay(function(e){return e[0]+' '+e[1]}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('desiredSize','radius',function(e){var t=parseInt(e?e:100),a=new go.Size(t,t);return a}).makeTwoWay(function(e){return e.width}),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),{figure:e.figure,fill:e.fill,strokeWidth:e.strokeWidth,stroke:e.stroke}),t(go.Shape,{name:'SHAPE_Back',figure:'Rectangle',fill:'rgba(128,128,128,0)',fromLinkable:!0,toLinkable:!0,strokeWidth:0},new go.Binding('desiredSize','width',function(e){var t=1.4142135623730951*(e/2);return new go.Size(t-3,t-3)}).ofObject('SHAPE')),t(go.Panel,'Table',t(go.RowColumnDefinition,{column:0,width:0}),t(go.Shape,'Rectangle',{row:0,column:0,fill:'rgba(0,255,0,0)',strokeWidth:0}),t(go.Panel,'Auto',{row:1,column:0},t(go.Shape,'RoundedRectangle',{fill:'rgba(0,0,0,0)',strokeWidth:0}),t(go.Picture,{alignment:go.Spot.Left,click:function(){alert('picture clicked')},name:'Picture',desiredSize:new go.Size(10,10)})),t(go.Shape,'Rectangle',{row:2,column:0,fill:'rgba(0,0,0,0)',strokeWidth:0}),t(go.Panel,'Auto',{row:0,column:1,rowSpan:3},t(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'bold 18px \u5E7C\u5706',stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Fill,click:function(){}},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return 1.4142135623730951*(e/2)}).ofObject('SHAPE'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()))))}},function(e){'use strict';e.exports={threeWheel:'M 225 0 C 100.736 0 0 100.735 0 225 s 100.736 225 225 225 c 124.265 0 225.001 -100.734 225.001 -225 C 450.002 100.735 349.265 0 225 0 Z M 225 1.515 c 62.006 0 118.106 25.257 158.591 66.037 c -38.634 133.172 -160.888 157.047 -160.888 157.047 l 0.047 0.083 h -0.051 C 123.453 130.609 19.61 161.966 9.597 165.291 C 35.716 70.857 122.255 1.515 225 1.515 Z M 1.517 225 c 0 -20.075 2.663 -39.524 7.627 -58.035 c 6.686 -2.295 111.992 -36.362 212.807 58.54 c -3.347 10.815 -36.032 125.634 54.089 217.118 c -16.395 3.83 -33.479 5.859 -51.04 5.859 C 101.575 448.482 1.517 348.428 1.517 225 Z M 277.292 442.318 c -89.298 -94.891 -57.746 -204.506 -53.915 -216.53 l 0.076 0.135 c 0 0 126.301 -26.492 161.022 -157.465 c 39.584 40.319 64.008 95.575 64.008 156.542 C 448.483 330.418 375.489 418.773 277.292 442.318 Z',fireWheel:'M225.000,450.000 C100.736,450.000 -0.000,349.264 -0.000,225.000 C-0.000,100.736 100.736,-0.000 225.000,-0.000 C349.264,-0.000 450.000,100.736 450.000,225.000 C450.000,349.264 349.264,450.000 225.000,450.000 ZM225.000,448.000 C338.085,448.000 431.498,363.821 446.026,254.709 C432.978,302.699 389.123,338.000 337.000,338.000 C274.592,338.000 224.000,287.408 224.000,225.000 C224.000,163.696 174.304,114.000 113.000,114.000 C51.696,114.000 2.000,163.696 2.000,225.000 C2.000,348.159 101.841,448.000 225.000,448.000 ZM225.000,2.000 C111.915,2.000 18.502,86.179 3.974,195.291 C17.022,147.301 60.877,112.000 113.000,112.000 C175.408,112.000 226.000,162.592 226.000,225.000 C226.000,286.304 275.696,336.000 337.000,336.000 C398.304,336.000 448.000,286.304 448.000,225.000 C448.000,225.000 448.000,225.000 448.000,225.000 C448.000,101.841 348.159,2.000 225.000,2.000 Z',goldWheel:'M449.993,0.008 L225.395,287.495 L355.004,449.995 L94.004,449.995 L224.597,287.502 L-0.008,0.008 L449.993,0.008 Z',waterWheel:'M268.000,443.000 C299.658,443.000 328.270,429.976 348.785,409.000 L351.564,409.000 C330.601,431.167 300.917,445.000 268.000,445.000 C204.487,445.000 153.000,393.513 153.000,330.000 C153.000,282.847 181.389,242.341 222.000,224.593 L222.000,224.508 C263.076,207.589 292.000,167.180 292.000,120.000 C292.000,57.592 241.408,7.000 179.000,7.000 C148.889,7.000 121.551,18.800 101.296,38.000 L98.382,38.000 C119.136,17.594 147.595,5.000 179.000,5.000 C242.513,5.000 294.000,56.487 294.000,120.000 C294.000,167.153 265.611,207.659 225.000,225.407 L225.000,225.478 C183.921,242.396 155.000,282.817 155.000,330.000 C155.000,392.408 205.592,443.000 268.000,443.000 Z'}},function(e,t,a){'use strict';function o(e){setTimeout(function(){try{if(!e.text)return;if(e.text&&''==e.text.trim())return;if(0!=e.lineCount%2){if('\n'==e.text[e.text.length-1])return void(e.text=e.text.substring(0,e.text.length-1));e.text+='\n'}}catch(t){}},100)}function i(e,t,a,o){var i=o.data.textAngle||'vertical',r;0==e.data.order%2?(t&&(r=t.data.nangle?t.data.textAngle||i:i,'horizontal'==r&&(t.locationSpot=new go.Spot(1,1,0,0),t.angle=0),t.__location=e.location.copy().offset(e.naturalBounds.width/2,0),t.__location=l(o.location,t.__location,e.angle),t.data.nloc?t.__offset?t.location=t.__location.copy().subtract(t.__offset):t.__offset=t.__location.copy().subtract(t.location):(t.location=e.location.copy().offset(e.naturalBounds.width/2,-e.naturalBounds.height/2),t.location=l(o.location,t.location,e.angle),delete t.__switchOrder),'vertical'==r&&(t.locationSpot=new go.Spot(.5,1,0,0),t.angle=e.angle)),a&&(r=a.data.nangle?a.data.textAngle||i:i,'horizontal'==r&&(a.locationSpot=new go.Spot(0,0,0,0),a.angle=0),void 0,a.__location=e.location.copy().offset(e.naturalBounds.width/2,0),a.__location=l(o.location,a.__location,e.angle),a.data.nloc?a.__offset?a.location=a.__location.copy().subtract(a.__offset):a.__offset=a.__location.copy().subtract(a.location):(a.location=e.location.copy().offset(e.naturalBounds.width/2,e.naturalBounds.height/2),a.location=l(o.location,a.location,e.angle),delete a.__switchOrder),'vertical'==r&&(a.locationSpot=new go.Spot(.5,0,0,0),a.angle=e.angle))):(t&&(r=t.data.nangle?t.data.textAngle||i:i,t.__location=e.location.copy().offset(e.naturalBounds.width/2,0),t.__location=l(o.location,t.__location,e.angle),t.data.nloc?t.__offset?t.location=t.__location.copy().subtract(t.__offset):t.__offset=t.__location.copy().subtract(t.location):(t.location=e.location.copy().offset(e.naturalBounds.width/2,e.naturalBounds.height/2),t.location=l(o.location,t.location,e.angle),delete t.__switchOrder),'horizontal'==r&&(t.locationSpot=new go.Spot(0,0,0,0),t.angle=0),'vertical'==r&&(t.locationSpot=new go.Spot(.5,0,0,0),t.angle=e.angle)),a&&(r=a.data.nangle?a.data.textAngle||i:i,a.__location=e.location.copy().offset(e.naturalBounds.width/2,0),a.__location=l(o.location,a.__location,e.angle),a.data.nloc?a.__offset?a.location=a.__location.copy().subtract(a.__offset):a.__offset=a.__location.copy().subtract(a.location):(a.location=e.location.copy().offset(e.naturalBounds.width/2,-e.naturalBounds.height/2),a.location=l(o.location,a.location,e.angle),delete a.__switchOrder),'horizontal'==r&&(a.locationSpot=new go.Spot(1,1,0,0),a.angle=0),'vertical'==r&&(a.locationSpot=new go.Spot(.5,1,0,0),a.angle=e.angle)))}function r(e,t,a){for(var r=[],d=a.data.oliveWidth,c=a.data.oliveHeight,g=a.data.shiStroke,m=a.data.xuStroke,p=a.data.centerStroke||'#3f5369',u=a.data.oliveType||'Ellipse',y=a.data.haveTail||!1,h=a.data.textAngle||'vertical',k=2*d/3,f=[],x=[],T=[],b,S,v,w,P;e.next();){var B=e.value;'shiText'==B.data.role&&f.push(B),'xuText'==B.data.role&&x.push(B),'centerText'==B.data.role&&T.push(B),B instanceof go.Node&&('line'==B.data.category&&(b=B,B.location=a.location.copy().offset(0,0),B.angle=a.angle),'wave'==B.data.category&&('Ellipse'==u?(B.diagram.model.setDataProperty(B.data,'oliveType','Ellipse'),B.diagram.model.setDataProperty(B.data,'desiredSize',d+' '+c)):(B.diagram.model.setDataProperty(B.data,'oliveType','Wave'),'waveTail'==B.data.role?(B.diagram.model.setDataProperty(B.data,'desiredSize',d/2+' '+c),B.diagram.model.setDataProperty(B.data,'selectable',!1)):B.diagram.model.setDataProperty(B.data,'desiredSize',d+' '+c)),B.angle=a.angle,k+=B.naturalBounds.width,r.push(B)))}k=r.length*d+2*d/3,y&&(k=r.length*d),void 0,b.findObject('SHAPE').width=k,b.diagram.model.setDataProperty(b.data,'stroke',p),a.containingGroup.layout.isOngoing=!0,a.containingGroup.layout.isValidLayout=!1,a.resizeObject.width=k,a.resizeObject.height=c,a.waveCount=r.length,v=a.data.xuStrokeWidth,S=a.data.shiStrokeWidth,w=a.data.shiStrokeDashArray,P=a.data.xuStrokeDashArray,r=r.sort(function(e,t){return+e.data.order-+t.data.order});var D=null,N=null;r.forEach(function(e,t){var r=t+1;N=e.__oldOrder?e.__oldOrder:e.data.order,delete e.__oldOrder,f[t]=e.diagram.findNodeForKey(e.data.shiText),x[t]=e.diagram.findNodeForKey(e.data.xuText),e.data.isNew||'waveTail'==e.data.role||N%2==r%2||(f[t].data.nloc&&(e.diagram.model.setDataProperty(f[t].data,'nloc',null),f[t].__oldLocation=f[t].location),x[t].data.nloc&&(e.diagram.model.setDataProperty(x[t].data,'nloc',null),x[t].__oldLocation=x[t].location)),e.diagram.model.setDataProperty(e.data,'order',r),e.data.nalign||e.diagram.model.setDataProperty(e.data,'textAlign','center'),g&&e.diagram.model.setDataProperty(e.data,'shiStroke',g),m&&e.diagram.model.setDataProperty(e.data,'xuStroke',m),v&&e.diagram.model.setDataProperty(e.data,'xuStrokeWidth',v),S&&e.diagram.model.setDataProperty(e.data,'shiStrokeWidth',S),w&&e.diagram.model.setDataProperty(e.data,'shiStrokeDashArray',w),P&&e.diagram.model.setDataProperty(e.data,'xuStrokeDashArray',P),e.location=a.location.copy().offset(d*(r-1),0);var c=!1;if('independent'==a.data.centerTextAngle){if(!e.data.centerText){var p=e.location.copy().offset(e.naturalBounds.width/2,0);p=l(a.location,p,e.angle);var u={text:e.data.text,minSize:d-30+' 30',deletable:!1,textAlign:e.data.textAlign,font:e.data.font||'18px \'Microsoft YaHei\'',textStroke:e.data.textStroke,category:'autoText',key:s.guid(),width:d-30,role:'centerText',level:0,group:e.data.group,order:r,visible:!1,layerName:'Foreground',locationSpot:go.Spot.stringify(new go.Spot(.5,.5,0,0)),selectable:!1,olive:e.data.key,loc:go.Point.stringify(p),angle:0};e.diagram.model.addNodeData(u),e.diagram.model.setDataProperty(e.data,'centerText',u.key),c=!0}var y=e.diagram.findNodeForKey(e.data.centerText);if(y){if(y.data.nalign||e.diagram.model.setDataProperty(y.data,'textAlign','center'),e.data.nangle||('vertical'==h&&(e.diagram.model.setDataProperty(y.data,'visible',!1),e.diagram.model.setDataProperty(e.data,'textVisible',!0)),'horizontal'==h&&(e.diagram.model.setDataProperty(y.data,'visible',!0),e.diagram.model.setDataProperty(e.data,'textVisible',!1),e.diagram.model.setDataProperty(y.data,'angle',0))),!c){var p=e.location.copy().offset(e.naturalBounds.width/2,0);p=l(a.location,p,e.angle),e.diagram.model.setDataProperty(y.data,'loc',go.Point.stringify(p))}e.diagram.model.setDataProperty(y.data,'order',r),y.data.nwidth||e.diagram.model.setDataProperty(y.data,'width',d-30),e.diagram.model.setDataProperty(y.data,'minSize',d-30+' 30'),s.checkPhone()&&(y.layerName='Background')}}e.text&&''!=e.text.trim()&&o(e.findObject('TEXT')),f[t]&&(!f[t].desiredSize.width&&f[t].updateTargetBindings(),e.diagram.model.setDataProperty(f[t].data,'showBorder',!0),!f[t].data.nwidth&&e.diagram.model.setDataProperty(f[t].data,'width',d),e.diagram.model.setDataProperty(f[t].data,'minSize',d-30+' 30'),e.diagram.model.setDataProperty(f[t].data,'order',r),!f[t].data.ncolor&&e.diagram.model.setDataProperty(f[t].data,'textStroke',g)),x[t]&&(!x[t].desiredSize.width&&x[t].updateTargetBindings(),e.diagram.model.setDataProperty(x[t].data,'minSize',d-30+' 30'),e.diagram.model.setDataProperty(x[t].data,'showBorder',!0),!x[t].data.nwidth&&e.diagram.model.setDataProperty(x[t].data,'width',d),e.diagram.model.setDataProperty(x[t].data,'order',r),!x[t].data.ncolor&&e.diagram.model.setDataProperty(x[t].data,'textStroke',m)),e.__location=l(a.location,e.location.copy(),e.angle),i(e,f[t],x[t],a),e.location=e.__location,D=e,e.diagram.model.setDataProperty(e.data,'isNew',null)})}function d(){go.Layout.call(this)}function l(e,t,a){if(e.equals(t))return t;var o=new go.Point(0,0).subtract(e.copy()),i=t.copy().offset(o.x,o.y),r=i.rotate(a),d=r.copy().offset(-o.x,-o.y);return d}var s=a(0);go.Diagram.inherit(d,go.Layout),d.prototype.doLayout=function(e){var t=this.diagram;t.model.startTransaction('WaveGroupLayout');var a=this.collectParts(e).iterator,o=this.group;return r(a,t,o),go.Layout.prototype.doLayout.call(this,e),void t.model.commitTransaction('WaveGroupLayout')},e.exports=d,e.exports.layoutWaveGroup=r,e.exports.adjustTextAngle=i},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e){var t=new go.Set,a=e.first();if(!a)t.addAll(e);else if(a.containingGroup&&'labelGroup'==a.containingGroup.data.category){var o=a.containingGroup.findSubGraphParts().iterator;for(t.add(a.containingGroup);o.next();){var i=o.value;t.add(i)}}else c.travelParts(a,function(e){t.add(e)});this;return go.DraggingTool.prototype.computeEffectiveCollection.call(this,t)}function d(e,t,a){return 2<=e.findLinksOutOf().count||1<=e.findLinksOutOf().count&&1==e.data.key?void 0:e.data.group===a.data.group}var i='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e},l=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),s=go.GraphObject.make,c=a(0),g=a(3),m=a(2),p=a(11),u=function(){function e(t,a){o(this,e),this.config=a,this.textDoubleClick=a.textDoubleClick,this.modelChangedListener=a.modelChangedListener,this.showContextMenuListener=a.showContextMenuListener,this.hideContextMenuListener=a.hideContextMenuListener,this.dealFireTextCallback=a.dealFireTextCallback,this.exportAsSubFigureCallback=a.exportAsSubFigureCallback,this.ViewportBoundsChangedListener=a.ViewportBoundsChangedListener,this.InitialLayoutCompleted=a.InitialLayoutCompleted,this.cxElement=a.cxElement,this.deleteCallback=a.deleteCallback,this.canAddAxisGroup=null==a.canAddAxisGroup||a.canAddAxisGroup,this.createFigure=a.createFigure,this.openFigure=a.openFigure,this.useDefaultContext=null==a.useDefaultContext||a.useDefaultContext,this.defaultCxElement=null,this.type=a.type,this.div=t,this.containerDivId=a.containerDivId||'mainbox',this.diagram={},null!=a.model&&'object'==i(a.model)&&(a.model=JSON.stringify(a.model)),this.model=a.model,this.tpid=a.tpid||Date.now(),this.InitialFontSize=18,this.tdCurrentTheme={id:6,borderWidth:2,borderColor:'black',groupColor:'rgba(0,0,0,0)',groupStroke:'rgba(0,0,0,0)',groupStrokeWidth:0,themeName:'\u9ED1\u767D',linkColor:'black',colorRange:'white'},this.nodeClickListener=a.nodeClickListener,this.nodeDoubleClickListener=a.nodeDoubleClickListener,this.isModified=!1,this.lastModified=0,this.modifiedIndex=0}return l(e,[{key:'initDiagram',value:function(){}},{key:'addNodeTemplate',value:function(){}},{key:'resetZoom',value:function(e){this.diagram.commandHandler.resetZoom(e)}},{key:'getDefaultCustomMenuDivStr',value:function(){return'\n        <ul>\n            <li trtd_action="addLevelNodeMenu"><a class="i18n" data-lang="insertsl">\u63D2\u5165\u540C\u7EA7\u8282\u70B9</a></li>\n            <li trtd_action="addChildNodeMenu"><a class="i18n" data-lang="icn">\u63D2\u5165\u5B50\u8282\u70B9</a></li>\n            <li trtd_action="duplicateNode"><a class="i18n" data-lang="duplicateNode">\u590D\u5236\u8282\u70B9</a></li>\n            <li trtd_action="deleteNodeMenu"><a class="i18n" data-lang="remove">\u5220\u9664</a></li>\n            <li trtd_action="orderChildNode"><a class="i18n" data-lang="ordernode">\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearOrderChildNode"><a class="i18n" data-lang="clearordernode">\u53D6\u6D88\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearNodeTextMenu"><a class="i18n" data-lang="emptynodetext">\u6E05\u7A7A\u8282\u70B9\u6587\u672C</a></li>\n            <li trtd_action="insertTianpanMenu"><a class="i18n" data-lang="insertnodetianpan">\u63D2\u5165\u5929\u76D8\u8282\u70B9</a></li>\n            <li trtd_action="insertTextMenu"><a class="i18n" data-lang="inserttext">\u63D2\u5165\u6587\u672C</a></li>\n            <li trtd_action="locateRootNodeMenu"><a class="i18n" data-lang="locaterootnode">\u5B9A\u4F4D\u6839\u8282\u70B9</a></li>\n            <li trtd_action="showAllNodesMenu"><a class="i18n" data-lang="displayallnodes">\u663E\u793A\u6240\u6709\u8282\u70B9</a></li>\n            <li trtd_action="fixPictureMenu"><a class="i18n" data-lang="fixnode">\u56FA\u5B9A\u8282\u70B9</a></li>\n            <li trtd_action="activePictureMenu"><a class="i18n" data-lang="cancelfix">\u53D6\u6D88\u56FA\u5B9A</a></li>\n        \n            <li trtd_action="delYunpanAxis"><a class="i18n" data-lang="cancelfix">\u5220\u9664 CTRL+DEL</a></li>\n            <li trtd_action="addYunpanAxis"><a class="i18n" data-lang="cancelfix">\u589E\u52A0 CTRL+X/Y</a></li>\n            <li trtd_action="addFollowerGround"><a class="i18n" data-lang="insertsl">\u589E\u52A0\u540C\u7EA7\u8282\u70B9</a></li>\n            <li trtd_action="addNewCircle"><a class="i18n" data-lang="icn">\u589E\u52A0\u5B50\u8282\u70B9</a></li>\n            <li trtd_action="apiDeleteSelection"><a class="i18n" data-lang="remove">\u5220\u9664</a></li>\n        </ul>\n        '}},{key:'getShowContextMenus',value:function(e){var t='';return!e||e.data.isGroup?t='locateRootNodeMenu,showAllNodesMenu,insertTextMenu,insertTianpanMenu':(!(e instanceof go.Group)&&(!e.data.category||''==e.data.category||'0'==e.data.category||'1'==e.data.category||'4'==e.data.category)&&(t='addLevelNodeMenu,addChildNodeMenu,deleteNodeMenu,orderChildNode,clearOrderChildNode,clearNodeTextMenu,duplicateNode',t+=e.selectable?'fixPictureMenu':'activePictureMenu'),('8'==e.data.category||'text'==e.data.category||'addtextTemplate'==e.data.category)&&(t='deleteNodeMenu,duplicateNode'),('yunpanx'===e.data.category||'yunpany'===e.data.category)&&(t='delYunpanAxis,addYunpanAxis'),'dipan'===e.data.category&&(t='addFollowerGround,addChildDipanNode,deleteDipanNode')),t}},{key:'insertPicture',value:function(e){this.apiInsertPicture(e)}},{key:'apiInsertPicture',value:function(e){var t=this.diagram,a=this.diagram.model.modelData.currentType,o=t.selection.first();if(!o||'dipan'!=o.data.category||rootKey){t.model.startTransaction('setSourceOfPicture');try{var i=JSON.parse(localStorage.getItem('TRTD_documentPoint'));i||(i=t.lastInput.documentPoint)}catch(e){var i=t.lastInput.documentPoint}if(o)'3'==o.data.category&&t.model.setDataProperty(o.data,'picture',e);else{var r=(t.model.nodeDataArray.length+1).toString(),d={key:r,text:'',category:'3'};t.model.makeNodeDataKeyUnique(d),d.loc=go.Point.stringify(i),d.picture=e,t.model.addNodeData(d)}t.model.commitTransaction('setSourceOfPicture')}}},{key:'apiGetTheme',value:function(){for(var e=this.diagram.model,t='',a=0;a<e.nodeDataArray.length;a++)if(('theme'==e.nodeDataArray[a].role||'themeText'==e.nodeDataArray[a].role||'themeText'==e.nodeDataArray[a].subRole)&&e.nodeDataArray[a].text){t=e.nodeDataArray[a].text;break}if(!t){var o=e.findNodeDataForKey(1);o&&(t=o.text)}return t}},{key:'apiGetThemeNode',value:function(){for(var e=this.diagram.model,t=null,a=this.diagram.nodes,o;a.next();)if(o=a.value,'theme'==o.data.role||'themeText'==o.data.role||'themeText'==o.data.subRole){t=o;break}if(!t){var i=this.diagram.findNodeForKey(1);i&&(t=i)}return t}},{key:'insertFigure',value:function(e,t){var a=this.diagram,o=this.diagram.model.modelData.currentType,i=a.selection.first();if(!i){a.model.startTransaction('setSourceOfPicture');try{var r=JSON.parse(localStorage.getItem('TRTD_documentPoint'))}catch(e){var r=a.lastInput.documentPoint}if(i)'3'!=i.data.category&&'text'!=i.data.category&&a.model.setCategoryForNodeData(i.data,'4'),'text'!=i.data.category&&a.model.setDataProperty(i.data,'picture',e);else{var d=(a.model.nodeDataArray.length+1).toString(),l={key:d,text:'',category:'3'};a.model.makeNodeDataKeyUnique(l),l.loc=go.Point.stringify(r),l.figureId=t,l.picture=e,a.model.addNodeData(l)}a.model.commitTransaction('setSourceOfPicture')}}},{key:'apiDuplicateNode',value:function(){function e(e){return e.level=0,delete e.prev,delete e.isparent,delete e.next,delete e.group,delete e.parent,delete e.role,delete e.group,delete e.dimKey,delete e.subRole,delete e.order,delete e.figure,delete e.iconVisible,delete e.deletable,delete e.theta,delete e.orderX,delete e.orderY,delete e.dimX,delete e.dimY,e}var t=this.diagram,a=t.selection.first();if(a){t.startTransaction();var o=t.model.copyNodeData(a.data),i=a.location.copy();i.offset(50,-50),o.loc=go.Point.stringify(i),o.level=0,o=e(o),t.model.addNodeData(o),t.commitTransaction()}}},{key:'apiPreviewImage',value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:'white',t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,a=this.diagram,o={scale:t,background:e,type:'image/png',maxSize:new go.Size(9e3,9e3)},i=new go.List(go.GraphObject),r=a.selection.first(),d=!1;if(r){for(;r.containingGroup;)r=r.containingGroup;r.data.isGroup&&(d=!0)}if(d)for(var l=r.findSubGraphParts().iterator;l.next();){var s=l.value,c=s.findObject('figure');c&&(c.visible=!1),s instanceof go.Group||(i.add(s),s instanceof go.Node&&'centerText'==s.data.role&&(s.layerName='Foreground'))}else a.nodes.each(function(e){var t=e.findObject('figure');t&&(t.visible=!1),e instanceof go.Group||(i.add(e),e instanceof go.Node&&'centerText'==e.data.role&&(e.layerName='Foreground'))});a.links.each(function(e){i.add(e)}),o.parts=i.iterator;var g=a.makeImageData(o);return a.nodes.each(function(e){var t=e.findObject('figure');e.data.figure&&t&&(t.visible=!0)}),g}},{key:'apiDeleteSelection',value:function(){this.diagram.toolManager.textEditingTool.doCancel(),this.diagram.commandHandler.deleteSelection()}},{key:'apiUndo',value:function(){this.diagram.commandHandler.undo()}},{key:'apiRedo',value:function(){this.diagram.commandHandler.redo()}},{key:'saveModel',value:function(){c.saveModelToLocalStorage(this.tpid,this.diagram.model)}},{key:'addNodeTemplateBase',value:function(){var e=this.diagram;this.diagram.nodeTemplateMap.add('text',g(this.diagram)),this.diagram.nodeTemplateMap.add('3',m(this.diagram)),e.nodeTemplateMap.add('pic',p('pic',{diagram:this.diagram}).getNodeTemplate()),e.nodeTemplateMap.add('autoText',p('autoText',{diagram:e}).getNodeTemplate()),e.groupTemplateMap.add('picGroup',p('picGroup',{diagram:e}).getNodeTemplate())}},{key:'addWater',value:function(){var t=this.diagram,a=t.selection.first(),o=null;a&&'axisGroup'==a.data.category&&(o=a.data.key);var i=t.lastInput;t.startTransaction('addCbian');var e=c.guid(),r=i.documentPoint,d={category:'picGroup',role:'cbian',isGroup:!0,level:0,key:e,loc:go.Point.stringify(r),deletable:!0};o&&(d.group=o);var l={group:e,text:'',resizable:!1,category:'pic',loc:go.Point.stringify(r),picture:'https://static.365trtd.com/system/water/water.png',width:150,height:150},s={text:'\u603B\u7ED3',deletable:!0,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(r.copy().offset(3,-3)),movable:!0,group:e},g={text:'\u65F6\u95F4',deletable:!0,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(r.copy().offset(150,0)),movable:!0,group:e},m={text:'\u80FD\u91CF',deletable:!0,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(r.copy().offset(0,-150)),movable:!0,group:e},p={text:'\u603B\u7ED31',deletable:!0,textStroke:'#0e399d',iconVisible:!1,locationSpot:'0 0 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(r.copy().offset(155*_Mathcos(30*_MathPI/180),-150*_Mathsin(30*_MathPI/180))),movable:!0,group:e},u={text:'\u603B\u7ED32',deletable:!0,textStroke:'#FFC000',iconVisible:!1,locationSpot:'0 0.5 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(r.copy().offset(145*_Mathcos(45*_MathPI/180),-150*_Mathsin(45*_MathPI/180))),movable:!0,group:e},y={text:'\u603B\u7ED33',deletable:!0,textStroke:'#cb1c27',iconVisible:!1,locationSpot:'0 1 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(r.copy().offset(145*_Mathcos(70*_MathPI/180),-140*_Mathsin(70*_MathPI/180))),movable:!0,group:e};t.model.addNodeData(p),t.model.addNodeData(u),t.model.addNodeData(y),t.model.addNodeData(s),t.model.addNodeData(g),t.model.addNodeData(m),t.model.addNodeData(l),t.model.addNodeData(d),t.commitTransaction('addWater')}},{key:'initDiagramBase',value:function(e,t){var a=this,o=this.diagram,l=this,o=this.diagram,c={initialContentAlignment:go.Spot.Center,initialAutoScale:go.Diagram.Uniform,initialDocumentSpot:go.Spot.Center,initialViewportSpot:go.Spot.Center,"toolManager.hoverDelay":100,padding:-20,click:function(t){localStorage.setItem('TRTD_documentPoint',go.Point.stringify(t.documentPoint))},"dragSelectingTool.isEnabled":!1,"draggingTool.isCopyEnabled":!1,"commandHandler.archetypeGroupData":{text:'Group',isGroup:!0,color:'blue'},allowDrop:!0,"undoManager.isEnabled":!0,"undoManager.maxHistoryLength":20,"toolManager.mouseWheelBehavior":go.ToolManager.WheelZoom,maxScale:5,minScale:.2,hasVerticalScrollbar:!1,hasHorizontalScrollbar:!1,scrollMode:go.Diagram.InfiniteScroll,scrollMargin:50,"animationManager.isEnabled":!1,maxSelectionCount:1,InitialLayoutCompleted:function(t){t.diagram.animationManager.isEnabled=!0,l.InitialLayoutCompleted&&l.InitialLayoutCompleted(t)},validCycle:go.Diagram.CycleDestinationTree,ModelChanged:function(t){t.isTransactionFinished&&(l.isModified=!0,l.lastModified=Date.now(),l.modifiedIndex+=1,setTimeout(function(){if(l.isModified){var e=Date.now()-l.lastModified;1e3<=e&&(l.modifiedIndex=0,l.isModified=!1,l.saveModel(t),l.modelChangedListener&&l.modelChangedListener(t.model))}},1100))},TextEdited:function(t){t.diagram.isModified=!0},contextMenu:s(go.Adornment),ViewportBoundsChanged:function(t){l.ViewportBoundsChangedListener&&l.ViewportBoundsChangedListener(t)}},g=Object.assign(c,t.diagramConfig);delete g.type,delete g.tpid,delete g.model,delete g.modelChangedListener,delete g.mouseOverListener,delete g.clickListener,this.diagram=s(go.Diagram,e,g),this.diagram.__trtd=this;var o=this.diagram,m=o.findLayer('Foreground');o.addLayerBefore(go.GraphObject.make(go.Layer,{name:'default'}),m),o.addLayerBefore(go.GraphObject.make(go.Layer,{name:'overflow'}),m);for(var p=10;0<=p;p--)o.addLayerBefore(go.GraphObject.make(go.Layer,{name:p.toString()}),m);o.toolManager.draggingTool.computeEffectiveCollection=r,o.toolManager.rotatingTool.handleArchetype=s(go.Panel,'Auto',s(go.Shape,'BpmnActivityLoop',{width:30,height:30,stroke:'green',fill:'transparent'}),s(go.Shape,'Rectangle',{width:30,height:30,stroke:'green',fill:'transparent',strokeWidth:0})),o.toolManager.linkReshapingTool.handleArchetype=s(go.Shape,'Circle',{width:30,height:30,fill:'lightblue',stroke:'dodgerblue'}),o.toolManager.linkingTool.linkValidation=d,o.toolManager.relinkingTool.linkValidation=d,o.commandHandler.doKeyDown=function(t){a.dokeyDownFn(t)},o.commandHandler.deleteSelection=function(){var e=l.diagram.selection.first();if(e&&'theme'!=e.data.role&&'themeText'!=e.data.role&&'themeText'!=e.data.subRole){var t=JSON.parse(JSON.stringify(e.data));l.deleteSelection(),l.deleteCallback&&l.deleteCallback(t)}},o.commandHandler.redo=function(){var e=o.commandHandler;o.clearSelection(),go.CommandHandler.prototype.redo.call(e)},o.commandHandler.undo=function(){var e=o.commandHandler;o.clearSelection(),o.toolManager&&o.toolManager.textEditingTool.doCancel(),go.CommandHandler.prototype.undo.call(e)},o.toolManager.clickCreatingTool.archetypeNodeData={category:'autoText',text:'\u53CC\u51FB\u7F16\u8F91\u6587\u672C',level:0,radius:120},this.addNodeTemplateBase(),this.addDiagramContextMenu()}},{key:'removeNodeRemarkTips',value:function(){var e=document.getElementById('tooltip');e&&e.parentNode.removeChild(e)}},{key:'showNodeRemarkTips',value:function(t,e){var a=document.getElementById('tooltip');if(!a||0==a.length){var o=document.createElement('div');o.setAttribute('id','tooltip'),o.setAttribute('style','word-wrap: break-word;word-break: break-all'),document.body.appendChild(o),a=document.getElementById('tooltip')}var i=document.getElementById('tooltip');if(!(!e.data.istemp&&e.data.text&&''==e.data.text.trim()&&(e.data.remark&&''==e.data.remark.trim()||'undefined'==typeof e.data.remark))){if(e.data.istemp)var r=lang.trans('tempnodetips');else if('y'===e.category||'LogicXor'===e.category&&'5'===e.data.loc.split(' ')[1])var r='\u6700\u53F3\u65B0\u589E';else if('x'===e.category||'LogicXor'===e.category&&'-20'===e.data.loc.split(' ')[0])var r='\u6700\u4E0A\u65B0\u589E';else{var r=e.data.text+'<br><hr>';r+=e.data.remark?e.data.remark:''}i.innerHTML=r,'y'===e.category||'x'===e.category||'LogicXor'===e.category?(i.style.left=t.event.clientX+10+'px',i.style.top=t.event.clientY-10+'px'):(i.style.left=t.event.clientX+50+'px',i.style.top=t.event.clientY-50+'px'),i.style.position='fixed',i.style.zIndex=5555,i.style.backgroundColor='#FFFFE1'}}},{key:'nodeResizeAdornmentTemplate',value:function(){return s(go.Adornment,'Spot',s(go.Placeholder),s(go.Shape,'Circle',{alignment:go.Spot.TopLeft,alignmentFocus:go.Spot.BottomRight,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}),s(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'customMenu',value:function(){if(this.defaultCxElement)return this.defaultCxElement;if(!this.useDefaultContext)return null;var e=this.getDefaultCustomMenuDivStr(),t=document.createElement('div');t.setAttribute('class','context-menu'),t.innerHTML=e;var a=document.getElementById(this.containerDivId);a.appendChild(t);var o=a.getElementsByClassName('context-menu')[0];return this.defaultCxElement=o,this.bindMenuEventListener(o),o}},{key:'bindMenuEventListener',value:function(e){for(var t=this,a=e.getElementsByTagName('li'),o=function(e){a[e].addEventListener('click',function(){var o=a[e].getAttribute('trtd_action');return t.diagram.__trtd[o](),t.diagram.currentTool.stopTool(),!1})},r=0;r<a.length;r++)o(r)}},{key:'addDiagramContextMenu',value:function(){var e=this,t=this.diagram,a=t.toolManager.contextMenuTool;if(!this.cxElement){this.defaultCxElement||(this.defaultCxElement=this.customMenu());var o=this.defaultCxElement}else var o=this.cxElement;o&&(o.addEventListener('contextmenu',function(t){return t.preventDefault(),!1},!1),o.tabIndex='1',a.showContextMenu=function(a){var r=this.diagram;if(null!==r){a!==this.currentContextMenu&&this.hideContextMenu();var d=t.findPartAt(t.lastInput.documentPoint,!1);this.currentContextMenu=a;var l=r.lastInput.viewPoint;if(o.style.left=l.x+'px',o.style.top=l.y+'px',e.showContextMenuListener)return e.showContextMenuListener(this.diagram,d);var s=e.getShowContextMenus(d),g=o.getElementsByTagName('li');if(s){for(var m=0;m<g.length;m++)g[m].style.display='none';for(var i=0;i<s.split(',').length;i++)try{c.getElementByAttr(o,'li','trtd_action',s.split(',')[i])[0]&&(c.getElementByAttr(o,'li','trtd_action',s.split(',')[i])[0].style.display='block')}catch(t){continue}}else if(''==s)for(var p=0;p<g.length;p++)g[p].style.display='block';else for(var u=0;u<g.length;u++)g[u].style.display='none';o.style.display='block'}},a.hideContextMenu=function(){if(null!==this.currentContextMenu&&(this.currentContextMenu=null,o.style.display='none',e.hideContextMenuListener))return e.hideContextMenuListener(t)})}},{key:'getNodeContextMenu',value:function(){return s(go.Adornment);var e={}}},{key:'dokeyDownFn',value:function(){var t=this.diagram,a=this.diagram,o=this.diagram.lastInput,e=t.commandHandler,i=t.selection.first();if(o.event.altKey){if('Q'==o.key)return void autoLayoutAll();if('R'==o.key)return void centerNode();if('C'==o.key)return void centerCurrentNode();if('A'==o.key)return void zoomToFit()}if(65<=o.event.keyCode&&90>=o.event.keyCode&&!o.event.altKey&&!o.event.ctrlKey&&!o.event.shiftKey)return o.bubbles=!1,a.__trtd.selectText(o),!0;if(13===o.event.keyCode)i&&'Root'==i.data.category?a.__trtd.addFollowerGround():i&&'dipan'==i.data.category&&a.__trtd.addFollowerGround();else if(9===o.event.keyCode)i&&'Root'==i.data.category?a.__trtd.addNewCircle():i&&'dipan'==i.data.category&&a.__trtd.addNewCircle();else if('t'===o.key)e.canCollapseSubGraph()?e.collapseSubGraph():e.canExpandSubGraph()&&e.expandSubGraph();else if('Del'==o.key){if(0==t.selection.count)return;a.__trtd.deleteSelection()}else 113==o.event.keyCode?a.__trtd.selectText():37==o.event.keyCode?a.__trtd.moveWithinNodes('left'):38==o.event.keyCode?a.__trtd.moveWithinNodes('up'):39==o.event.keyCode?a.__trtd.moveWithinNodes('right'):40==o.event.keyCode?a.__trtd.moveWithinNodes('down'):go.CommandHandler.prototype.doKeyDown.call(e);o.bubbles=!1}}]),e}();e.exports.Trtd=u},function(module,exports,__webpack_require__){'use strict';var waveNodeTemplate=__webpack_require__(15),waveGroupNodeTemplate=__webpack_require__(16),axisGroupNodeTemplate=__webpack_require__(17),iconTextNodeTemplate=__webpack_require__(19),autoTextNodeTemplate=__webpack_require__(20),labelGroupNodeTemplate=__webpack_require__(21),picNodeTemplate=__webpack_require__(22),picGroupNodeTemplate=__webpack_require__(23),yunGroupNodeTemplate=__webpack_require__(24),yunpanGroupNodeTemplate=__webpack_require__(26),shapeNodeTemplate=__webpack_require__(28),shapeTextNodeTemplate=__webpack_require__(29);module.exports=function(nodeType,options){var temp=nodeType+'NodeTemplate';var nodeTemplateClass=eval(temp);return new nodeTemplateClass(options)}},function(e){'use strict';function t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var a=(o={trtd:{en:'Turn Round TD',chn:'\u5706\u8F6C\u5929\u5730'},save:{en:'Save',chn:'\u4FDD\u5B58'},preview:{en:'Preview',chn:'\u9884\u89C8'},logout:{en:'Log out',chn:'\u9000\u51FA'},menu:{en:'Menu',chn:'\u83DC\u5355'},usual:{en:'Common',chn:'\u5E38\u7528'},thinking:{en:'Train of Thought',chn:'\u601D\u8DEF'},appearance:{en:'Appearance',chn:'\u5916\u89C2'},view:{en:'View',chn:'\u89C6\u56FE'},insertll:{en:'Insert the Lower Leve',chn:'\u63D2\u5165\u4E0B\u7EA7'},insertsl:{en:'Insert Sibling Level',chn:'\u63D2\u5165\u540C\u7EA7'},undo:{en:'Undo',chn:'\u64A4\u9500'},redo:{en:'Redo',chn:'\u91CD\u505A'},cte:{en:'Click to edit',chn:'\u5355\u51FB\u7F16\u8F91'},dce:{en:'Double Click to Edit',chn:'\u53CC\u51FB\u7F16\u8F91\u5185\u5BB9'},centertheme:{en:'Central Theme',chn:'\u4E2D\u5FC3\u4E3B\u9898'},edit:{en:'Edit',chn:'\u7F16\u8F91'},remove:{en:'Delete',chn:'\u5220\u9664'},radius:{en:'Size',chn:'\u5927\u5C0F'},shape:{en:'Shape',chn:'\u5F62\u72B6'},borderwidth:{en:'Border Width',chn:'\u8FB9\u6846\u5BBD\u5EA6'},noborder:{en:'No Border',chn:'\u65E0\u8FB9\u6846'},borderstyle:{en:'Border Style',chn:'\u8FB9\u6846\u6837\u5F0F'},fillcolor:{en:'Fill Color',chn:'\u586B\u5145\u8272'},bordercolor:{en:'Border Color',chn:'\u8FB9\u6846\u989C\u8272'},image:{en:'Pictures',chn:'\u56FE\u7247'},insert:{en:'Insert',chn:'\u63D2\u5165'},delete:{en:'Remove',chn:'\u79FB\u9664'},remark:{en:'Comment',chn:'\u5907\u6CE8'},removeallnode:{en:'Empty Nodes',chn:'\u6E05\u7A7A\u8282\u70B9'},removeallline:{en:'Delete Lines',chn:'\u6E05\u7A7A\u8FDE\u7EBF'},arrangelayout:{en:'Arrange layout',chn:'\u6574\u7406\u5E03\u5C40'},previewSubPan:{en:'Preview SubPan',chn:'\u9884\u89C8\u5B50\u76D8'},arrowstyle:{en:'Arrow Style',chn:'\u7BAD\u5934\u6837\u5F0F'},linkstyle:{en:'Link Style',chn:'\u5F27\u6837\u5F0F'},clearText:{en:'Clear Text',chn:'\u6E05\u7A7A\u6587\u672C'},tdautolayout:{en:'Auto layout',chn:'\u5929\u76D8\u81EA\u52A8\u5E03\u5C40'},jumptonewnode:{en:'Auto locate',chn:'\u81EA\u52A8\u8DF3\u8F6C\u5230\u65B0\u7684\u8282\u70B9'},theme:{en:'Subject',chn:'\u4E3B\u9898'},backcolor:{en:'Background Color',chn:'\u80CC\u666F\u989C\u8272'},objofaction:{en:'Object',chn:'\u4F5C\u7528\u5BF9\u8C61'},oneobj:{en:'Single Node',chn:'\u5355\u4E2A\u8282\u70B9'},sibobj:{en:'Sibling Nodes',chn:'\u540C\u7EA7\u8282\u70B9'},allsibobj:{en:'All Sibling Nodes',chn:'\u6240\u6709\u540C\u7EA7\u8282\u70B9'},allnodes:{en:'All Nodes',chn:'\u6240\u6709\u8282\u70B9'},shade:{en:'Shade',chn:'\u9634\u5F71'},font:{en:'Font',chn:'\u5B57\u4F53'},fontsize:{en:'Font Size',chn:'\u5B57\u53F7'},compactdegree:{en:'Compact Level',chn:'\u7D27\u51D1\u7A0B\u5EA6'},compact:{en:'Compact',chn:'\u7D27\u51D1'},sparse:{en:'Sparse',chn:'\u7A00\u758F'},eq:{en:'Equal Interval',chn:'\u7B49\u95F4\u8DDD'},spread:{en:'Spread',chn:'\u5C55\u5F00'},firstl:{en:'First Layer',chn:'\u7B2C\u4E00\u5C42'},secondl:{en:'Second Layer',chn:'\u7B2C\u4E8C\u5C42'},threel:{en:'Third Layer',chn:'\u7B2C\u4E09\u5C42'},fourl:{en:'Fourth Layer',chn:'\u7B2C\u56DB\u5C42'},fifthl:{en:'Fifth Layer',chn:'\u7B2C\u4E94\u5C42'},localnodes:{en:'Location Nodes',chn:'\u5B9A\u4F4D\u8282\u70B9'},rootnode:{en:'Root Node',chn:'\u6839\u8282\u70B9'},currentnode:{en:'Current Nodes',chn:'\u5F53\u524D\u8282\u70B9'},displayallnodes:{en:'Display All Nodes',chn:'\u663E\u793A\u6240\u6709\u8282\u70B9'},return:{en:'Back',chn:'\u8FD4\u56DE'},tianpan:{en:'TianPan',chn:'\u5929\u76D8'},dipan:{en:'DiPan',chn:'\u5730\u76D8'},open:{en:'Open',chn:'\u6253\u5F00'},saveas:{en:'Save As',chn:'\u53E6\u5B58\u4E3A'},help:{en:'Help',chn:'\u5E2E\u52A9'},new:{en:'New',chn:'\u65B0\u5EFA'},commontemplate:{en:'Common template',chn:'\u5E38\u7528\u6A21\u677F'},openlocalfile:{en:'Open local file',chn:'\u6253\u5F00\u672C\u5730\u6587\u4EF6'},importtext:{en:'Import outline text',chn:'\u5BFC\u5165\u5927\u7EB2\u6587\u672C'},recentlyfile:{en:'Recently used files',chn:'\u6700\u8FD1\u4F7F\u7528\u7684\u6587\u4EF6'},exportdata:{en:'Export Data',chn:'\u53E6\u5B58\u4E3Atxt\u6570\u636E'},exporttext:{en:'Export Outline Text',chn:'\u5BFC\u51FA\u5927\u7EB2\u6587\u672C'},exportimg:{en:'Export Pictures',chn:'\u5BFC\u51FA\u56FE\u7247'},websupport:{en:'Website Support',chn:'\u7F51\u7AD9\u652F\u6301'},techsupport:{en:'Technical Support',chn:'\u6280\u672F\u652F\u6301'},techsupportqq:{en:'Technical Support to QQ Groups',chn:'\u6280\u672F\u652F\u6301QQ\u7FA4'},shortcutkey:{en:'Shortcut Key',chn:'\u5FEB\u6377\u952E'},addchildnode:{en:'Add Child',chn:'\u589E\u52A0\u5B50\u8282\u70B9'},addsibnode:{en:'Add Sibling',chn:'\u589E\u52A0\u540C\u7EA7\u8282\u70B9'},key:{en:'Key',chn:'\u952E'},or:{en:'Or',chn:'\u6216'},confirmedittext:{en:'Confirm the completion of editing text',chn:'\u7F16\u8F91\u5B8C\u6587\u5B57\u786E\u8BA4'},editnewline:{en:'Edit text newline',chn:'\u7F16\u8F91\u6587\u5B57\u6362\u884C'},canceltextedit:{en:'Cancel Text Editing',chn:'\u53D6\u6D88\u7F16\u8F91\u6587\u5B57'},activetextedit:{en:'Activate Text Editing',chn:'\u6FC0\u6D3B\u7F16\u8F91\u6587\u5B57'},sanpak:{en:'Select a node and press any key',chn:'\u9009\u4E2D\u8282\u70B9\u540E\u6309\u4EFB\u610F\u5B57\u6BCD\u952E'},auxview:{en:'Auxiliary View',chn:'\u8F85\u52A9\u67E5\u770B'},focusselectnode:{en:'Focus on selected nodes',chn:'\u805A\u7126\u9009\u4E2D\u8282\u70B9'},locateselectednode:{en:'Locate selected nodes',chn:'\u5B9A\u4F4D\u9009\u4E2D\u8282\u70B9'},locaterootnode:{en:'Locate Root Nodes',chn:'\u5B9A\u4F4D\u6839\u8282\u70B9'},bigcanvas:{en:'Enlarge Canvas',chn:'\u653E\u5927\u753B\u5E03'},smallcanvas:{en:'Narrow Canvas',chn:'\u7F29\u5C0F\u753B\u5E03'},switchnode:{en:'Switch selected nodes',chn:'\u5207\u6362\u9009\u62E9\u7684\u8282\u70B9'},mttnsn:{en:'Move to the next sibling node',chn:'\u79FB\u52A8\u5230\u4E0B\u4E00\u4E2A\u540C\u7EA7\u8282\u70B9'},mttlsn:{en:'Move to the last sibling node',chn:'\u79FB\u52A8\u5230\u4E0A\u4E00\u4E2A\u8282\u70B9'},mttfsn:{en:'Move to the first child node',chn:'\u79FB\u52A8\u5230\u7B2C\u4E00\u4E2A\u8282\u70B9'},mtfn:{en:'Move to Father Node',chn:'\u79FB\u52A8\u5230\u7236\u8282\u70B9'},direckey:{en:'Direction Key',chn:'\u65B9\u5411\u952E'},servicetd:{en:'Send Feedback',chn:'\u6211\u8981\u7ED9\u5706\u8F6C\u5929\u5730\u63D0\u610F\u89C1'},cbottc:{en:'Change background of the DiPan',chn:'\u66F4\u6362\u5730\u76D8\u80CC\u666F'},rbottc:{en:'Remove background of the DiPan',chn:'\u79FB\u9664\u5730\u76D8\u80CC\u666F'},icn:{en:'Insert child nodes',chn:'\u63D2\u5165\u5B50\u8282\u70B9'},addnodepic:{en:'Add Node Pictures',chn:'\u6DFB\u52A0\u8282\u70B9\u56FE\u7247'},removepicture:{en:'Remove Pictures',chn:'\u79FB\u9664\u56FE\u7247'},emptynodetext:{en:'Empty Node Text',chn:'\u6E05\u7A7A\u8282\u70B9\u6587\u672C'},insertnodetianpan:{en:'Insert Nodes of TianPan',chn:'\u63D2\u5165\u5929\u76D8\u8282\u70B9'},inserttext:{en:'Insert Text',chn:'\u63D2\u5165\u6587\u672C'},centerpicture:{en:'Center Pictures',chn:'\u5C45\u4E2D\u56FE\u7247'},ewah:{en:'Equal Width and Hight',chn:'\u7B49\u5BBD\u9AD8'},bringtofront:{en:'Bring to Front',chn:'\u7F6E\u4E8E\u9876\u5C42'},bringtobottom:{en:'Bring to Bottom',chn:'\u7F6E\u4E8E\u5E95\u5C42'},bringforward:{en:'Bring Forward',chn:'\u4E0A\u79FB\u4E00\u5C42'},fixnode:{en:'Fixed Nodes',chn:'\u56FA\u5B9A\u8282\u70B9'},cancelfix:{en:'Cancel Fixed',chn:'\u53D6\u6D88\u56FA\u5B9A'},themecolor:{en:'Theme Colors',chn:'\u4E3B\u9898\u989C\u8272'},standardcolor:{en:'Standard Colors',chn:'\u6807\u51C6\u989C\u8272'},webcolor:{en:'Web Colors',chn:'\u66F4\u591A\u989C\u8272'},backtop:{en:'Back to Palette',chn:'\u8FD4\u56DE\u4E3B\u9898\u989C\u8272'},history:{en:'History',chn:'\u5386\u53F2'},nohistory:{en:'No history yet',chn:'\u6682\u65E0\u5386\u53F2'},week:{en:'Week',chn:'\u6700\u8FD1\u4E00\u5468'},Jan:{en:'January',chn:'\u4E00\u6708'},Feb:{en:'February',chn:'\u4E8C\u6708'},Mar:{en:'March',chn:'\u4E09\u6708'},Apr:{en:'April',chn:'\u56DB\u6708'},May:{en:'May',chn:'\u4E94\u6708'},Jun:{en:'June',chn:'\u516D\u6708'},Jul:{en:'July',chn:'\u4E03\u6708'},Aug:{en:'August',chn:'\u516B\u6708'},Sep:{en:'September',chn:'\u4E5D\u6708'},Oct:{en:'October',chn:'\u5341\u6708'},Nov:{en:'November',chn:'\u5341\u4E00\u6708'},Dec:{en:'December',chn:'\u5341\u4E8C\u6708'},insertimg:{en:'Insert Pictures',chn:'\u63D2\u5165\u56FE\u7247'},imglist:{en:'Pictures list',chn:'\u56FE\u7247\u5217\u8868'},uploadimg:{en:'Upload Picture',chn:'\u4E0A\u4F20\u56FE\u7247'},katong:{en:'Cartoon Picture',chn:'\u5361\u901A\u56FE\u7247'},numbericon:{en:'Number Icons',chn:'\u6570\u5B57\u56FE\u7247'},qipao:{en:'Bubble',chn:'\u6C14\u6CE1'},custompic:{en:'Custom Picture',chn:'\u81EA\u5B9A\u4E49\u56FE\u7247'},picture:{en:'Picture',chn:'\u56FE\u7247'},cancel:{en:'Cancel',chn:'\u53D6\u6D88'},ok:{en:'Ok',chn:'\u786E\u5B9A'},previewimg:{en:'Preview Pictures',chn:'\u9884\u89C8\u56FE\u7247'},copyimg:{en:'Copy Picture',chn:'\u590D\u5236\u56FE\u7247'},copyimgsucces:{en:'Already Copy Picture Into Clipboard',chn:'\u6210\u529F\u590D\u5236\u56FE\u7247\u5230\u7C98\u8D34\u677F'},dragtoupload:{en:'Drag to Upload Picture',chn:'\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20'},linkaddress:{en:'Link Address',chn:'\u94FE\u63A5\u5730\u5740'},insertremark:{en:'Insert Comment',chn:'\u63D2\u5165\u5907\u6CE8'},insertlink:{en:'Insert Link',chn:'\u63D2\u5165\u94FE\u63A5'},copy:{en:'copy',chn:'\u590D\u5236'},picdin:{en:'Picture definition',chn:'\u56FE\u7247\u6E05\u6670\u5EA6'},hsacc:{en:'Hierarchical Subject',chn:'\u5929\u76D8\u5C42\u7EA7\u4E3B\u9898'},mtwtb:{en:'Bold Border Subject',chn:'\u5929\u76D8\u767D\u5B57\u7C97\u53D8\u4E3B\u9898'},officetheme:{en:'Office Subject',chn:'Office\u4E3B\u9898'},lctheme:{en:'Light-coloured Subject',chn:'\u6D45\u8272\u4E3B\u9898'},web2theme:{en:'web2.0 Subject',chn:'Web2.0\u4E3B\u9898'},metrotheme:{en:'Metro Subject',chn:'Metro\u4E3B\u9898'},retrotheme:{en:'Retro Subject',chn:'\u590D\u53E4\u4E3B\u9898'},bustheme:{en:'Business Subject',chn:'\u5546\u4E1A\u4E3B\u9898'},hiet1:{en:'Hierachy Subject 1',chn:'\u5C42\u6B21\u4E3B\u98981'},hiet2:{en:'Hierachy Subject 2',chn:'\u5C42\u6B21\u4E3B\u98982'},eayth:{en:'Earlier Version Subject',chn:'\u65E7\u7248\u4E3B\u9898'},blankth:{en:'Pure-black Subject',chn:'\u7EAF\u9ED1\u8272\u4E3B\u9898'},transthe:{en:'Transparent Subject',chn:'\u900F\u660E\u4E3B\u9898'},randomdipan:{en:'Random Subject of the DiPan',chn:'\u968F\u673A\u5730\u76D8\u4E3B\u9898'},radomcolor1:{en:'Random Colour 1',chn:'\u968F\u673A\u8272\u5F691'},radomcolor2:{en:'Random Colour 1',chn:'\u968F\u673A\u8272\u5F692'},mylocalfile:{en:'My local file',chn:'\u6211\u7684\u672C\u5730\u6587\u4EF6'},ut2c:{en:'Up to 20 characters',chn:'\u6700\u591A20\u4E2A\u5B57\u7B26'},success:{en:'Success',chn:'\u6210\u529F'},danger:{en:'Fail',chn:'\u5931\u8D25'},info:{en:'Info',chn:'\u63D0\u793A'},strf:{en:'Save the file in:Menu->Open->Recently used file',chn:'\u6587\u4EF6\u4FDD\u5B58\u5728:\u83DC\u5355->\u6253\u5F00->\u6700\u8FD1\u4F7F\u7528\u6587\u4EF6\u4E2D'},netonffline:{en:'Network is not connected, commonly used template download failed',chn:'\u7F51\u7EDC\u672A\u8FDE\u63A5\uFF0C\u5E38\u7528\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25'},cantcheckver:{en:'The network is not connected, the version of the test failed',chn:'\u7F51\u7EDC\u672A\u8FDE\u63A5\uFF0C\u7248\u672C\u68C0\u6D4B\u5931\u8D25'},spacebar:{en:'Space bar',chn:'\u7A7A\u683C\u952E'},supportmail:{en:'Support Mail',chn:'\u6280\u672F\u652F\u6301\u90AE\u7BB1'},updatesuccess:{en:'Update sucess',chn:'\u66F4\u65B0\u6210\u529F'},blankText:{en:'Blank text',chn:'\u7A7A\u767D\u6587\u672C'},blockquote:{en:'Block Quote',chn:'\u5F15\u7528'},bold:{en:'Bold',chn:'\u52A0\u7C97\u6587\u5B57'},code:{en:'Code',chn:'\u63D2\u5165\u4EE3\u7801'},color:{en:'Text Color',chn:'\u6587\u5B57\u989C\u8272'},coloredText:{en:'Colored Text',chn:'\u5F69\u8272\u6587\u5B57'},hr:{en:'Horizontal Line',chn:'\u5206\u9694\u7EBF'}},t(o,'image',{en:'Insert Image',chn:'\u63D2\u5165\u56FE\u7247'}),t(o,'externalImage',{en:'External Image',chn:'\u5916\u94FE\u56FE\u7247'}),t(o,'uploadImage',{en:'Upload Image',chn:'\u4E0A\u4F20\u56FE\u7247'}),t(o,'uploadFailed',{en:'Upload failed',chn:'\u4E0A\u4F20\u5931\u8D25\u4E86'}),t(o,'uploadError',{en:'Error occurs during upload',chn:'\u4E0A\u4F20\u51FA\u9519\u4E86'}),t(o,'imageUrl',{en:'Url',chn:'\u56FE\u7247\u5730\u5740'}),t(o,'imageSize',{en:'Size',chn:'\u56FE\u7247\u5C3A\u5BF8'}),t(o,'imageAlt',{en:'Alt',chn:'\u56FE\u7247\u63CF\u8FF0'}),t(o,'restoreImageSize',{en:'Restore Origin Size',chn:'\u8FD8\u539F\u56FE\u7247\u5C3A\u5BF8'}),t(o,'uploading',{en:'Uploading',chn:'\u6B63\u5728\u4E0A\u4F20'}),t(o,'indent',{en:'Indent',chn:'\u5411\u53F3\u7F29\u8FDB'}),t(o,'outdent',{en:'Outdent',chn:'\u5411\u5DE6\u7F29\u8FDB'}),t(o,'italic',{en:'Italic',chn:'\u659C\u4F53\u6587\u5B57'}),t(o,'link',{en:'Insert Link',chn:'\u63D2\u5165\u94FE\u63A5'}),t(o,'linkText',{en:'Text',chn:'\u94FE\u63A5\u6587\u5B57'}),t(o,'linkUrl',{en:'Url',chn:'\u94FE\u63A5\u5730\u5740'}),t(o,'linkTarget',{en:'Target',chn:'\u6253\u5F00\u65B9\u5F0F'}),t(o,'openLinkInCurrentWindow',{en:'Open link in current window',chn:'\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00'}),t(o,'openLinkInNewWindow',{en:'Open link in new window',chn:'\u5728\u5F53\u524D\u7A97\u53E3\u4E2D\u6253\u5F00'}),t(o,'removeLink',{en:'Remove Link',chn:'\u79FB\u9664\u94FE\u63A5'}),t(o,'ol',{en:'Ordered List',chn:'\u6709\u5E8F\u5217\u8868'}),t(o,'ul',{en:'Unordered List',chn:'\u65E0\u5E8F\u5217\u8868'}),t(o,'strikethrough',{en:'Strikethrough',chn:'\u5220\u9664\u7EBF\u6587\u5B57'}),t(o,'table',{en:'Table',chn:'\u8868\u683C'}),t(o,'deleteRow',{en:'Delete Row',chn:'\u5220\u9664\u884C'}),t(o,'insertRowAbove',{en:'Insert Row Above',chn:'\u5728\u4E0A\u9762\u63D2\u5165\u884C'}),t(o,'insertRowBelow',{en:'Insert Row Below',chn:'\u5728\u4E0B\u9762\u63D2\u5165\u884C'}),t(o,'deleteColumn',{en:'Delete Column',chn:'\u5220\u9664\u5217'}),t(o,'insertColumnLeft',{en:'Insert Column Left',chn:'\u5728\u5DE6\u8FB9\u63D2\u5165\u5217'}),t(o,'insertColumnRight',{en:'Insert Column Right',chn:'\u5728\u53F3\u8FB9\u63D2\u5165\u5217'}),t(o,'deleteTable',{en:'Delete Table',chn:'\u5220\u9664\u8868\u683C'}),t(o,'title',{en:'Title',chn:'\u6807\u9898'}),t(o,'normalText',{en:'Text',chn:'\u666E\u901A\u6587\u672C'}),t(o,'underline',{en:'Underline',chn:'\u4E0B\u5212\u7EBF\u6587\u5B57'}),t(o,'alignment',{en:'Alignment',chn:'\u6C34\u5E73\u5BF9\u9F50'}),t(o,'alignCenter',{en:'Align Center',chn:'\u5C45\u4E2D'}),t(o,'alignLeft',{en:'Align Left',chn:'\u5C45\u5DE6'}),t(o,'alignRight',{en:'Align Right',chn:'\u5C45\u53F3'}),t(o,'selectLanguage',{en:'Select Language',chn:'\u9009\u62E9\u7A0B\u5E8F\u8BED\u8A00'}),t(o,'fontScale',{en:'Font Size',chn:'\u5B57\u4F53\u5927\u5C0F'}),t(o,'fontScaleXLarge',{en:'X Large Size',chn:'\u8D85\u5927\u5B57\u4F53'}),t(o,'fontScaleLarge',{en:'Large Size',chn:'\u5927\u53F7\u5B57\u4F53'}),t(o,'fontScaleNormal',{en:'Normal Size',chn:'\u6B63\u5E38\u5927\u5C0F'}),t(o,'fontScaleSmall',{en:'Small Size',chn:'\u5C0F\u53F7\u5B57\u4F53'}),t(o,'fontScaleXSmall',{en:'X Small Size',chn:'\u8D85\u5C0F\u5B57\u4F53'}),t(o,'savesuccess',{en:'Save successful',chn:'\u4FDD\u5B58\u6210\u529F'}),t(o,'failsuccess',{en:'Save failed',chn:'\u4FDD\u5B58\u5931\u8D25'}),t(o,'layoutmode',{en:'Layout Mode',chn:'\u5E03\u5C40\u65B9\u5F0F'}),t(o,'outequaldivid',{en:'Divided by the last layer',chn:'\u5916\u5708\u5747\u5206'}),t(o,'innerequaldivid',{en:'Divided by the first layer',chn:'\u5185\u5708\u5747\u5206'}),t(o,'givenlayer',{en:'Designate',chn:'\u6307\u5B9A\u5C42\u5747\u5206'}),t(o,'textdirection',{en:'Text Direction',chn:'\u6587\u5B57\u65B9\u5411'}),t(o,'textrotate',{en:'Rotate',chn:'\u65CB\u8F6C'}),t(o,'textoutside',{en:'Toward the outside',chn:'\u653E\u5C04'}),t(o,'upwards',{en:'Upwards',chn:'\u6B63\u5411'}),t(o,'sectorthickness',{en:'Sector thickness',chn:'\u6247\u533A\u5BBD\u5EA6'}),t(o,'thicknessrange',{en:'Range 100~300',chn:'\u8303\u56F4 100~300'}),t(o,'currentfile',{en:'Current File',chn:'\u7F16\u8F91\u4E2D'}),t(o,'uploadsuccess',{en:'Upload successful',chn:'\u4E0A\u4F20\u6210\u529F'}),t(o,'deletenodeinfo',{en:'Are you sure to delete the node and its child nodes?',chn:'\u5220\u9664\u8282\u70B9\u4F1A\u5220\u9664\u5B83\u7684\u6240\u6709\u5B50\u8282\u70B9\uFF0C\u786E\u5B9E\u8981\u5220\u9664\u5417\uFF1F'}),t(o,'exporttdp',{en:'Save as .tdp shared file',chn:'\u53E6\u5B58\u4E3A.tdp\u5171\u4EAB\u6587\u4EF6'}),t(o,'hypertype',{en:'Type',chn:'\u94FE\u63A5\u7C7B\u578B'}),t(o,'url',{en:'URL',chn:'\u7F51\u5740'}),t(o,'localfile',{en:'Local file',chn:'\u672C\u5730\u6587\u4EF6'}),t(o,'tiandipan',{en:'Tianpan or Dipan',chn:'\u5929\u5730\u76D8'}),t(o,'link',{en:'Hyperlink',chn:'\u94FE\u63A5'}),t(o,'outlineeditor',{en:'Outline Editor',chn:'\u5927\u7EB2\u7F16\u8F91'}),t(o,'modificationbuttons',{en:'Modification Buttons',chn:'\u4FEE\u6539\u6309\u94AE'}),t(o,'browsingbuttons',{en:'Browsing Buttons',chn:'\u6D4F\u89C8\u6309\u94AE'}),t(o,'show',{en:'Show',chn:'\u663E\u793A'}),t(o,'hide',{en:'Hide',chn:'\u9690\u85CF'}),t(o,'newnode',{en:'New Node',chn:'\u65B0\u8282\u70B9'}),t(o,'moveupnode',{en:'Move up',chn:'\u4E0A\u79FB\u8282\u70B9'}),t(o,'movedownnode',{en:'Move down',chn:'\u4E0B\u79FB\u8282\u70B9'}),t(o,'removenode',{en:'Remove',chn:'\u5220\u9664\u8282\u70B9'}),t(o,'editnode',{en:'Edit Node',chn:'\u7F16\u8F91\u8282\u70B9'}),t(o,'prevnode',{en:'Select Previous',chn:'\u4E0A\u4E00\u4E2A\u8282\u70B9'}),t(o,'nextnode',{en:'Select Next',chn:'\u4E0B\u4E00\u4E2A\u8282\u70B9'}),t(o,'expandnode',{en:'Expand',chn:'\u5C55\u5F00\u8282\u70B9'}),t(o,'collapsenode',{en:'Collapse',chn:'\u6298\u53E0\u8282\u70B9'}),t(o,'expandall',{en:'Expand All',chn:'\u5168\u90E8\u5C55\u5F00'}),t(o,'collapseall',{en:'Collapse All',chn:'\u5168\u90E8\u6298\u53E0'}),t(o,'preview',{en:'Preview',chn:'\u9884\u89C8'}),t(o,'cancel',{en:'Cancel',chn:'\u53D6\u6D88'}),t(o,'apply',{en:'Apply',chn:'\u5E94\u7528'}),t(o,'openpreviewimg',{en:'Preview image is loading',chn:'\u6B63\u5728\u6253\u5F00\u9884\u89C8\u56FE\u7247'}),t(o,'tempnodetips',{en:'This is a temp node',chn:'\u8FD9\u662F\u4E34\u65F6\u8282\u70B9'}),t(o,'buildtdp',{en:'Build .tdp shared file',chn:'\u751F\u6210.tdp\u6587\u4EF6\u4E0B\u8F7D'}),t(o,'deleteconfirm',{en:'Are you sure to clear all the nodes?',chn:'\u786E\u5B9A\u8981\u6E05\u7A7A\u8282\u70B9\uFF1F'}),t(o,'selecttargertnode',{en:'Select Target Node',cn:'\u8BF7\u9009\u62E9\u76EE\u6807\u8282\u70B9'}),t(o,'link2web',{en:'Link to Webpage',cn:'\u94FE\u63A5\u7F51\u9875'}),t(o,'link2node',{en:'Link to Node',cn:'\u94FE\u63A5\u8282\u70B9'}),t(o,'removelink',{en:'Remove Link',cn:'\u79FB\u9664\u8282\u70B9'}),t(o,'addtemp',{en:'Add Template',cn:'\u6DFB\u52A0\u6A21\u677F'}),t(o,'buildtdp',{en:'Build .tdp shared file',chn:'\u751F\u6210.tdp\u6587\u4EF6\u4E0B\u8F7D'}),t(o,'deleteconfirm',{en:'Are you sure to clear all the nodes?',chn:'\u786E\u5B9A\u8981\u6E05\u7A7A\u8282\u70B9\uFF1F'}),t(o,'success',{en:'Success',chn:'\u6210\u529F'}),t(o,'warning',{en:'Warning',chn:'\u8B66\u544A'}),t(o,'error',{en:'Failed',chn:'\u5931\u8D25'}),t(o,'unsupportfile',{en:'Unsupported File!',cn:'\u4E0D\u652F\u6301\u8BE5\u5BFC\u5165\u6587\u4EF6'}),o),o;e.exports={trans:function(e){return a[e]?a[e][localStorage.getItem('language')]?a[e][localStorage.getItem('language')]:a[e].chn:e}}},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var i={};void 0,i.tianpan=a(4),i.dipan=a(31),i.jin=a(32),i.huo=a(33),i.shui=a(34),i.yunpan=a(35),i.wheel=a(36),i.dspiral=a(37),void 0;var r=function e(t,a){o(this,e);try{if(a.model){var r=go.Model.fromJson(a.model);r&&r.modelData&&r.modelData.type&&(a.type=r.modelData.type)}}catch(t){}var d=i[a.type];return new d(t,a)};r.go=go,r.version='0.0.33',void 0,window.localStorage.setItem('HARDCORE_VERSION',r.version),'undefined'!=typeof window&&(window.Trtd=r),e.exports=r},function(e){'use strict';function t(){go.Layout.call(this),this._radius=NaN,this._spacing=10,this._clockwise=!0,this._pointlist=[]}function a(e,t){var a=_Mathcos(t),o=_Mathsin(t);return new go.Point(e*(a+t*o),e*(o-t*a))}function o(e,t){for(var a=!1,o=t.iterator;o.next();)if(_Mathsqrt(e.point.distanceSquaredPoint(o.value.point))<e.radius+o.value.radius){a=!0;break}return a}var i=go.GraphObject.make,r=!1,d='sparse';go.Diagram.inherit(t,go.Layout),t.prototype.cloneProtected=function(e){go.Layout.prototype.cloneProtected.call(this,e),e._radius=this._radius,e._spacing=this._spacing,e._clockwise=this._clockwise},t.prototype.doLayout=function(e){var t=Math.atan;null===this.network&&(this.network=this.makeNetwork(e));for(var l=null,s=!1,c=this.network.vertexes.iterator,g=[],m;c.next();)m=c.value,s?0===m.sourceEdges.count&&g.push(m):(null===l&&(l=m),0===m.sourceEdges.count&&(l=m,s=!0));if(null===l)return void(this.network=null);var p=this.clockwise?1:-1,u=2.5,h=!(null!=window.localStorage.getItem('isautolayout'))||'true'==window.localStorage.getItem('isautolayout'),k=!0,f=0,T=5,b=new go.List,S=150,v,w,P,x,y,B,D,N,A,C,W,O,G,z,L,F;'terse'==d,S=150;var E;B=l.destinationEdges.first(),w=null===B?null:B.toVertex,l.node.rad=v;for(var M=0,R=!1;null!==w;)M++,w.node.data.isGroup&&(R=!0),W=w.destinationEdges.first(),O=null===W?null:W.toVertex,B=W,w=O;B=l.destinationEdges.first(),w=null===B?null:B.toVertex,v=1;var j;if(w){E=w.node.actualBounds.width;for(var X=l.node.actualBounds.width/2+w.node.actualBounds.width/2;j=a(v,T),j=new go.Point(j.x+l.node.location.x,j.y+l.node.location.y),!(_Mathsqrt(j.distanceSquaredPoint(l.node.location))>X+10);)v+=.1}for(var Y=0;k;){f++,u=T,B=l.destinationEdges.first(),l.node.data.angle=0,null!==B&&null!==B.link&&(B.link.curviness=p*v);null==B?20:B.link.curviness;w=null===B?null:B.toVertex,D=l,A=0;var H;for(P=0,x=0,w&&(w.node.data.angle=u),b.clear(),b.add({point:l.node.location,radius:l.node.actualBounds.width/2}),F=_Mathsqrt(a(v,5*_MathPI/2).distanceSquaredPoint(a(v,5*_MathPI/2-.7)));null!==w;){A++,l.node.data.rad=v,N=.4,H=u;for(var K=0;20>=K;K++){if(z=a(v,u),z=new go.Point(z.x+l.node.location.x,z.y+l.node.location.y),P=z.x,x=z.y,w.node instanceof go.Group&&B.link.toNode!==w.node){var i=B.link.toNode.location.copy().subtract(w.node.location);z.x-=i.x,z.y-=i.y}if(E=w.node.actualBounds.width/2,G={point:z,radius:E},y=o(G,b),y){if(Y++,u>=D.node.data.angle+_MathPI/2){u=D.node.data.angle+_MathPI/2;break}u=D.node.data.angle+(K+1)*_MathPI/16,C=p*t((w.node.actualBounds.width/2+D.node.actualBounds.width/2+S)/_Mathsqrt(w.node.location.distanceSquaredPoint(l.node.location))),u<=D.node.data.angle+C&&(u=D.node.data.angle+C)}else break}if(y){v+=1;break}W=w.destinationEdges.first(),O=null===W?null:W.toVertex,w.centerX=z.x,w.centerY=z.y,w.node.data.angle=u,B.link.data.unautoLink=!1,B.link.rad=v,B.link.angle1=D.node.data.angle,B.link.angle2=w.node.data.angle;var I=!1;6>=M?1.3*M<3*_MathPI/2&&!R?u+=_Mathmin(3*_MathPI/2/M,_MathPI/2):w.node.data.isGroup?I=!0:u+=1.3:I=!0,I&&(null==O?(L=F,C=p*t((L+S)/_Mathsqrt(z.distanceSquaredPoint(l.node.location)))):(L=_Mathmax(F,w.node.actualBounds.width/2+O.node.actualBounds.width/2),C=p*t((L+S)/_Mathsqrt(z.distanceSquaredPoint(l.node.location)))),u+=C),E=w.node.actualBounds.width,b.add(G),B=W,D=w,w=O}null==w&&(k=!1)}this.updateParts(),this.network=null,r},t.prototype.commitLayout=function(){this.network.vertexes.each(function(e){e.commit()}),this.network.edges.each(function(e){e.commit()}),r},t.prototype.diameter=function(e){if(!e)return 0;var t=e.bounds;return _Mathsqrt(t.width*t.width/4+t.height*t.height/4)},Object.defineProperty(t.prototype,'radius',{get:function(){return this._radius},set:function(e){if('number'!=typeof e)throw new Error('new value for SpiralLayout.radius must be a number, not: '+e);this._radius!==e&&(this._radius=e,this.invalidateLayout())}}),Object.defineProperty(t.prototype,'spacing',{get:function(){return this._spacing},set:function(e){if('number'!=typeof e)throw new Error('new value for SpiralLayout.spacing must be a number, not: '+e);this._spacing!==e&&(this._spacing=e,this.invalidateLayout())}}),Object.defineProperty(t.prototype,'clockwise',{get:function(){return this._clockwise},set:function(e){if('boolean'!=typeof e)throw new Error('new value for SpiralLayout.clockwise must be a boolean, not: '+e);this._clockwise!==e&&(this._clockwise=e,this.invalidateLayout())}}),e.exports=t},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'makeGeo',value:function(e,t,a){var o=e.radiusX,i=void 0===o?150:o,r=e.radiusY,d=void 0===r?100:r;i=t.part.findObject('main').width/2,d=t.part.findObject('main').height/2;var l=new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.SvgArc,2*i,0,i,d,0,1,a.clockwiseFlag?1:0)));return l.defaultStretch=go.GraphObject.Fill,l}},{key:'makeGeoWave',value:function(e,t,a){var o=e.radiusX,i=void 0===o?150:o,r=e.radiusY,d=void 0===r?100:r;i=t.part.findObject('main').width/2,d=t.part.findObject('main').height/2;var l=new go.PathSegment(go.PathSegment.QuadraticBezier,2*i,0,i,d*(a.clockwiseFlag?-1:1));'waveTail'==e.role&&(l=new go.PathSegment(go.PathSegment.QuadraticBezier,i,d*(a.clockwiseFlag?-1:1),i/2,d*(a.clockwiseFlag?-1:1)));var s=new go.Geometry().add(new go.PathFigure(0,0).add(l));return s.defaultStretch=go.GraphObject.None,s}},{key:'getShiHalfEllipseShape',value:function(){var e=this;return l(go.Shape,{name:'XU',strokeWidth:2,stroke:'#cb1c27',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.Uniform,alignment:go.Spot.Bottom,alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=0;return 0==t.order%2&&(o=1),t.flip,'Ellipse'==t.oliveType?e.makeGeo(t,a,{clockwiseFlag:o}):e.makeGeoWave(t,a,{clockwiseFlag:o})}),new go.Binding('stroke','shiStroke').makeTwoWay(),new go.Binding('strokeWidth','shiStrokeWidth').makeTwoWay(),new go.Binding('strokeDashArray','shiStrokeDashArray',function(e){return JSON.parse(e)}).makeTwoWay(function(e){return JSON.stringify(e)}),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getXuHalfEllipseShape',value:function(){var e=this;return l(go.Shape,{name:'SHI',strokeWidth:2,stroke:'#0e399d',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.Uniform,alignment:go.Spot.Bottom,strokeDashArray:[10,5],alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=1;return 0==t.order%2&&(o=0),'Ellipse'==t.oliveType?e.makeGeo(t,a,{clockwiseFlag:o}):e.makeGeoWave(t,a,{clockwiseFlag:o})}),new go.Binding('stroke','xuStroke').makeTwoWay(),new go.Binding('strokeWidth','xuStrokeWidth').makeTwoWay(),new go.Binding('strokeDashArray','xuStrokeDashArray',function(e){return JSON.parse(e)}).makeTwoWay(function(e){return JSON.stringify(e)}),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getTailShiShape',value:function(){var e=this;return l(go.Shape,{name:'XU',strokeWidth:2,stroke:'#cb1c27',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.None,alignment:go.Spot.Bottom,alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=0;return 0==t.order%2&&(o=1),t.flip,e.makeGeoWave(t,a,{clockwiseFlag:!o})}),new go.Binding('stroke','shiStroke').makeTwoWay(),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getTailXuShape',value:function(){var e=this;return l(go.Shape,{name:'TailXu',strokeWidth:2,stroke:'#0e399d',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.None,alignment:go.Spot.Bottom,strokeDashArray:[10,5],alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=1;return 0==t.order%2&&(o=0),e.makeGeoWave(t,a,{clockwiseFlag:!o})}),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getTextBuild',value:function(){return l(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.4),font:'18px \'Microsoft YaHei\'',editable:!1,angle:0,stroke:'black',isMultiline:!0,textEdited:function(e,t,a){var o=e.part.diagram.model.findNodeDataForKey(e.part.data.centerText);o&&(e.part.diagram.model.startTransaction('text'),e.part.diagram.model.setDataProperty(o,'text',a),e.part.diagram.model.commitTransaction('text')),setTimeout(function(){if(e.text&&!(e.text&&''==e.text.trim())&&0!=e.lineCount%2){if('\n'==a[a.length-1])return void(e.text=a.substring(0,a.length-1));e.text=a+'\n'}},100);e.part.containingGroup.layout.isValidLayout=!1},overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Uniform},new go.Binding('visible','textVisible').makeTwoWay(),new go.Binding('alignment','',function(){return new go.Spot(.5,.5)}),new go.Binding('textAlign','textAlign',function(e){return e}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e-30}).ofObject('main'),new go.Binding('text','text',function(e,t){return e}).makeTwoWay(function(e,t){return e}),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay())}},{key:'getNodeSelectionAdornmentTemplate',value:function(){return l(go.Adornment,'Spot',{},l(go.Panel,'Auto',l(go.Shape,{isPanelMain:!0,fill:null,stroke:'dodgerblue',strokeWidth:3}),l(go.Placeholder)),l('CircleButton',{name:'AddChild',toolTip:l(go.Adornment,'Auto',l(go.Shape,{fill:'#FFFFCC'}),l(go.TextBlock,{textAlign:'center',margin:new go.Margin(8,4,4,4)},new go.Binding('text','',function(){return'\u589E\u52A0\u6A44\u6984'}))),alignment:go.Spot.Right,alignmentFocus:go.Spot.Left,width:50,height:50,click:function(t){t.diagram.__trtd.addOlive()}},l(go.Shape,'PlusLine',{stroke:'#770077',desiredSize:new go.Size(25,25)})),l('CircleButton',{name:'RemoveChild',toolTip:l(go.Adornment,'Auto',l(go.Shape,{fill:'#FFFFCC'}),l(go.TextBlock,{textAlign:'center',margin:new go.Margin(8,4,4,4)},new go.Binding('text','',function(){return'\u5220\u9664\u6A44\u6984'}))),alignment:go.Spot.Left,alignmentFocus:go.Spot.Right,width:50,height:50,click:function(t){t.diagram.__trtd.deleteSelection()}},l(go.Shape,'MinusLine',{stroke:'#770077',desiredSize:new go.Size(25,25)})),l('Button',{name:'AddLevel',toolTip:l(go.Adornment,'Auto',l(go.Shape,{fill:'#FFFFCC'}),l(go.TextBlock,{textAlign:'center',margin:new go.Margin(8,4,4,4)},new go.Binding('text','',function(){return'\u589E\u52A0\u540C\u7EA7\u8282\u70B9'}))),alignment:new go.Spot(1,.5,15,0),width:30,height:30,click:function(t){t.diagram.__trtd.addOlive()}},l(go.Shape,'PlusLine',{stroke:'#227700',desiredSize:new go.Size(15,15)}),new go.Binding('visible','level',function(e){return 0!=e})))}},{key:'nodeResizeAdornmentTemplate',value:function(){return l(go.Adornment,'Spot',l(go.Placeholder),l(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'getNodeTemplate',value:function(){var e=this.diagram,t=this;return l(go.Node,'Spot',{__trtdNode:t,layerName:'overflow',zOrder:5,movable:!0,resizable:!1,resizeObjectName:'main',selectionObjectName:'main',rotatable:!1,toolTip:t.getTooTip(),resizeAdornmentTemplate:t.nodeResizeAdornmentTemplate(),layoutConditions:~go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,locationSpot:go.Spot.LeftCenter,click:function(t,e){if(e.containingGroup)for(var a=e.containingGroup.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&('xuText'==o.data.role||'shiText'==o.data.role)&&(o.data.order==e.data.order?(''==o.data.text||''==o.data.text.trim())&&(o.findObject('textBorder').visible=!0):o.findObject('textBorder').visible=!1)},mouseOver:function(t,e){if(e.containingGroup){var a=e.diagram.findNodeForKey(e.data.shiText);a&&(a.findObject('textBorder').visible=!0);var o=e.diagram.findNodeForKey(e.data.xuText);o&&(o.findObject('textBorder').visible=!0);var i=e.diagram.findNodeForKey(e.data.centerText);i&&(i.layerName='Background')}},contextMenu:l(go.Adornment),mouseDragEnter:function(t,e){var a=e.part,o=t.diagram.selection.first();if('wave'==o.data.category||'picGroup'==o.data.category&&'cbian'==o.data.role){var i=a.diagram.findNodeForKey(a.data.centerText);i&&(i.layerName='Background');var r=a.findObject('main');r&&(r._prevFill=r.fill,r.fill='RGBA(146,208,80,0.5)')}},mouseDragLeave:function(t,e){var a=e.part,o=a.findObject('main');o&&o._prevFill&&(o.fill=o._prevFill);var i=a.diagram.findNodeForKey(a.data.centerText);i&&!c.checkPhone()&&(i.layerName='Foreground')},mouseDrop:function(t,e){var a=e.part,o=t.diagram.selection.first();if(o){if('picGroup'==o.data.category&&'cbian'==o.data.role){for(var i=o.findSubGraphParts().iterator,r=[],d={},l;i.next();)l=i.value,'autoText'==l.data.category&&('0 0 0 0'==l.data.locationSpot&&(d.shiText=l.data.text),'0 0.5 0 0'==l.data.locationSpot&&(d.centerText=l.data.text),'0 1 0 0'==l.data.locationSpot&&(d.xuText=l.data.text)),r.push(l.data);t.diagram.startTransaction('mouseDrop'),t.diagram.model.removeNodeDataCollection(r);JSON.parse(JSON.stringify(o.data));return t.diagram.model.removeNodeData(o.data),t.diagram.__trtd.addOlive(a,d),void t.diagram.commitTransaction('mouseDrop')}if('wave'==o.data.category&&a&&o.data.group==e.data.group){t.diagram.startTransaction('mouseDrop'),o.__oldOrder=o.data.order,t.diagram.model.setDataProperty(o.data,'order',a.data.order+.5);var s=t.diagram.findNodeForKey(o.data.xuText),c=t.diagram.findNodeForKey(o.data.shiText);return t.diagram.model.setDataProperty(c,'order',a.data.order+.5),t.diagram.model.setDataProperty(s,'order',a.data.order+.5),void t.diagram.commitTransaction('mouseDrop')}}},mouseLeave:function(t,e){if(e.containingGroup){for(var a=e.containingGroup.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1);try{var i=t.diagram.findNodeForKey(e.data.centerText);i&&(i.layerName='Foreground')}catch(t){}}},selectionAdornmentTemplate:this.getNodeSelectionAdornmentTemplate(),doubleClick:function(t,e){if(e&&e.containingGroup){if('horizontal'==e.containingGroup.data.textAngle&&'independent'==e.containingGroup.data.centerTextAngle){e.findObject('TEXT').visible=!0;var a=e.diagram.findNodeForKey(e.data.centerText);a&&(a.visible=!1)}setTimeout(function(){t.diagram.__trtd.selectText(t,e)},100)}}},this.binding,l(go.Shape,'Rectangle',{name:'main',fill:'rgba(0,0,0,0)',stroke:null,width:300,height:150},new go.Binding('areaBackground','isHighlighted',function(e,t){return e?'RGBA(146,208,80,0.5)':null;var a=t.part.data.color}).ofObject(),new go.Binding('fill','fill').makeTwoWay(),new go.Binding('desiredSize','desiredSize',function(e){return go.Size.parse(e)}).makeTwoWay(function(e){return go.Size.stringify(e)})),this.getShiHalfEllipseShape(),this.getXuHalfEllipseShape(),this.getTextBuild(),l(go.Shape,{geometryString:'M540.5696 556.81024a81.8176 81.8176 0 0 1-53.0432-19.47648l-225.4848-191.52896a81.92 81.92 0 1 1 106.0864-124.86656l172.4416 146.47296 172.4416-146.47296a81.92 81.92 0 0 1 106.0864 124.86656l-225.4848 191.52896a81.7152 81.7152 0 0 1-53.0432 19.47648z m53.06368 246.23104l225.44384-191.52896a81.92 81.92 0 1 0-106.0864-124.84608l-172.40064 146.47296-172.48256-146.47296a81.92 81.92 0 1 0-106.04544 124.86656l225.52576 191.52896a81.7152 81.7152 0 0 0 53.00224 19.47648c18.88256 0 37.76512-6.49216 53.0432-19.49696z',visible:!1,name:'figure',cursor:'pointer',alignment:go.Spot.TopRight,alignmentFocus:go.Spot.TopRight,width:14,height:14,fill:'green',toolTip:l('ToolTip',l(go.Panel,'Vertical',l(go.Picture,new go.Binding('source','src',function(e){return'images/'+e+'.png'})),l(go.TextBlock,{text:'\u8FDB\u5165\u5B50\u76D8',margin:3}))),click:function(t){var e=t.targetObject.part;t.diagram.__trtd.openFigure({figure:e.data.figure,title:e.data.text,key:e.data.key,node:e})}},new go.Binding('visible','figure',function(e){return!!e})))}}]),t}(s);e.exports=g},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=a(9),m=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'nodeResizeAdornmentTemplate',value:function(){return l(go.Adornment,'Spot',l(go.Placeholder),l(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'getNodeTemplate',value:function(){var e=this;return l(go.Group,'Spot',{selectionObjectName:'PH',layerName:'default',locationObjectName:'PH',resizeObjectName:'PH',resizable:!0,locationSpot:go.Spot.LeftCenter,alignment:go.Spot.Left,alignmentFocus:go.Spot.Left,click:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1)},selectionAdornmentTemplate:this.getNodeSelectionAdornmentTemplate(),resizeAdornmentTemplate:e.nodeResizeAdornmentTemplate(),mouseOver:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&('xuText'==e.data.role||'shiText'==e.data.role)&&(''==o.data.text||''==o.data.text.trim())&&(o.findObject('textBorder').visible=!0)},mouseLeave:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1)},rotatable:!0,contextMenu:l(go.Adornment),layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,layout:new g},new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),l(go.Shape,{name:'PH',figure:'Rectangle',alignment:new go.Spot(0,.5),stroke:'#9aa8b6',strokeWidth:0,minSize:new go.Size(300,70),maxSize:new go.Size(NaN,400),fill:'rgba(88,0,0,0)'},new go.Binding('desiredSize','desiredSize',function(e){return go.Size.parse(e)}).makeTwoWay(go.Size.stringify)),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify))}}]),t}(s);e.exports=m},function(e,t,a){'use strict';'use script';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=a(18),m=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'addFreeText',value:function(t,e){var a={text:'\u81EA\u7531\u6587\u672C',deletable:!0,role:'freeText',fill:'black',iconVisible:!1,locationSpot:'0.5 0.5 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(t.documentPoint),movable:!0,group:e.data.key};this.diagram.startTransaction('addFreeText'),this.diagram.model.addNodeData(a),this.diagram.commitTransaction('addFreeText')}},{key:'getNodeTemplate',value:function(){var t=this;return l(go.Group,'Auto',{selectionObjectName:'PH',layerName:'Background',locationObjectName:'PH',locationSpot:go.Spot.BottomLeft,rotatable:!1,alignment:go.Spot.Left,alignmentFocus:go.Spot.Left,click:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1)},doubleClick:function(a,e){t.addFreeText(a,e)},mouseOver:function(t,e){},contextMenu:l(go.Adornment),mouseLeave:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next()&&(o=a.value,'labelGroup'!=o.data.role););},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,layout:new g},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('copyable','copyable').makeTwoWay(),l(go.Shape,{name:'PH',figure:'Rectangle',stroke:'yellow',strokeWidth:0,fill:'rgba(0,0,0,0)'}))}}]),t}(s);e.exports=m},function(e){'use strict';function t(){go.Layout.call(this)}go.Diagram.inherit(t,go.Layout),t.prototype.doLayout=function(e){var t=this.diagram;t.startTransaction('AxisGroupLayout');for(var a=this.collectParts(e).iterator,o=[],i=[],r=this.group,d=0,l=0,s=[],c=[],g,m,p,u,y,h,k,f,x,T,b,S,v,w;a.next();)w=a.value,(i.push(w.data),'wave'==w.data.category&&o.push(w),!!(w instanceof go.Node))&&('axisYText'==w.data.role&&(y=w),'axisXText'==w.data.role&&(u=w),'themeText'==w.data.role&&(h=w),'shiText'==w.data.role&&s.push(w),'xuText'==w.data.role&&c.push(w),'labelText1'==w.data.role&&(k=w),'labelText2'==w.data.role&&(f=w),'labelText3'==w.data.role&&(x=w),'labelGroup'==w.data.role&&(T=w),w.naturalBounds.width>d&&(d=w.naturalBounds.width),w.naturalBounds.height>l&&(l=w.naturalBounds.height),'line'==w.data.category&&'centerLine'==w.data.role&&(g=w),w.data.group==r.key&&('line'==w.data.category&&('axisX'==w.data.role&&(w.angle=0,m=w),'axisY'==w.data.role&&(p=w,w.angle=270),w.location=r.location.copy().offset(0,0)),'waveGroup'==w.data.category&&(b=w,S=w.data.oliveWidth,v=w.data.oliveHeight,w.location=r.location.copy().offset(0,0))));if(p&&(p.angle=270),m&&(m.angle=0),b){var P=b.resizeObject.width*_Mathcos(_Mathabs(360-b.angle%360)/180*_MathPI),B=b.resizeObject.width*_Mathsin(_Mathabs(360-b.angle%360)/180*_MathPI);this.diagram.model.setDataProperty(m.data,'desiredSize',P+' '+10),this.diagram.model.setDataProperty(p.data,'desiredSize',B+' '+10),r.width=P,r.height=B;var D=b.data.shiStroke,N=b.data.xuStroke,A=b.data.centerStroke||'#3f5369';u&&(u.location=r.location.copy().offset(P,0),u.locationSpot=go.Spot.Top),y&&(y.location=r.location.copy().offset(-10,-B),y.locationSpot=go.Spot.Right)}if(h,T){for(var C=T.findSubGraphParts().iterator,W;C.next();)W=C.value,'labelText1'==W.data.role&&(k=W),'labelText2'==W.data.role&&(f=W),'labelText3'==W.data.role&&(x=W);b&&(b.labelText1=k,b.labelText2=f,b.labelText3=x)}return D&&k&&this.diagram.model.setDataProperty(k.data,'fill',D),N&&f&&this.diagram.model.setDataProperty(f.data,'fill',N),A&&x&&this.diagram.model.setDataProperty(x.data,'fill',A),go.Layout.prototype.doLayout.call(this,e),void t.commitTransaction('AxisGroupLayout')},e.exports=t},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'makeGeo',value:function(e,t,a){var o=e.radiusX,i=void 0===o?150:o,r=e.radiusY,d=void 0===r?100:r,l=new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.SvgArc,2*i,0,i,d,0,1,a.clockwiseFlag?1:0)));return l.defaultStretch=go.GraphObject.Fill,l}},{key:'getShiHalfEllipseShape',value:function(){var e=this;return l(go.Shape,{name:'XU',stroke:'red',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.Uniform,alignment:go.Spot.Bottom,alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=0;return 0==t.order%2&&(t.flip=!0),t.flip&&(o=1),e.makeGeo(t,a,{clockwiseFlag:o})}),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getXuHalfEllipseShape',value:function(){var e=this;return l(go.Shape,{name:'SHI',stroke:'blue',fill:'rgba(0,66,0,0)',stretch:go.GraphObject.Uniform,alignment:go.Spot.Bottom,strokeDashArray:[5,5],alignmentFocus:go.Spot.Bottom},new go.Binding('geometry','',function(t,a){var o=1;return 0==t.order%2&&(t.flip=!0),t.flip&&(o=0),e.makeGeo(t,a,{clockwiseFlag:o})}),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size(e.width,e.height/2);return t}).ofObject('main'))}},{key:'getTextBuild',value:function(){return l(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.4),font:'bold 18px \u5E7C\u5706',editable:!0,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Uniform},new go.Binding('textAlign','textAlign',function(e){return-1<['start','center','end'].indexOf(e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e-30}).ofObject('main'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay())}},{key:'getNodeTemplate',value:function(){return l(go.Node,'Spot',{locationObjectName:'TEXT',movable:!0,resizable:!0,resizeObjectName:'TEXT',selectionObjectName:'TEXT',layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,locationSpot:go.Spot.LeftCenter,click:function(){},doubleClick:function(t,e){t.diagram.__trtd.selectText(t,e)},resizeAdornmentTemplate:l(go.Adornment,'Spot',l(go.Placeholder),l(go.Shape,'Circle',{alignment:go.Spot.Right,cursor:'col-resize',desiredSize:new go.Size(9,9),fill:'lightblue',stroke:'dodgerblue'}))},new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),l(go.TextBlock,{name:'TEXT',width:200,height:30,maxSize:new go.Size(NaN,70),minSize:new go.Size(NaN,70),alignment:go.Spot.Center,verticalAlignment:go.Spot.Center,isMultiline:!1,overflow:go.TextBlock.OverflowEllipsis,stretch:go.GraphObject.Fill,maxLines:5,stroke:'black',editable:!0,textAlign:'start',font:'18px \'Microsoft YaHei\''},new go.Binding('text','text').makeTwoWay(),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e})),l(go.Panel,'Vertical',{alignment:go.Spot.Left,alignmentFocus:go.Spot.Right},l(go.Shape,{name:'ICON',width:16,height:16,click:function(){},figure:'Diamond',fill:'red',strokeWidth:0,margin:3},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('figure','figure').makeTwoWay(),new go.Binding('fill','fill',function(e){return e}).makeTwoWay(),new go.Binding('height','height',function(e){return e||(e=30),2*e/3}).ofObject('label'),new go.Binding('width','height',function(e){return e||(e=30),2*e/3}).ofObject('label'))))}}]),t}(s);e.exports=g},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'dealFireText',value:function(t){function e(e,t,a){if(null==e.data.dimKey)return!1;var o=_Mathmax(_Mathabs(a.data.orderX-t.data.orderX),_Mathabs(a.data.orderY-t.data.orderY));return _Mathabs(e.data.orderX-t.data.orderX)==o||_Mathabs(e.data.orderY-t.data.orderY)==o;var i=(e.data.orderX-t.data.orderX)*(e.data.orderX-t.data.orderX)+(e.data.orderY-t.data.orderY)*(e.data.orderY-t.data.orderY),r=(a.data.orderX-t.data.orderX)*(a.data.orderX-t.data.orderX)+(a.data.orderY-t.data.orderY)*(a.data.orderY-t.data.orderY)}for(var a=t.diagram,o=a.selection.first(),i=o.containingGroup.findSubGraphParts().iterator,r,d;i.next();)d=i.value,'themeText'==d.data.subRole&&(r=d);var l=_Mathmax(o.data.orderX,o.data.orderY);for(l=_Mathabs(l-r.data.orderX),i.reset();i.next();){var d=i.value;if(!e(d,r,o));else d.findObject('TEXT')}var s=o.containingGroup,c=s.data.gridWidth;l=10;var g=new go.Rect(new go.Point(r.position.x-c*(l+1),r.position.y-c*(l+1)),new go.Size(2*(c*(l+1)),2*(c*(l+1))));a.animationManager.isEnabled=!1,a.zoomToRect(g),a.centerRect(r.actualBounds),a.animationManager.isEnabled=!0,t.diagram.__trtd.dealFireTextCallback&&t.diagram.__trtd.dealFireTextCallback(t,o)}},{key:'getNodeSelectionAdornmentTemplate',value:function(){var t=this;return l(go.Adornment,'Spot',{isActionable:!0},l(go.Panel,'Auto',l(go.Shape,'Rectangle',{isPanelMain:!0,fill:null,stroke:'dodgerblue',strokeWidth:3}),l(go.Placeholder)),l(go.Panel,'Auto',{name:'ButtonIcon1',visible:!1,alignment:new go.Spot(1,0,20,-20),width:60,height:60,isActionable:!0,toolTip:l('ToolTip',l(go.Panel,'Vertical',l(go.Picture,new go.Binding('source','src',function(e){return'images/'+e+'.png'})),l(go.TextBlock,{text:'\u78B0\u649E\u706B\u82B1',margin:3}))),cursor:'pointer',click:function(a,e){t.dealFireText(a,e)}},new go.Binding('visible','',function(t,e){return'coreText'==e.part.data.subRole}),l(go.Shape,'Circle',{fill:'rgba(1,1,1,0)',strokeWidth:0,stroke:'green',width:50,height:60}),l(go.Shape,{name:'FireButton',fill:'red',width:30,height:40,strokeWidth:2,stroke:'red'},new go.Binding('geometryString','',function(){return'M854.35904 613.09952v44.52864c-0.6656 2.16576-1.46944 4.33152-1.92 6.54336-4.55168 23.53664-7.1168 47.68768-13.9776 70.528-20.36224 67.39968-58.5216 123.57632-112.01024 169.43616-41.25184 35.39968-87.68512 60.9024-140.75904 73.45152-17.44896 4.13696-35.34336 6.57408-53.0432 9.79968h-44.51328c-2.16576-0.6656-4.3776-1.67424-6.59456-1.8176-46.99136-2.93376-91.52512-15.16544-133.2992-36.51072-78.96576-40.22272-135.93088-100.11136-161.9456-186.27072-5.53984-18.41664-7.85408-37.71392-11.69408-56.62208v-42.48064c1.67424-10.4448 3.1232-20.97664 5.0944-31.41632 8.41728-45.58848 28.67712-85.9648 55.51104-123.22816 25.30304-35.072 52.18304-69.04832 76.1856-105.0112 25.94816-39.0144 38.5024-82.31936 31.13984-129.80224-1.44896-9.37984-2.80576-18.75968-4.22912-28.08832 0.95744-0.24576 1.92-0.44032 2.87744-0.7168 57.92256 60.70784 67.3536 135.2192 59.07968 215.74144 2.11456-2.26304 3.8912-3.84 5.24288-5.66272 49.16224-66.48832 70.28224-139.93984 54.25152-222.208-10.1888-52.33664-32.22016-99.3792-68.67456-138.496-15.83104-16.93696-34.97984-30.79168-52.6336-46.08h18.21696c1.50528 0.6144 2.90816 1.67424 4.4288 1.8176 32.0512 2.75968 62.1568 12.65152 90.83904 26.56256 65.59744 31.75424 118.77376 78.69952 163.25632 135.95648 65.3824 84.26496 107.88864 177.73056 116.31104 285.35296 3.2256 41.08288-0.96256 81.01376-11.91424 120.40192-4.13696 14.91456-9.96864 29.3376-15.3088 44.8768 21.21728-9.0368 37.34016-22.84544 49.79712-40.74496 37.1456-53.48864 47.53408-113.13664 39.1168-179.08224 2.73408 3.1744 4.13696 4.4288 5.08928 6.00576 22.3744 35.34848 39.1168 73.0624 47.85664 114.04288 3.47136 16.22016 5.49376 32.8192 8.22272 49.19296m-349.952-78.42816c-0.82944 0.5888-1.7408 1.19808-2.60096 1.792-1.16224 16.24576-2.0224 32.52224-3.59936 48.768-2.31424 24.78592-8.2432 48.6912-19.84 70.91712-14.17728 27.22816-37.88288 44.16-64.1536 57.63072-28.32896 14.6176-46.17216 35.49696-48.4864 68.4544-2.41664 33.8944 7.77728 62.37696 35.10272 83.20512 25.6 19.49696 55.50592 25.85088 87.21408 24.79104 50.60608-1.64864 88.32512-25.7024 103.43424-76.35968 10.85952-36.36224 9.088-72.97024 1.82784-109.568-9.92768-50.176-28.09344-96.94208-59.1872-137.92256-8.7296-11.45344-19.7632-21.17632-29.70624-31.70816'}))))}},{key:'clearBorder',value:function(e){e.data.showBorder&&(e.findObject('textBorder').visible=!1)}},{key:'makeGeo',value:function(e,t,a){var o=e.radiusX,i=void 0===o?150:o,r=e.radiusY,d=void 0===r?100:r,l=new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.SvgArc,2*i,0,i,d,0,1,a.clockwiseFlag?1:0)));return l.defaultStretch=go.GraphObject.Fill,l}},{key:'getNodeTemplate',value:function(){var e=this,t=this.diagram;return l(go.Node,'Spot',{_controlExpand:!0,__trtdNode:e,layerName:'Foreground',zOrder:10,movable:!0,visible:!0,locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),toolTip:e.getTooTip(),resizable:!0,rotatable:!1,location:new go.Point(0,0),toMaxLinks:1,mouseDrop:function(t,e){var a=e.part,o=t.diagram.selection.first();if('picGroup'==o.data.category&&'cbian'==o.data.role&&'centerText'==a.data.role){var r=t.diagram.findNodeForKey(a.data.olive);if(!r)return;for(var d=o.findSubGraphParts().iterator,l=[],s={},c;d.next();)c=d.value,'autoText'==c.data.category&&('0 0 0 0'==c.data.locationSpot&&(s.shiText=c.data.text),'0 0.5 0 0'==c.data.locationSpot&&(s.centerText=c.data.text),'0 1 0 0'==c.data.locationSpot&&(s.xuText=c.data.text)),l.push(c.data);t.diagram.startTransaction('mouseDrop'),t.diagram.model.removeNodeDataCollection(l);JSON.parse(JSON.stringify(o.data));return t.diagram.model.removeNodeData(o.data),t.diagram.__trtd.addOlive(r,s),void t.diagram.commitTransaction('mouseDrop')}if('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole){t.diagram.model.startTransaction('coreTextExchange');var g=o.data.orderX,m=o.data.orderY,p=o.data.dimKey;t.diagram.model.setDataProperty(o.data,'orderX',a.data.orderX),t.diagram.model.setDataProperty(o.data,'orderY',a.data.orderY),t.diagram.model.setDataProperty(o.data,'dimKey',a.data.dimKey),t.diagram.model.setDataProperty(a.data,'orderX',g),t.diagram.model.setDataProperty(a.data,'orderY',m),t.diagram.model.setDataProperty(a.data,'dimKey',p),t.diagram.model.commitTransaction('coreTextExchange')}if('dimText'==o.data.subRole&&'dimText'==a.data.subRole&&o.data.category==a.data.category){if(o.data.group!=a.data.group)return;if(!o.containingGroup)return;if('yunpanGroup'!=o.containingGroup.data.category)return;if(o.data.dimX!=a.data.dimX&&o.data.dimY!=a.data.dimY)return;t.diagram.model.startTransaction('dimTextExchange');var g=o.data.dimX,m=o.data.dimY,d=a.containingGroup.findSubGraphParts().iterator,u=[],y=[],h=[],k=[],f='X';0==o.data.dimX&&(f='Y');for(var x=o.data['dim'+f],T=a.data['dim'+f],c;d.next();)c=d.value,'yunpanText'==c.data.subRole&&(c.data['order'+f]==T&&h.push(c),c.data['order'+f]==x&&k.push(c));for(var b=0,i,S;b<h.length;b++)t.diagram.model.setDataProperty(h[b].data,'order'+f,x);for(var b=0;b<k.length;b++)t.diagram.model.setDataProperty(k[b].data,'order'+f,T);return t.diagram.model.setDataProperty(o.data,'dim'+f,T),t.diagram.model.setDataProperty(a.data,'dim'+f,x),void t.diagram.model.commitTransaction('dimTextExchange')}if('dimText'==o.data.subRole&&'dimText'==a.data.subRole){t.diagram.model.startTransaction('dimTextExchange');var g=o.data.dimX,m=o.data.dimY,d=a.containingGroup.findSubGraphParts().iterator,u=[],y=[],h=[],k=[],f='X';for(0==o.data.dimX&&(f='Y');d.next();){var c=d.value;c.data.dimKey==a.data.key&&u.push(c),c.data.dimKey==o.data.key&&y.push(c),'yunpanText'==c.data.subRole&&(c.data['order'+f]==a.data['order'+f]&&h.push(c),c.data['order'+f]==o.data['order'+f]&&k.push(c))}var v=(a.containingGroup.__yunPointsX.length+1)/2,w=(a.containingGroup.__yunPointsY.length+1)/2;o.data.dimX>v&&y.sort(function(e,t){return e.data.orderX-t.data.orderX}),o.data.dimX==v&&(o.data.dimY>w?y.sort(function(e,t){return e.data.orderY-t.data.orderY}):y.sort(function(e,t){return t.data.orderY-e.data.orderY})),o.data.dimX<v&&y.sort(function(e,t){return t.data.orderX-e.data.orderX}),a.data.dimX>v&&u.sort(function(e,t){return e.data.orderX-t.data.orderX}),a.data.dimX==v&&(a.data.dimY>w?u.sort(function(e,t){return e.data.orderY-t.data.orderY}):u.sort(function(e,t){return t.data.orderY-e.data.orderY})),a.data.dimX<v&&u.sort(function(e,t){return t.data.orderX-e.data.orderX});for(var b=0,i,S;b<y.length;b++)i=y[b].data.orderX,S=y[b].data.orderY,t.diagram.model.setDataProperty(y[b].data,'orderX',u[b].data.orderX),t.diagram.model.setDataProperty(y[b].data,'orderY',u[b].data.orderY),t.diagram.model.setDataProperty(u[b].data,'orderX',i),t.diagram.model.setDataProperty(u[b].data,'orderY',S);t.diagram.model.setDataProperty(o.data,'dimX',a.data.dimX),t.diagram.model.setDataProperty(o.data,'dimY',a.data.dimY),t.diagram.model.setDataProperty(a.data,'dimX',g),t.diagram.model.setDataProperty(a.data,'dimY',m),t.diagram.model.commitTransaction('dimTextExchange')}if('wave'==o.data.category&&'centerText'==a.data.role&&a&&o.data.group==e.data.group){t.diagram.startTransaction('mouseDrop'),o.__oldOrder=o.data.order,t.diagram.model.setDataProperty(o.data,'order',a.data.order+.5);var P=t.diagram.model.findNodeDataForKey(o.data.xuText),B=t.diagram.model.findNodeDataForKey(o.data.shiText);t.diagram.model.setDataProperty(B,'order',a.data.order+.5),t.diagram.model.setDataProperty(P,'order',a.data.order+.5),t.diagram.commitTransaction('mouseDrop')}},mouseDragEnter:function(t,e){var a=e.part,o=t.diagram.selection.first();o&&(('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole)&&(o.areaBackground=null,a.areaBackground='RGB(107,208,137)'),'dimText'==o.data.subRole&&'dimText'==a.data.subRole&&(o.areaBackground=null,a.areaBackground='RGB(107,208,137)'),'centerText'==a.data.role&&(a.layerName='Background'))},mouseDragLeave:function(t,e){var a=e.part,o=t.diagram.selection.first();('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole)&&(a.areaBackground=null),'dimText'==o.data.subRole&&'dimText'==a.data.subRole&&(a.areaBackground=null),'centerText'==a.data.role&&(a.layerName='Foreground')},selectionChanged:function(e){if('autoText'==e.data.category&&null!=e.data.orderX&&null!=e.data.orderY&&'freeText'==e.data.role&&('coreText'==e.data.subRole||'yunpanText'==e.data.subRole)&&e.containingGroup&&('yunGroup'==e.containingGroup.data.category||'yunpanGroup'==e.containingGroup.data.category)&&'line'==e.containingGroup.data.beginSpark&&e.containingGroup.__yunPointsX&&e.containingGroup.__yunPointsY){var t=(e.containingGroup.__yunPointsX.length+1)/2,a=(e.containingGroup.__yunPointsY.length+1)/2;if(e.data.orderX==t&&e.data.orderY==a)return;var o=e.data.orderX,i=e.data.orderY;o==t&&(o=i),i==a&&(i=o);var r=e.containingGroup.data.shapeStrokes,d=e.containingGroup.data.showShape;if(e.isSelected){if('between'==e.containingGroup.data.snapType)var l=_Mathmax(_Mathabs(e.data.orderX-t),_Mathabs(e.data.orderY-a))+1;else var l=_Mathmax(_Mathabs(e.data.orderX-t),_Mathabs(e.data.orderY-a));for(var s=e.containingGroup.findSubGraphParts().iterator,g=null,m;s.next();)if(m=s.value,'autoText'==m.data.category&&null!=m.data.orderX&&null!=m.data.orderY&&'freeText'==m.data.role&&(m.findObject('textBorder').visible=!1,(_Mathabs(m.data.orderX-t)==_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)<=_Mathabs(i-a)||_Mathabs(m.data.orderX-t)<=_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)==_Mathabs(i-a))&&(m.areaBackground='white',m.zOrder=999)),'shape'==m.data.category&&'background'==m.data.role){var p=m.findObject('SHAPE');m.data.gridWidth==2*l?(g=p,!p.__prestroke&&(p.__prestroke=p.stroke,p.stroke='rgba(255,0,0,0.5)')):p.__prestroke&&(p.stroke=p.__prestroke,delete p.__prestroke)}if(!g){if('between'==e.containingGroup.data.snapType)var u=2*l;else var u=2*l;e.diagram.model.startTransaction('addShape');var y={deletable:!0,role:'background',category:'shape',loc:go.Point.stringify(new go.Point(e.containingGroup.__yunPointsX[t-1],e.containingGroup.__yunPointsY[a-1])),movable:!0,group:-19,key:c.guid(),orderX:10,orderY:10,gridWidth:u,stroke:r[l-1],visible:!0,strokeDashArray:'[0,0]',strokeWidth:3};e.diagram.model.addNodeData(y),e.diagram.model.commitTransaction('addShape'),setTimeout(function(){var t=e.diagram.findNodeForKey(y.key);if(t){var a=t.findObject('SHAPE');a.__prestroke||(a.__prestroke=a.stroke,a.stroke='rgba(255,0,0,0.5)')}},100)}}else for(var s=e.containingGroup.findSubGraphParts().iterator,m;s.next();)if(m=s.value,m.opacity=1,'autoText'==m.data.category&&null!=m.data.orderX&&null!=m.data.orderY&&'freeText'==m.data.role&&(_Mathabs(m.data.orderX-t)==_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)<=_Mathabs(i-a)||_Mathabs(m.data.orderX-t)<=_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)==_Mathabs(i-a))&&(m.areaBackground=null,m.zOrder=NaN),'shape'==m.data.category&&'background'==m.data.role){var p=m.findObject('SHAPE');d||(p.stroke='rgba(255,0,0,0)'),m.data.gridWidth==2*l?!p.__prestroke&&(p.__prestroke=p.stroke,p.stroke='rgba(255,0,0,0.7)'):p.__prestroke&&(p.stroke=p.__prestroke,delete p.__prestroke)}}},click:function(){},mouseOver:function(t,e){''==e.data.text&&(e.findObject('textBorder').visible=!0),e.data.showBorder&&''==e.data.text&&('xuText'==e.data.role||'shiText'==e.data.role)&&(e.findObject('textBorder').visible=!0),'centerText'==e.data.role&&(e.layerName='Background')},mouseLeave:function(t,e){e.findObject('textBorder').visible=!1,'centerText'==e.data.role&&(e.layerName='Foreground')},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&~go.Part.LayoutNodeSized,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,contextMenu:l(go.Adornment),resizeAdornmentTemplate:l(go.Adornment,'Spot',l(go.Placeholder),l(go.Shape,'Circle',{alignment:go.Spot.Left,cursor:'col-resize',desiredSize:new go.Size(9,9),fill:'lightblue',stroke:'dodgerblue'}),l(go.Shape,'Circle',{alignment:go.Spot.Right,cursor:'col-resize',desiredSize:new go.Size(9,9),fill:'lightblue',stroke:'dodgerblue'}),l(go.Shape,'Circle',{alignment:go.Spot.Top,cursor:'col-resize',desiredSize:new go.Size(9,9),fill:'lightblue',stroke:'dodgerblue'}),l(go.Shape,'Circle',{alignment:go.Spot.Bottom,cursor:'col-resize',desiredSize:new go.Size(9,9),fill:'lightblue',stroke:'dodgerblue'})),doubleClick:function(t,e){return t.diagram.__trtd.textDoubleClick?t.diagram.__trtd.textDoubleClick(t,e):void t.diagram.__trtd.selectText(t,e)},selectionAdornmentTemplate:this.getNodeSelectionAdornmentTemplate()},new go.Binding('locationSpot','locationSpot',function(e){return go.Spot.parse(e)}).makeTwoWay(function(e){return go.Spot.stringify(e)}),new go.Binding('visible','visible').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('rotatable','rotatable').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('copyable','copyable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}),l(go.TextBlock,{name:'TEXT',alignment:new go.Spot(0,0),font:'18px \'Microsoft YaHei\'',editable:!1,stroke:'black',isMultiline:!0,wrap:go.TextBlock.WrapDesiredSize,textAlign:'start',verticalAlignment:go.Spot.Center,spacingAbove:1,spacingBelow:1,portId:'TEXT',margin:5,maxSize:new go.Size(300,NaN),minSize:new go.Size(50,10),stretch:go.GraphObject.UniformToFill,textEdited:function(e,t,a){var o=e.part;''==a.trim()&&('shiText'==o.data.role||'xuText'==o.data.role)&&(e.part.diagram.model.startTransaction('text'),e.part.diagram.model.setDataProperty(e.part.data,'nloc',null),e.part.diagram.model.commitTransaction('text')),e.part.data.role&&-1<e.part.data.role.indexOf('labelText')&&(e.part.containingGroup.layout.isValidLayout=!1)}},new go.Binding('areaBackground','isHighlighted',function(e,t){return e?'RGBA(146,208,80,0.5)':null;var a=t.part.data.color}).ofObject(),new go.Binding('background','background',function(e){return e}).makeTwoWay(),new go.Binding('areaBackground','areaBackground',function(e){return e}).makeTwoWay(),new go.Binding('textAlign','textAlign',function(e){return e}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('maxSize','',function(e){var t=1e3,a=NaN;return e.width&&(t=parseInt(e.width)),e.height&&(a=parseInt(e.height)),new go.Size(t,a)}),new go.Binding('minSize','minSize',function(e){return go.Size.parse(e)}),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()),l(go.Panel,'Vertical',{alignment:go.Spot.Left,alignmentFocus:go.Spot.Right},l(go.Shape,{name:'ICON',width:16,height:16,visible:!1,click:function(){},figure:'Circle',fill:'red',strokeWidth:0,margin:3},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('figure','figure').makeTwoWay(),new go.Binding('visible','iconVisible').makeTwoWay(),new go.Binding('fill','fill',function(e){return e}).makeTwoWay())),l(go.Shape,'Rectangle',{name:'textBorder',stroke:'green',strokeWidth:3,strokeDashArray:[10,5],visible:!1,fill:'transparent',alignment:go.Spot.Center,width:100,height:270},new go.Binding('stroke','textStroke'),new go.Binding('desiredSize','',function(e,t){if(!c.checkPhone())return new go.Size(t.part.naturalBounds.width-3,t.part.naturalBounds.height-3);var a=t.part.diagram.findNodeForKey(t.part.data.olive);return new go.Size(a.naturalBounds.width-3,a.naturalBounds.height)})),l(go.Shape,'Circle',{name:'place',stroke:'red',strokeWidth:1,strokeDashArray:null,visible:!1,fill:'transparent',alignment:go.Spot.Center,width:50,height:50},new go.Binding('stroke','placeStroke')),l(go.Shape,{geometryString:'M540.5696 556.81024a81.8176 81.8176 0 0 1-53.0432-19.47648l-225.4848-191.52896a81.92 81.92 0 1 1 106.0864-124.86656l172.4416 146.47296 172.4416-146.47296a81.92 81.92 0 0 1 106.0864 124.86656l-225.4848 191.52896a81.7152 81.7152 0 0 1-53.0432 19.47648z m53.06368 246.23104l225.44384-191.52896a81.92 81.92 0 1 0-106.0864-124.84608l-172.40064 146.47296-172.48256-146.47296a81.92 81.92 0 1 0-106.04544 124.86656l225.52576 191.52896a81.7152 81.7152 0 0 0 53.00224 19.47648c18.88256 0 37.76512-6.49216 53.0432-19.49696z',visible:!1,name:'figure',cursor:'pointer',alignment:new go.Spot(1,0,5,-5),alignmentFocus:go.Spot.RightCenter,width:14,height:14,fill:'green',toolTip:l('ToolTip',l(go.Panel,'Vertical',l(go.Picture,new go.Binding('source','src',function(e){return'images/'+e+'.png'})),l(go.TextBlock,{text:'\u8FDB\u5165\u5B50\u76D8',margin:3}))),click:function(t){var e=t.targetObject.part;t.diagram.__trtd.openFigure({figure:e.data.figure,title:e.data.text,key:e.data.key,node:e})}},new go.Binding('visible','figure',function(e){return!!e})))}}]),t}(s);e.exports=g},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'switchBorder',value:function(e,t){e.findObject('groupBorder').opacity=t?1:0}},{key:'hiddenAllText',value:function(e){e.diagram.startTransaction();for(var t=e.findSubGraphParts().iterator,a=null,o;t.next();)o=t.value,null==a&&(a=o.visible),'autoText'==o.data.category&&e.diagram.model.setDataProperty(o.data,'visible',!a);e.diagram.commitTransaction()}},{key:'addLabelText',value:function(t,e){var a={text:'\u8BF4\u660E\uFF1A\u5185\u5BB9',deletable:!0,fill:'black',iconVisible:!0,locationSpot:'0 0 0 0',textAlign:'start',category:'autoText',loc:e.location.x+30+' '+e.location.y,movable:!1,group:e.data.key};this.diagram.startTransaction('addLabelText'),this.diagram.model.addNodeData(a),this.diagram.commitTransaction('addLabelText')}},{key:'getNodeTemplate',value:function(){var t=this;return l(go.Group,'Spot',{__trtdNode:t,layerName:'default',locationObjectName:'groupBorder',zOrder:5,background:'rgba(0,0,0,0)',rotatable:!1,minSize:new go.Size(200,100),locationSpot:go.Spot.Center,toolTip:l('ToolTip',l(go.TextBlock,{margin:4},new go.Binding('text','',function(){return'\u53CC\u51FB\u663E\u793A/\u9690\u85CF'}))),click:function(){},selectable:!0,doubleClick:function(a,e){t.hiddenAllText(e),t.switchBorder(e,!1)},mouseOver:function(a,e){if(t.switchBorder(e,!0),!!e.containingGroup){var o=e.containingGroup.findSubGraphParts().iterator;for(e.diagram.startTransaction();o.next();){var i=o.value;'autoText'==i.data.category&&i.data.role&&-1<i.data.role.indexOf('labelText')&&i.diagram.model.setDataProperty(i.data,'minSize','120 30')}e.diagram.commitTransaction()}},mouseLeave:function(a,e){t.switchBorder(e,!1)},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,layout:l(go.GridLayout,{isInitial:!1,isOngoing:!1,spacing:new go.Size(0,0),cellSize:go.Size.parse(300,150),arrangement:go.GridLayout.LeftToRight,wrappingColumn:1,isRealtime:!1,alignment:go.GridLayout.Location})},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('copyable','copyable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),l(go.Placeholder,{padding:30,alignment:go.Spot.Center,name:'placeholder'}),l(go.Shape,'Rectangle',{name:'groupBorder',stroke:'green',strokeWidth:3,strokeDashArray:[10,5],visible:!0,opacity:0,fill:null,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center},new go.Binding('desiredSize','',function(e,t){return new go.Size(t.part.measuredBounds.width-3,t.part.measuredBounds.height-3)}).ofObject('')))}}]),t}(s);e.exports=g},function(e,t,a){'use strict';function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function d(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),s=go.GraphObject.make,c=a(1),g=a(0),m=function(e){function t(e){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return d(t,e),l(t,[{key:'getNodeSelectionAdornmentTemplate',value:function(){return s(go.Adornment,'Spot',s(go.Panel,'Auto',s(go.Shape,{fill:null,stroke:'dodgerblue',strokeWidth:1}),s(go.Placeholder)),s(go.Panel,'Vertical',{name:'ButtonIcon1',alignment:new go.Spot(0,1,-20,20),alignmentFocus:go.Spot.Center,width:60,height:60,isActionable:!0},s(go.Shape,'Circle',{fill:'rgba(1,1,1,0)',strokeWidth:0,stroke:'green',width:50,height:50})))}},{key:'nodeResizeAdornmentTemplate',value:function(){return s(go.Adornment,'Spot',s(go.Placeholder),s(go.Shape,'Circle',{alignment:go.Spot.TopLeft,alignmentFocus:go.Spot.BottomRight,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}),s(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'getNodeTemplate',value:function(){var e=this.diagram,t=this;return s(go.Node,'Spot',o({name:'NODE',_controlExpand:!0,layerName:'Background',locationSpot:go.Spot.BottomLeft,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,rotateObjectName:'SHAPE',doubleClick:function(t,e){e.diagram.__trtd.nodeDoubleClickListener&&e.diagram.__trtd.nodeDoubleClickListener(e)},click:function(t,e){e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},selectable:!0,movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:t.nodeResizeAdornmentTemplate(),contextMenu:e.__trtd.nodeContextMenu,selectionAdornmentTemplate:t.getNodeSelectionAdornmentTemplate()},'contextMenu',s(go.Adornment)),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('resizable','resizable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),s(go.Picture,{name:'SHAPE',width:400,height:400},{successFunction:function(e){e.width&&e.height||e.part.data.width&&e.part.data.height||(e.width=e.element.width,e.height=e.element.height)}},{sourceCrossOrigin:function(){return''}},new go.Binding('source','picture',function(e){return e+'?'+Date.now()}).makeTwoWay(function(e){return e?(e=e.replace(/\?.*$/g,''),e):''}),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('opacity','opacity',function(e){return e?parseFloat(e):1}).makeTwoWay(function(e){return e})))}}]),t}(c);e.exports=m},function(module,exports,__webpack_require__){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function _inherits(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),$=go.GraphObject.make,Base=__webpack_require__(1),helpers=__webpack_require__(0),PicGroupNodeTemplate=function(_Base){function PicGroupNodeTemplate(e){_classCallCheck(this,PicGroupNodeTemplate);var t=_possibleConstructorReturn(this,(PicGroupNodeTemplate.__proto__||Object.getPrototypeOf(PicGroupNodeTemplate)).call(this,e)),a={cbianText1:'490.19843547330686 -207.92899577343746',cbianText2:'179.32782881269065 -477.3356656420584',cbianText3:'373.5304832720494 -373.95951083813827',axisXText:'530 8',axisYText:'-15 -517'},o={cbianText1:'131.233937586588 -72',cbianText2:'46.592920782221995 -128.5569669100272',cbianText3:'99.53048327204942 -103.06601717798208',axisXText:'147 3',axisYText:'-3 -147'};return t.cbianThemes=[{name:'cbian1',type:'small',textStrokes:['#0e399d','#cb1c27','#FFC000'],picture:'https://static.365trtd.com/system/cbian/cbian.png',offsets:o,size:[150,150],pictureBig:'https://static.365trtd.com/system/cbian/cbian1_big.png',offsetsBig:a,sizeBig:[500,500]},{name:'cbian_red',type:'small',textStrokes:['red','red','red'],picture:'https://static.365trtd.com/system/cbian/cbian_red.png',offsets:o,size:[150,150],pictureBig:'https://static.365trtd.com/system/cbian/cbian_big_red.png',offsetsBig:a,sizeBig:[500,500]},{name:'cbian_blue',type:'small',textStrokes:['blue','blue','blue'],picture:'https://static.365trtd.com/system/cbian/cbian_blue.png',offsets:o,size:[150,150],pictureBig:'https://static.365trtd.com/system/cbian/cbian_big_blue.png',offsetsBig:a,sizeBig:[500,500]},{name:'cbian_green',type:'small',textStrokes:['green','green','green'],picture:'https://static.365trtd.com/system/cbian/cbian_green.png',offsets:o,size:[150,150],pictureBig:'https://static.365trtd.com/system/cbian/cbian_big_green.png',offsetsBig:a,sizeBig:[500,500]}],t}return _inherits(PicGroupNodeTemplate,_Base),_createClass(PicGroupNodeTemplate,[{key:'changeCbianSize',value:function(node,cbianType){if(node&&cbianType){for(var cbianThemes=this.cbianThemes,cbianName=node.data.cbianName||'cbian1',index=null,theme=null,i=0,len=cbianThemes.length;i<len;i++)if(cbianThemes[i].name==cbianName){index=i,theme=cbianThemes[i];break}if(null!=index){var baseNode,cbianText1,cbianText2,cbianText3,axisXText,axisYText,pic;if(theme)for(var it=node.findSubGraphParts().iterator,n;it.next();)n=it.value,'theme'==n.data.role&&(baseNode=n),'cbianText1'==n.data.role&&(cbianText1=n),'cbianText2'==n.data.role&&(cbianText2=n),'cbianText3'==n.data.role&&(cbianText3=n),'axisXText'==n.data.role&&(axisXText=n),'axisYText'==n.data.role&&(axisYText=n),'pic'==n.data.category&&(pic=n);var diagram=node.diagram;if(baseNode){var propertyPicture='picture',propertySize='size',propertyoffset='offsets';'big'==cbianType&&(propertyPicture='pictureBig',propertySize='sizeBig',propertyoffset='offsetsBig'),diagram.model.startTransaction(),diagram.model.setDataProperty(pic.data,'picture',theme[propertyPicture]),diagram.model.setDataProperty(pic.data,'width',theme[propertySize][0]),diagram.model.setDataProperty(pic.data,'height',theme[propertySize][1]),diagram.model.setDataProperty(node.data,'cbianType',cbianType),diagram.model.setDataProperty(node.data,'cbianName',cbianName),window.localStorage.setItem('cbianName',JSON.stringify(theme));for(var nodeNameList=['cbianText1','cbianText2','cbianText3','axisXText','axisYText'],i=0;i<nodeNameList.length;i++){var nodeName=nodeNameList[i],tmpPoint,tmpNode;tmpNode=eval(nodeName),tmpPoint=theme[propertyoffset][nodeName],cbianText1&&tmpPoint&&(tmpPoint=go.Point.parse(tmpPoint),diagram.model.setDataProperty(tmpNode.data,'loc',go.Point.stringify(baseNode.location.copy().offset(tmpPoint.x,tmpPoint.y))))}diagram.model.commitTransaction()}}}}},{key:'changeCbianName',value:function(e,t){if(e&&t){for(var a=this.cbianThemes,o=null,r=null,d=0,i=a.length;d<i;d++)if(a[d].name==t){o=d,r=a[d];break}if(null!=o){var l,s,c,g,m,p,u;if(r)for(var y=e.findSubGraphParts().iterator,h;y.next();)h=y.value,'theme'==h.data.role&&(l=h),'cbianText1'==h.data.role&&(s=h),'cbianText2'==h.data.role&&(c=h),'cbianText3'==h.data.role&&(g=h),'axisXText'==h.data.role&&(m=h),'axisYText'==h.data.role&&(p=h),'pic'==h.data.category&&(u=h);var k=e.diagram;if(l){var f='picture';'big'==e.data.cbianType&&(f='pictureBig'),k.model.startTransaction(),k.model.setDataProperty(u.data,'picture',r[f]),k.model.setDataProperty(e.data,'cbianName',t),window.localStorage.setItem('cbianName',JSON.stringify(r)),s&&k.model.setDataProperty(s.data,'textStroke',r.textStrokes[0]),c&&k.model.setDataProperty(c.data,'textStroke',r.textStrokes[1]),g&&k.model.setDataProperty(g.data,'textStroke',r.textStrokes[2]),k.model.commitTransaction()}}}}},{key:'getNodeSelectionAdornmentTemplate',value:function(){return $(go.Adornment,'Spot',$(go.Panel,'Auto',$(go.Shape,{fill:null,stroke:'dodgerblue',strokeWidth:1}),$(go.Placeholder)),$(go.Panel,'Vertical',{name:'ButtonIcon1',alignment:new go.Spot(0,1,-20,20),alignmentFocus:go.Spot.Center,width:60,height:60,isActionable:!0},$(go.Shape,'Circle',{fill:'rgba(1,1,1,0)',strokeWidth:0,stroke:'green',width:50,height:50})))}},{key:'nodeResizeAdornmentTemplate',value:function(){return $(go.Adornment,'Spot',$(go.Placeholder),$(go.Shape,'Circle',{alignment:go.Spot.TopLeft,alignmentFocus:go.Spot.BottomRight,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}),$(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'addFreeText',value:function(t,e){return void this.changeCbianThemeColor(t,e);var a={text:'\u603B\u7ED3\u6587\u672C',deletable:!0,fill:'black',iconVisible:!1,locationSpot:'0 0.5 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(t.documentPoint),movable:!0,group:e.data.key}}},{key:'getNodeTemplate',value:function(){var e=this.diagram,t=this;return $(go.Group,'Auto',{__trtdNode:t,layerName:'default',locationObjectName:'placeholder',zOrder:5,background:'rgba(0,0,0,0)',rotatable:!1,locationSpot:go.Spot.BottomLeft,click:function(){},layout:$(go.Layout),doubleClick:function(a,e){for(var o=0,r=0;r<t.cbianThemes.length;r++)if(t.cbianThemes[r].name==e.data.cbianName){o=r;break}var i=(o+1)%t.cbianThemes.length;t.changeCbianName(e,t.cbianThemes[i].name)},contextMenu:$(go.Adornment),layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized},new go.Binding('location','loc',function(e){return go.Point.parse(e)}).makeTwoWay(go.Point.stringify),new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('layerName','layerName').makeTwoWay(),$(go.Placeholder,{padding:30,alignment:go.Spot.Center,name:'placeholder'}))}}]),PicGroupNodeTemplate}(Base);module.exports=PicGroupNodeTemplate},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=a(25),m=function(e){function t(e){o(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.defaultTextFont='20px \'Microsoft YaHei\'',a}return r(t,e),d(t,[{key:'snapToGrid',value:function(e,t){if('coreText'!=e.subRole&&'themeText'!=e.subRole){var a=go.Point.parse(e.loc);if(t.__yunPointsX&&t.__yunPointsY)if(a.x>=t.__yunPointsX[0]&&a.x<=t.__yunPointsX[t.__yunPointsX.length-1]&&a.y>=t.__yunPointsY[t.__yunPointsY.length-1]&&a.y<=t.__yunPointsY[0]){for(var o=2e4,r=2e4,d=0,i,l,s;d<t.__yunPointsX.length;d++)i=_Mathabs(a.x-t.__yunPointsX[d]),i<o&&(o=i,l=d+1);for(var d=0;d<t.__yunPointsY.length;d++)i=_Mathabs(a.y-t.__yunPointsY[d]),i<r&&(r=i,s=d+1);null!=l&&null!=s&&(e.orderX=l,e.orderY=s)}else delete e.orderX,delete e.orderY}}},{key:'addFreeText',value:function(t,e){var a=e.data.gridWidth,o=t.documentPoint,i=this,r={text:'\u7075\u611F',deletable:!0,role:'freeText',fill:'black',iconVisible:!1,locationSpot:'0.5 0.5 0 0',minSize:'30 30',font:i.defaultTextFont,textAlign:'center',category:'autoText',loc:go.Point.stringify(o),movable:!0,group:e.data.key};this.snapToGrid(r,e),this.diagram.startTransaction('addFreeText'),this.diagram.model.addNodeData(r),this.diagram.commitTransaction('addFreeText'),e.layout.isValidLayout=!1}},{key:'getNodeTemplate',value:function(){var e=this;return l(go.Group,'Auto',{selectionObjectName:'PH',__trtdNode:e,layerName:'default',padding:0,margin:0,copyable:!0,zOrder:15,locationObjectName:'PH',locationSpot:new go.Spot(0,1,0,-0),rotatable:!1,alignment:go.Spot.Left,alignmentFocus:go.Spot.Left,click:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1);return void(e.layout.isValidLayout=!1)},doubleClick:function(){},mouseOver:function(){},contextMenu:l(go.Adornment),mouseLeave:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next()&&(o=a.value,'labelGroup'!=o.data.role););},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,layout:new g},new go.Binding('deletable','deletable').makeTwoWay(function(e){return e}),new go.Binding('copyable','copyable').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('zOrder','zOrder').makeTwoWay(function(e){return e}),new go.Binding('locationSpot','',function(e){return new go.Spot(0,1,e.gridWidth,-e.gridHeight)}),l(go.Shape,{name:'PH',figure:'Rectangle',stroke:'yellow',strokeWidth:0,fill:'rgba(0,0,255,0.0)'}),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify))}}]),t}(s);e.exports=m},function(e){'use strict';function t(){go.Layout.call(this)}go.Diagram.inherit(t,go.Layout),t.prototype.doLayout=function(e){var t=this.diagram;t.startTransaction('YunGroupLayout');for(var a=this.collectParts(e).iterator,o=[],i=[],r=this.group,d=r.data.gridWidth,l=r.data.gridHeight,s=0,c=0,g=[],m=[],p=[],u=[],y=[],h=[],k=[],f=[],x=r.data.snapType||'grid',T=r.data.showShape,b=r.data.beginSpark,S=r.data.shapeStrokes,v,w,P,B,D,N,A,C,W,O;a.next();)O=a.value,(i.push(O.data),'wave'==O.data.category&&o.push(O),!!(O instanceof go.Node))&&('background'==O.data.role&&f.push(O),'axisYText'==O.data.role&&(B=O),'axisXText'==O.data.role&&(P=O),'themeText'==O.data.role&&(D=O),'shiText'==O.data.role&&g.push(O),'xuText'==O.data.role&&m.push(O),'labelText1'==O.data.role&&(N=O),'labelText2'==O.data.role&&(A=O),'labelText3'==O.data.role&&(C=O),'labelGroup'==O.data.role&&(W=O),O.naturalBounds.width>s&&(s=O.naturalBounds.width),O.naturalBounds.height>c&&(c=O.naturalBounds.height),'freeText'==O.data.role&&k.push(O),'line'==O.data.category&&(h.push(O),'verticalLine'==O.data.role&&p.push(O),'horizontalLine'==O.data.role&&u.push(O),'freelLine'==O.data.role&&y.push(O)),O.data.group==r.key&&'line'==O.data.category&&('axisX'==O.data.role&&(O.angle=0,v=O,O.location=r.location.copy().offset(0,0)),'axisY'==O.data.role&&(w=O,O.angle=270,O.location=r.location.copy().offset(0,0))));if(p.sort(function(e,t){return e.data.order-t.data.order}),u.sort(function(e,t){return e.data.order-t.data.order}),y.sort(function(e,t){return e.data.order-t.data.order}),'between'==x)var G=p.length*d+d,z=u.length*l+l;else var G=p.length*d,z=u.length*l;var L=[],F=[],E=(u.length+1)/2,M=(p.length+1)/2;return h.forEach(function(e){'axisX'!=e.data.role&&'axisY'!=e.data.role}),p.forEach(function(e,t){var a=t+1;e.diagram.model.setDataProperty(e.data,'order',a),e.location=r.location.copy().offset(d*a,0),e.angle=270,e.diagram.model.setDataProperty(e.data,'desiredSize',z+20+' 10'),'between'==x?(a<E&&L.push(e.location.x-d/2),a==E&&L.push(e.location.x),a>E&&L.push(e.location.x+d/2)):L.push(e.location.x)}),u.forEach(function(e,t){var a=t+1;e.diagram.model.setDataProperty(e.data,'order',a),e.location=r.location.copy().offset(0,-l*a),e.angle=0,e.diagram.model.setDataProperty(e.data,'desiredSize',G+20+' 10'),'between'==x?(a<M&&F.push(e.location.y+l/2),a==M&&F.push(e.location.y),a>M&&F.push(e.location.y-l/2)):F.push(e.location.y)}),this.group.__yunPointsX=L,this.group.__yunPointsY=F,y.forEach(function(){}),f.forEach(function(e){if(e.diagram.model.setDataProperty(e.data,'visible',!0),!T)e.diagram.model.setDataProperty(e.data,'stroke','rgba(255,0,0,0)');else try{e.diagram.model.setDataProperty(e.data,'stroke',S[e.data.gridWidth/2-1])}catch(t){}if(!e.data.desiredSize){e.data.orderX=E,e.data.orderY=M,e.location=new go.Point(L[e.data.orderX-1],F[e.data.orderY-1]);var t=e.data.gridWidth||2;if('between'==x){var a=new go.Size(d*(t-1),l*(t-1));e.diagram.model.setDataProperty(e.data,'strokeWidth',d)}else{var a=new go.Size(d*t+3,l*t+3);e.diagram.model.setDataProperty(e.data,'strokeWidth',3)}e.diagram.model.setDataProperty(e.data,'desiredSize',go.Size.stringify(a)),e.diagram.model.setDataProperty(e.data,'strokeDashArray','[0,0]')}}),k.forEach(function(e){if(e.areaBackground=null,r.data.autoSnapText&&(e.data.orderX&&e.data.orderY&&(e.location=new go.Point(L[e.data.orderX-1],F[e.data.orderY-1]),e.location=new go.Point(L[e.data.orderX-1],F[e.data.orderY-1])),'dimText'==e.data.subRole&&null!=e.data.dimX&&null!=e.data.dimY)){var t,a;t=L[e.data.dimX-1],a=F[e.data.dimY-1],e.data.dimX>=L.length&&(t=L[L.length-1]+d),e.data.dimY>=F.length&&(a=F[F.length-1]-l),0>=e.data.dimX&&(t=L[0]-d,'between'!=x&&e.data.dimY<F.length&&(t-=d/2)),0>=e.data.dimY&&(a=F[0]+l,'between'!=x&&e.data.dimX<L.length&&(a+=l/2)),e.location=new go.Point(t,a)}if(('themeText'!=e.data.subRole&&e.data.orderY==M||e.data.dimY==M)&&(e.diagram.model.setDataProperty(e.data,'width',d-10),e.diagram.model.setDataProperty(e.data,'height',null)),('themeText'!=e.data.subRole&&e.data.orderX==E||e.data.dimX==E)&&(e.diagram.model.setDataProperty(e.data,'height',l-10),e.diagram.model.setDataProperty(e.data,'width',null)),1==_Mathabs(e.data.orderX-E)&&1==_Mathabs(e.data.orderY-M)&&'between'!=x&&(e.diagram.model.setDataProperty(e.data,'width',d-10),e.diagram.model.setDataProperty(e.data,'height',l-10)),'coreText'==e.data.subRole){var o=_Mathmax(_Mathabs(e.data.orderX-E),_Mathabs(e.data.orderY-M));e.diagram.model.setDataProperty(e.data,'theta',o)}0!=_Mathabs(e.data.orderX-E)||0!=_Mathabs(e.data.orderY-M)}),P,B,w&&(w.angle=270,this.diagram.model.setDataProperty(w.data,'desiredSize',z+30+' 10')),v&&(v.angle=0,this.diagram.model.setDataProperty(v.data,'desiredSize',G+30+' 10')),r.width=G+2*d,r.height=z+2*l,go.Layout.prototype.doLayout.call(this,e),void t.commitTransaction('YunGroupLayout')},e.exports=t},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=a(27),m=function(e){function t(e){o(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.defaultTextFont='20px \'Microsoft YaHei\'',a}return r(t,e),d(t,[{key:'snapToGrid',value:function(e,t){if('coreText'!=e.subRole&&'themeText'!=e.subRole){var a=go.Point.parse(e.loc);if(t.__yunPointsX&&t.__yunPointsY)if(a.x>=t.__yunPointsX[0]&&a.x<=t.__yunPointsX[t.__yunPointsX.length-1]&&a.y>=t.__yunPointsY[t.__yunPointsY.length-1]&&a.y<=t.__yunPointsY[0]){for(var o=2e4,r=2e4,d=0,i,l,s;d<t.__yunPointsX.length;d++)i=_Mathabs(a.x-t.__yunPointsX[d]),i<o&&(o=i,l=d+1);for(var d=0;d<t.__yunPointsY.length;d++)i=_Mathabs(a.y-t.__yunPointsY[d]),i<r&&(r=i,s=d+1);null!=l&&null!=s&&(e.orderX=l,e.orderY=s)}else delete e.orderX,delete e.orderY}}},{key:'addFreeText',value:function(t,e){var a=e.data.gridWidth,o=t.documentPoint,i=this,r={text:'\u8282\u70B9',deletable:!0,role:'freeText',fill:'black',iconVisible:!1,locationSpot:'0.5 0.5 0 0',minSize:'30 30',subRole:'yunpanText',font:i.defaultTextFont,textAlign:'center',category:'autoText',loc:go.Point.stringify(o),movable:!0,group:e.data.key};this.snapToGrid(r,e),this.diagram.startTransaction('addFreeText'),this.diagram.model.addNodeData(r),this.diagram.commitTransaction('addFreeText'),e.layout.isValidLayout=!1}},{key:'addFreeShapeText',value:function(t,e){var a=e.data.gridWidth,o=t.documentPoint,i=this,r={text:'\u8282\u70B9',deletable:!0,role:'freeText',fill:'#F2F2F2',iconVisible:!1,locationSpot:'0.5 0.5 0 0',minSize:'30 30',subRole:'yunpanText',desiredSize:go.Size.stringify(new go.Size(a-10,a-10)),font:i.defaultTextFont,textAlign:'center',category:'shapeText',loc:go.Point.stringify(o),movable:!0,group:e.data.key};this.snapToGrid(r,e),this.diagram.startTransaction('addFreeText'),this.diagram.model.addNodeData(r),this.diagram.commitTransaction('addFreeText'),e.layout.isValidLayout=!1}},{key:'getNodeTemplate',value:function(){var t=this;return l(go.Group,'Auto',{selectionObjectName:'PH',__trtdNode:t,layerName:'default',padding:0,margin:0,copyable:!1,zOrder:15,locationObjectName:'PH',locationSpot:new go.Spot(0,1,0,-0),rotatable:!1,alignment:go.Spot.Left,alignmentFocus:go.Spot.Left,click:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next();)o=a.value,'autoText'==o.data.category&&(o.findObject('textBorder').visible=!1);return void(e.layout.isValidLayout=!1)},doubleClick:function(a,e){t.addFreeShapeText(a,e)},mouseOver:function(){},contextMenu:l(go.Adornment),mouseLeave:function(t,e){for(var a=e.findSubGraphParts().iterator,o;a.next()&&(o=a.value,'labelGroup'!=o.data.role););},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&go.Part.LayoutNodeSized,layout:new g},new go.Binding('deletable','deletable').makeTwoWay(function(e){return e}),new go.Binding('copyable','copyable').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(function(e){return e}),new go.Binding('zOrder','zOrder').makeTwoWay(function(e){return e}),new go.Binding('locationSpot','',function(e){return new go.Spot(0,1,e.gridWidth,-e.gridHeight)}),l(go.Shape,{name:'PH',figure:'Rectangle',stroke:'yellow',strokeWidth:0,fill:'rgba(0,0,255,0.0)'}),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify))}}]),t}(s);e.exports=m},function(e){'use strict';function t(){go.Layout.call(this)}go.Diagram.inherit(t,go.Layout),t.prototype.doLayout=function(e){var t=this.diagram;t.startTransaction('YunGroupLayout');for(var a=this.collectParts(e).iterator,o=[],i=[],r=this.group,d=r.data.gridWidth,l=r.data.gridHeight,s=0,c=0,g=[],m=[],p=[],u=[],y=[],h=[],k=[],f=[],x=[],T=[],b=r.data.snapType||'grid',S=r.data.showShape,v=r.data.beginSpark,w=r.data.shapeStrokes,P,B,D,N,A,C,W,O,G,z;a.next();)z=a.value,(i.push(z.data),'wave'==z.data.category&&o.push(z),!!(z instanceof go.Node))&&(0==z.data.dimX&&'dimText'==z.data.subRole&&T.push(z),0==z.data.dimY&&'dimText'==z.data.subRole&&x.push(z),'background'==z.data.role&&f.push(z),'axisYText'==z.data.role&&(N=z),'axisXText'==z.data.role&&(D=z),'themeText'==z.data.role&&(A=z),'shiText'==z.data.role&&g.push(z),'xuText'==z.data.role&&m.push(z),'labelText1'==z.data.role&&(C=z),'labelText2'==z.data.role&&(W=z),'labelText3'==z.data.role&&(O=z),'labelGroup'==z.data.role&&(G=z),z.naturalBounds.width>s&&(s=z.naturalBounds.width),z.naturalBounds.height>c&&(c=z.naturalBounds.height),'freeText'==z.data.role&&k.push(z),'line'==z.data.category&&(h.push(z),'verticalLine'==z.data.role&&p.push(z),'horizontalLine'==z.data.role&&u.push(z),'freelLine'==z.data.role&&y.push(z)),z.data.group==r.key&&'line'==z.data.category&&('axisX'==z.data.role&&(z.angle=0,P=z,z.location=r.location.copy().offset(0,0)),'axisY'==z.data.role&&(B=z,z.angle=270,z.location=r.location.copy().offset(0,0))));if(p.sort(function(e,t){return e.data.order-t.data.order}),u.sort(function(e,t){return e.data.order-t.data.order}),y.sort(function(e,t){return e.data.order-t.data.order}),'between'==b)var L=p.length*d+d,F=u.length*l+l;else var L=p.length*d,F=u.length*l;var E=[],M=[],R=(u.length+1)/2,j=(p.length+1)/2;return h.forEach(function(e){'axisX'!=e.data.role&&'axisY'!=e.data.role}),p.forEach(function(e,t){var a=t+1;e.diagram.model.setDataProperty(e.data,'order',a),e.location=r.location.copy().offset(d*a,0),e.angle=270,e.diagram.model.setDataProperty(e.data,'deletable',!0),e.diagram.model.setDataProperty(e.data,'desiredSize',F+20+' 10'),'between'==b?(a<R&&E.push(e.location.x-d/2),a==R&&E.push(e.location.x),a>R&&E.push(e.location.x+d/2)):E.push(e.location.x)}),u.forEach(function(e,t){var a=t+1;e.diagram.model.setDataProperty(e.data,'order',a),e.diagram.model.setDataProperty(e.data,'deletable',!0),e.location=r.location.copy().offset(0,-l*a),e.angle=0,e.diagram.model.setDataProperty(e.data,'desiredSize',L+20+' 10'),'between'==b?(a<j&&M.push(e.location.y+l/2),a==j&&M.push(e.location.y),a>j&&M.push(e.location.y-l/2)):M.push(e.location.y)}),this.group.__yunPointsX=E,this.group.__yunPointsY=M,y.forEach(function(){}),k.forEach(function(e){if(e.areaBackground=null,r.data.autoSnapText&&(e.data.orderX&&e.data.orderY&&(e.location=new go.Point(E[e.data.orderX-1],M[e.data.orderY-1]),e.location=new go.Point(E[e.data.orderX-1],M[e.data.orderY-1])),'dimText'==e.data.subRole&&null!=e.data.dimX&&null!=e.data.dimY)){e.diagram.model.setDataProperty(e.data,'deletable',!0);var t,a;t=E[e.data.dimX-1],a=M[e.data.dimY-1],0>=e.data.dimX&&(t=E[0]-d/2-10,'between'!=b&&e.data.dimY<=M.length&&(t-=d/2)),0>=e.data.dimY&&(a=M[0]+l/2,'between'!=b&&e.data.dimX<=E.length&&(a+=l/2)),e.location=new go.Point(t,a)}}),D&&(D.location=r.location.copy().offset(L+50,0),D.locationSpot=go.Spot.Left),N&&(N.location=r.location.copy().offset(0,-(F+50)),N.locationSpot=go.Spot.Bottom),B&&(B.angle=270,this.diagram.model.setDataProperty(B.data,'desiredSize',F+30+' 10')),P&&(P.angle=0,this.diagram.model.setDataProperty(P.data,'desiredSize',L+30+' 10')),r.width=L+2*d,r.height=F+2*l,go.Layout.prototype.doLayout.call(this,e),void t.commitTransaction('YunGroupLayout')},e.exports=t},function(e,t,a){'use strict';function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function d(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),s=go.GraphObject.make,c=a(1),g=a(0),m=function(e){function t(e){return i(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return d(t,e),l(t,[{key:'getNodeSelectionAdornmentTemplate',value:function(){return s(go.Adornment,'Spot',s(go.Panel,'Auto',s(go.Shape,{fill:null,stroke:'dodgerblue',strokeWidth:1}),s(go.Placeholder)),s(go.Panel,'Vertical',{name:'ButtonIcon1',alignment:new go.Spot(0,1,-20,20),alignmentFocus:go.Spot.Center,width:60,height:60,isActionable:!0},s(go.Shape,'Circle',{fill:'rgba(1,1,1,0)',strokeWidth:0,stroke:'green',width:50,height:50})))}},{key:'nodeResizeAdornmentTemplate',value:function(){return s(go.Adornment,'Spot',s(go.Placeholder),s(go.Shape,'Circle',{alignment:go.Spot.TopLeft,alignmentFocus:go.Spot.BottomRight,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}),s(go.Shape,'Circle',{alignment:go.Spot.BottomRight,alignmentFocus:go.Spot.TopLeft,cursor:'col-resize',desiredSize:new go.Size(30,30),fill:'lightblue',stroke:'dodgerblue'}))}},{key:'getNodeTemplate',value:function(){var e=this.diagram,t=this;return s(go.Node,'Spot',o({name:'NODE',_controlExpand:!0,layerName:'default',zOrder:13,locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,rotateObjectName:'SHAPE',doubleClick:function(t,e){e.diagram.__trtd.nodeDoubleClickListener&&e.diagram.__trtd.nodeDoubleClickListener(e)},click:function(t,e){e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},selectable:!0,movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:t.nodeResizeAdornmentTemplate(),contextMenu:e.__trtd.nodeContextMenu,selectionAdornmentTemplate:t.getNodeSelectionAdornmentTemplate()},'contextMenu',s(go.Adornment)),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('resizable','resizable').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('visible','visible'),new go.Binding('zOrder','zOrder'),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),s(go.Shape,{strokeDashArray:null,margin:0,name:'SHAPE',figure:'Rectangle',fill:'rgba(0,0,0,0)',minSize:new go.Size(50,50),strokeWidth:3,stroke:'RGBA(255,0,0,0.2)',portId:''},new go.Binding('fill','fill').makeTwoWay(),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(),new go.Binding('figure','figure').makeTwoWay(),new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('desiredSize','desiredSize',function(e){var t=new go.Size.parse(e);return t}).makeTwoWay(function(e){return go.Size.stringify(e)}),new go.Binding('strokeDashArray','strokeDashArray',function(e){return JSON.parse(e)}).makeTwoWay(function(e){return JSON.stringify(e)})))}}]),t}(c);e.exports=m},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=go.GraphObject.make,s=a(1),c=a(0),g=function(e){function t(e){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),d(t,[{key:'clearBorder',value:function(e){e.data.showBorder&&(e.findObject('textBorder').visible=!1)}},{key:'makeGeo',value:function(e,t,a){var o=e.radiusX,i=void 0===o?150:o,r=e.radiusY,d=void 0===r?100:r,l=new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.SvgArc,2*i,0,i,d,0,1,a.clockwiseFlag?1:0)));return l.defaultStretch=go.GraphObject.Fill,l}},{key:'getNodeTemplate',value:function(){var e=this,t=this.diagram;return l(go.Node,'Spot',{_controlExpand:!0,__trtdNode:e,layerName:'Foreground',zOrder:15,movable:!0,isShadowed:!0,shadowColor:'#57617a',shadowOffset:new go.Point(0,0),visible:!0,locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),selectionObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!1,location:new go.Point(0,0),toMaxLinks:1,mouseDrop:function(t,e){var a=e.part,o=t.diagram.selection.first();if('picGroup'==o.data.category&&'cbian'==o.data.role&&'centerText'==a.data.role){var r=t.diagram.findNodeForKey(a.data.olive);if(!r)return;for(var d=o.findSubGraphParts().iterator,l=[],s={},c;d.next();)c=d.value,'autoText'==c.data.category&&('0 0 0 0'==c.data.locationSpot&&(s.shiText=c.data.text),'0 0.5 0 0'==c.data.locationSpot&&(s.centerText=c.data.text),'0 1 0 0'==c.data.locationSpot&&(s.xuText=c.data.text)),l.push(c.data);t.diagram.startTransaction('mouseDrop'),t.diagram.model.removeNodeDataCollection(l);JSON.parse(JSON.stringify(o.data));return t.diagram.model.removeNodeData(o.data),t.diagram.__trtd.addOlive(r,s),void t.diagram.commitTransaction('mouseDrop')}if('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole){t.diagram.model.startTransaction('coreTextExchange');var g=o.data.orderX,m=o.data.orderY,p=o.data.dimKey;t.diagram.model.setDataProperty(o.data,'orderX',a.data.orderX),t.diagram.model.setDataProperty(o.data,'orderY',a.data.orderY),t.diagram.model.setDataProperty(o.data,'dimKey',a.data.dimKey),t.diagram.model.setDataProperty(a.data,'orderX',g),t.diagram.model.setDataProperty(a.data,'orderY',m),t.diagram.model.setDataProperty(a.data,'dimKey',p),t.diagram.model.commitTransaction('coreTextExchange')}if('dimText'==o.data.subRole&&'dimText'==a.data.subRole&&o.data.category==a.data.category){if(o.data.group!=a.data.group)return;if(!o.containingGroup)return;if('yunpanGroup'!=o.containingGroup.data.category)return;if(o.data.dimX!=a.data.dimX&&o.data.dimY!=a.data.dimY)return;t.diagram.model.startTransaction('dimTextExchange');var g=o.data.dimX,m=o.data.dimY,d=a.containingGroup.findSubGraphParts().iterator,u=[],y=[],h=[],k=[],f='X';0==o.data.dimX&&(f='Y');for(var x=o.data['dim'+f],T=a.data['dim'+f],c;d.next();)c=d.value,'yunpanText'==c.data.subRole&&(c.data['order'+f]==T&&h.push(c),c.data['order'+f]==x&&k.push(c));for(var b=0,i,S;b<h.length;b++)t.diagram.model.setDataProperty(h[b].data,'order'+f,x);for(var b=0;b<k.length;b++)t.diagram.model.setDataProperty(k[b].data,'order'+f,T);return t.diagram.model.setDataProperty(o.data,'dim'+f,T),t.diagram.model.setDataProperty(a.data,'dim'+f,x),void t.diagram.model.commitTransaction('dimTextExchange')}if('dimText'==o.data.subRole&&'dimText'==a.data.subRole){t.diagram.model.startTransaction('dimTextExchange');var g=o.data.dimX,m=o.data.dimY,d=a.containingGroup.findSubGraphParts().iterator,u=[],y=[],h=[],k=[],f='X';for(0==o.data.dimX&&(f='Y');d.next();){var c=d.value;c.data.dimKey==a.data.key&&u.push(c),c.data.dimKey==o.data.key&&y.push(c),'yunpanText'==c.data.subRole&&(c.data['order'+f]==a.data['order'+f]&&h.push(c),c.data['order'+f]==o.data['order'+f]&&k.push(c))}var v=(a.containingGroup.__yunPointsX.length+1)/2,w=(a.containingGroup.__yunPointsY.length+1)/2;o.data.dimX>v&&y.sort(function(e,t){return e.data.orderX-t.data.orderX}),o.data.dimX==v&&(o.data.dimY>w?y.sort(function(e,t){return e.data.orderY-t.data.orderY}):y.sort(function(e,t){return t.data.orderY-e.data.orderY})),o.data.dimX<v&&y.sort(function(e,t){return t.data.orderX-e.data.orderX}),a.data.dimX>v&&u.sort(function(e,t){return e.data.orderX-t.data.orderX}),a.data.dimX==v&&(a.data.dimY>w?u.sort(function(e,t){return e.data.orderY-t.data.orderY}):u.sort(function(e,t){return t.data.orderY-e.data.orderY})),a.data.dimX<v&&u.sort(function(e,t){return t.data.orderX-e.data.orderX});for(var b=0,i,S;b<y.length;b++)i=y[b].data.orderX,S=y[b].data.orderY,t.diagram.model.setDataProperty(y[b].data,'orderX',u[b].data.orderX),t.diagram.model.setDataProperty(y[b].data,'orderY',u[b].data.orderY),t.diagram.model.setDataProperty(u[b].data,'orderX',i),t.diagram.model.setDataProperty(u[b].data,'orderY',S);t.diagram.model.setDataProperty(o.data,'dimX',a.data.dimX),t.diagram.model.setDataProperty(o.data,'dimY',a.data.dimY),t.diagram.model.setDataProperty(a.data,'dimX',g),t.diagram.model.setDataProperty(a.data,'dimY',m),t.diagram.model.commitTransaction('dimTextExchange')}if('wave'==o.data.category&&'centerText'==a.data.role&&a&&o.data.group==e.data.group){t.diagram.startTransaction('mouseDrop'),o.__oldOrder=o.data.order,t.diagram.model.setDataProperty(o.data,'order',a.data.order+.5);var P=t.diagram.model.findNodeDataForKey(o.data.xuText),B=t.diagram.model.findNodeDataForKey(o.data.shiText);t.diagram.model.setDataProperty(B,'order',a.data.order+.5),t.diagram.model.setDataProperty(P,'order',a.data.order+.5),t.diagram.commitTransaction('mouseDrop')}},mouseDragEnter:function(t,e){var a=e.part,o=t.diagram.selection.first();o&&(('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole)&&(o.areaBackground=null,a.areaBackground='RGB(107,208,137)'),'dimText'==o.data.subRole&&'dimText'==a.data.subRole&&(o.areaBackground=null,a.areaBackground='RGB(107,208,137)'),'centerText'==a.data.role&&(a.layerName='Background'))},mouseDragLeave:function(t,e){var a=e.part,o=t.diagram.selection.first();('coreText'==o.data.subRole&&'coreText'==a.data.subRole||'yunpanText'==o.data.subRole&&'yunpanText'==a.data.subRole)&&(a.areaBackground=null),'dimText'==o.data.subRole&&'dimText'==a.data.subRole&&(a.areaBackground=null),'centerText'==a.data.role&&(a.layerName='Foreground')},selectionChanged:function(e){if('autoText'==e.data.category&&null!=e.data.orderX&&null!=e.data.orderY&&'freeText'==e.data.role&&'coreText'==e.data.subRole&&'yunpanText'==e.data.subRole&&e.containingGroup&&'yunGroup'==e.containingGroup.data.category&&'yunpanGroup'==e.containingGroup.data.category&&'line'==e.containingGroup.data.beginSpark&&e.containingGroup.__yunPointsX&&e.containingGroup.__yunPointsY){var t=(e.containingGroup.__yunPointsX.length+1)/2,a=(e.containingGroup.__yunPointsY.length+1)/2;if(e.data.orderX==t&&e.data.orderY==a)return;var o=e.data.orderX,i=e.data.orderY;o==t&&(o=i),i==a&&(i=o);var r=e.containingGroup.data.shapeStrokes,d=e.containingGroup.data.showShape;if(e.isSelected){if('between'==e.containingGroup.data.snapType)var l=_Mathmax(_Mathabs(e.data.orderX-t),_Mathabs(e.data.orderY-a))+1;else var l=_Mathmax(_Mathabs(e.data.orderX-t),_Mathabs(e.data.orderY-a));for(var s=e.containingGroup.findSubGraphParts().iterator,g=null,m;s.next();)if(m=s.value,'autoText'==m.data.category&&null!=m.data.orderX&&null!=m.data.orderY&&'freeText'==m.data.role&&(m.findObject('textBorder').visible=!1,(_Mathabs(m.data.orderX-t)==_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)<=_Mathabs(i-a)||_Mathabs(m.data.orderX-t)<=_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)==_Mathabs(i-a))&&(m.areaBackground='white',m.zOrder=999)),'shape'==m.data.category&&'background'==m.data.role){var p=m.findObject('SHAPE');m.data.gridWidth==2*l?(g=p,!p.__prestroke&&(p.__prestroke=p.stroke,p.stroke='rgba(255,0,0,0.5)')):p.__prestroke&&(p.stroke=p.__prestroke,delete p.__prestroke)}if(!g){if('between'==e.containingGroup.data.snapType)var u=2*l;else var u=2*l;e.diagram.model.startTransaction('addShape');var y={deletable:!0,role:'background',category:'shape',loc:go.Point.stringify(new go.Point(e.containingGroup.__yunPointsX[t-1],e.containingGroup.__yunPointsY[a-1])),movable:!0,group:-19,key:c.guid(),orderX:10,orderY:10,gridWidth:u,stroke:r[l-1],visible:!0,strokeDashArray:'[0,0]',strokeWidth:3};e.diagram.model.addNodeData(y),e.diagram.model.commitTransaction('addShape'),setTimeout(function(){var t=e.diagram.findNodeForKey(y.key);if(t){var a=t.findObject('SHAPE');a.__prestroke||(a.__prestroke=a.stroke,a.stroke='rgba(255,0,0,0.5)')}},100)}}else for(var s=e.containingGroup.findSubGraphParts().iterator,m;s.next();)if(m=s.value,'autoText'==m.data.category&&null!=m.data.orderX&&null!=m.data.orderY&&'freeText'==m.data.role&&(_Mathabs(m.data.orderX-t)==_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)<=_Mathabs(i-a)||_Mathabs(m.data.orderX-t)<=_Mathabs(o-t)&&_Mathabs(m.data.orderY-a)==_Mathabs(i-a))&&(m.areaBackground=null,m.zOrder=NaN),'shape'==m.data.category&&'background'==m.data.role){var p=m.findObject('SHAPE');d||(p.stroke='rgba(255,0,0,0)'),m.data.gridWidth==2*l?!p.__prestroke&&(p.__prestroke=p.stroke,p.stroke='rgba(255,0,0,0.7)'):p.__prestroke&&(p.stroke=p.__prestroke,delete p.__prestroke)}}},click:function(){},mouseOver:function(t,e){e.data.showBorder&&''==e.data.text&&('xuText'==e.data.role||'shiText'==e.data.role)&&(e.findObject('textBorder').visible=!0),'centerText'==e.data.role&&(e.layerName='Background')},mouseLeave:function(t,e){e.data.showBorder&&(e.findObject('textBorder').visible=!1),'centerText'==e.data.role&&(e.layerName='Foreground')},layoutConditions:go.Part.LayoutStandard&go.Part.LayoutRemoved&go.Part.LayoutAdded&~go.Part.LayoutNodeSized,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,contextMenu:l(go.Adornment),resizeAdornmentTemplate:l(go.Adornment,'Spot',l(go.Placeholder),l(go.Shape,'Circle',{alignment:go.Spot.BottomRight,cursor:'col-resize',desiredSize:new go.Size(15,15),fill:'lightblue',stroke:'dodgerblue'})),doubleClick:function(t,e){t.diagram.__trtd.selectText(t,e)}},new go.Binding('locationSpot','locationSpot',function(e){return go.Spot.parse(e)}).makeTwoWay(function(e){return go.Spot.stringify(e)}),new go.Binding('type','type',function(e){return go.Panel[e]}),new go.Binding('visible','visible').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('rotatable','rotatable').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('copyable','copyable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}),l(go.Shape,{strokeDashArray:null,opacity:.7,stretch:go.GraphObject.UniformToFill,name:'SHAPE',figure:'Circle',fill:'rgba(0,255,0,1)',fromLinkable:!1,toLinkable:!1,width:100,height:100,cursor:'pointer',minSize:new go.Size(50,50),strokeWidth:1,stroke:'black',portId:''},new go.Binding('strokeDashArray','shiStrokeDashArray',function(e){return JSON.parse(e)}).makeTwoWay(function(e){return JSON.stringify(e)}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('desiredSize','desiredSize',function(e){return go.Size.parse(e)}).makeTwoWay(function(e){return go.Size.stringify(e)}),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),new go.Binding('opacity','opacity').makeTwoWay()),l(go.Shape,{geometryString:'M540.5696 556.81024a81.8176 81.8176 0 0 1-53.0432-19.47648l-225.4848-191.52896a81.92 81.92 0 1 1 106.0864-124.86656l172.4416 146.47296 172.4416-146.47296a81.92 81.92 0 0 1 106.0864 124.86656l-225.4848 191.52896a81.7152 81.7152 0 0 1-53.0432 19.47648z m53.06368 246.23104l225.44384-191.52896a81.92 81.92 0 1 0-106.0864-124.84608l-172.40064 146.47296-172.48256-146.47296a81.92 81.92 0 1 0-106.04544 124.86656l225.52576 191.52896a81.7152 81.7152 0 0 0 53.00224 19.47648c18.88256 0 37.76512-6.49216 53.0432-19.49696z',visible:!1,name:'figure',cursor:'pointer',alignment:go.Spot.TopRight,alignmentFocus:go.Spot.TopRight,width:14,height:14,fill:'green',toolTip:l('ToolTip',l(go.Panel,'Vertical',l(go.Picture,new go.Binding('source','src',function(e){return'images/'+e+'.png'})),l(go.TextBlock,{text:'\u8FDB\u5165\u5B50\u76D8',margin:3}))),click:function(t){var e=t.targetObject.part;t.diagram.__trtd.openFigure({figure:e.data.figure,title:e.data.text,key:e.data.key,node:e})}},new go.Binding('visible','figure',function(e){return!!e})),l(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'18px \'Microsoft YaHei\'',editable:!1,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',verticalAlignment:go.Spot.Center,spacingAbove:4,spacingBelow:4,portId:'TEXT',margin:0,maxSize:new go.Size(600,NaN),minSize:new go.Size(10,10),stretch:go.GraphObject.UniformToFill,textEdited:function(e,t,a){var o=e.part;''==a.trim()&&('shiText'==o.data.role||'xuText'==o.data.role)&&(e.part.diagram.model.startTransaction('text'),e.part.diagram.model.setDataProperty(e.part.data,'nloc',null),e.part.diagram.model.commitTransaction('text')),e.part.data.role&&-1<e.part.data.role.indexOf('labelText')&&(e.part.containingGroup.layout.isValidLayout=!1)}},new go.Binding('background','background',function(e){return e}).makeTwoWay(),new go.Binding('areaBackground','areaBackground',function(e){return e}).makeTwoWay(),new go.Binding('textAlign','textAlign',function(e){return e}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return c.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('maxSize','',function(e){var t=NaN,a=NaN;return e.width&&(t=e.width),e.height&&(a=e.height),new go.Size(t,a)}),new go.Binding('minSize','minSize',function(e){return go.Size.parse(e)}),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()))}}]),t}(s);e.exports=g},function(e){'use strict';function t(){go.Link.call(this)}function a(e,t){var a,o;return 0<=t&&90>=t?(a=e*_Mathsin(t*_MathPI/180),o=e*_Mathcos(t*_MathPI/180),[o,a]):90<t&&180>=t?(a=e*_Mathsin((180-t)*_MathPI/180),o=e*_Mathcos((180-t)*_MathPI/180),[-o,a]):180<t&&270>=t?(a=e*_Mathsin((t-180)*_MathPI/180),o=e*_Mathcos((t-180)*_MathPI/180),[-o,-a]):270<t&&360>=t?(a=e*_Mathsin((360-t)*_MathPI/180),o=e*_Mathcos((360-t)*_MathPI/180),[o,-a]):void 0}function o(e,t,o){var i=new go.Point((t.x+o.x)/2,(t.y+o.y)/2);if(e.equals(t)){var d=i.copy(),l=_Mathsqrt(i.distanceSquaredPoint(t)),r=(t.directionPoint(o)+90)%360,s=.15*l,c=a(s,r);return d.offset(c[0],c[1]),l=_Mathsqrt(d.distanceSquaredPoint(t)),[l,d.x,d.y]}var g=_Mathsqrt(e.distanceSquaredPoint(i)),m=e.directionPoint(i),p=e.distanceSquaredPoint(o)<e.distanceSquaredPoint(t);if(p)var u=o.directionPoint(t);else var u=t.directionPoint(o);var y=_Mathabs(m-u);90<y&&180>y?y=180-y:180<=y&&(y=360-y);var h=g*_Mathcos(y*_MathPI/180),c=a(h,u),d=e.copy();d.offset(c[0],c[1]);var l=_Mathsqrt(d.distanceSquaredPoint(t));return[l,d.x,d.y]}function i(e,t,o){var i=arguments[3]?arguments[3]:triangleCircle(e,t,o);var r=i[0],d=new go.Point(i[1],i[2]),l=_Mathabs(d.directionPoint(e)-d.directionPoint(o));l=180<l?360-l:l;var s=r/_Mathcos(l/3*_MathPI/180),c=new go.Geometry(go.Geometry.Line);c.startX=d.x,c.startY=d.y,c.endX=e.x,c.endY=e.y,c.rotate(l/3,d.x,d.y);var g=d.direction(c.endX,c.endY),m;i=a(s,g),m=d.copy().offset(i[0],i[1]),c.rotate(l/3,d.x,d.y),g=d.direction(c.endX,c.endY);var p;return i=a(s,g),p=d.copy().offset(i[0],i[1]),[m,p]}var r=go.GraphObject.make;go.Diagram.inherit(t,go.Link),t.prototype.makeGeometry=function(){var e=go.Link.prototype.makeGeometry.call(this);return e.type!==go.Geometry.Path||0===e.figures.length?e:e},t.prototype.computePoints=function(){var e=Math.acos,t=this.diagram;if(null==this.fromNode||null==this.toNode)return!0;if(this.fromNode.location.equals(this.toNode.location))return!1;var a=this.fromNode.location.copy(),r=this.toNode.location.copy();if(!a.isReal()||!r.isReal())return!0;var d=t.findNodeForKey(this.toNode.data.parent);if(!d)return!0;d=d.location;var l=o(d,a,r),s=l,c=new go.Point(s[1],s[2]);this.micenter=c;var g=s[0],m=this.fromNode.actualBounds.width/2,p=this.toNode.actualBounds.width/2,u=(2*g*g-m*m)/(2*g),y=180*e(u/g)/_MathPI,h=new go.Geometry(go.Geometry.Line);h.startX=c.x,h.startY=c.y,h.endX=this.fromNode.location.x,h.endY=this.fromNode.location.y,y||(y=0),h.rotate(y,c.x,c.y);var k=new go.Point(h.endX,h.endY);u=(2*g*g-p*p)/(2*g),y=180*e(u/g)/_MathPI,h.endX=this.toNode.location.x,h.endY=this.toNode.location.y,y||(y=0),h.rotate(-y,c.x,c.y);var f=new go.Point(h.endX,h.endY),x=i(k,null,f,s),T=x[0],b=x[1];this.clearPoints(),(isNaN(k.x)||isNaN(k.y))&&(k=this.fromNode.location.copy()),(isNaN(f.x)||isNaN(f.y))&&(f=this.toNode.location.copy()),this.points.add(k),this.points.add(x[0]),this.points.add(x[1]),this.points.add(f);return!0},e.exports=function(){return r(t,{curve:go.Link.Bezier,layerName:'',isTreeLink:!0,curviness:30,adjusting:go.Link.Stretch,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,layoutConditions:go.Part.LayoutStandard&~go.Part.LayoutNodeSized,mouseDragEnter:function(t,e){var a=e.part,o=a.findObject('SHAPE');o._preStoke=o.stroke,o.stroke='darkred',o._preStrokeWidth=o.strokeWidth,o.strokeWidth=5},mouseDragLeave:function(t,e){var a=e.part,o=a.findObject('SHAPE');o.stroke=o._preStoke,o.strokeWidth=o._preStrokeWidth},mouseDrop:function(t,e){var a=e.part,o=t.diagram.selection.first();if(!(!o instanceof go.Node)&&!(!o instanceof go.Group)&&1!=o.data.key){var i=a.fromNode,r=a.toNode;r.data.parent==i.data.key?t.diagram.__trtd.setNodeAsChildren(o,i):t.diagram.__trtd.setNodeAsSibling(o,i)}}},r(go.Shape,{name:'SHAPE',stroke:'#767678',strokeWidth:3},new go.Binding('strokeWidth','strokeWidth').makeTwoWay(),new go.Binding('stroke','color').makeTwoWay(),new go.Binding('strokeDashArray','strokeDashArray',function(e){try{var t=[parseInt(e.split(' ')[0]),parseInt(e.split(' ')[1])]}catch(t){var t=null}return t}).makeTwoWay(function(e){return e[0]+' '+e[1]})),r(go.Shape,{name:'Arrow',toArrow:'Triangle',stroke:'#767678',strokeWidth:3},new go.Binding('strokeWidth','strokeWidth'),new go.Binding('fill','color'),new go.Binding('stroke','color'),new go.Binding('toArrow','toArrow')),new go.Binding('curviness','curviness').makeTwoWay(),new go.Binding('points').makeTwoWay())}},function(e,t,a){'use strict';function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function d(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t=e.selection.first();if(t.data.istemp){e.model.startTransaction();var a=e.findNodeForKey(t.data.parent);e.model.setDataProperty(t.data,'istemp',void 0);for(var o=null;a;){if(a.data.istemp)e.model.setDataProperty(a.data,'istemp',void 0),e.model.setDataProperty(a.data,'text','\u53CC\u51FB\u7F16\u8F91\u5185\u5BB9'),o=a;else{o&&e.model.setDataProperty(a.data,'isparent',o.data.key);break}a=e.findNodeForKey(a.data.parent)}e.model.commitTransaction(),e.isModified=!0}}function s(e,t){var a=t.__trtd.tdCurrentTheme;if(t.model.setDataProperty(e,'strokeWidth',a.borderWidth),t.model.setDataProperty(e,'stroke',a.borderColor),null==a.colorRange)t.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0]);else if(a.colorRange instanceof Array){var o='white';o=e.level>=a.colorRange.length?a.colorRange[e.level%a.colorRange.length]:a.colorRange[e.level],t.model.setDataProperty(e,'fill',o)}else if('random'!=a.colorRange)'white'==a.colorRange?t.model.setDataProperty(e,'fill','white'):t.model.setDataProperty(e,'fill','rgba(0,0,0,0)');else if(e.prev){var i=t.findNodeForKey(e.prev);i?t.model.setDataProperty(e,'fill',i.data.fill):t.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0])}else t.model.setDataProperty(e,'fill',randomColor({luminosity:'light',count:1})[0]);return e}function c(e,t){var a=e.sweep?e.sweep:360,t=e.layerThickness||100,o=e.dradius?e.dradius:100,i=new go.Point(o+t,0).rotate(-a/2),r=new go.Point(o,0).rotate(a/2),d=new go.Geometry().add(new go.PathFigure(i.x,i.y).add(new go.PathSegment(go.PathSegment.Arc,-a/2,a,0,0,o+t,o+t)).add(new go.PathSegment(go.PathSegment.Line,r.x,r.y)).add(new go.PathSegment(go.PathSegment.Arc,a/2,-a,0,0,o,o).close()));return d.normalize(),d}function g(e){var t=null;return t=e.nodeDataArray.find(function(e){if(!e.isGroup&&'Root'==e.category&&0==e.level)return!0}),t}var m=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),u=a(0),p=a(12),y=a(2),h=a(10).Trtd,k=go.GraphObject.make,f=function(e){function t(e,a){i(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a));return o.config=a,o.modelChangedListener=a.modelChangedListener,o.type=a.type,o.diagram={},o.model=a.model,o.readOnly=!1,null!=a.readOnly&&(o.readOnly=a.readOnly),o.initDiagramBase(e,a),o.diagram=o.initDiagram(e,a),o.initListener(),o.model&&o.initModel(),o}return d(t,e),m(t,[{key:'initDiagram',value:function(e,t){var a=this.diagram,o=Object.assign({"undoManager.isEnabled":!0,allowMove:!0,"animationManager.isEnabled":!1},t.diagramConfig);return this.diagram.setProperties(o),this.addNodeTemplate(),a}},{key:'getTdData',value:function(){return this.diagram.model.toJson()}},{key:'getDefaultCustomMenuDivStr',value:function(){return'\n        <ul>\n            <li trtd_action="addFollowerGround"><a class="i18n" data-lang="insertsl">\u589E\u52A0\u540C\u7EA7\u8282\u70B9</a></li>\n            <li trtd_action="addNewCircle"><a class="i18n" data-lang="icn">\u589E\u52A0\u5B50\u8282\u70B9</a></li>\n            <li trtd_action="apiDeleteSelection"><a class="i18n" data-lang="remove">\u5220\u9664</a></li>\n        </ul>\n        '}},{key:'getShowContextMenus',value:function(e){return e?'addFollowerGround,addNewCircle,apiDeleteSelection':'none'}},{key:'addTextNode',value:function(e){var t=this.diagram;t.startTransaction();var a={text:e||p.trans('blankText'),category:'text'};a.loc=go.Point.stringify(t.lastInput.documentPoint),t.model.addNodeData(a),t.commitTransaction()}},{key:'initModel',value:function(e){e&&(this.model=e);var t=go.Model.fromJson(this.model);'dipan'==t.modelData.currentType&&(t.nodeDataArray=t.nodeDataArray.filter(function(e){if(!e.isGroup)return delete e.group,!0}),t.linkDataArray=[]),this.diagram.layout.isInitial=!1,t.modelData.type=this.type,this.diagram.model=t,this.groundLayout(this.diagram),this.diagram.updateAllTargetBindings()}},{key:'loadModel',value:function(e){this.initModel(e)}},{key:'initListener',value:function(){}},{key:'addNodeTemplate',value:function(){var e=this,t=this.diagram,a=this.tdGetModelData(null,t.model,t),o=parseInt(a.layerThickness),i=a.tdDipanTextAngle;t.nodeTemplateMap.add('dipan',this.createDipanTemplate(o,i)),t.nodeTemplateMap.add('Root',this.getDipanRootTemplate(o)),t.nodeTemplateMap.add('3',y(this.diagram))}},{key:'createTextNodeTemplate',value:function(){var e={figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:1,stroke:'rgba(0,0,0,0)',fontSize:15,font:'sans-serif'};return k(go.Node,'Spot',{_controlExpand:!0,layerName:'Foreground',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,location:new go.Point(0,0),toMaxLinks:1,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,contextMenu:this.getNodeContextMenu},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),k(go.Shape,{strokeDashArray:null,name:'SHAPE',figure:'Rectangle',fill:'rgba(0,0,0,0)',fromLinkable:!0,toLinkable:!0,cursor:'pointer',minSize:new go.Size(50,50),strokeWidth:2,stroke:'rgba(0,0,0,0)',portId:'',width:150},new go.Binding('strokeDashArray','strokeDashArray',function(e){return[e.split()[0],e.split()[1]]}).makeTwoWay(function(e){return e[0]+' '+e[1]}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),{figure:e.figure,fill:e.fill,strokeWidth:e.strokeWidth,stroke:e.stroke}),k(go.Shape,{name:'SHAPE_Back',figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:0},new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('height','height',function(e){return e}).ofObject('SHAPE')),k(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'bold 22px \u5E7C\u5706',editable:!0,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Fill},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()))}},{key:'createDipanTemplate',value:function(e,t){if(null==100);if(null=='zhengli');var a=this,o=go.GraphObject.make;return o(go.Node,'Spot',{locationSpot:go.Spot.Center,locationObjectName:'MAIN',selectionObjectName:'SHAPE',click:function(t,e){a.readOnly&&e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},contextMenu:this.getNodeContextMenu,movable:!1,doubleClick:function(t){if(!a.readOnly){var e=t.diagram,o=e.selection.first();if(o){var i=e.selection.first().findObject('TEXT');i&&e.commandHandler.editTextBlock(i),u.simulateEnterWithAlt(t),l(e)}}},selectionAdorned:!a.readOnly,selectionAdornmentTemplate:o(go.Adornment,'Spot',o(go.Panel,'Auto',o(go.Shape,{fill:'rgba(255,232,211,0.1)',stroke:'blue',strokeWidth:2}),o(go.Placeholder)),o('Button',{alignment:go.Spot.RightCenter,alignmentFocus:go.Spot.Bottom,width:30,height:30,click:function(t){var e=t.diagram.selection.first();if(e.data.parent){var o=e.diagram.findNodeForKey(e.data.parent);if(o.data.istemp)return}a.addNewCircle(t)}},o(go.Shape,'PlusLine',{desiredSize:new go.Size(15,15)})),o('Button',{alignment:go.Spot.BottomCenter,width:30,height:30,click:function(t){t.diagram.selection.first().data.istemp||a.addFollowerGround(t)}},o(go.Shape,'PlusLine',{desiredSize:new go.Size(15,15)}))),mouseOver:function(){},mouseLeave:function(){},mouseDragEnter:function(){},mouseDragLeave:function(){},mouseDrop:function(){}},new go.Binding('angle','dangle'),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('selectionAdorned','selectionAdorned',function(e){return e?e:''}).makeTwoWay(function(e){return e}),o(go.Shape,{figure:'Rectangle',name:'MAIN',fill:'rgba(255,255,0,0)',strokeWidth:0,stroke:'red',height:1},new go.Binding('width','layerThickness',function(e){return parseInt(e||100)})),o(go.Shape,{name:'SHAPE',fill:'lightgray',strokeWidth:2,margin:5,stroke:'green',alignment:go.Spot.Right,alignmentFocus:go.Spot.Right,portId:''},new go.Binding('geometry','',function(e){return c(e)}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e})),o(go.Shape,{figure:'Rectangle',name:'LOCATE',fill:'rgba(0,255,0,0)',strokeWidth:0,stroke:'green',height:20,alignment:go.Spot.Right,alignmentFocus:go.Spot.Right},new go.Binding('width','layerThickness',function(e){return parseInt(e||100)})),o(go.TextBlock,{name:'TEXT',isMultiline:!0,click:function(){},textAlign:'center',editable:!1,wrap:go.TextBlock.WrapDesiredSize,overflow:go.TextBlock.OverflowClip,spacingAbove:4,spacingBelow:4,font:'bold 15px \u5E7C\u5706'},new go.Binding('text').makeTwoWay(),new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay(),new go.Binding('width','',function(e){var t=e.tdDipanTextAngle||'xuanzhuan',a=parseInt(e.layerThickness||100),o=.7*(e.sweep/180*e.dradius*_MathPI);return'fangshe'==t?o:'zhengli'==t?.7*a:'xuanzhuan'==t?.7*a:void 0}),new go.Binding('angle','textAngle').makeTwoWay(),new go.Binding('alignment','tdDipanTextAngle',function(e){var t=e||'xuanzhuan',a=go.Spot.Center;return'xuanzhuan'===t?a=go.Spot.Center:'fangshe'===t?a=go.Spot.Left:'zhengli'===t?a=go.Spot.Center:void 0,a}),new go.Binding('alignmentFocus','tdDipanTextAngle',function(e){var t=e||'xuanzhuan',a=go.Spot.Center;return'xuanzhuan'===t?a=go.Spot.Center:'fangshe'===t?a=go.Spot.Left:'zhengli'===t?a=go.Spot.Center:void 0,a})))}},{key:'getDipanRootTemplate',value:function(){var t=this,a=this,e;return k(go.Node,'Auto',(e={locationSpot:go.Spot.Center,selectionAdorned:!0,movable:!1,click:function(t,e){a.readOnly&&e.diagram.__trtd.nodeClickListener&&e.diagram.__trtd.nodeClickListener(e)},doubleClick:function(t){if(!a.readOnly){var e=t.diagram,o=e.selection.first();if(o){var i=e.selection.first().findObject('TEXT');i&&e.commandHandler.editTextBlock(i),u.simulateEnterWithAlt(t)}}},mouseOver:function(){},mouseLeave:function(){}},o(e,'selectionAdorned',!a.readOnly),o(e,'selectionAdornmentTemplate',k(go.Adornment,'Spot',k(go.Panel,'Auto',k(go.Shape,{fill:'rgba(255,232,211,0.1)',stroke:'blue',strokeWidth:2}),k(go.Placeholder)),k('Button',{alignment:go.Spot.RightCenter,alignmentFocus:go.Spot.Bottom,width:30,height:30,click:function(a){var e=a.diagram.selection.first();if(e.data.parent){var o=e.diagram.findNodeForKey(e.data.parent);if(o.data.istemp)return}t.addNewCircle(a)}},k(go.Shape,'PlusLine',{desiredSize:new go.Size(15,15)})))),o(e,'location',new go.Point(0,0)),e),new go.Binding('width','layerThickness',function(e){return e?2*e:200}),new go.Binding('height','layerThickness',function(e){return e?2*e:200}),k(go.Shape,'Circle',{name:'SHAPE',fill:'#FFBFBF',strokeWidth:0,spot1:go.Spot.TopLeft,spot2:go.Spot.BottomRight},new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e})),k(go.TextBlock,{name:'TEXT',font:'bold 23px \u5E7C\u5706',textAlign:'center',editable:!1,spacingAbove:4,isMultiline:!0,spacingBelow:4},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return u.tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('width','width').makeTwoWay(),new go.Binding('font','font').makeTwoWay(),new go.Binding('angle','textAngle').makeTwoWay()))}},{key:'tdGetModelData1',value:function(e,t){return Object.assign({currentType:'dipan',currentThemeID:0,layerThickness:100,splitLayer:1,layout:'inner',tdDipanTextAngle:'xuanzhuan'},t.modelData)}},{key:'tdGetModelData',value:function(e,t){var a=this.diagram,t=a.model,o={currentType:'tianpan',currentThemeID:0,layerThickness:100,splitLayer:1,layout:'inner',tdDipanTextAngle:'xuanzhuan'},i=g(t);if('undefined'!=typeof e&&null!=e)return i?i[e]||t.modelData[e]||o[e]:t.modelData[e]||o[e];if(i)for(var r in o)i[r]?o[r]=i[r]:t.modelData&&t.modelData[r]&&(o[r]=t.modelData[r]);else for(var r in o)t.modelData&&t.modelData[r]&&(o[r]=t.modelData[r]);return o}},{key:'deleteSelection',value:function(){var e=this.diagram,t=e.selection.first();var a=e.commandHandler,o=null;if(t&&!t.data.istemp&&1!=t.data.key&&'g_1'!=t.data.key&&'Root'!=t.data.key){e.model.startTransaction('all'),e.model.startTransaction('level1'),e.model.setDataProperty(t.data,'istemp',!0),this.deleteNode(t,e);var r=this.getMaxCircle(e),d=[];e.model.nodeDataArray.forEach(function(e){e.level>r&&d.push(e)}),e.model.removeNodeDataCollection(d),e.model.nodeDataArray.forEach(function(t){t.level==r&&null!=t.isparent&&e.model.setDataProperty(t,'isparent',null)}),e.model.removeNodeData(t.data),e.model.commitTransaction('level1'),this.groundLayout(e),e.model.commitTransaction('all');for(var o=null,l=['next','prev','parent'],s=0;s<l.length;s++)if(t.data[l[s]]){o=e.findNodeForKey(t.data[l[s]]);break}o&&e.select(o)}}},{key:'deleteNode',value:function(e){var t=this.diagram,a=e.data.prev?t.findNodeForKey(e.data.prev):null,o=e.data.next?t.findNodeForKey(e.data.next):null,r=e.data.parent?t.findNodeForKey(e.data.parent):null;if(e.data.isparent){var d=t.findNodeForKey(e.data.isparent),l=[];u.tdTravelTdpData(d.data,t.model,l,function(e){return e}),t.model.removeNodeDataCollection(l);this.getMaxCircle(t)}if(null!=r&&(r.data.isparent==e.data.key?null==o?t.model.setDataProperty(r.data,'isparent',void 0):(t.model.setDataProperty(r.data,'isparent',o.data.key),t.model.setDataProperty(o.data,'prev',void 0)):(t.model.setDataProperty(a.data,'next',null==o?null:o.data.key),null!=o&&t.model.setDataProperty(o.data,'prev',a.data.key))),'dipan'==t.model.modelData.currentType){for(var s=0,c=0;c<t.model.nodeDataArray.length&&(t.model.nodeDataArray[c].istemp||t.model.nodeDataArray[c].isGroup||s++,!(1<s));c++);if(1>=s){var i=t.model.findNodeDataForKey(1);delete i.group}}t.isModified=!0}},{key:'getMaxCircle',value:function(){var e=this.diagram,t=0,a=[],o=[],i=[],r=[];e.model.nodeDataArray.forEach(function(e){e.istemp||e.isGroup?r.push(e):(a.push(e),e.level&&o.push(e.level))});var d=_Mathmax.apply(null,o);return a.forEach(function(e){e.level===d&&i.push(e)}),d===-Infinity&&0===i.length?(t=0):d!==-Infinity&&0===i.length?t=d-1:0<i.length&&(t=d),t}},{key:'addNewCircle',value:function(){var e=this.diagram,t=this.getMaxCircle(),a=e.selection.first();if(a&&!(a.data.isparent&&e.findNodeForKey(a.data.isparent)&&!e.findNodeForKey(a.data.isparent).visible)){e.model.startTransaction('addNewCircle'),'istemp'in a.data&&a.data.istemp&&(l(e),''==a.data.text&&e.model.setDataProperty(a.data,'text',p.trans('dce')));var o=null;if(a.data.isparent&&(o=e.model.findNodeDataForKey(a.data.isparent)),null!=o&&o.istemp)e.model.setDataProperty(o,'istemp',!1),e.model.setDataProperty(o,'text',p.trans('dce'));else{var i=this.addChildNodeData(a);i.level>t&&(t=i.level),this.groundLayout(e)}e.model.commitTransaction('addNewCircle')}}},{key:'addChildNodeData',value:function(e){var t=null==window.localStorage.getItem('isautolayout')||'true'==window.localStorage.getItem('isautolayout'),a=e.diagram,o=arguments[1]?arguments[1]:null,i=(a.model.nodeDataArray.length+1).toString(),r={key:i,text:p.trans('dce')};a.model.makeNodeDataKeyUnique(r),i=r.key;var d=null;r.level=e.data.level+1,r.parent=e.data.key,r.prev=void 0,e.data.isparent&&(d=a.model.findNodeDataForKey(e.data.isparent),d&&(r.next=d.key,a.model.setDataProperty(d,'prev',r.key))),null!=o&&(r.istemp=!0,r.text='');var l=a.model.modelData.layerThickness;return r.dangle=e.data.dangle,r.dradius=e.data.dradius,r.sweep=e.data.sweep,r.layerThickness=l||100,r.tdDipanTextAngle=e.data.tdDipanTextAngle||'xuanzhuan',0!=e.data.level&&(r.category=e.data.category),'Root'==e.data.category&&(r.category='dipan'),r.strokeWidth=e.data.strokeWidth,e.data.figure&&(r.figure=e.data.figure),e.data.picture&&(r.picture=e.data.picture),e.data.width&&(r.width=e.data.width),e.data.height&&(r.height=e.data.height),r=s(r,a),r.font=e.data.font,r.textStroke=e.findObject('TEXT').stroke,a.model.setDataProperty(e.data,'isparent',i),r.newAdd=!0,a.model.addNodeData(r,a),a.isModified=!0,r}},{key:'addFollowerGround',value:function(){var e=this.diagram;if(0!=e.selection.count){var t=e.selection.first();if(1!=t.data.key&&t){var a=t.diagram;if(null!==t&&t instanceof go.Node&&!(t instanceof go.Group)){e.model.startTransaction('all'),'istemp'in t.data&&t.data.istemp&&(l(e),''==t.data.text&&e.model.setDataProperty(t.data,'text','')),e.startTransaction('sub1');var o=this.addLevelNodeData(t);e.commitTransaction('sub1'),this.groundLayout(e),e.model.commitTransaction('all');var i=a.findNodeForData(o);i&&a.select(i)}}}}},{key:'addLevelNodeData',value:function(e){var t=null==window.localStorage.getItem('isautolayout')||'true'==window.localStorage.getItem('isautolayout'),a=this.diagram,o=e.data.next,i=(a.model.nodeDataArray.length+1).toString(),r={key:i,text:p.trans('dce'),color:'yellow'};a.model.makeNodeDataKeyUnique(r),i=r.key;var d=null;if(o)var d=a.model.findNodeDataForKey(o);a.model.startTransaction(),r=s(r,a);return null!=d&&(r.next=d.key,a.model.setDataProperty(d,'prev',r.key)),r.level=e.data.level,r.radius=e.data.radius,r.fill=e.data.fill,r.dangle=e.data.dangle,r.dradius=e.data.dradius,r.sweep=e.data.sweep,r.layerThickness=e.data.layerThickness||100,r.tdDipanTextAngle=e.data.tdDipanTextAngle||'xuanzhuan',r.parent=e.data.parent,r.prev=e.data.key,r.strokeWidth=e.data.strokeWidth,r.stroke=e.data.stroke,r.font=e.data.font,r.textStroke=e.findObject('TEXT').stroke,e.data.figure&&(r.figure=e.data.figure),r.loc=e.data.loc,e.data.width&&(r.width=e.data.width),e.data.height&&(r.height=e.data.height),r.category=e.data.category,r.newAdd=!0,a.model.addNodeData(r),a.model.setDataProperty(e.data,'next',i),a.model.commitTransaction(),a.isModified=!0,r}},{key:'moveWithinNodes',value:function(e){var t=this.diagram,a=t.selection.first();if(a){if(!a)return void t.select(t.findNodeForKey(1));switch(e){case'left':if(a.data.prev){var o=t.findNodeForKey(a.data.prev);o&&t.select(o)}break;case'up':if(a.data.parent){var o=t.findNodeForKey(a.data.parent);o&&t.select(o)}break;case'right':if(a.data.next){var o=t.findNodeForKey(a.data.next);o&&t.select(o)}break;case'down':if(a.data.isparent){var o=t.findNodeForKey(a.data.isparent);o&&t.select(o)}}}}},{key:'selectText',value:function(t){var e=this.diagram,a=e.selection.first();if(a){var o=e.selection.first().findObject('TEXT');o&&e.commandHandler.editTextBlock(o),u.simulateEnterWithAlt(t)}}},{key:'groundLayout',value:function(e){function t(e,t){e.diagram.startTransaction('radial layout');var a=t.model.modelData.layerThickness||100,i=e.data.tdDipanTextAngle||'xuanzhuan';e.diagram.model.setDataProperty(e.data,'dangle',0),e.diagram.model.setDataProperty(e.data,'sweep',360),e.diagram.model.setDataProperty(e.data,'dradius',0),t.nodes.each(function(e){e.data._laid=!1}),e.location=new go.Point(0,0),m=s.getMaxCircle(t),o(e,1,90,360,a,i,t),e.diagram.commitTransaction('radial layout')}function o(e,t,r,d,l,c,g){s.addChildNodeData;try{var u=i(e)}catch(t){}e.data.key;if(!(3<=e.data.category)){var y=u.length;if(!(0===y&&e.data.level>=m)){if(0===y){var h=s.addChildNodeData(e,'temp'),k=g.findNodeForData(h);u.push(k),y++}for(var f=g.model.findNodeDataForKey(1),x=parseInt(f.layerThickness),T=x+(t-1)*l,b=d/y,S=0;S<y;S++){var v=u[S],w=r-d/2+b/2+S*b,P=new go.Point(T+l/2,0);if(v.data._laid){o(v,t+1,v.data.dangle,v.data.sweep,l,c,g);continue}P.rotate(w),v.diagram.model.setDataProperty(v.data,'loc',go.Point.stringify(P)),v.data._laid=!0,v.diagram.model.setDataProperty(v.data,'dangle',w),v.diagram.model.setDataProperty(v.data,'sweep',b),v.diagram.model.setDataProperty(v.data,'dradius',T),v.diagram.model.setDataProperty(v.data,'layerThickness',l);var p=v.findObject('TEXT');null!==p&&(p.angle=90<w&&270>w||-90>w?180:0,'xuanzhuan'==c&&v.diagram.model.setDataProperty(v.data,'textAngle',p.angle),'fangshe'==c&&v.diagram.model.setDataProperty(v.data,'textAngle',90),'zhengli'==c&&v.diagram.model.setDataProperty(v.data,'textAngle',-w)),'1'==v.data.key&&v.diagram.model.setDataProperty(v.data,'textAngle',0),o(v,t+1,w,d/y,l,c,g)}}}}function a(e){return e.model.modelData.layout?e.model.modelData.layout:'inner'}function i(e){try{if(!e.data.isparent)return[];var t=[],a;if(!e.data.isparent)return[];var o=e.diagram.findNodeForKey(e.data.isparent);if(a=o,a)for(t.push(o);a.data.next&&(a=e.diagram.findNodeForKey(a.data.next),!!a);)t.push(a);return t}catch(t){}}function r(t,i){null==t&&(t=i.findNodeDataForKey(1));var r=i.findNodeDataForKey(1),l=parseInt(r.layerThickness);i.nodeDataArray.forEach(function(e){e._laid=!1});var s=e.model.modelData.layerThickness,c=t.tdDipanTextAngle||'xuanzhuan',g=arguments[2]?arguments[2]:getMaxCircle(e),m=d(t,i,g),y=m.count;if(!(0>=y)){var h=360/y,k=i.nodeDataArray.length,f=[];if(t.isparent)var x=i.findNodeDataForKey(t.isparent);else return;u.tdTravelTdpData(x,i,f,function(e){return e});for(var T=1,b;T<=g;T++){b=_.filter(f,function(e){return!e.isGroup&&e.level==T});for(var S=0,v=0,w=l+(T-1)*s,P=0,B;P<b.length;P++){if(B=b[P],B._laid=!0,'1'==B.key){i.setDataProperty(n.data,'textAngle',0);continue}if(m=d(B,i,g),y=m.count,!(0>y)){if(0==y)var D=h;else var D=y*h;0==P&&(v=-90),S=v+D/2,v+=D;var N=S,A=new go.Point(w+s/2,0);A.rotate(N),i.setDataProperty(B,'loc',go.Point.stringify(A)),i.setDataProperty(B,'dangle',N),i.setDataProperty(B,'sweep',D),i.setDataProperty(B,'dradius',w),i.setDataProperty(B,'layerThickness',s);var p=90<N&&270>N||-90>N?180:0;if('xuanzhuan'==c&&i.setDataProperty(B,'textAngle',p),'fangshe'==c){var p=0<N&&180>N||-180>N?180:0;i.setDataProperty(B,'textAngle',90)}'zhengli'==c&&i.setDataProperty(B,'textAngle',-N)}}}g<this.getMaxCircle(e)&&o(e.findNodeForKey(1),1,90,360,s,c)}}function d(e,t,a,o){var i={count:0,list:[]},r=!1;try{if(1==e.key)t.nodeDataArray.forEach(function(e){r=o?e.level>=a:e.level==a,!_.has(e,'isGroup')&&r&&(i.count+=1,i.list.push(e))});else{if(e.isparent)var d=t.findNodeDataForKey(e.isparent);else return i;u.tdTravelTdpData(d,t,[],function(e){r=o?e.level>=a:e.level==a,!_.has(e,'isGroup')&&r&&(i.count+=1,i.list.push(e))})}}catch(t){return{count:0,list:[]}}return i}var e=this.diagram,l=e.findNodeForKey(1),s=this;if(l){l.location=new go.Point(0,0);var c=l.diagram;if(null!==c){l.data.category='Root';var g=a(e);if('out'==g){var m=this.getMaxCircle(e),p=e.model;u.tdTravelTdpData(l.data,p,[],function(t){if(t.level<m&&'undefined'==typeof t.isparent){var a=e.findNodeForKey(t.key);s.addChildNodeData(a,'temp')}}),changeLayout()}else'inner'==g?t(l,e):(splitLayer=e.model.modelData.splitLayer?e.model.modelData.splitLayer:splitLayer,r(null,e.model,splitLayer))}}}},{key:'dokeyDownFnq',value:function(t){var a=this.diagram,o=a.lastInput,e=a.commandHandler,i=a.selection.first();if(65<=o.event.keyCode&&90>=o.event.keyCode&&!o.event.altKey&&!o.event.ctrlKey&&!o.event.shiftKey)return o.bubbles=!1,this.selectText(o,t),!0;if(13===o.event.keyCode)i&&'Root'==i.data.category?this.addFollowerGround():i&&'dipan'==i.data.category&&this.addFollowerGround();else if(9===o.event.keyCode)i&&'Root'==i.data.category?this.addNewCircle():i&&'dipan'==i.data.category&&this.addNewCircle();else if('t'===o.key)e.canCollapseSubGraph()?e.collapseSubGraph():e.canExpandSubGraph()&&e.expandSubGraph();else if('Del'==o.key){if(0==a.selection.count)return;o.diagram.commandHandler.deleteSelection()}else 113==o.event.keyCode?this.selectText():37==o.event.keyCode?this.moveWithinNodes('left'):38==o.event.keyCode?this.moveWithinNodes('up'):39==o.event.keyCode?this.moveWithinNodes('right'):40==o.event.keyCode?this.moveWithinNodes('down'):go.CommandHandler.prototype.doKeyDown.call(e);o.bubbles=!1}},{key:'downloadImage',value:function(){var e=this.diagram,t=e.makeImageData({scale:1,background:'#ffffff',type:'image/png',maxSize:new go.Size(9e3,9e3)});return t}}]),t}(h);f.go=go,e.exports=f},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=a(4),s=a(7),c=a(2),g=a(5),m=a(3),p=a(6),u=function(e){function t(e,a){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a))}return r(t,e),d(t,[{key:'addNodeTemplate',value:function(){var e=this.diagram;e.nodeTemplateMap.add('0',s(this.diagram)),e.nodeTemplateMap.add('1',s(this.diagram)),e.nodeTemplateMap.add('2',s(this.diagram)),e.nodeTemplateMap.add('3',c(this.diagram)),e.nodeTemplateMap.add('4',g(this.diagram)),e.nodeTemplateMap.add('text',m(this.diagram)),e.nodeTemplateMap.add('',s(this.diagram)),e.nodeTemplateMap.add('8',p(this.diagram))}}]),t}(l);e.exports=u},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=a(4),s=a(7),c=a(2),g=a(5),m=a(3),p=a(6),u=function(e){function t(e,a){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a))}return r(t,e),d(t,[{key:'addNodeTemplate',value:function(){var e=this.diagram;e.nodeTemplateMap.add('0',s(this.diagram)),e.nodeTemplateMap.add('1',s(this.diagram)),e.nodeTemplateMap.add('2',s(this.diagram)),e.nodeTemplateMap.add('3',c(this.diagram)),e.nodeTemplateMap.add('4',g(this.diagram)),e.nodeTemplateMap.add('text',m(this.diagram)),e.nodeTemplateMap.add('',s(this.diagram)),e.nodeTemplateMap.add('8',p(this.diagram))}}]),t}(l);e.exports=u},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=a(4),s=a(7),c=a(2),g=a(5),m=a(3),p=a(6),u=function(e){function t(e,a){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a))}return r(t,e),d(t,[{key:'addNodeTemplate',value:function(){var e=this.diagram;e.nodeTemplateMap.add('0',s(this.diagram)),e.nodeTemplateMap.add('1',s(this.diagram)),e.nodeTemplateMap.add('2',s(this.diagram)),e.nodeTemplateMap.add('3',c(this.diagram)),e.nodeTemplateMap.add('4',g(this.diagram)),e.nodeTemplateMap.add('text',m(this.diagram)),e.nodeTemplateMap.add('',s(this.diagram)),e.nodeTemplateMap.add('8',p(this.diagram))}}]),t}(l);e.exports=u},function(e,t,a){'use strict';function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function d(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(){return P(go.Node,'Vertical',{movable:!1,locationSpot:go.Spot.Bottom,location:new go.Point(0,0),angle:90,click:function(){},selectionAdornmentTemplate:function(){var e=go.GraphObject.make;return e(go.Adornment,'Spot',e(go.Panel,'Auto',e(go.Shape,{figure:'Linev',fill:'blue',stroke:'blue',strokeWidth:2}),e(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'blue',stroke:'blue',strokeWidth:0,alignment:new go.Spot(.5,0,0,0)}),e(go.Placeholder)))}(),contextMenu:h,mouseEnter:function(t,e){e.diagram},mouseLeave:function(t){t.diagram}},new go.Binding('angle','angle').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('selectable','selectable').makeTwoWay(),P(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'rgb(135,153,196)',stroke:'#8799c4',strokeWidth:0,strokeDashArray:[0,0]},new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('fill','stroke').makeTwoWay()),P(go.Shape,{name:'LINE',figure:'Linev',stroke:'#8799c4',strokeWidth:2,strokeDashArray:[4,2]},new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('strokeDashArray','strokeDashArray').makeTwoWay(),new go.Binding('geometryString','geometryString').makeTwoWay(),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay()))}function s(){return P(go.Node,'Vertical',{movable:!1,locationSpot:go.Spot.Bottom,location:new go.Point(0,0),click:function(){},selectionAdornmentTemplate:function(){var e=go.GraphObject.make;return e(go.Adornment,'Spot',e(go.Panel,'Auto',e(go.Shape,{figure:'Linev',fill:'rgba(255,0,120,0.2)',stroke:'blue',strokeWidth:2}),e(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'blue',stroke:'blue',strokeWidth:0,alignment:new go.Spot(.5,0,0,0)}),e(go.Placeholder)))}(),contextMenu:h,mouseEnter:function(t,e){e.diagram},mouseLeave:function(t){t.diagram}},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('selectable','selectable').makeTwoWay(),P(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'rgb(135,153,196)',stroke:'#8799c4',strokeWidth:0,strokeDashArray:[0,0]},new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('fill','stroke').makeTwoWay()),P(go.Shape,{name:'LINE',figure:'Linev',stroke:'#8799c4',strokeWidth:2,strokeDashArray:[4,2]},new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('strokeDashArray','strokeDashArray').makeTwoWay(),new go.Binding('geometryString','geometryString').makeTwoWay(),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay()))}function c(t){var e=go.GraphObject.make;return e(go.Node,'Vertical',{movable:!1,locationSpot:go.Spot.Bottom,location:new go.Point(0,0),angle:0,click:function(){},selectionAdornmentTemplate:function(){var e=go.GraphObject.make;return e(go.Adornment,'Spot',e(go.Panel,'Auto',e(go.Shape,{figure:'Linev',fill:'blue',stroke:'blue',strokeWidth:2}),e(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'blue',stroke:'blue',strokeWidth:2,alignment:new go.Spot(.5,0,0,0)}),e(go.Placeholder)))}(),mouseHover:function(){},mouseEnter:function(t,e){var a=e.diagram;a.model.setDataProperty(e.data,'stroke','blue'),a.model.setDataProperty(e.data,'fill','blue')},mouseLeave:function(a,e){var o=e.diagram;t.removeNodeRemarkTips(),o.model.setDataProperty(e.data,'stroke','#8799c4'),o.model.setDataProperty(e.data,'fill','#8799c4')}},new go.Binding('angle','angle').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),e(go.Shape,{geometry:go.Geometry.parse('M584.641736 896S299.62889 148.827862 0-128c0 0 413.707108 34.128461 584.641736 212.37111 0 0 163.261205-185.842992 584.641735-212.37111 0 0-486.056523 686.369398-584.641735 1024z',!0).rotate(180).scale(.0117,.0117),fill:'#8799c4',stroke:'#8799c4'},new go.Binding('fill','fill').makeTwoWay(),new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('strokeWidth','strokeWidth').makeTwoWay()),e(go.Shape,{name:'LINE',width:0,height:1e3,fill:'#8799c4',stroke:'#8799c4',strokeWidth:2},new go.Binding('height','height').makeTwoWay(),new go.Binding('fill','fill').makeTwoWay(),new go.Binding('stroke','stroke').makeTwoWay(),new go.Binding('strokeDashArray','strokeDashArray').makeTwoWay(),new go.Binding('strokeWidth','strokeWidth').makeTwoWay()))}function g(){var e=go.GraphObject.make,t;return e(go.Node,'Vertical',{movable:!1,selectionAdorned:!1,click:function(){}},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('locationSpot','dir',function(e){return m(e,!1)}),e(go.Panel,'Vertical',e(go.TextBlock,(t={name:'TEXT',alignment:new go.Spot(0,1),font:'14px \u5FAE\u8F6F\u96C5\u9ED1',width:70,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',editable:!0,isMultiline:!1,margin:0,stroke:'black'},o(t,'isMultiline',!0),o(t,'alignment',go.Spot.Right),o(t,'portId','TEXT'),o(t,'stretch',go.GraphObject.Fill),t),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay(),new go.Binding('margin','margin').makeTwoWay())))}function m(e){if('right'===e)return go.Spot.Right;return'top'===e?go.Spot.Top:void 0}function p(){var e=go.GraphObject.make,t={figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:1,stroke:'rgba(0,0,0,0)',fontSize:15,font:'sans-serif'};return e(go.Node,'Spot',{_controlExpand:!0,layerName:'Foreground',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,location:new go.Point(0,0),toMaxLinks:1,click:function(){},layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('isShadowed','isShadowed').makeTwoWay(),new go.Binding('angle','angle').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('layerName','layerName',function(e){return e?e:''}).makeTwoWay(function(e){return e}),e(go.Shape,{strokeDashArray:null,name:'SHAPE',figure:'Rectangle',fill:'rgba(0,0,0,0)',fromLinkable:!0,toLinkable:!0,cursor:'pointer',minSize:new go.Size(50,50),strokeWidth:2,stroke:'rgba(0,0,0,0)',portId:''},new go.Binding('strokeDashArray','strokeDashArray',function(e){return[e.split()[0],e.split()[1]]}).makeTwoWay(function(e){return e[0]+' '+e[1]}),new go.Binding('fill','fill',function(e){return e instanceof go.Brush?e.color:e}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('height','height',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke',function(e){return e instanceof go.Brush?e.stroke:e}).makeTwoWay(),new go.Binding('strokeWidth','strokeWidth',function(e){return e}).makeTwoWay(function(e){return e}),new go.Binding('figure','figure').makeTwoWay(),{figure:t.figure,fill:t.fill,strokeWidth:t.strokeWidth,stroke:t.stroke}),e(go.Shape,{name:'SHAPE_Back',figure:'Rectangle',fill:'rgba(0,0,0,0)',strokeWidth:0},new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('height','height',function(e){return e}).ofObject('SHAPE')),e(go.TextBlock,{name:'TEXT',alignment:new go.Spot(.5,.5),font:'bold 18px \u5E7C\u5706',editable:!0,stroke:'black',isMultiline:!0,overflow:go.TextBlock.OverflowClip,wrap:go.TextBlock.WrapDesiredSize,textAlign:'center',spacingAbove:4,spacingBelow:4,portId:'TEXT',stretch:go.GraphObject.Fill},new go.Binding('textAlign','textAlign',function(e){return _.contains(['start','center','end'],e)?e:'center'}).makeTwoWay(),new go.Binding('spacingAbove','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('spacingBelow','spacingline',function(e){return tdTransToNum(e,4)}).makeTwoWay(),new go.Binding('width','width',function(e){return e}).ofObject('SHAPE'),new go.Binding('text','text').makeTwoWay(),new go.Binding('stroke','textStroke').makeTwoWay(),new go.Binding('font','font').makeTwoWay()))}function u(t){var e=go.GraphObject.make;return e(go.Node,'Vertical',{movable:!1,locationSpot:go.Spot.Top,location:new go.Point(860,5),mouseHover:function(a,e){t.showNodeRemarkTips(a,e)},mouseLeave:function(){t.removeNodeRemarkTips()},click:function(t,e){void 0,void 0,0<+e.data.loc.split(' ')[1]?k(t):f(t)}},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),e(go.Shape,{figure:'LogicXor',stroke:'#8799c4',width:30,strokeWidth:2}))}function y(t){var a=t.diagram,o=t.diagram,i=o.lastInput,e=o.selection.first(),r=o.commandHandler;('Del'===i.key||8===i.event.keyCode)&&(void 0,x(i)),i.event.ctrlKey&&(89===i.event.keyCode&&(e&&'addtextTemplate'!==e.data.category||!e)&&k(i),88===i.event.keyCode&&(e&&'addtextTemplate'!==e.data.category||!e)&&f(i),i.bubbles=!1)}function h(){return P(go.Adornment,'Vertical',P('ContextMenuButton',P(go.TextBlock,'\u5220\u9664 DEl'),{click:function(t){x(t)}}),P('ContextMenuButton',P(go.TextBlock,'\u589E\u52A0 CTRL+X/Y'),{click:function(t,e){'0'===e.data.loc.split(' ')[1]&&'x'!==e.data.category?k(t):'0'===e.data.loc.split(' ')[0]&&'y'!==e.data.category&&f(t)}}))}function k(t){var e=t.diagram,a=e.selection.first(),o=e.model.nodeDataArray;var i=0,r=0,d='',s=260;o.forEach(function(t){if('y'===t.category&&(i=t.height-10),'x'===t.category&&(s=t.height+200,e.model.startTransaction('addheight'),e.model.setDataProperty(t,'height',s),e.model.commitTransaction('addheight')),'LogicXor'===t.category){var a=+t.loc.split(' ')[0];if(0<a){e.model.startTransaction(),e.model.setDataProperty(t,'loc',a+200+' 5'),e.model.commitTransaction()}}}),o.forEach(function(t){if('0'===t.loc.split(' ')[0]&&'addtextTemplate'!==t.category){var a=s-10;e.model.startTransaction('changel'),e.model.setDataProperty(t,'geometryString','M 0 0 L 0 '+a),e.model.commitTransaction('changel')}});var l='M 0 0 L 0 '+i;if(a&&('y'===a.data.category||'0'!==a.data.loc.split(' ')[0])&&'x'!==a.data.category&&'LogicXor'!==a.data.category&&'addtextTemplate'!==a.data.category)r=+a.data.loc.split(' ')[0]+200,d=r+' 0',o.forEach(function(t){if('LogicXor'!==t.category&&'addtextTemplate'!==t.category){var a=+t.loc.split(' ')[0];if(a>=r){a+=200;var o=a+' 0';e.model.startTransaction('changeloc'),e.model.setDataProperty(t,'loc',o),e.model.commitTransaction('changeloc')}}});else{var c=[];if(o.forEach(function(e){'0'!==e.loc.split(' ')[0]&&'LogicXor'!==e.category&&'addtextTemplate'!==e.category&&c.push(+e.loc.split(' ')[0])}),0===c.length)d='200 0';else{var g=_Mathmax.apply(null,c)+200;d=g+' 0'}}var m={key:S(),category:'yunpany',stroke:'#8799c4',geometryString:l,strokeDashArray:[4,2],loc:d},p={key:S(),category:'xtext',margin:10,textStroke:'#666666',text:'\u7EF4\u5EA6'+d.split(' ')[0]/200,loc:d,dir:'top'};e.model.startTransaction('addy'),e.model.addNodeData(m),e.model.addNodeData(p),e.model.commitTransaction('addy')}function f(t){var e=t.diagram,a=e.selection.first(),o=e.model.nodeDataArray,i=0,r=0,d='',s=260;o.forEach(function(t){if('x'===t.category&&(i=t.height-10),'y'===t.category&&(s=t.height+200,e.model.startTransaction('addheight'),e.model.setDataProperty(t,'height',s),e.model.commitTransaction('addheight')),'LogicXor'===t.category){var a=+t.loc.split(' ')[1];if(0>a){e.model.startTransaction(),e.model.setDataProperty(t,'loc','-20 '+(a-200)),e.model.commitTransaction()}}}),o.forEach(function(t){if('0'===t.loc.split(' ')[1]&&'addtextTemplate'!==t.category){var a=s-10;e.model.startTransaction('changel'),e.model.setDataProperty(t,'geometryString','M 0 0 L 0 '+a),e.model.commitTransaction('changel')}});var l='M 0 0 L 0 '+i;if(a&&('x'===a.data.category||'0'!==a.data.loc.split(' ')[1])&&'y'!==a.data.category&&'LogicXor'!==a.data.category&&'addtextTemplate'!==a.data.category)r=+a.data.loc.split(' ')[1]-200,d='0 '+r,o.forEach(function(t){if('LogicXor'!==t.category&&'addtextTemplate'!==t.category){var a=+t.loc.split(' ')[1];if(a<=r){a-=200;var o='0 '+a;e.model.startTransaction('changeloc'),e.model.setDataProperty(t,'loc',o),e.model.commitTransaction('changeloc')}}else;});else{var c=[];if(o.forEach(function(e){'0'!==e.loc.split(' ')[1]&&'LogicXor'!==e.category&&'addtextTemplate'!==e.category&&c.push(+e.loc.split(' ')[1])}),0===c.length)d='0 -200';else{var g=_Mathmin.apply(null,c)-200;d='0 '+g}}var m={key:S(),category:'yunpanx',stroke:'#8799c4',geometryString:l,strokeDashArray:[4,2],loc:d},p={key:S(),category:'ytext',text:'\u7EF4\u5EA6'+_Mathabs(+d.split(' ')[1]/200),textStroke:'#666666',loc:d,dir:'right'};e.model.startTransaction('addx'),e.model.addNodeData(m),e.model.addNodeData(p),e.model.commitTransaction('addx')}function x(t){var e=t.diagram,a=e.selection.first();if(a)if('yunpany'===a.data.category){var o=a.data.loc,i=+a.data.loc.split(' ')[0];e.model.nodeDataArray.forEach(function(t){'xtext'===t.category&&t.loc===o&&(e.model.startTransaction('delettext'),e.model.removeNodeData(a.data),e.model.removeNodeData(t),e.model.commitTransaction('delettext'))}),T(i,e)}else if('yunpanx'===a.data.category){var r=a.data.loc,d=+a.data.loc.split(' ')[1];e.model.nodeDataArray.forEach(function(t){'ytext'===t.category&&t.loc===r&&(e.model.startTransaction('delettext'),e.model.removeNodeData(t),e.model.removeNodeData(a.data),e.model.commitTransaction('delettext'))}),b(d,e)}else'ytext'!==a.data.category&&'xtext'!==a.data.category&&'LogicXor'!==a.data.category&&'x'!==a.data.category&&'y'!==a.data.category&&(e.model.startTransaction(),e.model.removeNodeData(a.data),e.model.commitTransaction())}function T(e,t){void 0,t.model.nodeDataArray.forEach(function(a){var o=+a.loc.split(' ')[0];if(o>e&&('yunpany'===a.category||'xtext'===a.category)){t.model.startTransaction('changea'),t.model.setDataProperty(a,'loc',o-200+' 0'),t.model.commitTransaction('changea')}if('x'===a.category){var i=a.height-200;t.model.startTransaction('cheight'),t.model.setDataProperty(a,'height',i),t.model.commitTransaction('cheight')}else if('yunpanx'===a.category){var r=NaN,d=(a.geometryString||'').split(' ');r=d[5]?+d[5]-200:+d[3]-200;var l=r+'';t.model.startTransaction('changea'),t.model.setDataProperty(a,'geometryString','M 0 0  L 0 '+l),t.model.commitTransaction('changea')}if('LogicXor'===a.category){var s=+a.loc.split(' ')[0];if(0<s){t.model.startTransaction(),t.model.setDataProperty(a,'loc',s-200+' 5'),t.model.commitTransaction()}}})}function b(e,t){void 0,t.model.nodeDataArray.forEach(function(a){var o=+a.loc.split(' ')[1];if(o<e&&('yunpanx'===a.category||'ytext'===a.category)){t.model.startTransaction('changea'),t.model.setDataProperty(a,'loc','0 '+(o+200)),t.model.commitTransaction('changea')}if('y'===a.category){var i=a.height-200;t.model.startTransaction('cheight'),t.model.setDataProperty(a,'height',i),t.model.commitTransaction('cheight')}else if('yunpany'===a.category){var r=NaN,d=(a.geometryString||'').split(' ');r=d[5]?+d[5]-200:+d[3]-200;var l=r+'';t.model.startTransaction('changea'),t.model.setDataProperty(a,'geometryString','M 0 0  L 0 '+l),t.model.commitTransaction('changea')}if('LogicXor'===a.category){var s=+a.loc.split(' ')[1];if(0>s){t.model.startTransaction(),t.model.setDataProperty(a,'loc','-20 '+(s+200)),t.model.commitTransaction()}}})}function S(){function e(){return(0|65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+'-'+e()+'-'+e()+'-'+e()+'-'+e()+e()+e()}var v=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),w=a(4),P=go.GraphObject.make,B=a(2),D=a(5),N=a(3),A=a(6),C=function(e){function t(e,a){i(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a));return o.initDiagramYun(e,a),o}return d(t,e),v(t,[{key:'initDiagramYun',value:function(e,t){var a=this,o=this.diagram,i={contextMenu:this.getYunpanNodeContextMenu,"animationManager.isEnabled":!1};this.diagram.commandHandler.doKeyDown=function(){return y(a)};var r=Object.assign(i,t.diagramConfig);return this.diagram.setProperties(r),this.addNodeTemplate(),o}},{key:'addNodeTemplate',value:function(){var e=this,t=this.diagram;t.nodeTemplateMap.add('yunpanx',l(e)),t.nodeTemplateMap.add('yunpany',s(e)),t.nodeTemplateMap.add('y',c(e)),t.nodeTemplateMap.add('x',c(e)),t.nodeTemplateMap.add('ytext',g()),t.nodeTemplateMap.add('xtext',g()),t.nodeTemplateMap.add('LogicXor',u(e)),t.nodeTemplateMap.add('addtextTemplate',p())}}]),t}(w),W=null,O=null;e.exports=C},function(e,t,a){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function r(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),l=a(4),s=a(7),c=a(2),g=a(5),m=a(3),p=a(6),u=function(e){function t(e,a){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a))}return r(t,e),d(t,[{key:'addNodeTemplate',value:function(){var e=this,t=this.diagram;t.nodeTemplateMap.add('0',s(this.diagram)),t.nodeTemplateMap.add('1',s(this.diagram)),t.nodeTemplateMap.add('2',s(this.diagram)),t.nodeTemplateMap.add('3',c(this.diagram)),t.nodeTemplateMap.add('4',g(this.diagram)),t.nodeTemplateMap.add('text',m(this.diagram)),t.nodeTemplateMap.add('',s(this.diagram)),t.nodeTemplateMap.add('8',p(this.diagram))}}]),t}(l);e.exports=u},function(e,t,a){'use strict';function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function r(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function d(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,a){if(e.equals(t))return t;var o=new go.Point(0,0).subtract(e.copy()),i=t.copy().offset(o.x,o.y),r=i.rotate(a),d=r.copy().offset(-o.x,-o.y);return d}var s=function(){function e(e,t){for(var a=0,o;a<t.length;a++)o=t[a],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,a,o){return a&&e(t.prototype,a),o&&e(t,o),t}}(),c=a(4),g=a(7),m=a(2),p=a(5),u=a(3),y=a(6),h=a(38),k=a(39),f=a(40),x=a(11),T=go.GraphObject.make,b=a(41),S=a(0),v=a(9).layoutWaveGroup,w=a(9).adjustTextAngle;a(42);var P=function(e){function t(e,a){i(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a)),d=o,s={layout:T(go.Layout),initialContentAlignment:go.Spot.Center,initialAutoScale:go.Diagram.Uniform,initialDocumentSpot:go.Spot.Center,initialViewportSpot:go.Spot.Center,rotatingTool:new b,PartResized:function(t){var e=t.subject.part;if(e)if('waveGroup'==e.data.category){for(var a=400,o=400,i=e.findSubGraphParts().iterator,r=0,d,l,s,c;i.next();)c=i.value,'wave'==c.data.category&&(r+=1,s=c);var g=e.resizeObject.actualBounds,m=s.resizeObject.naturalBounds;d=5*(g.width-0)/3/r,d=3*(g.width-0)/(3*r+2),100>d&&(d=100),d>a&&(d=a),l=g.height,l>o&&(l=o),l>d&&(l=d),e.diagram.startTransaction(),e.diagram.model.setDataProperty(e.data,'oliveHeight',l),e.diagram.model.setDataProperty(e.data,'oliveWidth',d);var i=t.subject.part.findSubGraphParts().iterator;for(v(i,e.diagram,t.subject.part),i.reset();i.next();)i.value.updateTargetBindings();e.diagram.commitTransaction(),setTimeout(function(){t.subject.part.layout.isOngoing=!0,t.subject.part.layout.isValidLayout=!1},100)}else'autoText'===e.data.category&&(50>=t.subject.width&&(t.subject.width=50),50>=t.subject.height&&(t.subject.height=50),t.diagram.startTransaction('resize'),t.diagram.model.setDataProperty(e.data,'width',t.subject.width),t.diagram.model.setDataProperty(e.data,'nwidth',!0),t.diagram.model.setDataProperty(e.data,'height',t.subject.height),t.diagram.model.setDataProperty(e.data,'nheight',!0),t.diagram.commitTransaction('resize'))},SelectionMoved:function(t){try{var e=t.subject.first();if(!e)return;if('wave'==e.data.category&&e.containingGroup&&(e.containingGroup.layout.isValidLayout=!1),'autoText'==e.data.category){if('shiText'==e.data.role||'xuText'==e.data.role){if(e.diagram.startTransaction(),!e.__location){var a=e.diagram.findNodeForKey(e.data.olive),o=e.containingGroup;if(a){var i=o.location.copy().offset(o.data.oliveWidth*(a.data.order-1),0);e.__location=i.copy().offset(a.naturalBounds.width/2,0),e.__location=l(o.location,e.__location,a.angle)}}e.__location&&(e.__offset=0==e.data.order%2?e.__location.copy().subtract(e.location):e.__location.copy().subtract(e.location),delete e.__oldOrder),delete e.__oldLocation,''!=e.data.text.trim()&&(e.data.nloc=!0,e.diagram.model.setDataProperty(e.data,'nloc',!0)),e.diagram.commitTransaction()}e.containingGroup&&('yunGroup'==e.containingGroup.data.category||'yunpanGroup'==e.containingGroup.data.category)&&(e.containingGroup.__trtdNode.snapToGrid(e.data,e.containingGroup),e.containingGroup.layout.isValidLayout=!1)}'shapeText'==e.data.category&&e.containingGroup&&'yunpanGroup'==e.containingGroup.data.category&&(e.containingGroup.__trtdNode.snapToGrid(e.data,e.containingGroup),e.containingGroup.layout.isValidLayout=!1)}catch(e){}},click:function(t){d.clearAllTextBorder(),localStorage.setItem('TRTD_documentPoint',go.Point.stringify(t.documentPoint))}};return o.diagram.setProperties(s),o.diagram.commandHandler.doKeyDown=function(t){o.dokeyDownFn(t)},o.diagram.commandHandler.canCopySelection=function(){var e=d.diagram.selection.first();if(e)return'axisGroup'==e.data.category||'yunGroup'==e.data.category;var t=this.diagram.commandHandler;return go.CommandHandler.prototype.canCopySelection.call(t)},o.diagram.commandHandler.pasteFromClipboard=function(){for(var e=go.CommandHandler.prototype.pasteFromClipboard.call(this),t=e.iterator,a=[],o=[],i=[],r=[],d=null,l;t.next();){if(l=t.value,'shiText'==l.data.role){a.push(l);continue}if('xuText'==l.data.role){o.push(l);continue}if('centerText'==l.data.role){r.push(l);continue}if('wave'==l.data.category&&'waveTail'!=l.data.role){i.push(l);continue}'waveGroup'==l.data.category&&(d=l)}return d?(i=i.sort(function(e,t){return+e.data.order-+t.data.order}),a.sort(function(e,t){return+e.data.order-+t.data.order}),o.sort(function(e,t){return+e.data.order-+t.data.order}),r.sort(function(e,t){return+e.data.order-+t.data.order}),i.forEach(function(e,t){e.data.shiText=a[t].data.key,e.data.xuText=o[t].data.key,e.data.centerText=r[t].data.key,a[t].data.olive=e.data.key,o[t].data.olive=e.data.key}),e):(e=new go.Set(go.Part),e)},o.diagram.commandHandler.deleteSelection=function(){return o.deleteSelection()},o.diagram.toolManager.resizingTool.computeReshape=function(){return'shapeText'!=this.adornedObject.part.data.category&&void go.TextEditingTool.prototype.doCancel.call(this)},o.diagram.toolManager.textEditingTool.doCancel=function(){var e=this;try{if(this.textBlock)var t=this.textBlock.part}catch(t){}setTimeout(function(){try{if(t&&'wave'==t.data.category&&t.containingGroup&&'horizontal'==t.containingGroup.data.textAngle&&'independent'==t.containingGroup.data.centerTextAngle){t.findObject('TEXT').visible=!1;var e=t.diagram.findNodeForKey(t.data.centerText);e&&(e.visible=!0)}}catch(t){}},100),go.TextEditingTool.prototype.doCancel.call(e)},o.diagram.toolManager.resizingTool.computeReshape=function(){return'pic'!=this.adornedObject.part.data.category},window.TextEditor&&(o.diagram.toolManager.textEditingTool.defaultTextEditor=window.TextEditor),o.diagram.toolManager.clickCreatingTool.archetypeNodeData={category:'autoText',font:'18px \'Microsoft YaHei\'',text:'\u7A7A\u767D\u6587\u672C',level:0},o.diagram.groupTemplateMap.add('waveGroup1',T(go.Group,'Spot',{selectionObjectName:'SHAPE'},{locationObjectName:'SHAPE',locationSpot:go.Spot.Center},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),{rotatable:!0},new go.Binding('angle','angle',function(e){return e}).makeTwoWay(function(e){return e}),{resizable:!0,resizeObjectName:'SHAPE'},T(go.Panel,'Vertical',T(go.TextBlock,{font:'bold 12pt sans-serif'},new go.Binding('text','key')),T(go.Shape,{name:'SHAPE',fill:'transparent'},new go.Binding('desiredSize','desiredSize',go.Size.parse).makeTwoWay(go.Size.stringify))))),o}return d(t,e),s(t,[{key:'addNodeTemplate',value:function(){var e=this.diagram;e.nodeTemplateMap.add('0',g(this.diagram)),e.nodeTemplateMap.add('1',g(this.diagram)),e.nodeTemplateMap.add('2',g(this.diagram)),e.nodeTemplateMap.add('3',m(this.diagram)),e.nodeTemplateMap.add('4',p(this.diagram)),e.nodeTemplateMap.add('text',u(this.diagram)),e.nodeTemplateMap.add('',g(this.diagram)),e.nodeTemplateMap.add('8',y(this.diagram)),e.nodeTemplateMap.add('9',h(this.diagram)),e.nodeTemplateMap.add('line',k(this.diagram)),e.nodeTemplateMap.add('wave',x('wave',{diagram:e}).getNodeTemplate()),e.nodeTemplateMap.add('iconText',x('iconText',{diagram:e}).getNodeTemplate()),e.nodeTemplateMap.add('pic',x('pic',{diagram:this.diagram}).getNodeTemplate()),e.nodeTemplateMap.add('shape',x('shape',{diagram:this.diagram}).getNodeTemplate()),e.nodeTemplateMap.add('autoText',x('autoText',{diagram:e}).getNodeTemplate()),e.nodeTemplateMap.add('shapeText',x('shapeText',{diagram:e}).getNodeTemplate()),e.groupTemplateMap.add('labelGroup',x('labelGroup',{diagram:e}).getNodeTemplate()),e.groupTemplateMap.add('picGroup',x('picGroup',{diagram:e}).getNodeTemplate()),e.groupTemplateMap.add('waveGroup',x('waveGroup',{diagram:this.diagram}).getNodeTemplate()),e.groupTemplateMap.add('axisGroup',x('axisGroup',{diagram:this.diagram}).getNodeTemplate()),e.groupTemplateMap.add('yunGroup',x('yunGroup',{diagram:this.diagram}).getNodeTemplate()),e.groupTemplateMap.add('yunpanGroup',x('yunpanGroup',{diagram:this.diagram}).getNodeTemplate())}},{key:'deleteSelection',value:function(e){var t=this.diagram.commandHandler;e||(e=this.diagram.selection.first());var a=null,o,i,r;if(e&&e.canDelete()&&('yunGroup'!=e.data.category||e.data.deletable)){this.diagram.startTransaction('deleteSelection1');var d=0;if(e){if('axisGroup'==e.data.category){for(var l=e.findSubGraphParts().iterator,s;l.next();)s=l.value,this.diagram.model.removeNodeData(s.data);this.diagram.model.removeNodeData(e.data)}if('wave'==e.data.category&&e.containingGroup){for(var l=e.containingGroup.findSubGraphParts().iterator,s;l.next();)s=l.value,'wave'==s.data.category&&'waveTail'!=s.data.role&&(s.data.order==e.data.order+1&&(a=s),d++),'shiText'==s.data.role&&s.data.order==e.data.order&&(o=s),'xuText'==s.data.role&&s.data.order==e.data.order&&(i=s),'centerText'==s.data.role&&s.data.order==e.data.order&&(r=s);if(1>=d)return void this.diagram.commitTransaction('deleteSelection1');e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1,e.containingGroup.containingGroup&&(e.containingGroup.containingGroup.layout.isOngoing=!0,e.containingGroup.containingGroup.layout.isValidLayout=!1)}if('autoText'==e.data.category&&'dimText'==e.data.subRole&&e.containingGroup&&'yunpanGroup'==e.containingGroup.data.category){var l=e.containingGroup.findSubGraphParts().iterator,c=[],g=[],m='X',p='Y',u='verticalLine';for(0==e.data.dimX&&(m='Y',p='X',u='horizontalLine');l.next();){var s=l.value;'dimText'==s.data.subRole&&0==s.data['dim'+p]&&d++,'yunpanText'==s.data.subRole&&s.data['order'+m]==e.data['dim'+m]&&c.push(s.data),'line'==s.data.category&&s.data.role==u&&s.data.order==e.data['dim'+m]&&g.push(s.data)}if(1>=d)return void this.diagram.commitTransaction('deleteSelection1');for(l.reset();l.next();){var s=l.value;'dimText'==s.data.subRole&&0==s.data['dim'+p]&&s.data['dim'+m]>e.data['dim'+m]&&s.diagram.model.setDataProperty(s.data,'dim'+m,s.data['dim'+m]-1),'yunpanText'==s.data.subRole&&s.data['order'+m]>e.data['dim'+m]&&s.diagram.model.setDataProperty(s.data,'order'+m,s.data['order'+m]-1),'line'==s.data.category&&s.data.role==u&&s.data.order>e.data['dim'+m]&&s.diagram.model.setDataProperty(s.data,'order',s.data.order-1)}e.diagram.model.removeNodeDataCollection(g),e.diagram.model.removeNodeDataCollection(c),e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1}}i&&this.diagram.model.removeNodeData(i.data),o&&this.diagram.model.removeNodeData(o.data),r&&this.diagram.model.removeNodeData(r.data),go.CommandHandler.prototype.deleteSelection.call(t),this.diagram.commitTransaction('deleteSelection1'),a&&this.diagram.select(a)}}},{key:'layoutLabelGroup',value:function(){var e=this;setTimeout(function(){for(var t=e.diagram.nodes.iterator,a;t.next();)a=t.value,'labelGroup'==a.data.category&&(a.layout.isOngoing=!0,a.layout.isValidLayout=!1)},200)}},{key:'copyWaveGroup',value:function(){var e=this.diagram,t=this.diagram.commandHandler;return t.copySelection(),void t.pasteSelection()}},{key:'layoutAllGroup',value:function(){for(var e=this.diagram.nodes.iterator,t;e.next();)t=e.value,!0==t.data.isGroup&&(t.layout.isOngoing=!0,t.layout.isValidLayout=!1)}},{key:'exportAsSubFigure',value:function(){var e=this.diagram,t=e.selection.first();if(t&&t.data.isGroup){for(var a=t.findSubGraphParts().iterator,o=[t.data],i=null,r;a.next();)r=a.value,o.push(r.data),'themeText'==r.data.role&&(i=r);var d=JSON.parse(e.model.toJson());d.nodeDataArray=o,this.exportAsSubFigureCallback&&this.exportAsSubFigureCallback({node:t,model:d,theme:i})}}},{key:'splitOlive2Half',value:function(){var e=this.diagram,t=e.selection.first();if(t&&'wave'==t.data.category&&1!=t.data.order&&t.containingGroup){this.diagram.startTransaction('splitOlive2Half'),t.containingGroup.layout.isOngoing=!0,t.containingGroup.layout.isValidLayout=!1;var a=this.addAxisGroup({emptyAxis:!0});if(!a)return void this.diagram.commitTransaction('splitOlive2Half');for(var o=0,i;o<a.length;o++)if('waveGroup'==a[o].category){i=a[o];break}if(!i)return void this.diagram.commitTransaction('splitOlive2Half');for(var r=t.data.order,d=t.containingGroup.findSubGraphParts().iterator,l=[],s;d.next();)s=d.value,'wave'==s.data.category&&s.data.order>=r&&'waveTail'!=s.data.role&&l.push(s);for(var o=0;o<l.length;o++){this.diagram.model.setDataProperty(l[o].data,'group',i.key);var c=this.diagram.model.findNodeDataForKey(l[o].data.shiText),g=this.diagram.model.findNodeDataForKey(l[o].data.centerText),m=this.diagram.model.findNodeDataForKey(l[o].data.xuText);c&&this.diagram.model.setDataProperty(c,'group',i.key),g&&this.diagram.model.setDataProperty(g,'group',i.key),m&&this.diagram.model.setDataProperty(m,'group',i.key)}this.diagram.commitTransaction('splitOlive2Half')}}},{key:'splitOlive2Cbian',value:function(){var e=this.diagram,t=e.selection.first();if(t&&'wave'==t.data.category){this.diagram.startTransaction('splitOlive2Cbian');var a=this.diagram.model.findNodeDataForKey(t.data.shiText),o=this.diagram.model.findNodeDataForKey(t.data.centerText),i=this.diagram.model.findNodeDataForKey(t.data.xuText),r={shiText:a.text,centerText:o.text,xuText:i.text,basePoint:t.location.copy().offset(0,-300),group:t.data.group};this.deleteSelection(t),this.addCbian(r),this.diagram.commitTransaction('splitOlive2Cbian')}}},{key:'addCbian',value:function(t){var a=this.diagram,o=a.selection.first(),i=null;o&&'axisGroup'==o.data.category&&(i=o.data.key);var r=a.lastInput;a.startTransaction('addCbian');var e=S.guid();if(t&&t.basePoint)var d=t.basePoint;else var d=r.documentPoint;var l={category:'picGroup',role:'cbian',isGroup:!0,level:0,key:e,loc:go.Point.stringify(d),deletable:!0};i&&(l.group=i),t&&t.group&&(l.group=t.group);var s={group:e,text:'',cbianName:'cbian1',resizable:!1,category:'pic',loc:go.Point.stringify(d),picture:'https://static.365trtd.com/system/cbian/cbian.png',width:150,height:150},c={text:'\u603B\u7ED3',role:'theme',deletable:!1,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(d.copy().offset(3,-3)),movable:!0,group:e},g={text:'\u65F6\u95F4',role:'axisXText',deletable:!1,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(d.copy().offset(150,0)),movable:!0,group:e},m={text:'\u80FD\u91CF',role:'axisYText',deletable:!1,fill:'black',iconVisible:!1,locationSpot:'1 0 0 0',textAlign:'center',category:'autoText',loc:go.Point.stringify(d.copy().offset(0,-150)),movable:!0,group:e},p={text:'\u603B\u7ED31',role:'cbianText1',deletable:!1,font:'normal bold 18px \'Microsoft YaHei\'',textStroke:'#0e399d',iconVisible:!1,locationSpot:'0 0 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(d.copy().offset(155*_Mathcos(30*_MathPI/180),-150*_Mathsin(30*_MathPI/180))),movable:!0,group:e},u={text:'\u603B\u7ED33',role:'cbianText3',deletable:!1,font:'normal bold 18px \'Microsoft YaHei\'',textStroke:'rgba(252, 172, 0, 1)',iconVisible:!1,locationSpot:'0 0.5 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(d.copy().offset(145*_Mathcos(45*_MathPI/180),-150*_Mathsin(45*_MathPI/180))),movable:!0,group:e},y={text:'\u603B\u7ED32',role:'cbianText2',font:'normal bold 18px \'Microsoft YaHei\'',deletable:!1,textStroke:'#cb1c27',iconVisible:!1,locationSpot:'0 1 0 0',textAlign:'left',category:'autoText',loc:go.Point.stringify(d.copy().offset(145*_Mathcos(70*_MathPI/180),-140*_Mathsin(70*_MathPI/180))),movable:!0,group:e},h=localStorage.getItem('cbianName');if(h)try{var k=JSON.parse(h);s.picture=k.picture,s.width=k.size[0],s.height=k.size[1],s.cbianName=k.name,p.textStroke=k.textStrokes[0],y.textStroke=k.textStrokes[1],u.textStroke=k.textStrokes[2]}catch(t){}t&&(p.text=t.shiText,u.text=t.centerText,y.text=t.xuText),a.model.addNodeData(p),a.model.addNodeData(u),a.model.addNodeData(y),a.model.addNodeData(c),a.model.addNodeData(g),a.model.addNodeData(m),a.model.addNodeData(s),a.model.addNodeData(l),a.commitTransaction('addCbian')}},{key:'adjustTextAngle',value:function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];w(t)}},{key:'addOlive',value:function(e,t){var a=this.diagram;if(e||(e=a.selection.first()),!!e){for(var o=0,i=e.containingGroup.findSubGraphParts().iterator,r=e.containingGroup.data.oliveWidth,d;i.next();)d=i.value,'wave'==d.data.category&&o++;var l=50;if(null!=e.containingGroup.data.maxOlive&&(l=e.containingGroup.data.maxOlive),!(o>l)){var s=this.diagram.findNodeForKey(e.data.shiText),c=this.diagram.findNodeForKey(e.data.xuText);a.startTransaction('dspiral');var g=1e3;null!=e.data.order&&(g=+e.data.order+.5);var m=JSON.parse(JSON.stringify(e.data));Object.assign(m,{key:S.guid(),order:g,text:''}),t&&(m.text=t.centerText),delete m.centerText,delete m.__gohashid,delete m.hyperlink,delete m.figure,delete m.remark;var p=JSON.parse(JSON.stringify(s.data));delete p.__gohashid,delete p.hyperlink,delete p.figure,delete p.remark,delete p.nloc,Object.assign(p,{key:S.guid(),order:g,olive:m.key,text:''}),t&&(p.text=t.shiText);var u=JSON.parse(JSON.stringify(c.data));delete u.__gohashid,delete u.hyperlink,delete u.figure,delete u.remark,delete u.nloc,Object.assign(u,{key:S.guid(),order:g,olive:m.key,text:''}),t&&(u.text=t.xuText),m.shiText=p.key,m.xuText=u.key,e.containingGroup&&(e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1,e.containingGroup.containingGroup&&(e.containingGroup.containingGroup.layout.isOngoing=!0,e.containingGroup.containingGroup.layout.isValidLayout=!1)),m.isNew=!0,a.model.addNodeData(m),a.model.addNodeData(p),a.model.addNodeData(u),a.commitTransaction('dspiral')}}}},{key:'getAxisGroupData',value:function(t){var a=this.diagram.lastInput,e=a.documentPoint,o=go.Point.stringify(e),i=S.guid(),r=S.guid(),d=S.guid(),l=S.guid(),s=S.guid(),c=S.guid(),g=S.guid(),m=S.guid(),p=S.guid(),u=S.guid(),y=S.guid(),h=S.guid(),k=S.guid(),f=S.guid(),x=S.guid(),T=S.guid(),b=S.guid(),v=S.guid(),w=S.guid(),P=[{category:'labelGroup',group:i,role:'labelGroup',isGroup:!0,level:0,key:r,loc:go.Point.stringify(e.copy().offset(30,700)),deletable:!1,selectable:!1},{category:'waveGroup',maxOlive:15,deletable:!1,haveTail:!0,oliveType:'Wave',shiStroke:'#0e399d',xuStroke:'#cb1c27',centerStroke:'rgba(9, 166, 9, 1)',oliveWidth:150,oliveHeight:120,isGroup:!0,level:0,key:d,loc:o,angle:330.08938180947,group:i,movable:!1,desiredSize:'700 120',textAngle:'horizontal',centerTextAngle:'independent',centerTextMode:'independent'},{category:'axisGroup',isGroup:!0,level:0,key:i,loc:o,angle:0,desiredSize:'300 150'},{category:'line',level:0,key:-11,loc:o,desiredSize:'700 1',width:1400,height:1,group:d,angle:330.08938180947,role:'centerLine',selectable:!1,stroke:'rgba(9, 166, 9, 1)'},{category:'line',level:0,key:-8,loc:'-91.91674008334496 -140.02427812707117',desiredSize:'606.7630471788291 10',width:1400,height:1,angle:0,group:i,role:'axisX',selectable:!1,stroke:'#0e399d'},{category:'line',level:0,key:-7,loc:'-91.91674008334496 -140.02427812707117',desiredSize:'349.05387059630493 10',width:1400,height:1,angle:270,group:i,role:'axisY',selectable:!1,stroke:'#cb1c27'},{text:'\u80FD\u91CF',deletable:!1,font:'24px \'Microsoft YaHei\'',category:'autoText',loc:'-101.91674008334496 -489.0781487233761',key:-12,role:'axisYText',locationSpot:'1 0.5 0 0',group:i,movable:!0},{text:'\u4E3B\u9898',role:'themeText',deletable:!1,font:'24px \'Microsoft YaHei\'',category:'autoText',loc:go.Point.stringify(e.copy().offset(-30,0)),key:-13,level:0,group:i,locationSpot:'0.5 0 0 0',movable:!0,width:300},{text:'\u65F6\u95F4',deletable:!1,font:'24px \'Microsoft YaHei\'',category:'autoText',loc:'514.8463070954841 -140.02427812707117',key:-14,role:'axisXText',group:i,locationSpot:'0.5 0 0 0'},{text:'\u5B9E\u7EBF\uFF1A',deletable:!1,fill:'#cb1c27',iconVisible:!0,locationSpot:'0 0 0 0',textAlign:'start',category:'autoText',loc:go.Point.stringify(e.copy().offset(30,-350)),role:'labelText1',movable:!0,group:r,visible:!0,minSize:'120 30'},{text:'\u865A\u7EBF\uFF1A',deletable:!1,fill:'#0e399d',iconVisible:!0,locationSpot:'0 0 0 0',textAlign:'start',category:'autoText',loc:go.Point.stringify(e.copy().offset(30,-310)),role:'labelText2',movable:!0,group:r,visible:!0,minSize:'120 30'},{text:'\u4E2D\u7EBF\uFF1A',deletable:!1,fill:'#3f5369',iconVisible:!0,locationSpot:'0 0 0 0',textAlign:'start',category:'autoText',loc:go.Point.stringify(e.copy().offset(30,-270)),role:'labelText3',movable:!0,group:r,visible:!0,minSize:'120 30'},{category:'wave',text:'',role:'waveTail',deletable:!1,selectable:!1,level:0,key:'2d6ff2f1-0966-36bf-4e85-f5775ca0652b',group:d,loc:'710.0826118675676 -829.1890319396903',desiredSize:'75 120',order:999,oliveType:'Wave',angle:330.08938180947,textAlign:'center',shiStroke:'#0e399d',xuStroke:'#cb1c27',centerText:'df53d882-fe51-d78e-d8e3-8d9681578cb8',textVisible:!1,isNew:null}];return t||(P=P.concat([{category:'wave',text:'1\n',level:0,key:l,group:d,desiredSize:'150 120',order:1,shiText:m,xuText:p,angle:330.08938180947,loc:'-91.91674008334496 -140.02427812707123',oliveType:'Ellipse',textAlign:'center',shiStroke:'#cb1c27',xuStroke:'#0e399d',centerText:T,textVisible:!1},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:m,width:150,role:'shiText',level:0,group:d,order:1,olive:l,loc:'4.128618140465704 -125.47989214278559',locationSpot:'0 0 0 0',textStroke:'#cb1c27',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:p,width:150,role:'xuText',level:0,group:d,order:1,olive:l,loc:'-56.2078366340385 -230.36321886941172',locationSpot:'1 1 0 0',textStroke:'#0e399d',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{category:'wave',text:'3\n',level:0,key:s,group:d,desiredSize:'150 120',order:3,shiText:u,xuText:y,angle:330.08938180947,loc:'168.12456585043884 -289.61879409691636',oliveType:'Ellipse',textAlign:'center',shiStroke:'#cb1c27',xuStroke:'#0e399d',centerText:b,textVisible:!1},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:u,width:150,role:'shiText',level:0,group:d,order:3,olive:s,loc:'264.16992407424954 -275.07440811263075',locationSpot:'0 0 0 0',textStroke:'#cb1c27',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:y,width:150,role:'xuText',level:0,group:d,order:3,olive:s,loc:'203.83346929974533 -379.9577348392569',locationSpot:'1 1 0 0',textStroke:'#0e399d',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{category:'wave',text:'2\n',level:0,key:c,group:d,desiredSize:'150 120',order:2,shiText:h,xuText:k,angle:330.08938180947,loc:'38.10391288354694 -214.8215361119938',oliveType:'Ellipse',textAlign:'center',shiStroke:'#cb1c27',xuStroke:'#0e399d',centerText:v,textVisible:!1},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:h,width:150,role:'shiText',level:0,group:d,order:2,olive:c,loc:'73.8128163328534 -305.1604768543343',locationSpot:'1 1 0 0',textStroke:'#cb1c27',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:k,width:150,role:'xuText',level:0,group:d,order:2,olive:c,loc:'134.1492711073576 -200.27715012770815',locationSpot:'0 0 0 0',textStroke:'#0e399d',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{category:'wave',text:'4\n',level:0,key:g,group:d,desiredSize:'150 120',order:4,shiText:f,xuText:x,angle:330.08938180947,loc:'298.1452188173308 -364.41605208183887',oliveType:'Ellipse',textAlign:'center',shiStroke:'#cb1c27',xuStroke:'#0e399d',centerText:w,textVisible:!1},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:f,width:150,role:'shiText',level:0,group:d,order:4,olive:g,loc:'333.8541222666372 -454.7549928241794',locationSpot:'1 1 0 0',textStroke:'#cb1c27',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{deletable:!1,text:'',font:'18px \'Microsoft YaHei\'',category:'autoText',key:x,width:150,role:'xuText',level:0,group:d,order:4,olive:g,loc:'394.1905770411414 -349.87166609755326',locationSpot:'0 0 0 0',textStroke:'#0e399d',showBorder:!0,angle:0,minSize:'120 30',textAlign:'start'},{text:'1\n',minSize:'120 30',deletable:!1,textAlign:'center',font:'18px \'Microsoft YaHei\'',category:'autoText',key:T,width:120,role:'centerText',level:0,group:d,order:1,visible:!0,layerName:'Foreground',locationSpot:'0.5 0.5 0 0',selectable:!1,olive:l,loc:'-26.039609246786398 -177.92155550609866',angle:0},{text:'2\n',minSize:'120 30',deletable:!1,textAlign:'center',font:'18px \'Microsoft YaHei\'',category:'autoText',key:v,width:120,role:'centerText',level:0,group:d,order:2,visible:!0,layerName:'Foreground',locationSpot:'0.5 0.5 0 0',selectable:!1,olive:c,loc:'103.9810437201055 -252.71881349102122',angle:0},{text:'3\n',minSize:'120 30',deletable:!1,textAlign:'center',font:'18px \'Microsoft YaHei\'',category:'autoText',key:b,width:120,role:'centerText',level:0,group:d,order:3,visible:!0,layerName:'Foreground',locationSpot:'0.5 0.5 0 0',selectable:!1,olive:s,loc:'234.00169668699743 -327.5160714759438',angle:0},{text:'4\n',minSize:'120 30',deletable:!1,textAlign:'center',font:'18px \'Microsoft YaHei\'',category:'autoText',key:w,width:120,role:'centerText',level:0,group:d,order:4,visible:!0,layerName:'Foreground',locationSpot:'0.5 0.5 0 0',selectable:!1,olive:g,loc:'364.0223496538893 -402.3133294608663',angle:0}])),P}},{key:'addAxisGroup',value:function(e){for(var t=this.diagram,a=0,o=0;o<t.model.nodeDataArray.length;o++)'axisGroup'==t.model.nodeDataArray[o].category&&(a+=1);if(!(13<a)){var i=this.getAxisGroupData(e);if(i){t.startTransaction('dspiral');for(var o=0;o<i.length;o++)t.model.addNodeData(i[o]);return t.commitTransaction('dspiral'),i}}}},{key:'selectText',value:function(t){var e=this.diagram,a=e.selection.first();if(a){var o=e.selection.first().findObject('TEXT');if(o&&e.commandHandler.editTextBlock(o),!S.checkPhone())S.simulateEnterWithAlt(t);else{var i=e.currentTool.currentTextEditor.mainElement.value;e.currentTool.currentTextEditor.mainElement.selectionStart=i.length,e.currentTool.currentTextEditor.mainElement.selectionEnd=i.length}}}},{key:'clearAllTextBorder',value:function(){for(var e=this.diagram.nodes.iterator,t;e.next();)t=e.value,'autoText'==t.data.category&&(t.findObject('textBorder').visible=!1)}},{key:'triggerShowFireText',value:function(){var t=this.diagram.lastInput,e=this.diagram.selection.first();e&&e.__trtdNode.dealFireText(t)}},{key:'apiGetFireText',value:function(e){var t={},a=this.diagram.selection.first();if(!a)return t;if(a.containingGroup&&'yunGroup'==a.containingGroup.data.category){var o=a.containingGroup,i;if(e){for(i=o.findSubGraphParts().iterator;i.next();)if(i.value.data.theta==e){a=i.value;break}i.reset()}var r=_Mathmax(_Mathabs(a.data.orderX-10),_Mathabs(a.data.orderY-10));for(i=o.findSubGraphParts().iterator;i.next();){var d=i.value;0==d.data.dimX&&19==d.data.dimY&&(t.dimText1=d),10==d.data.dimX&&19==d.data.dimY&&(t.dimText2=d),19==d.data.dimX&&19==d.data.dimY&&(t.dimText3=d),19==d.data.dimX&&10==d.data.dimY&&(t.dimText4=d),19==d.data.dimX&&19==d.data.dimY&&(t.dimText5=d),10==d.data.dimX&&0==d.data.dimY&&(t.dimText6=d),0==d.data.dimX&&0==d.data.dimY&&(t.dimText7=d),0==d.data.dimX&&10==d.data.dimY&&(t.dimText8=d),d.data.orderX==10-r&&d.data.orderY==10+r&&(t.text1=d),10==d.data.orderX&&d.data.orderY==10+r&&(t.text2=d),d.data.orderX==10+r&&d.data.orderY==10+r&&(t.text3=d),d.data.orderX==10+r&&10==d.data.orderY&&(t.text4=d),d.data.orderX==10+r&&d.data.orderY==10-r&&(t.text5=d),10==d.data.orderX&&d.data.orderY==10-r&&(t.text6=d),d.data.orderX==10-r&&d.data.orderY==10-r&&(t.text7=d),d.data.orderX==10-r&&10==d.data.orderY&&(t.text8=d),'themeText'==d.data.subRole&&(t.themeText=d)}return t.radius=r,t}return t}},{key:'apiSwitchWaveTail',value:function(){var e=this.diagram.selection.first();if(e){this.diagram.startTransaction();for(var t=e.findSubGraphParts().iterator,a=null,i=null,r,d;t.next();)if(d=t.value,i=d,'waveTail'==d.data.role){a=d;break}if(r=i?i.data.loc:e.data.loc,a)this.diagram.model.removeNodeData(a.data),this.diagram.model.setDataProperty(e.data,'haveTail',!1);else{var l;this.diagram.model.setDataProperty(e.data,'haveTail',!0);var s=(l={category:'wave',text:'',role:'waveTail',deletable:!1,selectable:!1},o(l,'deletable',!1),o(l,'level',0),o(l,'key',S.guid()),o(l,'group',e.data.key),o(l,'loc',r),o(l,'desiredSize',e.data.oliveWidth+' '+e.data.oliveHeight),o(l,'order',2e3),l);this.diagram.model.addNodeData(s)}e.layout.isOngoing=!0,e.layout.isValidLayout=!1,this.diagram.commitTransaction()}}},{key:'apiSwitchToEllipse',value:function(){var e=this.diagram.selection.first();if(e){this.diagram.startTransaction(),this.diagram.model.setDataProperty(e.data,'oliveType','Ellipse');for(var t=e.findSubGraphParts().iterator,a=null,o;t.next();)if(o=t.value,'waveTail'==o.data.role){a=o;break}a&&this.diagram.model.removeNodeData(a.data),e.layout.isOngoing=!0,e.layout.isValidLayout=!1,e.containingGroup&&(e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1),this.diagram.commitTransaction()}}},{key:'apiSwitchToWave',value:function(){var e=this.diagram.selection.first();if(e){this.diagram.startTransaction('apiSwitchToWave'),this.diagram.model.setDataProperty(e.data,'oliveType','Wave');for(var t=e.findSubGraphParts().iterator,a=null,i=null,r=e.data.haveTail,d,l;t.next();)if(l=t.value,i=l,'waveTail'==l.data.role){a=l;break}if(d=i?i.data.loc:e.data.loc,!a&&!0==r){var s=(c={category:'wave',text:'',role:'waveTail',deletable:!1,selectable:!1},o(c,'deletable',!1),o(c,'level',0),o(c,'key',S.guid()),o(c,'group',e.data.key),o(c,'loc',d),o(c,'desiredSize',e.data.oliveWidth+' '+e.data.oliveHeight),o(c,'order',2e3),c),c;this.diagram.model.addNodeData(s)}e.layout.isOngoing=!0,e.layout.isValidLayout=!1,e.containingGroup&&(e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1),this.diagram.commitTransaction('apiSwitchToWave')}}},{key:'apiSwitchTextAngle',value:function(e){var t=this.diagram.selection.first();if(t){t.diagram.startTransaction('apiSwitchTextAngle'),e&&-1<['horizontal','vertical'].indexOf(e)?(t.diagram.model.setDataProperty(t.data,'textAngle',e),t.data.textAngle=e):(e={horizontal:'vertical',vertical:'horizontal'}[t.data.textAngle]||'horizontal',t.diagram.model.setDataProperty(t.data,'textAngle',e),t.data.textAngle=e),t.layout.isOngoing=!0,t.layout.isValidLayout=!1,t.diagram.commitTransaction('apiSwitchTextAngle')}}},{key:'getDefaultCustomMenuDivStr',value:function(){return'\n        <ul>\n            <li trtd_action="exportAsSubFigure"><a class="i18n" data-lang="cancelfix">\u521B\u5EFA\u4E3A\u5B50\u76D8</a></li>\n            <li trtd_action="drillAnalyze"><a class="i18n" data-lang="cancelfix">\u63D2\u5165\u5B50\u76D8</a></li>\n            <li trtd_action="addFollower"><a class="i18n" data-lang="insertsl">\u63D2\u5165\u540C\u7EA7\u8282\u70B9</a></li>\n            <li trtd_action="startNewSpiral"><a class="i18n" data-lang="icn">\u63D2\u5165\u5B50\u8282\u70B9</a></li>\n            <li trtd_action="apiDuplicateNode"><a class="i18n" data-lang="duplicateNode">\u590D\u5236\u8282\u70B9</a></li>\n            <li trtd_action="apiDeleteSelection"><a class="i18n" data-lang="remove">\u5220\u9664</a></li>\n            <li trtd_action="splitOlive2Cbian"><a class="i18n" data-lang="remove">\u5206\u79BB</a></li>\n            <li trtd_action="splitOlive2Half"><a class="i18n" data-lang="remove">\u62C6\u5206</a></li>\n            <li trtd_action="orderChildNode"><a class="i18n" data-lang="ordernode">\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearOrderChildNode"><a class="i18n" data-lang="clearordernode">\u53D6\u6D88\u5B50\u8282\u70B9\u7F16\u53F7</a></li>\n            <li trtd_action="clearNodeTextMenu"><a class="i18n" data-lang="emptynodetext">\u6E05\u7A7A\u8282\u70B9\u6587\u672C</a></li>\n            <li trtd_action="apiInsertTianpanNode"><a class="i18n" data-lang="insertnodetianpan">\u63D2\u5165\u5929\u76D8\u8282\u70B9</a></li>\n            <li trtd_action="addTextNode"><a class="i18n" data-lang="inserttext">\u63D2\u5165\u6587\u672C</a></li>\n            <li trtd_action="locateRootNodeMenu"><a class="i18n" data-lang="locaterootnode">\u5B9A\u4F4D\u6839\u8282\u70B9</a></li>\n            <li trtd_action="showAllNodesMenu"><a class="i18n" data-lang="displayallnodes">\u663E\u793A\u6240\u6709\u8282\u70B9</a></li>\n            <li trtd_action="fixPictureMenu"><a class="i18n" data-lang="fixnode">\u56FA\u5B9A\u8282\u70B9</a></li>\n            <li trtd_action="activePictureMenu"><a class="i18n" data-lang="cancelfix">\u53D6\u6D88\u56FA\u5B9A</a></li>\n            <li trtd_action="apiSwitchToEllipse"><a class="i18n" data-lang="cancelfix">\u5207\u6362\u4E3A\u6A44\u6984\u5F62\u72B6</a></li>\n            <li trtd_action="apiSwitchToWave"><a class="i18n" data-lang="cancelfix">\u5207\u6362\u4E3A\u87BA\u65CB\u5F62\u72B6</a></li>\n            <li trtd_action="apiSwitchWaveTail"><a class="i18n" data-lang="cancelfix">\u6DFB\u52A0/\u5220\u9664\u5C3E\u5DF4</a></li>\n            <li trtd_action="apiSwitchTextAngle"><a class="i18n" data-lang="cancelfix">\u5207\u6362\u6587\u5B57\u65B9\u5411</a></li>\n            <li trtd_action="addCbian"><a class="i18n" data-lang="cancelfix">\u6DFB\u52A0\u603B\u7ED3\u56FE</a></li>\n            <li trtd_action="addAxisGroup"><a class="i18n" data-lang="cancelfix">\u63D2\u5165\u62D3\u6251</a></li>\n            <li trtd_action="addYunText"><a class="i18n" data-lang="cancelfix">\u6DFB\u52A0\u6587\u5B57</a></li>\n            <li trtd_action="showRect"><a class="i18n" data-lang="cancelfix">\u663E\u793A\u77E9\u5F62\u7EBF</a></li>\n            <li trtd_action="hideRect"><a class="i18n" data-lang="cancelfix">\u9690\u85CF\u77E9\u5F62\u7EBF</a></li>\n            <li trtd_action="offShowRedLine"><a class="i18n" data-lang="cancelfix">\u5173\u95ED\u81EA\u52A8\u663E\u793A\u7EA2\u7EBF</a></li>\n            <li trtd_action="autoShowRedline"><a class="i18n" data-lang="cancelfix">\u81EA\u52A8\u663E\u793A\u81EA\u65CB\u7EA2\u7EBF</a></li>\n            <li trtd_action="bringupLayer"><a class="i18n" data-lang="cancelfix">\u4E0A\u79FB\u4E00\u5C42</a></li>\n            <li trtd_action="bringdownLayer"><a class="i18n" data-lang="cancelfix">\u4E0B\u79FB\u4E00\u5C42</a></li>\n            <li trtd_action="bringToBackground"><a class="i18n" data-lang="cancelfix">\u7F6E\u4E8E\u5E95\u5C42</a></li>\n            <li trtd_action="bringToForeground"><a class="i18n" data-lang="cancelfix">\u7F6E\u4E8E\u9876\u5C42</a></li>\n            <li trtd_action="addDimTtext"><a class="i18n" data-lang="cancelfix">\u589E\u52A0\u7EF4\u5EA6</a></li>\n            <li trtd_action="switchCbianSize"><a class="i18n" data-lang="cancelfix">\u5207\u6362\u5927\u5C0F</a></li>\n            <li trtd_action="copyWaveGroup"><a class="i18n" data-lang="cancelfix">\u590D\u5236</a></li>\n        </ul>\n        '}},{key:'getShowContextMenus',value:function(e){var t=null;return e?(-1<['axisGroup'].indexOf(e.data.category)&&(t='addCbian,apiDeleteSelection,exportAsSubFigure,copyWaveGroup'),-1<['picGroup'].indexOf(e.data.category)&&(t='apiDeleteSelection,switchCbianSize'),-1<['3'].indexOf(e.data.category)&&(t='bringupLayer,apiDeleteSelection,bringdownLayer,bringToBackground,bringToForeground'),-1<['wave'].indexOf(e.data.category)&&(null==e.data.deletable?e.deletable&&(t='apiDeleteSelection,splitOlive2Cbian,splitOlive2Half'):e.data.deletable&&(t='apiDeleteSelection,splitOlive2Cbian,splitOlive2Half')),-1<['waveGroup'].indexOf(e.data.category)&&(t='apiSwitchTextAngle,',t+='Ellipse'==e.data.oliveType?'apiSwitchToWave':'apiSwitchToEllipse,apiSwitchWaveTail'),-1<['yunGroup'].indexOf(e.data.category)&&(t='addYunText,',t+=e.data.showShape?'hideRect':'showRect',t+='line'==e.data.beginSpark?',offShowRedLine':',autoShowRedline'),-1<['autoText'].indexOf(e.data.category)&&0>['shiText','xuText'].indexOf(e.data.role)&&(t='apiDeleteSelection'),'dimText'==e.data.subRole&&'yunpanGroup'==e.containingGroup.data.category&&(t='apiDeleteSelection,addDimTtext'),'shapeText'==e.data.category&&'yunpanGroup'==e.containingGroup.data.category&&(t='apiDeleteSelection'),-1<['wave','autoText','shapeText'].indexOf(e.data.category)&&e.data.text&&(t+=',drillAnalyze'),-1<['autoText'].indexOf(e.data.category)&&(t+=',apiDuplicateNode')):(t=this.canAddAxisGroup?'addCbian,addAxisGroup':'addCbian'),t}},{key:'addYunText',value:function(){var t=this.diagram.selection.first(),a=this.diagram;if(t){var o=a.lastInput;t.__trtdNode.addFreeText(o,t)}}},{key:'addDimTtext',value:function(){var e=this.diagram.selection.first(),t=this.diagram;if(e&&'dimText'==e.data.subRole){var a=0,o=e.containingGroup.findSubGraphParts().iterator,i=[],r=null,d='X',l='Y',s='verticalLine';for(0==e.data.dimX&&(d='Y',l='X',s='horizontalLine');o.next();){var c=o.value;'dimText'==c.data.subRole&&0==c.data['dim'+l]&&a++,'yunpanText'==c.data.subRole&&c.data['order'+d]==e.data['dim'+d]&&i.push(c.data),'line'==c.data.category&&c.data.role==s&&c.data.order==e.data['dim'+d]&&(r=c)}if(!(30<=a)){for(this.diagram.startTransaction('addDimTtext'),o.reset();o.next();){var c=o.value;'dimText'==c.data.subRole&&0==c.data['dim'+l]&&c.data['dim'+d]>e.data['dim'+d]&&c.diagram.model.setDataProperty(c.data,'dim'+d,c.data['dim'+d]+1),'yunpanText'==c.data.subRole&&c.data['order'+d]>e.data['dim'+d]&&c.diagram.model.setDataProperty(c.data,'order'+d,c.data['order'+d]+1),'line'==c.data.category&&c.data.role==s&&c.data.order>e.data['dim'+d]&&c.diagram.model.setDataProperty(c.data,'order',c.data.order+1)}var g=JSON.parse(JSON.stringify(e.data));if(delete g.key,delete g.__gohashid,r){var m=JSON.parse(JSON.stringify(r.data));delete m.key,delete m.__gohashid,++m.order,e.diagram.model.addNodeData(m)}g['dim'+d]=e.data['dim'+d]+1,g.text='\u7EF4\u5EA6'+g['dim'+d],e.diagram.model.addNodeData(g),e.containingGroup.layout.isOngoing=!0,e.containingGroup.layout.isValidLayout=!1,this.diagram.commitTransaction('addDimTtext')}}}},{key:'switchCbianSize',value:function(){var e=this.diagram.selection.first();e&&('big'==e.data.cbianType?e.__trtdNode.changeCbianSize(e,'small'):e.__trtdNode.changeCbianSize(e,'big'))}},{key:'bringToBackground',value:function(){var e=this.diagram.selection.first(),t=this.diagram;t.model.startTransaction(),t.model.setDataProperty(e.data,'layerName','Background'),t.model.setDataProperty(e.data,'zOrder',1),t.model.commitTransaction()}},{key:'bringToForeground',value:function(){var e=this.diagram.selection.first(),t=this.diagram;t.model.startTransaction(),t.model.setDataProperty(e.data,'layerName','Foreground'),t.model.setDataProperty(e.data,'zOrder',999),t.model.commitTransaction()}},{key:'bringdownLayer',value:function(){var e=this.diagram.selection.first(),t=this.diagram;if(e){var a=e.layerName,o=a,i=e.zOrder;'Foreground'==a&&(o='default'),'default'==a&&(o='Background'),'Background'==a&&(o='Background'),t.model.startTransaction(),t.model.setDataProperty(e.data,'layerName',o),t.model.setDataProperty(e.data,'zOrder',1),t.model.commitTransaction()}}},{key:'bringupLayer',value:function(){var e=this.diagram.selection.first(),t=this.diagram;if(e){var a=e.layerName,o=a,i=e.zOrder;'Background'==a&&(o='default'),'default'==a&&(o='Foreground'),'Foreground'==a&&(o='Foreground'),t.model.startTransaction(),t.model.setDataProperty(e.data,'layerName',o),t.model.setDataProperty(e.data,'zOrder',999),t.model.commitTransaction()}}},{key:'bringToLayer',value:function(e){var t=myDiagram.selection.first();if(myDiagram.model.startTransaction(),t)if(null==e){e=t.data.layerName?t.data.layerName:'';var a=myDiagram.model.copyNodeData(t.data);myDiagram.model.removeNodeData(t.data),myDiagram.model.addNodeData(a)}else myDiagram.model.setDataProperty(t.data,'layerName',e);myDiagram.model.commitTransaction()}},{key:'showRect',value:function(){var e=this.diagram.selection.first();if(e&&'yunGroup'==e.data.category){e.diagram.startTransaction('showRect'),e.diagram.model.setDataProperty(e.data,'showShape',!0);for(var t=e.findSubGraphParts().iterator,a;t.next();)a=t.value,'background'==a.data.role&&e.diagram.model.setDataProperty(a.data,'visible',!0);e.layout.isValidLayout=!1,e.diagram.commitTransaction('showRect')}}},{key:'hideRect',value:function(){var e=this.diagram.selection.first();if(e&&'yunGroup'==e.data.category){e.diagram.startTransaction('hideRect'),e.diagram.model.setDataProperty(e.data,'showShape',!1);for(var t=e.findSubGraphParts().iterator,a;t.next();)a=t.value,'background'==a.data.role&&(e.diagram.model.setDataProperty(a.data,'visible',!0),e.diagram.model.setDataProperty(a.data,'stroke','rgba(255,0,0,0)'));e.diagram.commitTransaction('hideRect')}}},{key:'autoShowRedline',value:function(){var e=this.diagram.selection.first();e&&'yunGroup'==e.data.category&&(e.diagram.startTransaction('beginSpark'),e.diagram.model.setDataProperty(e.data,'beginSpark','line'),e.diagram.commitTransaction('beginSpark'))}},{key:'offShowRedLine',value:function(){var e=this.diagram.selection.first();e&&'yunGroup'==e.data.category&&(e.diagram.startTransaction('offShowRedLine'),e.diagram.model.setDataProperty(e.data,'beginSpark',void 0),e.diagram.commitTransaction('offShowRedLine'))}},{key:'dokeyDownFn',value:function(t){var e=this,a=this.diagram,o=this,i=this.diagram,t=i.lastInput,r=i.commandHandler;if(t.event.altKey){if('Q'==t.key)return void autoLayoutAll();if('R'==t.key)return void centerNode();if('C'==t.key)return void centerCurrentNode();if('A'==t.key)return void zoomToFit()}if(65<=t.event.keyCode&&90>=t.event.keyCode&&!t.event.altKey&&!t.event.ctrlKey&&!t.event.shiftKey){t.bubbles=!1;var d=i.selection.first();if(!d)return;if('wave'==d.data.category&&d.containingGroup&&'horizontal'==d.containingGroup.data.textAngle&&'independent'==d.containingGroup.data.centerTextAngle){d.findObject('TEXT').visible=!0;var l=d.diagram.findNodeForKey(d.data.centerText);l&&(l.visible=!1)}return setTimeout(function(){return e.textDoubleClick?e.textDoubleClick(t,d):void e.selectText(t,a)},100),!0}if(13===t.event.keyCode){var d=i.selection.first();d&&'wave'==d.category&&this.addOlive()}else 9===t.event.keyCode?this.addFollower(!0):'t'===t.key?r.canCollapseSubGraph()?r.collapseSubGraph():r.canExpandSubGraph()&&r.expandSubGraph():'Del'==t.key?t.diagram.commandHandler.deleteSelection():113==t.event.keyCode?this.selectText(t,a):37==t.event.keyCode?this.moveWithinNodes('left',a):38==t.event.keyCode?this.moveWithinNodes('up',a):39==t.event.keyCode?this.moveWithinNodes('right',a):40==t.event.keyCode?this.moveWithinNodes('down',a):go.CommandHandler.prototype.doKeyDown.call(r);t.bubbles=!1}},{key:'findPrevOlive',value:function(e){if(1>=e.data.order)return null;for(var t=null,a=e.containingGroup.findSubGraphParts().iterator,o;a.next();)if(o=a.value,'wave'==o.data.category&&o.data.order==e.data.order-1){t=o;break}return t}},{key:'findNextOlive',value:function(e){for(var t=null,a=e.containingGroup.findSubGraphParts().iterator,o;a.next();)if(o=a.value,'waveTail'!=o.data.role)if('autoText'==e.data.category){if('shiText'==o.data.role&&o.data.order==e.data.order+1){t=o;break}}else if('wave'==o.data.category&&o.data.order==e.data.order+1){t=o;break}return t}},{key:'findUpOlive',value:function(e){var t=null;return'wave'==e.data.category&&(0==e.data.order%2?t=this.diagram.findNodeForKey(e.data.shiText):t=this.diagram.findNodeForKey(e.data.xuText)),'xuText'==e.data.role&&(0!=e.data.order%2||(t=this.diagram.findNodeForKey(e.data.olive))),'shiText'==e.data.role&&0!=e.data.order%2&&(t=this.diagram.findNodeForKey(e.data.olive)),t}},{key:'findDownOlive',value:function(e){var t=null;return'wave'==e.data.category&&(0==e.data.order%2?t=this.diagram.findNodeForKey(e.data.xuText):t=this.diagram.findNodeForKey(e.data.shiText)),'xuText'==e.data.role&&0!=e.data.order%2&&(t=this.diagram.findNodeForKey(e.data.olive)),'shiText'==e.data.role&&(0!=e.data.order%2||(t=this.diagram.findNodeForKey(e.data.olive))),t}},{key:'moveWithinNodes',value:function(e){var t=this.diagram,a=t.selection.first();if(a){if('autoText'==a.data.category&&'coreText'==a.data.subRole){if(!(a.containingGroup&&'yunGroup'==a.containingGroup.data.category))return;var o=3e4,i=3e4,r;switch(a.containingGroup.__yunPointsX&&a.containingGroup.__yunPointsY&&(o=(a.containingGroup.__yunPointsX.length+1)/2,i=(a.containingGroup.__yunPointsY.length+1)/2),e){case'left':if(a.data.orderX==o)return;for(var d=a.containingGroup.findSubGraphParts().iterator,l;d.next();)if(l=d.value,'coreText'==l.data.subRole&&l.data.dimKey==a.data.dimKey&&+l.data.orderX==+a.data.orderX-1){r=l;break}break;case'up':if(a.data.orderY==i)return;for(var d=a.containingGroup.findSubGraphParts().iterator,l;d.next();)if(l=d.value,'coreText'==l.data.subRole&&l.data.dimKey==a.data.dimKey&&+l.data.orderY==+a.data.orderY+1){r=l;break}break;case'right':if(a.data.orderX==o)return;for(var d=a.containingGroup.findSubGraphParts().iterator,l;d.next();)if(l=d.value,'coreText'==l.data.subRole&&l.data.dimKey==a.data.dimKey&&+l.data.orderX==+a.data.orderX+1){r=l;break}break;case'down':if(a.data.orderY==i)return;for(var d=a.containingGroup.findSubGraphParts().iterator,l;d.next();)if(l=d.value,'coreText'==l.data.subRole&&l.data.dimKey==a.data.dimKey&&+l.data.orderY==+a.data.orderY-1){r=l;break}}r&&t.select(r)}if('wave'==a.data.category||'shiText'==a.data.role||'xuText'==a.data.role)switch(e){case'left':var s=this.findPrevOlive(a);s&&t.select(s);break;case'up':var c=this.findUpOlive(a);c&&t.select(c);break;case'right':var r=this.findNextOlive(a);r&&t.select(r);break;case'down':var g=this.findDownOlive(a);g&&t.select(g);}}}},{key:'drillAnalyze',value:function(){var e=this.diagram.selection.first();if(e)if(null!=e.data.figure)this.openFigure&&this.openFigure({figure:e.data.figure,title:e.data.text,key:e.data.key,node:e});else if(this.createFigure)this.createFigure({title:e.data.text||'\u672A\u547D\u540D\u62D3\u6251',key:e.data.key,node:e})}}]),t}(c);e.exports=P},function(e,t,a){'use strict';function o(t){var e=t.diagram;e.startTransaction();var a={text:'\u53CC\u51FB\u7F16\u8F91\u6587\u672C',category:'text'};a.loc=go.Point.stringify(e.lastInput.documentPoint),e.model.addNodeData(a),e.commitTransaction()}var i=go.GraphObject.make,r=a(8);e.exports=function(e){return i(go.Node,'Spot',{name:'NODE',_controlExpand:!0,layerName:'Background',locationSpot:go.Spot.Center,resizeCellSize:new go.Size(10,10),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,rotateObjectName:'SHAPE',click:function(){},doubleClick:function(t){o(t)},selectable:!0,selectionObjectName:'SHAPE',movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:i(go.Adornment)},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),i(go.Shape,{name:'SHAPE',fill:'white',strokeWidth:3,stroke:'black',minSize:new go.Size(50,50)},new go.Binding('fill','fill').makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('desiredSize','desiredSize',function(e){return e}).ofObject('BACKGROUND'),new go.Binding('angle','angle',function(e){return e}).ofObject('BACKGROUND'),new go.Binding('geometryString','geometryString',function(e){return e})),i(go.Shape,'Rectangle',{name:'BACKGROUND',fill:'rgba(1,1,1,0)',angle:0,stroke:'rgba(1,1,1,0)'},new go.Binding('desiredSize','desiredSize',function(e,t){return e?go.Size.parse(e):t.part.findObject('SHAPE').measuredBounds.size}).makeTwoWay(function(e){return go.Size.stringify(e)})))}},function(e,t,a){'use strict';var o=go.GraphObject.make,i=a(8);e.exports=function(e){return o(go.Node,'Spot',{name:'NODE',zOrder:10,layerName:'default',padding:0,_controlExpand:!0,locationSpot:go.Spot.LeftCenter,resizeCellSize:new go.Size(1,1),locationObjectName:'SHAPE',resizable:!0,resizeObjectName:'SHAPE',rotatable:!0,mouseDragEnter:function(){},mouseDrop:function(t,e){e.part},click:function(){},deletable:!1,doubleClick:function(t,e){if(!e.selectable){var a=t.diagram.findObjectAt(t.documentPoint,function(e){return e.part},function(e){return e.canSelect()&&'wave'==e.data.category});a&&(t.diagram.select(a),a.doubleClick(t,a)),void 0}},selectable:!0,selectionObjectName:'SHAPE',movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:o(go.Adornment)},new go.Binding('zOrder','zOrder').makeTwoWay(),new go.Binding('selectable','selectable').makeTwoWay(),new go.Binding('locationSpot','locationSpot',function(e){return go.Spot.parse(e)}).makeTwoWay(function(e){return go.Spot.stringify(e)}),new go.Binding('movable','movable').makeTwoWay(),new go.Binding('visible','visible').makeTwoWay(),new go.Binding('deletable','deletable').makeTwoWay(),new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),new go.Binding('angle','angle').makeTwoWay(function(e,t,o){return e}),o(go.Shape,'LineH',{name:'SHAPE',alignment:go.Spot.Left,alignmentFocus:go.Spot.Left,stretch:go.GraphObject.Horizontal,strokeCap:'round',strokeDashArray:[0,0],width:300,height:20,margin:0,fill:'white',strokeWidth:3,stroke:'black',minSize:new go.Size(NaN,10),maxSize:new go.Size(NaN,20)},new go.Binding('fill','fill').makeTwoWay(function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeDashArray','strokeDashArray',function(e){return JSON.parse(e)}).makeTwoWay(function(e){return JSON.stringify(e)}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('desiredSize','desiredSize',function(e,t){return e?go.Size.parse(e):t.part.findObject('SHAPE').measuredBounds.size}).makeTwoWay(function(e){return go.Size.stringify(e)})),o(go.Shape,{name:'BeginArrow',visible:!1,margin:0,alignment:new go.Spot(0,.5,10,0),alignmentFocus:go.Spot.Right,geometryString:'M 0,-4 l -8,4 8,4',strokeCap:'round',fill:'black',width:10,height:15,strokeWidth:3,stroke:'black'},new go.Binding('fill','stroke',function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('visible','showBeginArrow')),o(go.Shape,{name:'EndArrow',visible:!1,margin:0,alignment:new go.Spot(1,.5,0,0),alignmentFocus:go.Spot.Right,geometryString:'M 0,-4 l 8,4 -8,4',strokeCap:'round',fill:'black',width:10,height:15,strokeWidth:3,stroke:'black'},new go.Binding('fill','stroke',function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('visible','showEndArrow')),o(go.Shape,{name:'Arrow',visible:!0,margin:0,alignment:new go.Spot(1,.5,5,0),alignmentFocus:go.Spot.Right,geometryString:'F M 158,-4 l 8,4 -8,4 2,-4 z',strokeCap:'round',fill:'black',width:20,height:15,strokeWidth:3,stroke:'black'},new go.Binding('fill','stroke',function(e){return e}),new go.Binding('stroke','stroke').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e}),new go.Binding('visible','showArrow')))}},function(e,t,a){'use strict';function o(){return go.Geometry.parse('M 0,80 A100,80 0 1 1 200,80')}function i(e,t){var a=go.Geometry.parse('M 0,80 A100,80 0 1 0 200,80');return t.isGeometryPositioned=!0,t.position=new go.Point(-100,-100),a}function r(t){var e=t.diagram;e.startTransaction();var a={text:'\u53CC\u51FB\u7F16\u8F91\u6587\u672C',category:'text'};a.loc=go.Point.stringify(e.lastInput.documentPoint),e.model.addNodeData(a),e.commitTransaction()}var d=go.GraphObject.make,l=a(8);e.exports=function(e){return d(go.Node,'Spot',{name:'NODE',_controlExpand:!0,layerName:'Background',locationSpot:go.Spot.Center,locationObjectName:'BACKGROUND',resizable:!0,resizeObjectName:'BACKGROUND',rotatable:!0,rotateObjectName:'BACKGROUND',click:function(){},doubleClick:function(t){r(t)},selectable:!0,movable:!0,angle:0,layoutConditions:go.Part.LayoutStandard&go.Part.LayoutNodeSized&go.Part.LayoutAdded&go.Part.LayoutNodeSized,alignment:go.Spot.Center,alignmentFocus:go.Spot.Center,resizeAdornmentTemplate:e.__trtd.nodeResizeAdornmentTemplate(),contextMenu:d(go.Adornment)},new go.Binding('location','loc',go.Point.parse).makeTwoWay(go.Point.stringify),d(go.Shape,'Rectangle',{name:'BACKGROUND',fill:'rgba(1,1,1,0)',angle:0,stroke:'rgba(1,1,1,1)'},new go.Binding('desiredSize','desiredSize',function(e){return go.Size.parse(e)}).makeTwoWay(function(e){return go.Size.stringify(e)})),d(go.Shape,{name:'UP',stroke:'blue',position:new go.Point(0,0),isGeometryPositioned:!0,alignment:go.Spot.Center,stretch:go.GraphObject.Fill},new go.Binding('geometry','',o),new go.Binding('stroke','stroke1').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e})),d(go.Shape,{name:'DOWN',stroke:'red',alignment:go.Spot.Center,strokeDashArray:[10,10],isGeometryPositioned:!0,position:new go.Point(-100,-100),stretch:go.GraphObject.Fill},new go.Binding('geometry','',i),new go.Binding('stroke','stroke2').makeTwoWay(function(e){return e}),new go.Binding('strokeWidth','strokeWidth').makeTwoWay(function(e){return e})))}},function(e){'use strict';function t(){go.RotatingTool.call(this),this._initialInfo=null,this._rotatePoint=new go.Point,this.handleAngle=0,this.handleArchetype=o(go.Panel,'Auto',o(go.Shape,'BpmnActivityLoop',{width:30,height:30,stroke:'green',fill:'transparent'}),o(go.Shape,'Rectangle',{width:30,height:30,stroke:'green',fill:'transparent',strokeWidth:0}))}function a(e,t,a){this.relativeLocation=e,this.centerLocationOffset=t,this.rotationAngle=a}var o=go.GraphObject.make;go.Diagram.inherit(t,go.RotatingTool),t.prototype.doActivate=function(){go.RotatingTool.prototype.doActivate.call(this);var e=this.adornedObject.part;if(e instanceof go.Group&&'waveGroup'==e.data.category){this._rotatePoint=e.location;var t=new go.Map(go.Part,a),o=e.data.textAngle||'vertical';this.walkTree(e,t,o),this._initialInfo=t}},t.prototype.walkTree=function(e,t,o){if(!(null===e||e instanceof go.Link)&&('horizontal'!=o||'autoText'!=e.data.category)){var i=e.locationObject.getDocumentPoint(go.Spot.Center),r=i.copy().subtract(e.location),d=i.subtract(this._rotatePoint);if(t.add(e,new a(d,r,e.rotateObject.angle)),e instanceof go.Group)for(var l=e.memberParts.iterator;l.next();)this.walkTree(l.value,t,o)}},t.prototype.rotate=function(e){var t=this.adornedObject.part;if(t instanceof go.Group&&(300>(e+360)%360||340<(e+360)%360)&&(300>(e+360)%360&&(e=300),340<(e+360)%360&&(e=340),void 0),go.RotatingTool.prototype.rotate.call(this,e),t instanceof go.Group){var a=e-this.originalAngle,o=this._rotatePoint;t.diagram.startTransaction();for(var i=this._initialInfo.iterator,r;i.next();){if(r=i.key,r instanceof go.Link)return;var d=i.value,l=d.rotationAngle+a,s=o.copy().add(d.relativeLocation),c=o.directionPoint(s),g=(a+c)*(_MathPI/180),m=d.centerLocationOffset.copy();m.rotate(a);var p=_Mathsqrt(o.distanceSquaredPoint(s)),u=new go.Point(o.x+p*_Mathcos(g),o.y+p*_Mathsin(g)).subtract(m);t.diagram.model.setDataProperty(r.data,'loc',go.Point.stringify(u)),t.diagram.model.setDataProperty(r.data,'angle',l),t.layout.isOngoing=!0,t.layout.isValidLayout=!1,t.containingGroup&&(t.containingGroup.layout.isOngoing=!0,t.containingGroup.layout.isValidLayout=!1),t.diagram.commitTransaction()}}},e.exports=t},function(){'use strict';(function(e){function t(){o.style.minHeight='40px',o.style.height='auto',o.style.height=o.scrollHeight+'px'}function a(){setTimeout(t,0)}var o=document.createElement('textarea');o.id='myTextArea',void 0,o.addEventListener('input',function(){var e=r.tool;if(null!==e.textBlock){var t=e.measureTemporaryTextBlock(this.value),a=this.textScale;this.style.width=20+t.measuredBounds.width*a+'px',this.rows=t.lineCount}},!1);var i;i=e.attachEvent?function(e,t){t.forEach(function(a){e.attachEvent('on'+a.evt,a.handler)})}:function(e,t){t.forEach(function(a){e.addEventListener(a.evt,a.handler,!1)})},i(o,[{evt:'change',handler:t},{evt:'cut',handler:a},{evt:'paste',handler:a},{evt:'drop',handler:a},{evt:'keydown',handler:a}]),o.addEventListener('keydown',function(t){var e=r.tool;if(null!==e.textBlock){var a=t.which;return 13===a?(!1===e.textBlock.isMultiline&&t.preventDefault(),void e.acceptText(go.TextEditingTool.Enter)):9===a?(e.acceptText(go.TextEditingTool.Tab),void t.preventDefault()):void(27===a&&(e.doCancel(),null!==e.diagram&&e.diagram.doFocus()))}},!1),o.addEventListener('focus',function(){var e=r.tool;e&&null!==e.currentTextEditor&&(e.state===go.TextEditingTool.StateActive&&(e.state=go.TextEditingTool.StateEditing),e.selectsTextOnActivate&&(o.select(),o.setSelectionRange(0,9999)))},!1),o.addEventListener('blur',function(){var e=r.tool;e&&null!==e.currentTextEditor&&e.state!==go.TextEditingTool.StateNone&&(o.focus(),e.selectsTextOnActivate&&(o.select(),o.setSelectionRange(0,9999)))},!1);var r=new go.HTMLInfo;r.valueFunction=function(){return o.value},r.mainElement=o,r.show=function(e,a,i){if(e instanceof go.TextBlock){if(r.tool=i,i.state===go.TextEditingTool.StateInvalid)return o.style.border='3px solid red',void o.focus();var d=e.getDocumentPoint(go.Spot.Center),l=a.position,s=a.scale,c=e.getDocumentScale()*s;c<i.minimumEditorScale&&(c=i.minimumEditorScale);var g=e.naturalBounds.width*c+6,m=e.naturalBounds.height*c+2,p=(d.x-l.x)*s,u=(d.y-l.y)*s;o.value=e.text,a.div.style.font=e.font;var y=1;o.style.position='absolute',o.style.zIndex='100',o.style.font='inherit',o.style.fontSize=100*c+'%',o.style.lineHeight='normal',o.style.width=g+'px',o.style.left=(0|p-g/2)-y+'px',o.style.top=(0|u-m/2)-y+'px',o.style.textAlign=e.textAlign,o.style.margin='0',o.style.padding=y+'px',o.style.border='0',o.style.outline='none',o.style.whiteSpace='pre-wrap',o.style.overflow='hidden',o.rows=e.lineCount,o.textScale=c,o.className='goTXarea',a.div.appendChild(o),o.focus(),i.selectsTextOnActivate&&(o.select(),o.setSelectionRange(0,9999)),t()}},r.hide=function(e){e.div.removeChild(o),r.tool=null},e.TextEditor=r})(window)}])});
  //# sourceMappingURL=hardcore0.0.33.min.js.map