@univerjs-pro/sheets-shape 0.21.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/facade.js CHANGED
@@ -1 +1 @@
1
- const _0x12986b=_0x5565;(function(_0x5954b7,_0xd9c166){const _0x5f24dd=_0x5565,_0x4d1e3d=_0x5954b7();while(!![]){try{const _0x18d354=-parseInt(_0x5f24dd(0x179))/0x1+-parseInt(_0x5f24dd(0x180))/0x2*(-parseInt(_0x5f24dd(0x121))/0x3)+parseInt(_0x5f24dd(0x137))/0x4+parseInt(_0x5f24dd(0x142))/0x5+parseInt(_0x5f24dd(0x157))/0x6*(parseInt(_0x5f24dd(0x18a))/0x7)+parseInt(_0x5f24dd(0x12e))/0x8*(parseInt(_0x5f24dd(0x122))/0x9)+-parseInt(_0x5f24dd(0x11c))/0xa;if(_0x18d354===_0xd9c166)break;else _0x4d1e3d['push'](_0x4d1e3d['shift']());}catch(_0x1282a8){_0x4d1e3d['push'](_0x4d1e3d['shift']());}}}(_0xa6ed,0x24e4d));function _0xa6ed(){const _0x25b3ab=['worldRect','getShapeData','insertShape','startArrow','localToWorld','2unlTMu','fill','length','ShapeGradientTypeEnum','height','getAdjustNames','setShapeSolidFill','newConnector','executeCommand','getWorkbook','133NYPpRZ','subUnitId','constructor','getShapeType','gradientStops','fillType','setAbsolutePosition','updateShape','getShapeId','toPrimitive','stroke','prototype','getDrawingPoints','size','1795900oRRInN','setShapeType','DRAWING_SHAPE','drawId','_preloadShapeProperties','95043zRvReQ','71073MZUevu','stringify','ShapeLineTypeEnum','setStrokeOpacity','newShape','ShapeLineDashEnum','getDrawingByParam','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','symbol','getShapeModel','color','setShapeGradientFill','152cLGNkb','capType','isLineShape','lineStrokeType','get','setEndArrowSize','setStrokeLineJoinType','connectShapes','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','200616YjrWYv','setHeight','setStrokeLineType','getAdjustValueByName','setStrokeLineDashType','cos','_resolveEndpoints','opacity','setStrokeColor','getDrawingData','getSheetId','1502235ytkUZy','Skeleton\x20for\x20unitId\x20','flipX','ensureSkeleton','width','left','shapeType','\x20not\x20found','NoFill','find','GradientFill','setPosition','_injector','rotation','unitId','getUnitId','transform','setStartArrowType','defineProperty','abs','getShapes','27948vehdkO','shape','_resolveExistingOrFreeEndpoint','updateContext','extend','relation','build','setNoneFill','ShapeTypeEnum','point','ShapeArrowTypeEnum','setEndArrowType','getEndConnectInfo','drawingType','push','adjustValues','entries','setWidth','getStartConnectInfo','setStrokeLineCapType','endArrow','function','_commandService','getConnectorLinePoints','from','getAdjustPoints','connectionSiteIndex','getConnectionSiteList','removeShape','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','gradientAngle','type','flipY','top','290120hpJNfC','shapeData'];_0xa6ed=function(){return _0x25b3ab;};return _0xa6ed();}import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';import{IDrawingManagerService}from'@univerjs/drawing';import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';import{FWorksheet}from'@univerjs/sheets/facade';function _0x5565(_0x1ed8fe,_0x505307){_0x1ed8fe=_0x1ed8fe-0x112;const _0xa6edcf=_0xa6ed();let _0x5565a6=_0xa6edcf[_0x1ed8fe];return _0x5565a6;}var FSheetsShapeEnumMixin=class extends FEnum{get[_0x12986b(0x15f)](){return ShapeTypeEnum;}get['ShapeFillEnum'](){return ShapeFillEnum;}get[_0x12986b(0x183)](){return ShapeGradientTypeEnum;}get[_0x12986b(0x124)](){return ShapeLineTypeEnum;}get[_0x12986b(0x127)](){return ShapeLineDashEnum;}get['ShapeLineCapEnum'](){return ShapeLineCapEnum;}get['ShapeLineJoinEnum'](){return ShapeLineJoinEnum;}get[_0x12986b(0x161)](){return ShapeArrowTypeEnum;}get['ShapeArrowSizeEnum'](){return ShapeArrowSizeEnum;}};FEnum[_0x12986b(0x15b)](FSheetsShapeEnumMixin);function _typeof(_0x4570d6){'@babel/helpers - typeof';const _0x260211=_0x12986b;return _typeof=_0x260211(0x16c)==typeof Symbol&&_0x260211(0x12a)==typeof Symbol['iterator']?function(_0x27587b){return typeof _0x27587b;}:function(_0x283af7){const _0x133e61=_0x260211;return _0x283af7&&_0x133e61(0x16c)==typeof Symbol&&_0x283af7[_0x133e61(0x18c)]===Symbol&&_0x283af7!==Symbol[_0x133e61(0x119)]?_0x133e61(0x12a):typeof _0x283af7;},_typeof(_0x4570d6);}function toPrimitive(_0x46cfb5,_0x11a639){const _0x6c1bf=_0x12986b;if('object'!=_typeof(_0x46cfb5)||!_0x46cfb5)return _0x46cfb5;var _0x2a1de9=_0x46cfb5[Symbol[_0x6c1bf(0x117)]];if(void 0x0!==_0x2a1de9){var _0x54f064=_0x2a1de9['call'](_0x46cfb5,_0x11a639||'default');if('object'!=_typeof(_0x54f064))return _0x54f064;throw new TypeError(_0x6c1bf(0x136));}return('string'===_0x11a639?String:Number)(_0x46cfb5);}function toPropertyKey(_0x423d8a){const _0x3fcf73=_0x12986b;var _0x1ccda9=toPrimitive(_0x423d8a,'string');return _0x3fcf73(0x12a)==_typeof(_0x1ccda9)?_0x1ccda9:_0x1ccda9+'';}function _defineProperty(_0x4dfcac,_0x16ed89,_0x5515f7){const _0x188206=_0x12986b;return(_0x16ed89=toPropertyKey(_0x16ed89))in _0x4dfcac?Object[_0x188206(0x154)](_0x4dfcac,_0x16ed89,{'value':_0x5515f7,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x4dfcac[_0x16ed89]=_0x5515f7,_0x4dfcac;}var FShape=class{constructor(_0xc2cf06,_0x5c2a17,_0x4e2809,_0x27d71a){const _0x2c8527=_0x12986b;_defineProperty(this,'unitId',void 0x0),_defineProperty(this,_0x2c8527(0x18b),void 0x0),_defineProperty(this,_0x2c8527(0x11f),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x2c8527(0x146),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x2c8527(0x184),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x2c8527(0x148),void 0x0),_defineProperty(this,_0x2c8527(0x17a),{}),_defineProperty(this,_0x2c8527(0x14e),void 0x0),this[_0x2c8527(0x150)]=_0xc2cf06,this['subUnitId']=_0x5c2a17,this[_0x2c8527(0x11f)]=_0x4e2809||generateRandomId(),this[_0x2c8527(0x14e)]=_0x27d71a;}[_0x12986b(0x14d)](_0x3b9632,_0x28391a,_0x51f356,_0x2b94c9){const _0x1e4115=_0x12986b,_0x4aafdc=this[_0x1e4115(0x14e)][_0x1e4115(0x132)](SheetSkeletonService)[_0x1e4115(0x145)](this['unitId'],this[_0x1e4115(0x18b)]);if(!_0x4aafdc)throw new Error(_0x1e4115(0x143)+this['unitId']+'\x20and\x20subUnitId\x20'+this[_0x1e4115(0x18b)]+'\x20not\x20found');const {transform:_0xb8415f}=convertPositionCellToSheetOverGrid(this['unitId'],this[_0x1e4115(0x18b)],{'row':_0x3b9632,'column':_0x28391a,'rowOffset':_0x51f356,'columnOffset':_0x2b94c9},0x1,0x1,_0x4aafdc);return this['x']=_0xb8415f['left'],this['y']=_0xb8415f[_0x1e4115(0x178)],this;}[_0x12986b(0x114)](_0x30fd1a,_0x4eb5dc){return this['x']=_0x30fd1a,this['y']=_0x4eb5dc,this;}[_0x12986b(0x11d)](_0x2a59c5){const _0x375c92=_0x12986b;return this[_0x375c92(0x148)]=_0x2a59c5,this;}[_0x12986b(0x186)](_0x329ed1,_0x59c114){const _0x4b42c8=_0x12986b;if(!this['shapeData']['fill'])this['shapeData'][_0x4b42c8(0x181)]={};this[_0x4b42c8(0x17a)][_0x4b42c8(0x181)][_0x4b42c8(0x113)]=ShapeFillEnum['SolidFill'];if(_0x329ed1!==void 0x0)this[_0x4b42c8(0x17a)][_0x4b42c8(0x181)][_0x4b42c8(0x12c)]=_0x329ed1;if(_0x59c114!==void 0x0)this[_0x4b42c8(0x17a)][_0x4b42c8(0x181)][_0x4b42c8(0x13e)]=_0x59c114;return this;}[_0x12986b(0x12d)](_0x2ce4a6,_0x482e4c,_0x215296){const _0x17eb1a=_0x12986b;if(_0x482e4c===void 0x0||_0x482e4c[_0x17eb1a(0x182)]===0x0)throw new Error(_0x17eb1a(0x129));if(!this[_0x17eb1a(0x17a)][_0x17eb1a(0x181)])this[_0x17eb1a(0x17a)][_0x17eb1a(0x181)]={};this[_0x17eb1a(0x17a)]['fill'][_0x17eb1a(0x112)]=_0x482e4c,this[_0x17eb1a(0x17a)][_0x17eb1a(0x181)]['fillType']=ShapeFillEnum[_0x17eb1a(0x14c)],this['shapeData'][_0x17eb1a(0x181)]['gradientType']=_0x2ce4a6;if(_0x215296!==void 0x0)this['shapeData'][_0x17eb1a(0x181)][_0x17eb1a(0x175)]=_0x215296;return this;}[_0x12986b(0x15e)](){const _0x389766=_0x12986b;return this['shapeData'][_0x389766(0x181)]={'fillType':ShapeFillEnum[_0x389766(0x14a)]},this;}[_0x12986b(0x13f)](_0x202128){const _0xe2c675=_0x12986b;if(!this['shapeData'][_0xe2c675(0x118)])this['shapeData']['stroke']={};return this[_0xe2c675(0x17a)]['stroke'][_0xe2c675(0x12c)]=_0x202128,this;}['setStrokeWidth'](_0x316bbc){const _0x4bf49f=_0x12986b;if(!this[_0x4bf49f(0x17a)]['stroke'])this[_0x4bf49f(0x17a)][_0x4bf49f(0x118)]={};return this['shapeData'][_0x4bf49f(0x118)][_0x4bf49f(0x146)]=_0x316bbc,this;}[_0x12986b(0x13b)](_0x1382e6){const _0x467144=_0x12986b;if(!this[_0x467144(0x17a)][_0x467144(0x118)])this[_0x467144(0x17a)][_0x467144(0x118)]={};return this[_0x467144(0x17a)][_0x467144(0x118)]['dashType']=_0x1382e6,this;}[_0x12986b(0x134)](_0x1f5819){const _0x2d72dc=_0x12986b;if(!this['shapeData'][_0x2d72dc(0x118)])this['shapeData'][_0x2d72dc(0x118)]={};return this[_0x2d72dc(0x17a)][_0x2d72dc(0x118)]['lineJoinType']=_0x1f5819,this;}[_0x12986b(0x16a)](_0x58af8f){const _0x2bbeba=_0x12986b;if(!this[_0x2bbeba(0x17a)]['stroke'])this[_0x2bbeba(0x17a)][_0x2bbeba(0x118)]={};return this['shapeData'][_0x2bbeba(0x118)][_0x2bbeba(0x12f)]=_0x58af8f,this;}[_0x12986b(0x125)](_0x4ef375){const _0x172876=_0x12986b;if(!this[_0x172876(0x17a)][_0x172876(0x118)])this[_0x172876(0x17a)][_0x172876(0x118)]={};return this[_0x172876(0x17a)]['stroke'][_0x172876(0x13e)]=_0x4ef375,this;}[_0x12986b(0x139)](_0x20ed44){const _0x4c339b=_0x12986b;if(!this[_0x4c339b(0x17a)]['stroke'])this[_0x4c339b(0x17a)]['stroke']={};return this['shapeData']['stroke'][_0x4c339b(0x131)]=_0x20ed44,this;}[_0x12986b(0x168)](_0x3a5aeb){const _0xbd0a12=_0x12986b;return this[_0xbd0a12(0x146)]=_0x3a5aeb,this;}[_0x12986b(0x138)](_0x27d9bb){const _0x44bca0=_0x12986b;return this[_0x44bca0(0x184)]=_0x27d9bb,this;}[_0x12986b(0x130)](){const _0x503b66=_0x12986b,_0x1073f4=this[_0x503b66(0x14e)]['get'](SheetsShapeService)[_0x503b66(0x12b)](this[_0x503b66(0x150)],this['subUnitId'],this['drawId']);if(_0x1073f4)return isConnectorShape(_0x1073f4[_0x503b66(0x18d)]());if(this[_0x503b66(0x148)])return isConnectorShape(this[_0x503b66(0x148)]);return![];}['getConnectionSites'](){const _0x44a024=_0x12986b,_0xdfb730=this['_injector']['get'](SheetsShapeService)[_0x44a024(0x12b)](this[_0x44a024(0x150)],this[_0x44a024(0x18b)],this[_0x44a024(0x11f)]);if(!_0xdfb730)return[];const _0x27404e=this[_0x44a024(0x14e)][_0x44a024(0x132)](IDrawingManagerService)['getDrawingByParam']({'unitId':this[_0x44a024(0x150)],'subUnitId':this['subUnitId'],'drawingId':this[_0x44a024(0x11f)]});if(!(_0x27404e===null||_0x27404e===void 0x0?void 0x0:_0x27404e['transform']))return[];const {width:width=0x0,height:height=0x0}=_0x27404e[_0x44a024(0x152)];return _0xdfb730['updateContext']({'width':width,'height':height}),_0xdfb730[_0x44a024(0x172)]();}[_0x12986b(0x170)](){const _0x3f6dd2=_0x12986b,_0x17fca8=this[_0x3f6dd2(0x14e)]['get'](SheetsShapeService)['getShapeModel'](this[_0x3f6dd2(0x150)],this['subUnitId'],this['drawId']);if(!_0x17fca8)return[];const _0x1dbd3e=this[_0x3f6dd2(0x14e)]['get'](IDrawingManagerService)[_0x3f6dd2(0x128)]({'unitId':this[_0x3f6dd2(0x150)],'subUnitId':this[_0x3f6dd2(0x18b)],'drawingId':this['drawId']});if(!(_0x1dbd3e===null||_0x1dbd3e===void 0x0?void 0x0:_0x1dbd3e[_0x3f6dd2(0x152)]))return[];const {width:width=0x0,height:height=0x0}=_0x1dbd3e['transform'];return _0x17fca8['updateContext']({'width':width,'height':height}),_0x17fca8[_0x3f6dd2(0x11a)]();}['getConnectorLinePoints'](){const _0x1a17cd=_0x12986b,_0x417c9c=this[_0x1a17cd(0x14e)][_0x1a17cd(0x132)](SheetsShapeService)['getShapeModel'](this[_0x1a17cd(0x150)],this[_0x1a17cd(0x18b)],this[_0x1a17cd(0x11f)]);if(!_0x417c9c)return[];if(!isConnectorShape(_0x417c9c[_0x1a17cd(0x18d)]()))return[];const _0x10620f=this[_0x1a17cd(0x14e)][_0x1a17cd(0x132)](IDrawingManagerService)[_0x1a17cd(0x128)]({'unitId':this[_0x1a17cd(0x150)],'subUnitId':this['subUnitId'],'drawingId':this['drawId']});if(!(_0x10620f===null||_0x10620f===void 0x0?void 0x0:_0x10620f[_0x1a17cd(0x152)]))return[];const {width:width=0x0,height:height=0x0}=_0x10620f[_0x1a17cd(0x152)];return _0x417c9c[_0x1a17cd(0x15a)]({'width':width,'height':height}),_0x417c9c['getConnectorLinePoints']();}[_0x12986b(0x169)](){const _0x684f15=_0x12986b;var _0x37ae34;const _0x42a840=this[_0x684f15(0x14e)][_0x684f15(0x132)](SheetsShapeService)['getShapeModel'](this['unitId'],this['subUnitId'],this[_0x684f15(0x11f)]);if(!_0x42a840)return null;return(_0x37ae34=_0x42a840['getStartConnectInfo']())!==null&&_0x37ae34!==void 0x0?_0x37ae34:null;}['getEndConnectInfo'](){const _0x20047d=_0x12986b;var _0x4d397c;const _0x263853=this['_injector']['get'](SheetsShapeService)[_0x20047d(0x12b)](this[_0x20047d(0x150)],this[_0x20047d(0x18b)],this[_0x20047d(0x11f)]);if(!_0x263853)return null;return(_0x4d397c=_0x263853[_0x20047d(0x163)]())!==null&&_0x4d397c!==void 0x0?_0x4d397c:null;}[_0x12986b(0x15d)](){const _0x3d24c2=_0x12986b;var _0x29f0a9,_0x3b4df7;if(!this[_0x3d24c2(0x148)])throw new Error(_0x3d24c2(0x174));if(this['x']===0x0||this['y']===0x0){const _0x4cfb68=this[_0x3d24c2(0x14e)][_0x3d24c2(0x132)](SheetSkeletonService)[_0x3d24c2(0x145)](this[_0x3d24c2(0x150)],this[_0x3d24c2(0x18b)]);if(!_0x4cfb68)throw new Error(_0x3d24c2(0x143)+this['unitId']+'\x20and\x20subUnitId\x20'+this[_0x3d24c2(0x18b)]+_0x3d24c2(0x149));const {transform:_0x4d83f6}=convertPositionCellToSheetOverGrid(this[_0x3d24c2(0x150)],this['subUnitId'],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x4cfb68);this['x']=this['x']>0x0?this['x']:_0x4d83f6[_0x3d24c2(0x147)],this['y']=this['y']>0x0?this['y']:_0x4d83f6[_0x3d24c2(0x178)];}return this[_0x3d24c2(0x146)]=(_0x29f0a9=this[_0x3d24c2(0x146)])!==null&&_0x29f0a9!==void 0x0?_0x29f0a9:DEFAULT_SHAPE_WIDTH,this['height']=(_0x3b4df7=this[_0x3d24c2(0x184)])!==null&&_0x3b4df7!==void 0x0?_0x3b4df7:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x3d24c2(0x150)],'subUnitId':this['subUnitId'],'shapeId':this['drawId'],'shapeType':this[_0x3d24c2(0x148)],'shapeData':Object['keys'](this[_0x3d24c2(0x17a)])[_0x3d24c2(0x182)]>0x0?this['shapeData']:void 0x0,'x':this['x'],'y':this['y'],'width':this[_0x3d24c2(0x146)],'height':this[_0x3d24c2(0x184)]};}[_0x12986b(0x116)](){const _0xc7ca46=_0x12986b;return this[_0xc7ca46(0x11f)];}[_0x12986b(0x18d)](){const _0x2a590f=_0x12986b;return this[_0x2a590f(0x148)];}[_0x12986b(0x17c)](){const _0x2e38ef=_0x12986b;return this[_0x2e38ef(0x17a)];}['getPosition'](){return{'x':this['x'],'y':this['y']};}['getSize'](){const _0x5b50aa=_0x12986b;return{'width':this[_0x5b50aa(0x146)],'height':this[_0x5b50aa(0x184)]};}},FConnectorShape=class extends FShape{constructor(_0xd3ea5e,_0x5c6292,_0x93f24,_0x2c8307){super(_0xd3ea5e,_0x5c6292,_0x93f24,_0x2c8307),_defineProperty(this,'shapeData',{});}[_0x12986b(0x11d)](_0x1101c6){const _0x26e4a2=_0x12986b;if(!isConnectorShape(_0x1101c6))throw new Error('Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20'+_0x1101c6+',\x20but\x20expected\x20a\x20connector\x20shape\x20type.');return super[_0x26e4a2(0x11d)](_0x1101c6),this;}[_0x12986b(0x153)](_0x4ae818){const _0x297941=_0x12986b;var _0x5f07e5,_0x47f60d;if(!((_0x5f07e5=this['shapeData'])===null||_0x5f07e5===void 0x0?void 0x0:_0x5f07e5['ln']))this[_0x297941(0x17a)]['ln']={};if(!((_0x47f60d=this[_0x297941(0x17a)])===null||_0x47f60d===void 0x0||(_0x47f60d=_0x47f60d['ln'])===null||_0x47f60d===void 0x0?void 0x0:_0x47f60d[_0x297941(0x17e)]))this['shapeData']['ln']['startArrow']={};return this[_0x297941(0x17a)]['ln'][_0x297941(0x17e)][_0x297941(0x176)]=_0x4ae818,this;}[_0x12986b(0x162)](_0x4ee753){const _0x4add36=_0x12986b;var _0x3d1416,_0x3afea1;if(!((_0x3d1416=this[_0x4add36(0x17a)])===null||_0x3d1416===void 0x0?void 0x0:_0x3d1416['ln']))this[_0x4add36(0x17a)]['ln']={};if(!((_0x3afea1=this[_0x4add36(0x17a)])===null||_0x3afea1===void 0x0||(_0x3afea1=_0x3afea1['ln'])===null||_0x3afea1===void 0x0?void 0x0:_0x3afea1[_0x4add36(0x16b)]))this[_0x4add36(0x17a)]['ln'][_0x4add36(0x16b)]={};return this['shapeData']['ln'][_0x4add36(0x16b)][_0x4add36(0x176)]=_0x4ee753,this;}['setStartArrowSize'](_0x3bb477){const _0x1bdc15=_0x12986b;var _0x3b2884,_0x246dcb;if(!((_0x3b2884=this[_0x1bdc15(0x17a)])===null||_0x3b2884===void 0x0?void 0x0:_0x3b2884['ln']))this[_0x1bdc15(0x17a)]['ln']={};if(!((_0x246dcb=this[_0x1bdc15(0x17a)])===null||_0x246dcb===void 0x0||(_0x246dcb=_0x246dcb['ln'])===null||_0x246dcb===void 0x0?void 0x0:_0x246dcb[_0x1bdc15(0x17e)]))this[_0x1bdc15(0x17a)]['ln'][_0x1bdc15(0x17e)]={};return this['shapeData']['ln'][_0x1bdc15(0x17e)]['size']=_0x3bb477,this;}[_0x12986b(0x133)](_0x5ccabe){const _0x255f17=_0x12986b;var _0x220f62,_0x5ee33c;if(!((_0x220f62=this[_0x255f17(0x17a)])===null||_0x220f62===void 0x0?void 0x0:_0x220f62['ln']))this[_0x255f17(0x17a)]['ln']={};if(!((_0x5ee33c=this[_0x255f17(0x17a)])===null||_0x5ee33c===void 0x0||(_0x5ee33c=_0x5ee33c['ln'])===null||_0x5ee33c===void 0x0?void 0x0:_0x5ee33c[_0x255f17(0x16b)]))this[_0x255f17(0x17a)]['ln']['endArrow']={};return this['shapeData']['ln'][_0x255f17(0x16b)][_0x255f17(0x11b)]=_0x5ccabe,this;}[_0x12986b(0x15d)](){const _0x109c99=_0x12986b;return super[_0x109c99(0x15d)]();}[_0x12986b(0x163)](){const _0x5a33ba=_0x12986b;var _0x48dcea;return((_0x48dcea=this[_0x5a33ba(0x17a)])===null||_0x48dcea===void 0x0||(_0x48dcea=_0x48dcea[_0x5a33ba(0x15c)])===null||_0x48dcea===void 0x0?void 0x0:_0x48dcea['to'])||null;}['getStartConnectInfo'](){const _0xbf8bad=_0x12986b;var _0x304082;return((_0x304082=this['shapeData'])===null||_0x304082===void 0x0||(_0x304082=_0x304082[_0xbf8bad(0x15c)])===null||_0x304082===void 0x0?void 0x0:_0x304082['from'])||null;}};function computeConnectionPointInfo(_0x54cc25,_0x3977f5,_0x5be51c,_0x27d92d,_0x297e9d,_0x4722bd){const _0x448d29=_0x12986b,_0x2b9c82=_0x297e9d[_0x448d29(0x12b)](_0x54cc25,_0x3977f5,_0x5be51c);if(!_0x2b9c82)return null;const _0x217c75=_0x4722bd['getDrawingByParam']({'unitId':_0x54cc25,'subUnitId':_0x3977f5,'drawingId':_0x5be51c});if(!(_0x217c75===null||_0x217c75===void 0x0?void 0x0:_0x217c75[_0x448d29(0x152)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x1b57a1}=_0x217c75[_0x448d29(0x152)];_0x2b9c82[_0x448d29(0x15a)]({'width':width,'height':height});const _0x30aba8=_0x2b9c82[_0x448d29(0x172)]()[_0x448d29(0x14b)](_0x390c1e=>_0x390c1e['index']===_0x27d92d);if(!_0x30aba8)return null;let _0xa12970=flipX?width-_0x30aba8['x']:_0x30aba8['x'],_0x558fc5=flipY?height-_0x30aba8['y']:_0x30aba8['y'];if(_0x1b57a1&&_0x1b57a1!==0x0){const _0x58ac78=_0x1b57a1*Math['PI']/0xb4,_0x24db42=Math[_0x448d29(0x13c)](_0x58ac78),_0x139712=Math['sin'](_0x58ac78),_0x5c0401=width/0x2,_0x261546=height/0x2,_0x17915f=_0xa12970-_0x5c0401,_0xbfd97c=_0x558fc5-_0x261546;_0xa12970=_0x5c0401+_0x17915f*_0x24db42-_0xbfd97c*_0x139712,_0x558fc5=_0x261546+_0x17915f*_0x139712+_0xbfd97c*_0x24db42;}_0xa12970+=left,_0x558fc5+=top;let _0x1fc16d=_0x30aba8['ang']/0xea60;if(flipX)_0x1fc16d=0xb4-_0x1fc16d;if(flipY)_0x1fc16d=-_0x1fc16d;_0x1fc16d+=_0x1b57a1||0x0,_0x1fc16d=(_0x1fc16d%0x168+0x168)%0x168;const _0x3e56c8=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x1b57a1||0x0);return{'point':{'x':_0xa12970,'y':_0x558fc5},'angle':_0x1fc16d,'bounds':_0x3e56c8};}function calculateFreeEndpointAngle(_0x41eef1,_0x4bb047){const _0x4849bb=_0x12986b,_0x21931a=_0x4bb047['x']-_0x41eef1['x'],_0x231eb5=_0x4bb047['y']-_0x41eef1['y'];if(Math[_0x4849bb(0x155)](_0x21931a)>=Math[_0x4849bb(0x155)](_0x231eb5))return _0x21931a>=0x0?0xb4:0x0;return _0x231eb5>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x443195,_0x5f02cd,_0x45c65b,_0x36980d,_0x5ef71a,_0x297677,_0x52990b){const _0x53cd9c=_0x12986b,_0x2a53c9=_0x297677['getShapeModel'](_0x443195,_0x5f02cd,_0x45c65b);if(!_0x2a53c9)return null;const _0x355730=_0x52990b[_0x53cd9c(0x128)]({'unitId':_0x443195,'subUnitId':_0x5f02cd,'drawingId':_0x45c65b});if(!(_0x355730===null||_0x355730===void 0x0?void 0x0:_0x355730[_0x53cd9c(0x152)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x355730[_0x53cd9c(0x152)];_0x2a53c9[_0x53cd9c(0x15a)]({'width':width,'height':height});const _0x4bc9b3=_0x2a53c9[_0x53cd9c(0x16e)]();if(_0x4bc9b3['length']<0x2)return null;const _0x4aab69=_0x36980d?_0x4bc9b3[0x0]:_0x4bc9b3[_0x4bc9b3[_0x53cd9c(0x182)]-0x1],_0xa34a87=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x53cd9c(0x17f)](_0x4aab69);return{'point':_0xa34a87,'angle':calculateFreeEndpointAngle(_0x5ef71a[_0x53cd9c(0x160)],_0xa34a87),'bounds':{'left':_0xa34a87['x'],'top':_0xa34a87['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x12986b(0x17d)](_0x580c29){const _0x1d4706=_0x12986b,{unitId:_0x557796,subUnitId:_0x2c8de1,shapeId:_0x1ba1b5,shapeType:_0x19c115,shapeData:_0x8b1d2d,x:_0xbdd58f,y:_0x3ed08b,width:_0x3806fe,height:_0x3a0255}=_0x580c29;return this[_0x1d4706(0x16d)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x557796,'subUnitId':_0x2c8de1,'shapeId':_0x1ba1b5,'shapeType':_0x19c115,'shapeData':_0x8b1d2d,'position':{'x':_0xbdd58f,'y':_0x3ed08b},'width':_0x3806fe,'height':_0x3a0255});}async[_0x12986b(0x115)](_0x253c54){const _0x136528=_0x12986b,{unitId:_0x59821b,subUnitId:_0x26a514,shapeId:_0x409bd3,shapeType:_0x1f1eac,shapeData:_0x32916c,x:_0x1ff886,y:_0x43a7ef,width:_0x4f1d1b,height:_0x381587}=_0x253c54;return this[_0x136528(0x16d)][_0x136528(0x188)](SetShapeDrawingDataCommand['id'],{'unitId':_0x59821b,'subUnitId':_0x26a514,'shapeId':_0x409bd3,'shapeType':_0x1f1eac,'shapeData':_0x32916c,'position':{'x':_0x1ff886,'y':_0x43a7ef},'width':_0x4f1d1b,'height':_0x381587});}[_0x12986b(0x126)](_0xa66d77){const _0x50ddb8=_0x12986b,_0x1ddb90=this['getWorkbook']()[_0x50ddb8(0x151)](),_0x59cbcf=this[_0x50ddb8(0x141)]();if(_0xa66d77){const _0x484994=new FShape(_0x1ddb90,_0x59cbcf,_0xa66d77[_0x50ddb8(0x11f)],this[_0x50ddb8(0x14e)]);return this[_0x50ddb8(0x120)](_0x484994,_0x1ddb90,_0x59cbcf,_0xa66d77['drawId']),_0x484994;}return new FShape(_0x1ddb90,_0x59cbcf,generateRandomId(),this['_injector']);}[_0x12986b(0x187)](_0x4638e2){const _0x345c1d=_0x12986b,_0x2ac3f9=this[_0x345c1d(0x189)]()[_0x345c1d(0x151)](),_0x5a527d=this['getSheetId']();if(_0x4638e2){const _0x67b3c5=new FConnectorShape(_0x2ac3f9,_0x5a527d,_0x4638e2[_0x345c1d(0x11f)],this[_0x345c1d(0x14e)]);return this[_0x345c1d(0x120)](_0x67b3c5,_0x2ac3f9,_0x5a527d,_0x4638e2[_0x345c1d(0x11f)]),_0x67b3c5;}return new FConnectorShape(_0x2ac3f9,_0x5a527d,generateRandomId(),this[_0x345c1d(0x14e)]);}[_0x12986b(0x156)](){const _0x1e2a53=_0x12986b,_0x7a58bc=this[_0x1e2a53(0x14e)][_0x1e2a53(0x132)](ISheetDrawingService),_0x3f684a=this['getWorkbook']()[_0x1e2a53(0x151)](),_0x150ec7=this[_0x1e2a53(0x141)](),_0x1a246e=_0x7a58bc[_0x1e2a53(0x140)](_0x3f684a,_0x150ec7);if(!_0x1a246e)return[];const _0x2efefa=[];for(const [_0x522f1f,_0x1ccbc2]of Object[_0x1e2a53(0x167)](_0x1a246e))if(_0x1ccbc2&&_0x1ccbc2[_0x1e2a53(0x164)]===DrawingTypeEnum[_0x1e2a53(0x11e)]){const _0xc497d7=new FShape(_0x3f684a,_0x150ec7,_0x522f1f,this['_injector']);this[_0x1e2a53(0x120)](_0xc497d7,_0x3f684a,_0x150ec7,_0x522f1f),_0x2efefa[_0x1e2a53(0x165)](_0xc497d7);}return _0x2efefa;}[_0x12986b(0x173)](_0x8cfe96){const _0x2a1f39=_0x12986b,{unitId:_0x4bc8c6,subUnitId:_0xbeff8d,drawId:_0x8d6d30}=_0x8cfe96;return this[_0x2a1f39(0x16d)][_0x2a1f39(0x188)](RemoveSheetDrawingCommand['id'],{'unitId':_0x4bc8c6,'drawings':[{'unitId':_0x4bc8c6,'subUnitId':_0xbeff8d,'drawingId':_0x8d6d30,'drawingType':DrawingTypeEnum['DRAWING_SHAPE']}]});}async[_0x12986b(0x135)](_0x2504f5){const _0x2e39da=_0x12986b,{connector:_0x2b7e29,startTarget:_0x3aacbe,endTarget:_0x14b306}=_0x2504f5;if(!_0x3aacbe&&!_0x14b306)return![];const _0x51254c=this['getWorkbook']()[_0x2e39da(0x151)](),_0x2d71c5=this[_0x2e39da(0x141)](),_0xc35790=this[_0x2e39da(0x14e)][_0x2e39da(0x132)](SheetsShapeService),_0x38ea94=this[_0x2e39da(0x14e)][_0x2e39da(0x132)](IDrawingManagerService),_0x4abd55=_0xc35790[_0x2e39da(0x12b)](_0x51254c,_0x2d71c5,_0x2b7e29[_0x2e39da(0x11f)]);if(!_0x4abd55)return![];const _0x3d53d4=_0x4abd55['getShapeType'](),_0x642960=_0x4abd55['getShapeRelation'](),_0x5aea71={};for(const _0x164431 of _0x4abd55[_0x2e39da(0x185)]()){const _0x1df45a=_0x4abd55[_0x2e39da(0x13a)](_0x164431);if(_0x1df45a!==void 0x0)_0x5aea71[_0x164431]=_0x1df45a;}const {startInfo:_0x3dcae5,endInfo:_0x38b051}=this[_0x2e39da(0x13d)](_0x51254c,_0x2d71c5,_0x2b7e29,_0x4abd55,_0x3aacbe,_0x14b306,_0xc35790,_0x38ea94,_0x642960);if(!_0x3dcae5||!_0x38b051)return![];const _0x1372df=computeConnectorRouteLayout(routeConnectorLineShape(_0x3dcae5,_0x38b051,_0x3d53d4),_0x3d53d4),_0x466777={};if(_0x3aacbe)_0x466777['from']={'shapeId':_0x3aacbe[_0x2e39da(0x158)][_0x2e39da(0x11f)],'cxnIndex':_0x3aacbe[_0x2e39da(0x171)]};else{if(_0x642960===null||_0x642960===void 0x0?void 0x0:_0x642960[_0x2e39da(0x16f)])_0x466777[_0x2e39da(0x16f)]=_0x642960[_0x2e39da(0x16f)];}if(_0x14b306)_0x466777['to']={'shapeId':_0x14b306[_0x2e39da(0x158)][_0x2e39da(0x11f)],'cxnIndex':_0x14b306[_0x2e39da(0x171)]};else{if(_0x642960===null||_0x642960===void 0x0?void 0x0:_0x642960['to'])_0x466777['to']=_0x642960['to'];}return this[_0x2e39da(0x16d)][_0x2e39da(0x188)](UpdateConnectorRelationCommand['id'],{'unitId':_0x51254c,'subUnitId':_0x2d71c5,'connectorShapeId':_0x2b7e29['drawId'],'width':_0x1372df[_0x2e39da(0x17b)]['width'],'height':_0x1372df[_0x2e39da(0x17b)][_0x2e39da(0x184)],'left':_0x1372df[_0x2e39da(0x17b)][_0x2e39da(0x147)],'top':_0x1372df['worldRect'][_0x2e39da(0x178)],'flipX':_0x1372df[_0x2e39da(0x17b)][_0x2e39da(0x144)]||![],'flipY':_0x1372df['worldRect'][_0x2e39da(0x177)]||![],'oldAdjustValues':_0x5aea71,'newAdjustValues':_0x1372df[_0x2e39da(0x166)],'newLineType':_0x1372df['lineType'],'oldLineType':_0x3d53d4,'rotation':_0x1372df[_0x2e39da(0x14f)],'oldRelation':_0x642960,'newRelation':_0x466777});}[_0x12986b(0x120)](_0x3f55ef,_0x993319,_0x512a9f,_0xb4479b){const _0x33bb1b=_0x12986b,_0x442a83=this[_0x33bb1b(0x14e)][_0x33bb1b(0x132)](IDrawingManagerService)[_0x33bb1b(0x128)]({'unitId':_0x993319,'subUnitId':_0x512a9f,'drawingId':_0xb4479b});if(_0x442a83===null||_0x442a83===void 0x0?void 0x0:_0x442a83[_0x33bb1b(0x152)]){var _0x4c826b,_0x1d450d,_0x9778ae,_0x4edb0e;_0x3f55ef['x']=(_0x4c826b=_0x442a83['transform'][_0x33bb1b(0x147)])!==null&&_0x4c826b!==void 0x0?_0x4c826b:0x0,_0x3f55ef['y']=(_0x1d450d=_0x442a83[_0x33bb1b(0x152)]['top'])!==null&&_0x1d450d!==void 0x0?_0x1d450d:0x0,_0x3f55ef[_0x33bb1b(0x146)]=(_0x9778ae=_0x442a83[_0x33bb1b(0x152)][_0x33bb1b(0x146)])!==null&&_0x9778ae!==void 0x0?_0x9778ae:_0x3f55ef['width'],_0x3f55ef[_0x33bb1b(0x184)]=(_0x4edb0e=_0x442a83[_0x33bb1b(0x152)][_0x33bb1b(0x184)])!==null&&_0x4edb0e!==void 0x0?_0x4edb0e:_0x3f55ef[_0x33bb1b(0x184)];}const _0x17f1f2=this[_0x33bb1b(0x14e)][_0x33bb1b(0x132)](SheetsShapeService)[_0x33bb1b(0x12b)](_0x993319,_0x512a9f,_0xb4479b);if(_0x17f1f2){_0x3f55ef[_0x33bb1b(0x148)]=_0x17f1f2['getShapeType']();const _0x1f6398=_0x17f1f2['getShapeData']();if(_0x1f6398)_0x3f55ef[_0x33bb1b(0x17a)]=JSON['parse'](JSON[_0x33bb1b(0x123)](_0x1f6398));}}[_0x12986b(0x13d)](_0x4e659b,_0x3e3ffa,_0x4d7bc7,_0x366373,_0x18bf0d,_0x7cf596,_0x3356a7,_0x25790e,_0x450c3c){const _0x3e2c54=_0x12986b;let _0xb897b3=null,_0x22e6a5=null;if(_0x18bf0d)_0xb897b3=computeConnectionPointInfo(_0x4e659b,_0x3e3ffa,_0x18bf0d[_0x3e2c54(0x158)][_0x3e2c54(0x11f)],_0x18bf0d[_0x3e2c54(0x171)],_0x3356a7,_0x25790e);if(_0x7cf596)_0x22e6a5=computeConnectionPointInfo(_0x4e659b,_0x3e3ffa,_0x7cf596[_0x3e2c54(0x158)]['drawId'],_0x7cf596[_0x3e2c54(0x171)],_0x3356a7,_0x25790e);if(!_0xb897b3)_0xb897b3=this[_0x3e2c54(0x159)](_0x4e659b,_0x3e3ffa,_0x4d7bc7[_0x3e2c54(0x11f)],!![],_0x22e6a5,_0x450c3c===null||_0x450c3c===void 0x0?void 0x0:_0x450c3c[_0x3e2c54(0x16f)],_0x3356a7,_0x25790e);if(!_0x22e6a5)_0x22e6a5=this['_resolveExistingOrFreeEndpoint'](_0x4e659b,_0x3e3ffa,_0x4d7bc7[_0x3e2c54(0x11f)],![],_0xb897b3,_0x450c3c===null||_0x450c3c===void 0x0?void 0x0:_0x450c3c['to'],_0x3356a7,_0x25790e);return{'startInfo':_0xb897b3,'endInfo':_0x22e6a5};}[_0x12986b(0x159)](_0x4574db,_0xc2f15c,_0x2d1fe9,_0x23e9ad,_0x26d5da,_0x393f7a,_0x229045,_0x19305e){if(_0x393f7a){const _0x5b8522=computeConnectionPointInfo(_0x4574db,_0xc2f15c,_0x393f7a['shapeId'],_0x393f7a['cxnIndex'],_0x229045,_0x19305e);if(_0x5b8522)return _0x5b8522;}if(!_0x26d5da)return null;return computeFreeEndpointInfo(_0x4574db,_0xc2f15c,_0x2d1fe9,_0x23e9ad,_0x26d5da,_0x229045,_0x19305e);}};FWorksheet['extend'](FWorksheetShapeMixin);export{FConnectorShape,FShape};
1
+ const _0x50bc8b=_0x12e7;function _0x12e7(_0x593a5b,_0xdff764){_0x593a5b=_0x593a5b-0x17b;const _0x3bc4be=_0x3bc4();let _0x12e751=_0x3bc4be[_0x593a5b];return _0x12e751;}(function(_0x5aa37f,_0x507fd6){const _0x427187=_0x12e7,_0x4cda8b=_0x5aa37f();while(!![]){try{const _0x5364cb=parseInt(_0x427187(0x193))/0x1+parseInt(_0x427187(0x1a3))/0x2+-parseInt(_0x427187(0x1b3))/0x3*(parseInt(_0x427187(0x1e5))/0x4)+-parseInt(_0x427187(0x1e8))/0x5+parseInt(_0x427187(0x192))/0x6*(parseInt(_0x427187(0x1ee))/0x7)+parseInt(_0x427187(0x1ec))/0x8*(-parseInt(_0x427187(0x1e2))/0x9)+-parseInt(_0x427187(0x1a6))/0xa*(-parseInt(_0x427187(0x1e3))/0xb);if(_0x5364cb===_0x507fd6)break;else _0x4cda8b['push'](_0x4cda8b['shift']());}catch(_0x3e4f78){_0x4cda8b['push'](_0x4cda8b['shift']());}}}(_0x3bc4,0x621d0));import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';import{IDrawingManagerService}from'@univerjs/drawing';import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';import{FWorksheet}from'@univerjs/sheets/facade';var FSheetsShapeEnumMixin=class extends FEnum{get['ShapeTypeEnum'](){return ShapeTypeEnum;}get[_0x50bc8b(0x1db)](){return ShapeFillEnum;}get[_0x50bc8b(0x1fd)](){return ShapeGradientTypeEnum;}get['ShapeLineTypeEnum'](){return ShapeLineTypeEnum;}get[_0x50bc8b(0x1ea)](){return ShapeLineDashEnum;}get[_0x50bc8b(0x1ac)](){return ShapeLineCapEnum;}get['ShapeLineJoinEnum'](){return ShapeLineJoinEnum;}get['ShapeArrowTypeEnum'](){return ShapeArrowTypeEnum;}get[_0x50bc8b(0x1d8)](){return ShapeArrowSizeEnum;}};function _0x3bc4(){const _0x25b3b2=['updateShape','getUnitId','setStrokeWidth','ShapeArrowSizeEnum','getPosition','Skeleton\x20for\x20unitId\x20','ShapeFillEnum','getShapeType','removeShape','\x20and\x20subUnitId\x20','width','setStrokeOpacity','get','3436605anVCVS','727474VSrDPB','push','4708EHNXSB','build','getAdjustValueByName','290730AoRjet','point','ShapeLineDashEnum','parse','8GPmseY','rotation','413OkBbVW','drawingType','getDrawingPoints','SolidFill','stroke','gradientAngle','extend','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','_preloadShapeProperties','executeCommand','adjustValues','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','getStartConnectInfo','_injector','symbol','ShapeGradientTypeEnum','shapeData','default','ensureSkeleton','_resolveEndpoints','connectionSiteIndex','opacity','capType','connectShapes',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','getShapes','getAdjustNames','getShapeId','startArrow','updateContext','relation','endArrow','setShapeGradientFill','getDrawingData','drawId','_resolveExistingOrFreeEndpoint','shape','localToWorld','setNoneFill','29838fsxnha','127731YkOgVP','getShapeModel','defineProperty','_commandService','toPrimitive','unitId','getDrawingByParam','call','GradientFill','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','object','setStartArrowSize','index','getShapeData','getWorkbook','transform','190682oWQGWk','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setHeight','130KKoacT','\x20not\x20found','setAbsolutePosition','fill','function','length','ShapeLineCapEnum','setStrokeLineDashType','getEndConnectInfo','setStrokeColor','setEndArrowType','setWidth','entries','1362ytqIbt','setStartArrowType','fillType','size','subUnitId','iterator','setStrokeLineType','DRAWING_SHAPE','color','string','newConnector','left','isLineShape','getShapeRelation','insertShape','getConnectorLinePoints','type','sin','from','flipY','find','getConnectionSiteList','newShape','setStrokeLineCapType','worldRect','ang','getSize','top','getSheetId','setShapeType','getAdjustPoints','setEndArrowSize','shapeType','height'];_0x3bc4=function(){return _0x25b3b2;};return _0x3bc4();}FEnum[_0x50bc8b(0x1f4)](FSheetsShapeEnumMixin);function _typeof(_0x114419){'@babel/helpers - typeof';const _0x2c9fff=_0x50bc8b;return _typeof=_0x2c9fff(0x1aa)==typeof Symbol&&_0x2c9fff(0x1fc)==typeof Symbol[_0x2c9fff(0x1b8)]?function(_0x1c8b1d){return typeof _0x1c8b1d;}:function(_0x1098b8){const _0x5a545e=_0x2c9fff;return _0x1098b8&&_0x5a545e(0x1aa)==typeof Symbol&&_0x1098b8['constructor']===Symbol&&_0x1098b8!==Symbol['prototype']?_0x5a545e(0x1fc):typeof _0x1098b8;},_typeof(_0x114419);}function toPrimitive(_0x4da8c3,_0x166389){const _0x30ff75=_0x50bc8b;if(_0x30ff75(0x19d)!=_typeof(_0x4da8c3)||!_0x4da8c3)return _0x4da8c3;var _0x4b7b5a=_0x4da8c3[Symbol[_0x30ff75(0x197)]];if(void 0x0!==_0x4b7b5a){var _0x29f0b5=_0x4b7b5a[_0x30ff75(0x19a)](_0x4da8c3,_0x166389||_0x30ff75(0x17c));if('object'!=_typeof(_0x29f0b5))return _0x29f0b5;throw new TypeError(_0x30ff75(0x1a4));}return(_0x30ff75(0x1bc)===_0x166389?String:Number)(_0x4da8c3);}function toPropertyKey(_0x45ffea){const _0x2998c4=_0x50bc8b;var _0x4d9fed=toPrimitive(_0x45ffea,_0x2998c4(0x1bc));return _0x2998c4(0x1fc)==_typeof(_0x4d9fed)?_0x4d9fed:_0x4d9fed+'';}function _defineProperty(_0x2408ef,_0xffb922,_0x2363c3){const _0x3ad3be=_0x50bc8b;return(_0xffb922=toPropertyKey(_0xffb922))in _0x2408ef?Object[_0x3ad3be(0x195)](_0x2408ef,_0xffb922,{'value':_0x2363c3,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2408ef[_0xffb922]=_0x2363c3,_0x2408ef;}var FShape=class{constructor(_0x3b62d2,_0x50b7e9,_0x686bd2,_0x5ac45c){const _0x41b8e0=_0x50bc8b;_defineProperty(this,_0x41b8e0(0x198),void 0x0),_defineProperty(this,_0x41b8e0(0x1b7),void 0x0),_defineProperty(this,_0x41b8e0(0x18d),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x41b8e0(0x1df),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x41b8e0(0x1d4),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x41b8e0(0x1d3),void 0x0),_defineProperty(this,_0x41b8e0(0x17b),{}),_defineProperty(this,_0x41b8e0(0x1fb),void 0x0),this[_0x41b8e0(0x198)]=_0x3b62d2,this['subUnitId']=_0x50b7e9,this[_0x41b8e0(0x18d)]=_0x686bd2||generateRandomId(),this[_0x41b8e0(0x1fb)]=_0x5ac45c;}['setPosition'](_0x2192f1,_0x8fbf6d,_0x13d028,_0x5a487a){const _0x2715c8=_0x50bc8b,_0xa6211f=this[_0x2715c8(0x1fb)][_0x2715c8(0x1e1)](SheetSkeletonService)['ensureSkeleton'](this[_0x2715c8(0x198)],this[_0x2715c8(0x1b7)]);if(!_0xa6211f)throw new Error(_0x2715c8(0x1da)+this[_0x2715c8(0x198)]+_0x2715c8(0x1de)+this[_0x2715c8(0x1b7)]+_0x2715c8(0x1a7));const {transform:_0x30460c}=convertPositionCellToSheetOverGrid(this[_0x2715c8(0x198)],this['subUnitId'],{'row':_0x2192f1,'column':_0x8fbf6d,'rowOffset':_0x13d028,'columnOffset':_0x5a487a},0x1,0x1,_0xa6211f);return this['x']=_0x30460c[_0x2715c8(0x1be)],this['y']=_0x30460c[_0x2715c8(0x1ce)],this;}[_0x50bc8b(0x1a8)](_0x2c21b7,_0x431ac4){return this['x']=_0x2c21b7,this['y']=_0x431ac4,this;}['setShapeType'](_0x31b384){return this['shapeType']=_0x31b384,this;}['setShapeSolidFill'](_0x378caf,_0x4e2ee8){const _0x227273=_0x50bc8b;if(!this[_0x227273(0x17b)][_0x227273(0x1a9)])this[_0x227273(0x17b)][_0x227273(0x1a9)]={};this[_0x227273(0x17b)]['fill']['fillType']=ShapeFillEnum[_0x227273(0x1f1)];if(_0x378caf!==void 0x0)this[_0x227273(0x17b)]['fill'][_0x227273(0x1bb)]=_0x378caf;if(_0x4e2ee8!==void 0x0)this[_0x227273(0x17b)]['fill'][_0x227273(0x180)]=_0x4e2ee8;return this;}[_0x50bc8b(0x18b)](_0x5c3cc7,_0x563823,_0x4ebb0e){const _0x3bcad1=_0x50bc8b;if(_0x563823===void 0x0||_0x563823['length']===0x0)throw new Error(_0x3bcad1(0x19c));if(!this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)])this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]={};this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]['gradientStops']=_0x563823,this['shapeData']['fill'][_0x3bcad1(0x1b5)]=ShapeFillEnum[_0x3bcad1(0x19b)],this[_0x3bcad1(0x17b)][_0x3bcad1(0x1a9)]['gradientType']=_0x5c3cc7;if(_0x4ebb0e!==void 0x0)this[_0x3bcad1(0x17b)]['fill'][_0x3bcad1(0x1f3)]=_0x4ebb0e;return this;}[_0x50bc8b(0x191)](){const _0x29e546=_0x50bc8b;return this[_0x29e546(0x17b)]['fill']={'fillType':ShapeFillEnum['NoFill']},this;}[_0x50bc8b(0x1af)](_0x558dad){const _0x35bb4f=_0x50bc8b;if(!this[_0x35bb4f(0x17b)][_0x35bb4f(0x1f2)])this[_0x35bb4f(0x17b)][_0x35bb4f(0x1f2)]={};return this[_0x35bb4f(0x17b)]['stroke']['color']=_0x558dad,this;}[_0x50bc8b(0x1d7)](_0x12b67e){const _0x3e1a02=_0x50bc8b;if(!this[_0x3e1a02(0x17b)]['stroke'])this[_0x3e1a02(0x17b)][_0x3e1a02(0x1f2)]={};return this[_0x3e1a02(0x17b)][_0x3e1a02(0x1f2)][_0x3e1a02(0x1df)]=_0x12b67e,this;}[_0x50bc8b(0x1ad)](_0x2d8269){const _0x55d0ad=_0x50bc8b;if(!this[_0x55d0ad(0x17b)]['stroke'])this[_0x55d0ad(0x17b)]['stroke']={};return this[_0x55d0ad(0x17b)][_0x55d0ad(0x1f2)]['dashType']=_0x2d8269,this;}['setStrokeLineJoinType'](_0x5765f5){const _0x575948=_0x50bc8b;if(!this['shapeData'][_0x575948(0x1f2)])this[_0x575948(0x17b)][_0x575948(0x1f2)]={};return this[_0x575948(0x17b)][_0x575948(0x1f2)]['lineJoinType']=_0x5765f5,this;}[_0x50bc8b(0x1ca)](_0x1582ef){const _0x374edf=_0x50bc8b;if(!this['shapeData']['stroke'])this[_0x374edf(0x17b)][_0x374edf(0x1f2)]={};return this['shapeData'][_0x374edf(0x1f2)][_0x374edf(0x181)]=_0x1582ef,this;}[_0x50bc8b(0x1e0)](_0x5493f9){const _0x54bb96=_0x50bc8b;if(!this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)])this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)]={};return this[_0x54bb96(0x17b)][_0x54bb96(0x1f2)][_0x54bb96(0x180)]=_0x5493f9,this;}[_0x50bc8b(0x1b9)](_0x1f26a7){const _0x12fe46=_0x50bc8b;if(!this[_0x12fe46(0x17b)][_0x12fe46(0x1f2)])this[_0x12fe46(0x17b)]['stroke']={};return this['shapeData']['stroke']['lineStrokeType']=_0x1f26a7,this;}[_0x50bc8b(0x1b1)](_0x369a54){const _0x22096f=_0x50bc8b;return this[_0x22096f(0x1df)]=_0x369a54,this;}[_0x50bc8b(0x1a5)](_0x41edab){const _0x34714d=_0x50bc8b;return this[_0x34714d(0x1d4)]=_0x41edab,this;}[_0x50bc8b(0x1bf)](){const _0x1ec1b4=_0x50bc8b,_0x4dc04c=this[_0x1ec1b4(0x1fb)][_0x1ec1b4(0x1e1)](SheetsShapeService)[_0x1ec1b4(0x194)](this['unitId'],this[_0x1ec1b4(0x1b7)],this[_0x1ec1b4(0x18d)]);if(_0x4dc04c)return isConnectorShape(_0x4dc04c[_0x1ec1b4(0x1dc)]());if(this['shapeType'])return isConnectorShape(this[_0x1ec1b4(0x1d3)]);return![];}['getConnectionSites'](){const _0x1df0d1=_0x50bc8b,_0x1b346c=this['_injector']['get'](SheetsShapeService)[_0x1df0d1(0x194)](this[_0x1df0d1(0x198)],this['subUnitId'],this['drawId']);if(!_0x1b346c)return[];const _0x3c2565=this['_injector'][_0x1df0d1(0x1e1)](IDrawingManagerService)[_0x1df0d1(0x199)]({'unitId':this[_0x1df0d1(0x198)],'subUnitId':this['subUnitId'],'drawingId':this[_0x1df0d1(0x18d)]});if(!(_0x3c2565===null||_0x3c2565===void 0x0?void 0x0:_0x3c2565[_0x1df0d1(0x1a2)]))return[];const {width:width=0x0,height:height=0x0}=_0x3c2565[_0x1df0d1(0x1a2)];return _0x1b346c['updateContext']({'width':width,'height':height}),_0x1b346c[_0x1df0d1(0x1c8)]();}[_0x50bc8b(0x1d1)](){const _0x5e6dca=_0x50bc8b,_0x5344d5=this[_0x5e6dca(0x1fb)]['get'](SheetsShapeService)[_0x5e6dca(0x194)](this[_0x5e6dca(0x198)],this['subUnitId'],this[_0x5e6dca(0x18d)]);if(!_0x5344d5)return[];const _0x2135d5=this['_injector']['get'](IDrawingManagerService)[_0x5e6dca(0x199)]({'unitId':this[_0x5e6dca(0x198)],'subUnitId':this[_0x5e6dca(0x1b7)],'drawingId':this[_0x5e6dca(0x18d)]});if(!(_0x2135d5===null||_0x2135d5===void 0x0?void 0x0:_0x2135d5[_0x5e6dca(0x1a2)]))return[];const {width:width=0x0,height:height=0x0}=_0x2135d5[_0x5e6dca(0x1a2)];return _0x5344d5[_0x5e6dca(0x188)]({'width':width,'height':height}),_0x5344d5[_0x5e6dca(0x1f0)]();}[_0x50bc8b(0x1c2)](){const _0x174047=_0x50bc8b,_0x26ea35=this['_injector']['get'](SheetsShapeService)[_0x174047(0x194)](this['unitId'],this[_0x174047(0x1b7)],this[_0x174047(0x18d)]);if(!_0x26ea35)return[];if(!isConnectorShape(_0x26ea35[_0x174047(0x1dc)]()))return[];const _0xe15f2b=this[_0x174047(0x1fb)][_0x174047(0x1e1)](IDrawingManagerService)[_0x174047(0x199)]({'unitId':this['unitId'],'subUnitId':this[_0x174047(0x1b7)],'drawingId':this[_0x174047(0x18d)]});if(!(_0xe15f2b===null||_0xe15f2b===void 0x0?void 0x0:_0xe15f2b['transform']))return[];const {width:width=0x0,height:height=0x0}=_0xe15f2b[_0x174047(0x1a2)];return _0x26ea35[_0x174047(0x188)]({'width':width,'height':height}),_0x26ea35[_0x174047(0x1c2)]();}[_0x50bc8b(0x1fa)](){const _0x20e6f4=_0x50bc8b;var _0x35b53d;const _0x3b4d4c=this[_0x20e6f4(0x1fb)][_0x20e6f4(0x1e1)](SheetsShapeService)[_0x20e6f4(0x194)](this[_0x20e6f4(0x198)],this[_0x20e6f4(0x1b7)],this['drawId']);if(!_0x3b4d4c)return null;return(_0x35b53d=_0x3b4d4c[_0x20e6f4(0x1fa)]())!==null&&_0x35b53d!==void 0x0?_0x35b53d:null;}[_0x50bc8b(0x1ae)](){const _0x4366f6=_0x50bc8b;var _0x15565b;const _0x544b04=this[_0x4366f6(0x1fb)][_0x4366f6(0x1e1)](SheetsShapeService)['getShapeModel'](this[_0x4366f6(0x198)],this['subUnitId'],this[_0x4366f6(0x18d)]);if(!_0x544b04)return null;return(_0x15565b=_0x544b04[_0x4366f6(0x1ae)]())!==null&&_0x15565b!==void 0x0?_0x15565b:null;}[_0x50bc8b(0x1e6)](){const _0x75e5=_0x50bc8b;var _0x53334a,_0x7d99c1;if(!this[_0x75e5(0x1d3)])throw new Error(_0x75e5(0x1f9));if(this['x']===0x0||this['y']===0x0){const _0x5e02ed=this['_injector']['get'](SheetSkeletonService)[_0x75e5(0x17d)](this[_0x75e5(0x198)],this[_0x75e5(0x1b7)]);if(!_0x5e02ed)throw new Error(_0x75e5(0x1da)+this[_0x75e5(0x198)]+_0x75e5(0x1de)+this[_0x75e5(0x1b7)]+_0x75e5(0x1a7));const {transform:_0x220b02}=convertPositionCellToSheetOverGrid(this['unitId'],this[_0x75e5(0x1b7)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x5e02ed);this['x']=this['x']>0x0?this['x']:_0x220b02[_0x75e5(0x1be)],this['y']=this['y']>0x0?this['y']:_0x220b02[_0x75e5(0x1ce)];}return this[_0x75e5(0x1df)]=(_0x53334a=this[_0x75e5(0x1df)])!==null&&_0x53334a!==void 0x0?_0x53334a:DEFAULT_SHAPE_WIDTH,this[_0x75e5(0x1d4)]=(_0x7d99c1=this[_0x75e5(0x1d4)])!==null&&_0x7d99c1!==void 0x0?_0x7d99c1:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x75e5(0x198)],'subUnitId':this[_0x75e5(0x1b7)],'shapeId':this[_0x75e5(0x18d)],'shapeType':this[_0x75e5(0x1d3)],'shapeData':Object['keys'](this[_0x75e5(0x17b)])['length']>0x0?this[_0x75e5(0x17b)]:void 0x0,'x':this['x'],'y':this['y'],'width':this[_0x75e5(0x1df)],'height':this['height']};}[_0x50bc8b(0x186)](){const _0x4debcf=_0x50bc8b;return this[_0x4debcf(0x18d)];}[_0x50bc8b(0x1dc)](){const _0x53ef09=_0x50bc8b;return this[_0x53ef09(0x1d3)];}[_0x50bc8b(0x1a0)](){return this['shapeData'];}[_0x50bc8b(0x1d9)](){return{'x':this['x'],'y':this['y']};}[_0x50bc8b(0x1cd)](){const _0x4c5f36=_0x50bc8b;return{'width':this['width'],'height':this[_0x4c5f36(0x1d4)]};}},FConnectorShape=class extends FShape{constructor(_0x42ea8a,_0x5040aa,_0x53a74f,_0x3b7c4a){const _0x16b3ed=_0x50bc8b;super(_0x42ea8a,_0x5040aa,_0x53a74f,_0x3b7c4a),_defineProperty(this,_0x16b3ed(0x17b),{});}[_0x50bc8b(0x1d0)](_0x3e0433){const _0x1a7592=_0x50bc8b;if(!isConnectorShape(_0x3e0433))throw new Error(_0x1a7592(0x1f5)+_0x3e0433+_0x1a7592(0x183));return super[_0x1a7592(0x1d0)](_0x3e0433),this;}[_0x50bc8b(0x1b4)](_0x36a46f){const _0x38834f=_0x50bc8b;var _0x1cb7db,_0x5fc427;if(!((_0x1cb7db=this[_0x38834f(0x17b)])===null||_0x1cb7db===void 0x0?void 0x0:_0x1cb7db['ln']))this[_0x38834f(0x17b)]['ln']={};if(!((_0x5fc427=this[_0x38834f(0x17b)])===null||_0x5fc427===void 0x0||(_0x5fc427=_0x5fc427['ln'])===null||_0x5fc427===void 0x0?void 0x0:_0x5fc427[_0x38834f(0x187)]))this[_0x38834f(0x17b)]['ln'][_0x38834f(0x187)]={};return this[_0x38834f(0x17b)]['ln'][_0x38834f(0x187)][_0x38834f(0x1c3)]=_0x36a46f,this;}[_0x50bc8b(0x1b0)](_0x2fd45b){const _0x215a25=_0x50bc8b;var _0x191148,_0xf4f801;if(!((_0x191148=this[_0x215a25(0x17b)])===null||_0x191148===void 0x0?void 0x0:_0x191148['ln']))this[_0x215a25(0x17b)]['ln']={};if(!((_0xf4f801=this[_0x215a25(0x17b)])===null||_0xf4f801===void 0x0||(_0xf4f801=_0xf4f801['ln'])===null||_0xf4f801===void 0x0?void 0x0:_0xf4f801[_0x215a25(0x18a)]))this['shapeData']['ln'][_0x215a25(0x18a)]={};return this['shapeData']['ln'][_0x215a25(0x18a)][_0x215a25(0x1c3)]=_0x2fd45b,this;}[_0x50bc8b(0x19e)](_0x3e22cf){const _0x1c54cf=_0x50bc8b;var _0x50325c,_0x217767;if(!((_0x50325c=this[_0x1c54cf(0x17b)])===null||_0x50325c===void 0x0?void 0x0:_0x50325c['ln']))this['shapeData']['ln']={};if(!((_0x217767=this[_0x1c54cf(0x17b)])===null||_0x217767===void 0x0||(_0x217767=_0x217767['ln'])===null||_0x217767===void 0x0?void 0x0:_0x217767['startArrow']))this['shapeData']['ln'][_0x1c54cf(0x187)]={};return this[_0x1c54cf(0x17b)]['ln'][_0x1c54cf(0x187)][_0x1c54cf(0x1b6)]=_0x3e22cf,this;}[_0x50bc8b(0x1d2)](_0xc614a4){const _0x980681=_0x50bc8b;var _0x319eca,_0x4f6868;if(!((_0x319eca=this[_0x980681(0x17b)])===null||_0x319eca===void 0x0?void 0x0:_0x319eca['ln']))this['shapeData']['ln']={};if(!((_0x4f6868=this[_0x980681(0x17b)])===null||_0x4f6868===void 0x0||(_0x4f6868=_0x4f6868['ln'])===null||_0x4f6868===void 0x0?void 0x0:_0x4f6868[_0x980681(0x18a)]))this['shapeData']['ln'][_0x980681(0x18a)]={};return this[_0x980681(0x17b)]['ln'][_0x980681(0x18a)][_0x980681(0x1b6)]=_0xc614a4,this;}[_0x50bc8b(0x1e6)](){const _0x45ca69=_0x50bc8b;return super[_0x45ca69(0x1e6)]();}[_0x50bc8b(0x1ae)](){const _0x19b5b2=_0x50bc8b;var _0xc2877e;return((_0xc2877e=this[_0x19b5b2(0x17b)])===null||_0xc2877e===void 0x0||(_0xc2877e=_0xc2877e[_0x19b5b2(0x189)])===null||_0xc2877e===void 0x0?void 0x0:_0xc2877e['to'])||null;}[_0x50bc8b(0x1fa)](){const _0x1a279a=_0x50bc8b;var _0x387b5b;return((_0x387b5b=this[_0x1a279a(0x17b)])===null||_0x387b5b===void 0x0||(_0x387b5b=_0x387b5b[_0x1a279a(0x189)])===null||_0x387b5b===void 0x0?void 0x0:_0x387b5b[_0x1a279a(0x1c5)])||null;}};function computeConnectionPointInfo(_0x322398,_0x580ed2,_0x32090f,_0xf3933d,_0x343a9e,_0x57fbf8){const _0x1a99c0=_0x50bc8b,_0x157a5c=_0x343a9e[_0x1a99c0(0x194)](_0x322398,_0x580ed2,_0x32090f);if(!_0x157a5c)return null;const _0x5a2c0e=_0x57fbf8[_0x1a99c0(0x199)]({'unitId':_0x322398,'subUnitId':_0x580ed2,'drawingId':_0x32090f});if(!(_0x5a2c0e===null||_0x5a2c0e===void 0x0?void 0x0:_0x5a2c0e[_0x1a99c0(0x1a2)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0xd263c6}=_0x5a2c0e[_0x1a99c0(0x1a2)];_0x157a5c[_0x1a99c0(0x188)]({'width':width,'height':height});const _0x2a737b=_0x157a5c[_0x1a99c0(0x1c8)]()[_0x1a99c0(0x1c7)](_0x58771c=>_0x58771c[_0x1a99c0(0x19f)]===_0xf3933d);if(!_0x2a737b)return null;let _0x36e5a6=flipX?width-_0x2a737b['x']:_0x2a737b['x'],_0xbb3625=flipY?height-_0x2a737b['y']:_0x2a737b['y'];if(_0xd263c6&&_0xd263c6!==0x0){const _0x15caf7=_0xd263c6*Math['PI']/0xb4,_0x3d7346=Math['cos'](_0x15caf7),_0x457ade=Math[_0x1a99c0(0x1c4)](_0x15caf7),_0x37b6bf=width/0x2,_0x3e884c=height/0x2,_0x26658e=_0x36e5a6-_0x37b6bf,_0x43befb=_0xbb3625-_0x3e884c;_0x36e5a6=_0x37b6bf+_0x26658e*_0x3d7346-_0x43befb*_0x457ade,_0xbb3625=_0x3e884c+_0x26658e*_0x457ade+_0x43befb*_0x3d7346;}_0x36e5a6+=left,_0xbb3625+=top;let _0x17d231=_0x2a737b[_0x1a99c0(0x1cc)]/0xea60;if(flipX)_0x17d231=0xb4-_0x17d231;if(flipY)_0x17d231=-_0x17d231;_0x17d231+=_0xd263c6||0x0,_0x17d231=(_0x17d231%0x168+0x168)%0x168;const _0x1b9e53=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0xd263c6||0x0);return{'point':{'x':_0x36e5a6,'y':_0xbb3625},'angle':_0x17d231,'bounds':_0x1b9e53};}function calculateFreeEndpointAngle(_0x5799bd,_0x341fa9){const _0x30b80e=_0x341fa9['x']-_0x5799bd['x'],_0x5a50c7=_0x341fa9['y']-_0x5799bd['y'];if(Math['abs'](_0x30b80e)>=Math['abs'](_0x5a50c7))return _0x30b80e>=0x0?0xb4:0x0;return _0x5a50c7>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x5a61e6,_0x3e5981,_0x5b336c,_0x3f85da,_0x1e58fc,_0x3069bf,_0x4ffc89){const _0x4e733c=_0x50bc8b,_0x3ade5c=_0x3069bf['getShapeModel'](_0x5a61e6,_0x3e5981,_0x5b336c);if(!_0x3ade5c)return null;const _0x5f4144=_0x4ffc89['getDrawingByParam']({'unitId':_0x5a61e6,'subUnitId':_0x3e5981,'drawingId':_0x5b336c});if(!(_0x5f4144===null||_0x5f4144===void 0x0?void 0x0:_0x5f4144['transform']))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x5f4144[_0x4e733c(0x1a2)];_0x3ade5c[_0x4e733c(0x188)]({'width':width,'height':height});const _0x187069=_0x3ade5c[_0x4e733c(0x1c2)]();if(_0x187069[_0x4e733c(0x1ab)]<0x2)return null;const _0x4d03e7=_0x3f85da?_0x187069[0x0]:_0x187069[_0x187069[_0x4e733c(0x1ab)]-0x1],_0x4e44b1=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x4e733c(0x190)](_0x4d03e7);return{'point':_0x4e44b1,'angle':calculateFreeEndpointAngle(_0x1e58fc[_0x4e733c(0x1e9)],_0x4e44b1),'bounds':{'left':_0x4e44b1['x'],'top':_0x4e44b1['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x50bc8b(0x1c1)](_0x251a7d){const _0x1e3d8f=_0x50bc8b,{unitId:_0x3a5fd1,subUnitId:_0x16878e,shapeId:_0x3098f4,shapeType:_0x449601,shapeData:_0xddc932,x:_0x4cdd2b,y:_0xe83090,width:_0x4dddd5,height:_0x51d982}=_0x251a7d;return this[_0x1e3d8f(0x196)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x3a5fd1,'subUnitId':_0x16878e,'shapeId':_0x3098f4,'shapeType':_0x449601,'shapeData':_0xddc932,'position':{'x':_0x4cdd2b,'y':_0xe83090},'width':_0x4dddd5,'height':_0x51d982});}async[_0x50bc8b(0x1d5)](_0x3a5312){const _0x2ebea1=_0x50bc8b,{unitId:_0x115602,subUnitId:_0x24d220,shapeId:_0x263688,shapeType:_0x352215,shapeData:_0x1b788b,x:_0x4a902f,y:_0x1b831d,width:_0x73e581,height:_0x31ab6d}=_0x3a5312;return this[_0x2ebea1(0x196)][_0x2ebea1(0x1f7)](SetShapeDrawingDataCommand['id'],{'unitId':_0x115602,'subUnitId':_0x24d220,'shapeId':_0x263688,'shapeType':_0x352215,'shapeData':_0x1b788b,'position':{'x':_0x4a902f,'y':_0x1b831d},'width':_0x73e581,'height':_0x31ab6d});}[_0x50bc8b(0x1c9)](_0x4dfb86){const _0x389480=_0x50bc8b,_0x57f7ce=this[_0x389480(0x1a1)]()[_0x389480(0x1d6)](),_0x43cbbd=this[_0x389480(0x1cf)]();if(_0x4dfb86){const _0x2a6bba=new FShape(_0x57f7ce,_0x43cbbd,_0x4dfb86[_0x389480(0x18d)],this['_injector']);return this['_preloadShapeProperties'](_0x2a6bba,_0x57f7ce,_0x43cbbd,_0x4dfb86[_0x389480(0x18d)]),_0x2a6bba;}return new FShape(_0x57f7ce,_0x43cbbd,generateRandomId(),this[_0x389480(0x1fb)]);}[_0x50bc8b(0x1bd)](_0x54deff){const _0x2d7d82=_0x50bc8b,_0x40208c=this[_0x2d7d82(0x1a1)]()[_0x2d7d82(0x1d6)](),_0x57c089=this[_0x2d7d82(0x1cf)]();if(_0x54deff){const _0x30aa32=new FConnectorShape(_0x40208c,_0x57c089,_0x54deff[_0x2d7d82(0x18d)],this[_0x2d7d82(0x1fb)]);return this[_0x2d7d82(0x1f6)](_0x30aa32,_0x40208c,_0x57c089,_0x54deff[_0x2d7d82(0x18d)]),_0x30aa32;}return new FConnectorShape(_0x40208c,_0x57c089,generateRandomId(),this['_injector']);}[_0x50bc8b(0x184)](){const _0x30710d=_0x50bc8b,_0x4c07ad=this[_0x30710d(0x1fb)][_0x30710d(0x1e1)](ISheetDrawingService),_0x498402=this['getWorkbook']()[_0x30710d(0x1d6)](),_0xf8aad7=this[_0x30710d(0x1cf)](),_0x5ef72a=_0x4c07ad[_0x30710d(0x18c)](_0x498402,_0xf8aad7);if(!_0x5ef72a)return[];const _0x37f687=[];for(const [_0xc40887,_0x522bed]of Object[_0x30710d(0x1b2)](_0x5ef72a))if(_0x522bed&&_0x522bed[_0x30710d(0x1ef)]===DrawingTypeEnum[_0x30710d(0x1ba)]){const _0x1e46ca=new FShape(_0x498402,_0xf8aad7,_0xc40887,this[_0x30710d(0x1fb)]);this[_0x30710d(0x1f6)](_0x1e46ca,_0x498402,_0xf8aad7,_0xc40887),_0x37f687[_0x30710d(0x1e4)](_0x1e46ca);}return _0x37f687;}[_0x50bc8b(0x1dd)](_0x40dc2b){const _0x4046e0=_0x50bc8b,{unitId:_0x3dd743,subUnitId:_0x2814db,drawId:_0x336397}=_0x40dc2b;return this[_0x4046e0(0x196)][_0x4046e0(0x1f7)](RemoveSheetDrawingCommand['id'],{'unitId':_0x3dd743,'drawings':[{'unitId':_0x3dd743,'subUnitId':_0x2814db,'drawingId':_0x336397,'drawingType':DrawingTypeEnum[_0x4046e0(0x1ba)]}]});}async[_0x50bc8b(0x182)](_0x490c39){const _0x5817b6=_0x50bc8b,{connector:_0x455c99,startTarget:_0x4f8735,endTarget:_0x582c13}=_0x490c39;if(!_0x4f8735&&!_0x582c13)return![];const _0x225411=this[_0x5817b6(0x1a1)]()['getUnitId'](),_0x56a308=this[_0x5817b6(0x1cf)](),_0x479760=this[_0x5817b6(0x1fb)]['get'](SheetsShapeService),_0x4c9422=this[_0x5817b6(0x1fb)][_0x5817b6(0x1e1)](IDrawingManagerService),_0x3b6b0e=_0x479760[_0x5817b6(0x194)](_0x225411,_0x56a308,_0x455c99['drawId']);if(!_0x3b6b0e)return![];const _0x5a86fc=_0x3b6b0e[_0x5817b6(0x1dc)](),_0x5ccc5f=_0x3b6b0e[_0x5817b6(0x1c0)](),_0x940392={};for(const _0x58e9ee of _0x3b6b0e[_0x5817b6(0x185)]()){const _0x416cc8=_0x3b6b0e[_0x5817b6(0x1e7)](_0x58e9ee);if(_0x416cc8!==void 0x0)_0x940392[_0x58e9ee]=_0x416cc8;}const {startInfo:_0x58897c,endInfo:_0x2576f8}=this['_resolveEndpoints'](_0x225411,_0x56a308,_0x455c99,_0x3b6b0e,_0x4f8735,_0x582c13,_0x479760,_0x4c9422,_0x5ccc5f);if(!_0x58897c||!_0x2576f8)return![];const _0x3c5f39=computeConnectorRouteLayout(routeConnectorLineShape(_0x58897c,_0x2576f8,_0x5a86fc),_0x5a86fc),_0x37c981={};if(_0x4f8735)_0x37c981[_0x5817b6(0x1c5)]={'shapeId':_0x4f8735['shape'][_0x5817b6(0x18d)],'cxnIndex':_0x4f8735[_0x5817b6(0x17f)]};else{if(_0x5ccc5f===null||_0x5ccc5f===void 0x0?void 0x0:_0x5ccc5f['from'])_0x37c981['from']=_0x5ccc5f[_0x5817b6(0x1c5)];}if(_0x582c13)_0x37c981['to']={'shapeId':_0x582c13['shape']['drawId'],'cxnIndex':_0x582c13[_0x5817b6(0x17f)]};else{if(_0x5ccc5f===null||_0x5ccc5f===void 0x0?void 0x0:_0x5ccc5f['to'])_0x37c981['to']=_0x5ccc5f['to'];}return this[_0x5817b6(0x196)][_0x5817b6(0x1f7)](UpdateConnectorRelationCommand['id'],{'unitId':_0x225411,'subUnitId':_0x56a308,'connectorShapeId':_0x455c99['drawId'],'width':_0x3c5f39[_0x5817b6(0x1cb)]['width'],'height':_0x3c5f39[_0x5817b6(0x1cb)][_0x5817b6(0x1d4)],'left':_0x3c5f39[_0x5817b6(0x1cb)][_0x5817b6(0x1be)],'top':_0x3c5f39['worldRect'][_0x5817b6(0x1ce)],'flipX':_0x3c5f39[_0x5817b6(0x1cb)]['flipX']||![],'flipY':_0x3c5f39['worldRect'][_0x5817b6(0x1c6)]||![],'oldAdjustValues':_0x940392,'newAdjustValues':_0x3c5f39[_0x5817b6(0x1f8)],'newLineType':_0x3c5f39['lineType'],'oldLineType':_0x5a86fc,'rotation':_0x3c5f39[_0x5817b6(0x1ed)],'oldRelation':_0x5ccc5f,'newRelation':_0x37c981});}[_0x50bc8b(0x1f6)](_0x489038,_0x4c5c2d,_0x1b06a1,_0x5dfc89){const _0x39a575=_0x50bc8b,_0x5ac2cc=this[_0x39a575(0x1fb)][_0x39a575(0x1e1)](IDrawingManagerService)[_0x39a575(0x199)]({'unitId':_0x4c5c2d,'subUnitId':_0x1b06a1,'drawingId':_0x5dfc89});if(_0x5ac2cc===null||_0x5ac2cc===void 0x0?void 0x0:_0x5ac2cc['transform']){var _0x33f061,_0x4941ee,_0x51f28e,_0x448f5a;_0x489038['x']=(_0x33f061=_0x5ac2cc['transform'][_0x39a575(0x1be)])!==null&&_0x33f061!==void 0x0?_0x33f061:0x0,_0x489038['y']=(_0x4941ee=_0x5ac2cc[_0x39a575(0x1a2)][_0x39a575(0x1ce)])!==null&&_0x4941ee!==void 0x0?_0x4941ee:0x0,_0x489038[_0x39a575(0x1df)]=(_0x51f28e=_0x5ac2cc['transform'][_0x39a575(0x1df)])!==null&&_0x51f28e!==void 0x0?_0x51f28e:_0x489038[_0x39a575(0x1df)],_0x489038[_0x39a575(0x1d4)]=(_0x448f5a=_0x5ac2cc[_0x39a575(0x1a2)][_0x39a575(0x1d4)])!==null&&_0x448f5a!==void 0x0?_0x448f5a:_0x489038[_0x39a575(0x1d4)];}const _0x2381d7=this[_0x39a575(0x1fb)][_0x39a575(0x1e1)](SheetsShapeService)['getShapeModel'](_0x4c5c2d,_0x1b06a1,_0x5dfc89);if(_0x2381d7){_0x489038[_0x39a575(0x1d3)]=_0x2381d7[_0x39a575(0x1dc)]();const _0x381eeb=_0x2381d7['getShapeData']();if(_0x381eeb)_0x489038[_0x39a575(0x17b)]=JSON[_0x39a575(0x1eb)](JSON['stringify'](_0x381eeb));}}[_0x50bc8b(0x17e)](_0x740f21,_0x486f3d,_0xca9ddd,_0x290ce5,_0x2dea79,_0x32ddf4,_0x5f43ea,_0x3d5b91,_0x57599f){const _0x4c078a=_0x50bc8b;let _0x401bbc=null,_0x5376d5=null;if(_0x2dea79)_0x401bbc=computeConnectionPointInfo(_0x740f21,_0x486f3d,_0x2dea79[_0x4c078a(0x18f)][_0x4c078a(0x18d)],_0x2dea79[_0x4c078a(0x17f)],_0x5f43ea,_0x3d5b91);if(_0x32ddf4)_0x5376d5=computeConnectionPointInfo(_0x740f21,_0x486f3d,_0x32ddf4['shape'][_0x4c078a(0x18d)],_0x32ddf4[_0x4c078a(0x17f)],_0x5f43ea,_0x3d5b91);if(!_0x401bbc)_0x401bbc=this['_resolveExistingOrFreeEndpoint'](_0x740f21,_0x486f3d,_0xca9ddd[_0x4c078a(0x18d)],!![],_0x5376d5,_0x57599f===null||_0x57599f===void 0x0?void 0x0:_0x57599f[_0x4c078a(0x1c5)],_0x5f43ea,_0x3d5b91);if(!_0x5376d5)_0x5376d5=this[_0x4c078a(0x18e)](_0x740f21,_0x486f3d,_0xca9ddd['drawId'],![],_0x401bbc,_0x57599f===null||_0x57599f===void 0x0?void 0x0:_0x57599f['to'],_0x5f43ea,_0x3d5b91);return{'startInfo':_0x401bbc,'endInfo':_0x5376d5};}[_0x50bc8b(0x18e)](_0x144913,_0x452050,_0xb90d12,_0x59f4a1,_0x239f34,_0x1376f5,_0x29063c,_0x27cd66){if(_0x1376f5){const _0x4d43e6=computeConnectionPointInfo(_0x144913,_0x452050,_0x1376f5['shapeId'],_0x1376f5['cxnIndex'],_0x29063c,_0x27cd66);if(_0x4d43e6)return _0x4d43e6;}if(!_0x239f34)return null;return computeFreeEndpointInfo(_0x144913,_0x452050,_0xb90d12,_0x59f4a1,_0x239f34,_0x29063c,_0x27cd66);}};FWorksheet[_0x50bc8b(0x1f4)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
package/lib/es/index.js CHANGED
@@ -1 +1 @@
1
- const _0xad074b=_0x1092;(function(_0x1cb9a6,_0x593195){const _0xe47d7e=_0x1092,_0x1bd9ee=_0x1cb9a6();while(!![]){try{const _0x9a48b6=-parseInt(_0xe47d7e(0x1ac))/0x1+-parseInt(_0xe47d7e(0x201))/0x2+parseInt(_0xe47d7e(0x1e0))/0x3*(-parseInt(_0xe47d7e(0x1a9))/0x4)+-parseInt(_0xe47d7e(0x1a1))/0x5+-parseInt(_0xe47d7e(0x182))/0x6+parseInt(_0xe47d7e(0x189))/0x7+-parseInt(_0xe47d7e(0x1c8))/0x8*(-parseInt(_0xe47d7e(0x1af))/0x9);if(_0x9a48b6===_0x593195)break;else _0x1bd9ee['push'](_0x1bd9ee['shift']());}catch(_0x7fee3c){_0x1bd9ee['push'](_0x1bd9ee['shift']());}}}(_0x2a32,0xbe462));import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x3f9c88){'@babel/helpers - typeof';const _0x563989=_0x1092;return _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol[_0x563989(0x1ba)]?function(_0x1029bb){return typeof _0x1029bb;}:function(_0x3fa3a8){const _0x18f3f1=_0x563989;return _0x3fa3a8&&_0x18f3f1(0x1b2)==typeof Symbol&&_0x3fa3a8[_0x18f3f1(0x206)]===Symbol&&_0x3fa3a8!==Symbol[_0x18f3f1(0x1fa)]?_0x18f3f1(0x192):typeof _0x3fa3a8;},_typeof(_0x3f9c88);}function _0x2a32(){const _0x147226=['sheet.mutation.update-shape-type','getShapeModel','pluginName','updateContext','getSkeleton','getStartConnectInfo','1373490ChQBhI','addShape','onCommandExecute','ang','redos','left','getShapeData','keys','763444gFOMjr','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','parse','24564PupgBd','index','UPDATE','27VoYONC','pushUndoRedo','interceptCommand','function','from','isLineShape','packageName','insertShape','COMMAND','getShapeRelation','_addLineFollowShapeUpdates','iterator','push','_configService','startX','_serializeShapeForUnit','rotateEnabled','_linesIds','sheet.mutation.insert-shape','sheets-shape.config','add','sheet.command.insert-shape','stringify','delete','SHEET_SHAPE_PLUGIN','8170072jhmMMj','preUndos','startY','isHorizontal','UNIVER_SHEET','isFrom','length','_initCommands','preRedos','getAdjustValueByName','forEach','shapeId','removeShape','_initCommandInterceptor','has','_shapeModelManagerMap','sheet.command.update-connector-relation','call','_ensureShapeModelManager','fromJSON','rotation','object','find','defineProperty','3KOjLuX','REMOVE','setShapeData','_injector','MUTATION','getBasicShapeRelation','getShapeDataById','@univerjs-pro/sheets-shape','getConnectionSiteList','lineShapeId','resizeEnabled','every','_groupIds','getEndConnectInfo','disposeWithMe','registerCommand','_getConnectPointInfo','_deserializeShapeForUnit','borderEnabled','range','toPrimitive','INSERT','getDrawingData','getOwnPropertyDescriptor','flipY','getLineShapeRelation','prototype','onStarting','transform','sin','filter','getShapeTypeById','hasShape','2018428uGTQyq','get','ensureSkeleton','getDrawingByParam','angle','constructor','_sheetSkeletonService','syncExecuteCommand','DRAWING_SHAPE','setShapeType','getCellIndexAndOffsetByPosition','_config','getCellWithCoordByIndex','flipX','_drawingManagerService','getShapeType','_initSnapshot','default','data','sheet.mutation.update-shape-data','relation','width','worldRect','fill','drawingType','height','top','getBatchUpdateOp','7785468hclIGU','_shapes','position','_sheetInterceptorService','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','_addLineRerouteUpdates','_resourcesManagerService','3587500nXEtHa','shapeData','cxnIndex','_sheetsShapeService','_commandService','toJSON','undos','setConfig','set','symbol','params','lineType','dispose','decorate','adjustValues','type','string','clear'];_0x2a32=function(){return _0x147226;};return _0x2a32();}function toPrimitive(_0x520bf3,_0x22be2e){const _0x4cfcbb=_0x1092;if(_0x4cfcbb(0x1dd)!=_typeof(_0x520bf3)||!_0x520bf3)return _0x520bf3;var _0x19d5d0=_0x520bf3[Symbol[_0x4cfcbb(0x1f4)]];if(void 0x0!==_0x19d5d0){var _0x41defd=_0x19d5d0[_0x4cfcbb(0x1d9)](_0x520bf3,_0x22be2e||_0x4cfcbb(0x212));if(_0x4cfcbb(0x1dd)!=_typeof(_0x41defd))return _0x41defd;throw new TypeError(_0x4cfcbb(0x1aa));}return(_0x4cfcbb(0x199)===_0x22be2e?String:Number)(_0x520bf3);}function toPropertyKey(_0x43e403){const _0x137dbc=_0x1092;var _0x2004cc=toPrimitive(_0x43e403,_0x137dbc(0x199));return _0x137dbc(0x192)==_typeof(_0x2004cc)?_0x2004cc:_0x2004cc+'';}function _defineProperty(_0x45d32e,_0xc1e09d,_0x37a3bd){const _0x113c26=_0x1092;return(_0xc1e09d=toPropertyKey(_0xc1e09d))in _0x45d32e?Object[_0x113c26(0x1df)](_0x45d32e,_0xc1e09d,{'value':_0x37a3bd,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x45d32e[_0xc1e09d]=_0x37a3bd,_0x45d32e;}function _0x1092(_0x1d4ed7,_0x20d860){_0x1d4ed7=_0x1d4ed7-0x17f;const _0x2a3272=_0x2a32();let _0x1092fa=_0x2a3272[_0x1d4ed7];return _0x1092fa;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x4c5fa2=_0x1092;super(),_defineProperty(this,_0x4c5fa2(0x183),new Map()),_defineProperty(this,'_linesIds',new Set()),_defineProperty(this,_0x4c5fa2(0x1ec),new Set());}['addShape'](_0x5000f2,_0x1474a2,_0xae5478){const _0x26c51a=_0x1092,_0x151923=new ShapeModel(_0x5000f2,_0x1474a2,_0xae5478);this[_0x26c51a(0x183)][_0x26c51a(0x191)](_0x1474a2,_0x151923);if(isConnectorShape(_0x5000f2))this[_0x26c51a(0x1c0)][_0x26c51a(0x1c3)](_0x1474a2);return _0x151923;}['getBasicShapeRelation'](_0x224628){const _0x4f9ee7=_0x1092,_0x85e684=[];for(const _0x31f0fe of this[_0x4f9ee7(0x1c0)]){const _0x13467a=this[_0x4f9ee7(0x183)][_0x4f9ee7(0x202)](_0x31f0fe);if(_0x13467a){const _0x5871af=_0x13467a[_0x4f9ee7(0x1b8)]();if(_0x5871af){var _0x119c30,_0x3ae8de;if(((_0x119c30=_0x5871af['from'])===null||_0x119c30===void 0x0?void 0x0:_0x119c30[_0x4f9ee7(0x1d3)])===_0x224628)_0x85e684[_0x4f9ee7(0x1bb)]({..._0x5871af['from'],'lineShapeId':_0x31f0fe,'isFrom':!![]});if(((_0x3ae8de=_0x5871af['to'])===null||_0x3ae8de===void 0x0?void 0x0:_0x3ae8de[_0x4f9ee7(0x1d3)])===_0x224628)_0x85e684[_0x4f9ee7(0x1bb)]({..._0x5871af['to'],'lineShapeId':_0x31f0fe,'isFrom':![]});}}}return _0x85e684;}['getLineShapeRelation'](_0xe0f01c){const _0x41b9df=_0x1092,_0x31ca67=this[_0x41b9df(0x183)][_0x41b9df(0x202)](_0xe0f01c);if(_0x31ca67)return _0x31ca67[_0x41b9df(0x1b8)]();}[_0xad074b(0x210)](_0x52e553){const _0x221537=_0xad074b,_0x2c3f9c=this['_shapes'][_0x221537(0x202)](_0x52e553);if(_0x2c3f9c)return _0x2c3f9c['getShapeType']();}[_0xad074b(0x200)](_0x4595f8){const _0x1fa928=_0xad074b;return this[_0x1fa928(0x183)][_0x1fa928(0x1d6)](_0x4595f8);}['removeShape'](_0xf11248){const _0x1c7638=_0xad074b,_0x558be4=this[_0x1c7638(0x183)][_0x1c7638(0x202)](_0xf11248);if(!_0x558be4)return;if(isConnectorShape(_0x558be4[_0x1c7638(0x210)]()))this[_0x1c7638(0x1c0)][_0x1c7638(0x1c6)](_0xf11248);this[_0x1c7638(0x183)]['delete'](_0xf11248);}[_0xad074b(0x18e)](){const _0x3cb42a=_0xad074b,_0x53b2c9=[];return this[_0x3cb42a(0x183)][_0x3cb42a(0x1d2)](_0x17113b=>{const _0x5263c2=_0x3cb42a;_0x53b2c9['push'](_0x17113b[_0x5263c2(0x18e)]());}),_0x53b2c9;}[_0xad074b(0x1db)](_0x2d4728){const _0x3f9e1e=_0xad074b;for(const _0x3d2f40 of _0x2d4728){const {id:_0x8727ec,shapeType:_0x4357cd}=_0x3d2f40,_0x16e7a0=this['addShape'](_0x4357cd,_0x8727ec,_0x3d2f40[_0x3f9e1e(0x18a)]);if(_0x16e7a0&&_0x16e7a0[_0x3f9e1e(0x1b4)]())this['_linesIds'][_0x3f9e1e(0x1c3)](_0x8727ec);}}[_0xad074b(0x195)](){const _0x50e35a=_0xad074b;if(this['_disposed'])return;this[_0x50e35a(0x183)][_0x50e35a(0x1d2)](_0x46b319=>{const _0x491d6f=_0x50e35a;_0x46b319[_0x491d6f(0x195)]();}),this['_shapes'][_0x50e35a(0x19a)](),this[_0x50e35a(0x1c0)][_0x50e35a(0x19a)](),this[_0x50e35a(0x1ec)][_0x50e35a(0x19a)](),super[_0x50e35a(0x195)]();}};function __decorateParam(_0x2cd80d,_0x466e2c){return function(_0x276bad,_0x122170){_0x466e2c(_0x276bad,_0x122170,_0x2cd80d);};}function __decorate(_0x30d0a7,_0x2f4995,_0x439c1a,_0x574538){const _0x2e8da5=_0xad074b;var _0x115527=arguments[_0x2e8da5(0x1ce)],_0x422a08=_0x115527<0x3?_0x2f4995:_0x574538===null?_0x574538=Object[_0x2e8da5(0x1f7)](_0x2f4995,_0x439c1a):_0x574538,_0x12a181;if(typeof Reflect===_0x2e8da5(0x1dd)&&typeof Reflect[_0x2e8da5(0x196)]==='function')_0x422a08=Reflect['decorate'](_0x30d0a7,_0x2f4995,_0x439c1a,_0x574538);else{for(var _0x5e53cf=_0x30d0a7['length']-0x1;_0x5e53cf>=0x0;_0x5e53cf--)if(_0x12a181=_0x30d0a7[_0x5e53cf])_0x422a08=(_0x115527<0x3?_0x12a181(_0x422a08):_0x115527>0x3?_0x12a181(_0x2f4995,_0x439c1a,_0x422a08):_0x12a181(_0x2f4995,_0x439c1a))||_0x422a08;}return _0x115527>0x3&&_0x422a08&&Object[_0x2e8da5(0x1df)](_0x2f4995,_0x439c1a,_0x422a08),_0x422a08;}const SHEET_SHAPE_PLUGIN=_0xad074b(0x1c7);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x16ad64){const _0x2c0fc6=_0xad074b;super(),this[_0x2c0fc6(0x188)]=_0x16ad64,_defineProperty(this,'_shapeModelManagerMap',new Map()),this[_0x2c0fc6(0x211)]();}[_0xad074b(0x1da)](_0x56ab05,_0x38002b){const _0x947646=_0xad074b;let _0x227b28=this['_shapeModelManagerMap'][_0x947646(0x202)](_0x56ab05);!_0x227b28&&(_0x227b28=new Map(),this[_0x947646(0x1d7)][_0x947646(0x191)](_0x56ab05,_0x227b28));let _0x2c3109=_0x227b28[_0x947646(0x202)](_0x38002b);return!_0x2c3109&&(_0x2c3109=new SheetShapeModelManager(),_0x227b28[_0x947646(0x191)](_0x38002b,_0x2c3109)),_0x2c3109;}[_0xad074b(0x1b6)](_0x24e15c,_0x39427d,_0x3b8e63,_0x4da2c1,_0x2f546b){const _0x12bbe8=_0xad074b;this['_ensureShapeModelManager'](_0x24e15c,_0x39427d)[_0x12bbe8(0x1a2)](_0x3b8e63,_0x4da2c1,_0x2f546b);}[_0xad074b(0x1d4)](_0xd54964,_0x10b143,_0x527a95){const _0x5ba3c1=_0xad074b;this[_0x5ba3c1(0x1da)](_0xd54964,_0x10b143)[_0x5ba3c1(0x1d4)](_0x527a95);}['getBasicShapeType'](_0x312e32,_0x259064,_0x314343){const _0x2d7ab2=_0xad074b;return this[_0x2d7ab2(0x1da)](_0x312e32,_0x259064)[_0x2d7ab2(0x210)](_0x314343);}[_0xad074b(0x210)](_0x561131,_0x1928cb,_0x1abc05){const _0x43e418=_0xad074b;return this[_0x43e418(0x1da)](_0x561131,_0x1928cb)[_0x43e418(0x210)](_0x1abc05);}[_0xad074b(0x200)](_0x5acd76,_0x4f1da9,_0x43d1de){const _0x1f37ac=_0xad074b;return this[_0x1f37ac(0x1da)](_0x5acd76,_0x4f1da9)[_0x1f37ac(0x200)](_0x43d1de);}[_0xad074b(0x1ff)](_0x175d37,_0x3f17d0,_0x2901cd){const _0x89dc89=_0xad074b;return this[_0x89dc89(0x1da)](_0x175d37,_0x3f17d0)[_0x89dc89(0x210)](_0x2901cd);}[_0xad074b(0x1e6)](_0x8df2f0,_0x121451,_0x465920){const _0x228405=_0xad074b,_0xdbef90=this[_0x228405(0x1da)](_0x8df2f0,_0x121451);if(!_0xdbef90[_0x228405(0x210)](_0x465920))return;const _0x1fd44b=_0xdbef90['_shapes'][_0x228405(0x202)](_0x465920);if(!_0x1fd44b)return;return _0x1fd44b[_0x228405(0x1a7)]();}[_0xad074b(0x19c)](_0x17f658,_0x30b375,_0x594aec){const _0x2aedda=_0xad074b;return this[_0x2aedda(0x1da)](_0x17f658,_0x30b375)[_0x2aedda(0x183)][_0x2aedda(0x202)](_0x594aec);}['getBasicShapeRelation'](_0x4fd271,_0x54a411,_0x24e237){const _0x245a85=_0xad074b;return this[_0x245a85(0x1da)](_0x4fd271,_0x54a411)['getBasicShapeRelation'](_0x24e237);}[_0xad074b(0x1f9)](_0x33f2dc,_0x1ff30c,_0x121abd){const _0x309c16=_0xad074b,_0x5c5e83=this[_0x309c16(0x1da)](_0x33f2dc,_0x1ff30c)[_0x309c16(0x183)][_0x309c16(0x202)](_0x121abd);if(!_0x5c5e83)return;return _0x5c5e83[_0x309c16(0x1b8)]();}[_0xad074b(0x20a)](){}[_0xad074b(0x1be)](_0x397e06){const _0x46ed40=_0xad074b,_0xcb5fe7={},_0x577c7f=this[_0x46ed40(0x1d7)][_0x46ed40(0x202)](_0x397e06);if(_0x577c7f)_0x577c7f[_0x46ed40(0x1d2)]((_0x12de8f,_0x4d94f8)=>{const _0x34c3cb=_0x46ed40,_0x32ffee=_0x12de8f[_0x34c3cb(0x18e)]();if(_0x32ffee[_0x34c3cb(0x1ce)]>0x0)_0xcb5fe7[_0x4d94f8]=_0x32ffee;});return JSON[_0x46ed40(0x1c5)](_0xcb5fe7);}[_0xad074b(0x1f1)](_0x152bab,_0x38fa49){const _0x3c2082=_0xad074b;Object['keys'](_0x38fa49)[_0x3c2082(0x1d2)](_0x33164b=>{const _0x473705=_0x3c2082;this['_ensureShapeModelManager'](_0x152bab,_0x33164b)[_0x473705(0x1db)](_0x38fa49[_0x33164b]);});}[_0xad074b(0x18e)](){const _0x4a943e=_0xad074b,_0x818801={};return this[_0x4a943e(0x1d7)]['forEach']((_0x6288f6,_0x372e94)=>{const _0x1d7baa=_0x4a943e;_0x818801[_0x372e94]={},_0x6288f6[_0x1d7baa(0x1d2)]((_0x1c9362,_0x9f51a9)=>{const _0x40875e=_0x1d7baa;_0x818801[_0x372e94][_0x9f51a9]=_0x1c9362[_0x40875e(0x18e)]();});}),_0x818801;}[_0xad074b(0x1db)](_0x36732b){const _0x146272=_0xad074b;Object[_0x146272(0x1a8)](_0x36732b)[_0x146272(0x1d2)](_0x43dc6d=>{const _0x1da130=_0x146272,_0x493963=_0x36732b[_0x43dc6d];Object[_0x1da130(0x1a8)](_0x493963)[_0x1da130(0x1d2)](_0x29cb07=>{const _0x4bf3f8=_0x1da130;this[_0x4bf3f8(0x1da)](_0x43dc6d,_0x29cb07)[_0x4bf3f8(0x1db)](_0x493963[_0x29cb07]);});});}['_initSnapshot'](){const _0x22f1d9=_0xad074b;this['_resourcesManagerService']['registerPluginResource']({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType[_0x22f1d9(0x1cc)]],'toJson':_0x3f6f92=>this[_0x22f1d9(0x1be)](_0x3f6f92),'parseJson':_0x1d14ef=>JSON[_0x22f1d9(0x1ab)](_0x1d14ef),'onLoad':(_0x489272,_0x55884a)=>{const _0x3ea2cc=_0x22f1d9;this[_0x3ea2cc(0x1f1)](_0x489272,_0x55884a);},'onUnLoad':_0x9efc0b=>{const _0x20b956=_0x22f1d9,_0x3b0571=this['_shapeModelManagerMap']['get'](_0x9efc0b);_0x3b0571&&(_0x3b0571[_0x20b956(0x1d2)](_0x5da22c=>{const _0x523fdb=_0x20b956;_0x5da22c[_0x523fdb(0x195)]();}),this[_0x20b956(0x1d7)]['delete'](_0x9efc0b));}});}['dispose'](){const _0xb8696e=_0xad074b;this[_0xb8696e(0x1d7)]['forEach'](_0x4c4267=>{const _0x592c11=_0xb8696e;_0x4c4267[_0x592c11(0x1d2)](_0x3b955e=>{const _0x3ea54d=_0x592c11;_0x3b955e[_0x3ea54d(0x195)]();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':_0xad074b(0x1c1),'type':CommandType[_0xad074b(0x1e4)],'handler':(_0x14840d,_0x1a6f97)=>{const _0x57aaa7=_0xad074b,{unitId:_0x5643d7,subUnitId:_0xfe0df9,shapeType:_0x40728c,shapeId:_0x2d9ca5,shapeData:_0x3bb542}=_0x1a6f97;return _0x14840d[_0x57aaa7(0x202)](SheetsShapeService)[_0x57aaa7(0x1b6)](_0x5643d7,_0xfe0df9,_0x40728c,_0x2d9ca5,_0x3bb542),!![];}},RemoveSheetsShapeMutation={'id':'sheet.mutation.remove-shape','type':CommandType[_0xad074b(0x1e4)],'handler':(_0x2d47af,_0x452f53)=>{const _0x52a6fe=_0xad074b,{unitId:_0x4c51b1,subUnitId:_0x43c312,shapeId:_0x3c71fd}=_0x452f53;return _0x2d47af[_0x52a6fe(0x202)](SheetsShapeService)[_0x52a6fe(0x1d4)](_0x4c51b1,_0x43c312,_0x3c71fd),!![];}},InsertShapeCommand={'type':CommandType['COMMAND'],'id':_0xad074b(0x1c4),'handler':(_0x12de0c,_0x1ee5bf)=>{const _0x1079af=_0xad074b;var _0x5d2c60,_0x122405;const _0x34c5a1=getSheetCommandTarget(_0x12de0c[_0x1079af(0x202)](IUniverInstanceService),_0x1ee5bf);if(!_0x34c5a1)return![];const _0x9ed26f=_0x12de0c[_0x1079af(0x202)](SheetSkeletonService),{unitId:_0x200981,subUnitId:_0x28764f}=_0x34c5a1,_0x40edf9=_0x9ed26f[_0x1079af(0x203)](_0x200981,_0x28764f);if(!_0x40edf9)return![];const _0x3855dd=_0x12de0c[_0x1079af(0x202)](ICommandService),_0x57f42b=_0x12de0c[_0x1079af(0x202)](IUndoRedoService),_0x277426=_0x12de0c[_0x1079af(0x202)](SheetInterceptorService),_0x2caa33=_0x12de0c[_0x1079af(0x202)](ISheetDrawingService),{shapeType:_0xafc372,shapeData:_0x2ec480}=_0x1ee5bf,_0x1ed60c=_0x1ee5bf['shapeId']||generateRandomId(),_0x29f681={'unitId':_0x200981,'subUnitId':_0x28764f,'shapeId':_0x1ed60c,'shapeType':_0xafc372,'shapeData':_0x2ec480},_0x57e9a3=_0x1ee5bf[_0x1079af(0x216)]||0xc8,_0x590206=_0x1ee5bf[_0x1079af(0x17f)]||0xc8;let _0x4b784b=0x0,_0x48e60f=0x0,_0xfdae53={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x11d3a3={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x1ee5bf[_0x1079af(0x184)]){const {x:_0x5417db,y:_0x158c69}=_0x1ee5bf['position'];_0x4b784b=_0x5417db,_0x48e60f=_0x158c69,_0xfdae53=_0x40edf9[_0x1079af(0x20b)](_0x5417db,_0x158c69),_0x11d3a3=_0x40edf9[_0x1079af(0x20b)](_0x5417db+_0x57e9a3,_0x158c69+_0x590206);}else{if(_0x1ee5bf[_0x1079af(0x1f3)]){const {startRow:_0x2c18a9,startColumn:_0x2bb338}=_0x1ee5bf[_0x1079af(0x1f3)],_0x16b793=0xa,_0x14da18=0xa;_0xfdae53={'row':_0x2c18a9,'rowOffset':_0x16b793,'column':_0x2bb338,'columnOffset':_0x14da18};const _0x5cb0c6=_0x40edf9[_0x1079af(0x20d)](_0x2c18a9,_0x2bb338);_0x4b784b=_0x5cb0c6[_0x1079af(0x1bd)]+_0x14da18,_0x48e60f=_0x5cb0c6[_0x1079af(0x1ca)]+_0x16b793,_0x11d3a3=_0x40edf9[_0x1079af(0x20b)](_0x4b784b+_0x57e9a3,_0x48e60f+_0x590206);}}const _0x42ef02={'from':_0xfdae53,'to':_0x11d3a3},_0x424095={'unitId':_0x200981,'subUnitId':_0x28764f,'drawingId':_0x1ed60c,'drawingType':DrawingTypeEnum[_0x1079af(0x209)],'sheetTransform':_0x42ef02,'transform':{'left':_0x4b784b,'top':_0x48e60f,'width':_0x57e9a3,'height':_0x590206},'data':{'shapeType':_0xafc372,'shapeData':_0x2ec480},'axisAlignSheetTransform':_0x42ef02,'allowTransform':!![]};isConnectorShape(_0xafc372)&&(_0x424095[_0x1079af(0x213)]['fill']=![],_0x424095[_0x1079af(0x213)][_0x1079af(0x1bf)]=![],_0x424095[_0x1079af(0x213)]['resizeEnabled']=![],_0x424095['data'][_0x1079af(0x1f2)]=![],_0x424095[_0x1079af(0x1fc)][_0x1079af(0x1bf)]=![],_0x424095['transform'][_0x1079af(0x1ea)]=![],_0x424095[_0x1079af(0x1fc)][_0x1079af(0x1f2)]=![]);const {undo:_0x19da8f,redo:_0x2b0e4e,objects:_0x90caa7}=_0x2caa33['getBatchAddOp']([_0x424095]),_0x52e0c4=_0x277426[_0x1079af(0x1a3)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x200981,'drawings':[_0x424095]}}),_0x2687ef=[...(_0x5d2c60=_0x52e0c4[_0x1079af(0x1d0)])!==null&&_0x5d2c60!==void 0x0?_0x5d2c60:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x200981,'subUnitId':_0x28764f,'op':_0x2b0e4e,'objects':_0x90caa7,'type':DrawingApplyType[_0x1079af(0x1f5)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x200981]},..._0x52e0c4['redos'],{'id':InsertSheetsShapeMutation['id'],'params':_0x29f681}],_0x4cbfe9=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x200981,'subUnitId':_0x28764f,'shapeId':_0x1ed60c}},...(_0x122405=_0x52e0c4[_0x1079af(0x1c9)])!==null&&_0x122405!==void 0x0?_0x122405:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x200981,'subUnitId':_0x28764f,'op':_0x19da8f,'objects':_0x90caa7,'type':DrawingApplyType[_0x1079af(0x1e1)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x200981]},..._0x52e0c4[_0x1079af(0x18f)]];if(sequenceExecute(_0x2687ef,_0x3855dd))return _0x57f42b['pushUndoRedo']({'unitID':_0x200981,'undoMutations':_0x4cbfe9,'redoMutations':_0x2687ef}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':_0xad074b(0x214),'type':CommandType[_0xad074b(0x1e4)],'handler':(_0x305c3c,_0x513adb)=>{const _0xaaf413=_0xad074b,{unitId:_0x331128,subUnitId:_0x57094e,shapeType:_0x1a2fc8,shapeId:_0x339712,shapeData:_0x131cc1}=_0x513adb,_0x25f91b=_0x305c3c[_0xaaf413(0x202)](SheetsShapeService)[_0xaaf413(0x19c)](_0x331128,_0x57094e,_0x339712);if(_0x25f91b){if(_0x1a2fc8!==void 0x0)_0x25f91b['setShapeType'](_0x1a2fc8);if(_0x131cc1)_0x25f91b===null||_0x25f91b===void 0x0||_0x25f91b[_0xaaf413(0x1e2)](_0x131cc1,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType['COMMAND'],'id':'sheet.command.set-shape-drawing-data','handler':(_0x561f54,_0x52425f)=>{const _0x4787ae=_0xad074b;var _0x15fa25,_0x51d33e;const _0x5ac61a=getSheetCommandTarget(_0x561f54['get'](IUniverInstanceService),_0x52425f);if(!_0x5ac61a)return![];const _0x45315b=_0x561f54[_0x4787ae(0x202)](SheetSkeletonService),{unitId:_0x29df86,subUnitId:_0x379d22}=_0x5ac61a,_0x24cd3e=_0x45315b[_0x4787ae(0x203)](_0x29df86,_0x379d22);if(!_0x24cd3e)return![];const _0x520b2c=_0x561f54[_0x4787ae(0x202)](SheetsShapeService),{shapeId:_0x177dc3,shapeType:_0xb7123d,shapeData:_0x42084c,position:_0x294a9a,width:_0x5ed2ea,height:_0x474d5d}=_0x52425f,_0x55c954=_0x520b2c[_0x4787ae(0x19c)](_0x29df86,_0x379d22,_0x177dc3);if(!_0x55c954)return![];const _0x21fbf3=_0x561f54[_0x4787ae(0x202)](ICommandService),_0xed750d=_0x561f54[_0x4787ae(0x202)](IUndoRedoService),_0x5611de=_0x561f54[_0x4787ae(0x202)](SheetInterceptorService),_0x46e65b=_0x561f54['get'](ISheetDrawingService),_0x33ca14={'unitId':_0x29df86,'subUnitId':_0x379d22,'shapeId':_0x177dc3,'shapeType':_0xb7123d,'shapeData':_0x42084c},_0x1db55e=_0x55c954[_0x4787ae(0x210)](),_0x589b5f=_0x55c954[_0x4787ae(0x1a7)](),{x:_0x26a4c,y:_0x288e00}=_0x294a9a,_0x3fad48={'from':_0x24cd3e[_0x4787ae(0x20b)](_0x26a4c,_0x288e00),'to':_0x24cd3e[_0x4787ae(0x20b)](_0x26a4c+_0x5ed2ea,_0x288e00+_0x474d5d)},_0x56e463={'unitId':_0x29df86,'subUnitId':_0x379d22,'drawingId':_0x177dc3,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x3fad48,'transform':{'left':_0x26a4c,'top':_0x288e00,'width':_0x5ed2ea,'height':_0x474d5d},'data':{'shapeType':_0xb7123d,'shapeData':_0x42084c},'axisAlignSheetTransform':_0x3fad48,'allowTransform':!![]};isConnectorShape(_0xb7123d)&&(_0x56e463[_0x4787ae(0x213)][_0x4787ae(0x218)]=![],_0x56e463[_0x4787ae(0x213)][_0x4787ae(0x1bf)]=![],_0x56e463[_0x4787ae(0x213)]['resizeEnabled']=![],_0x56e463[_0x4787ae(0x213)][_0x4787ae(0x1f2)]=![],_0x56e463[_0x4787ae(0x1fc)][_0x4787ae(0x1bf)]=![],_0x56e463[_0x4787ae(0x1fc)][_0x4787ae(0x1ea)]=![],_0x56e463['transform'][_0x4787ae(0x1f2)]=![]);const {undo:_0x594173,redo:_0x357479,objects:_0x46eb53}=_0x46e65b[_0x4787ae(0x181)]([_0x56e463]),_0x57f63b=_0x5611de[_0x4787ae(0x1a3)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x29df86,'drawings':[_0x56e463]}}),_0x540351=[...(_0x15fa25=_0x57f63b[_0x4787ae(0x1d0)])!==null&&_0x15fa25!==void 0x0?_0x15fa25:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x29df86,'subUnitId':_0x379d22,'op':_0x357479,'objects':_0x46eb53,'type':DrawingApplyType[_0x4787ae(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x29df86]},..._0x57f63b[_0x4787ae(0x1a5)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x33ca14}],_0x4af1b5=[...(_0x51d33e=_0x57f63b['preUndos'])!==null&&_0x51d33e!==void 0x0?_0x51d33e:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x29df86,'subUnitId':_0x379d22,'op':_0x594173,'objects':_0x46eb53,'type':DrawingApplyType[_0x4787ae(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x29df86]},..._0x57f63b[_0x4787ae(0x18f)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x29df86,'subUnitId':_0x379d22,'shapeType':_0x1db55e,'shapeId':_0x177dc3,'shapeData':_0x589b5f}}];if(sequenceExecute(_0x540351,_0x21fbf3))return _0xed750d[_0x4787ae(0x1b0)]({'unitID':_0x29df86,'undoMutations':_0x4af1b5,'redoMutations':_0x540351}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType['COMMAND'],'id':'sheet.command.toggle-shape-flip','handler':(_0x1a4e21,_0x502974)=>{const _0x4068b1=_0xad074b;var _0x2a6246,_0x564540;const _0x1ca97b=getSheetCommandTarget(_0x1a4e21[_0x4068b1(0x202)](IUniverInstanceService),_0x502974);if(!_0x1ca97b)return![];const _0x1d6544=_0x1a4e21[_0x4068b1(0x202)](SheetSkeletonService),{unitId:_0x52e807,subUnitId:_0x4a6ae1}=_0x1ca97b,_0x6271ac=_0x1d6544[_0x4068b1(0x19f)](_0x52e807,_0x4a6ae1);if(!_0x6271ac)return![];const _0xd19ced=_0x1a4e21['get'](ISheetDrawingService),{shapeId:_0x6abd5c,flipH:_0xfc8f1e,flipV:_0xf1a350}=_0x502974,_0x18b0aa=_0xd19ced[_0x4068b1(0x204)]({'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'drawingId':_0x6abd5c});if(!_0x18b0aa)return![];const _0x3ec937=_0x1a4e21['get'](SheetsShapeService)[_0x4068b1(0x19c)](_0x52e807,_0x4a6ae1,_0x6abd5c);if(!_0x3ec937)return![];const _0x42a2e6=_0x1a4e21[_0x4068b1(0x202)](ICommandService),_0x2c63b2=_0x1a4e21['get'](IUndoRedoService),_0x1860a8=_0x1a4e21[_0x4068b1(0x202)](SheetInterceptorService),_0x54cb6={..._0x18b0aa[_0x4068b1(0x1fc)]};if(_0xfc8f1e!==void 0x0)_0x54cb6['flipX']=!_0x54cb6[_0x4068b1(0x20e)];if(_0xf1a350!==void 0x0)_0x54cb6[_0x4068b1(0x1f8)]=!_0x54cb6['flipY'];const _0x1a7193=transformToDrawingPosition(_0x54cb6,_0x6271ac),_0x10315f=transformToAxisAlignPosition(_0x54cb6,_0x6271ac),_0x311607=_0x3ec937['getShapeType'](),_0x42d5b1=_0x3ec937[_0x4068b1(0x1a7)](),_0x31ce04={'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'drawingId':_0x6abd5c,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x1a7193,'transform':_0x54cb6,'data':{'shapeType':_0x311607,'shapeData':_0x42d5b1},'axisAlignSheetTransform':_0x10315f,'allowTransform':!![]},{undo:_0x3eed29,redo:_0x96a6a0,objects:_0x52dbb9}=_0xd19ced[_0x4068b1(0x181)]([_0x31ce04]),_0x2f1572=_0x1860a8['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x52e807,'drawings':[_0x31ce04]}}),_0x174d2d=[...(_0x2a6246=_0x2f1572[_0x4068b1(0x1d0)])!==null&&_0x2a6246!==void 0x0?_0x2a6246:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'op':_0x96a6a0,'objects':_0x52dbb9,'type':DrawingApplyType[_0x4068b1(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x52e807]},..._0x2f1572[_0x4068b1(0x1a5)]],_0xcf4f42=[...(_0x564540=_0x2f1572['preUndos'])!==null&&_0x564540!==void 0x0?_0x564540:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'op':_0x3eed29,'objects':_0x52dbb9,'type':DrawingApplyType[_0x4068b1(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x52e807]},..._0x2f1572['undos']];if(isConnectorShape(_0x311607)){const _0x1ce26d=_0x3ec937['getShapeRelation']();if(_0x1ce26d){const _0x5bff4c={..._0x1ce26d};_0x5bff4c[_0x4068b1(0x1b3)]=void 0x0,_0x5bff4c['to']=void 0x0,_0x174d2d[_0x4068b1(0x1bb)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'shapeId':_0x6abd5c,'shapeType':_0x311607,'shapeData':{'relation':_0x5bff4c}}}),_0xcf4f42[_0x4068b1(0x1bb)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x52e807,'subUnitId':_0x4a6ae1,'shapeId':_0x6abd5c,'shapeType':_0x311607,'shapeData':{'relation':_0x1ce26d}}});}}if(sequenceExecute(_0x174d2d,_0x42a2e6))return _0x2c63b2[_0x4068b1(0x1b0)]({'unitID':_0x52e807,'undoMutations':_0xcf4f42,'redoMutations':_0x174d2d}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0xad074b(0x1b7)],'id':'sheet.command.set-shape-rotate','handler':(_0x596565,_0x41511e)=>{const _0x3d5073=_0xad074b;var _0x353d66,_0x419419;const _0x2d2e1d=getSheetCommandTarget(_0x596565[_0x3d5073(0x202)](IUniverInstanceService),_0x41511e);if(!_0x2d2e1d)return![];const _0x56ace1=_0x596565['get'](SheetSkeletonService),{unitId:_0x59ff20,subUnitId:_0x4b3517}=_0x2d2e1d,_0x494896=_0x56ace1[_0x3d5073(0x19f)](_0x59ff20,_0x4b3517);if(!_0x494896)return![];const _0x55ffd3=_0x596565[_0x3d5073(0x202)](ISheetDrawingService),{shapeId:_0x5ad801,rotate:_0x5e86b5}=_0x41511e,_0x3502be=_0x55ffd3['getDrawingByParam']({'unitId':_0x59ff20,'subUnitId':_0x4b3517,'drawingId':_0x5ad801});if(!_0x3502be)return![];const _0x2d4518=_0x596565['get'](SheetsShapeService)[_0x3d5073(0x19c)](_0x59ff20,_0x4b3517,_0x5ad801);if(!_0x2d4518)return![];const _0x567e59=_0x596565[_0x3d5073(0x202)](ICommandService),_0x5beb77=_0x596565[_0x3d5073(0x202)](IUndoRedoService),_0x4171b6=_0x596565['get'](SheetInterceptorService),_0x546912={..._0x3502be['transform']};if(_0x5e86b5!==void 0x0)_0x546912[_0x3d5073(0x205)]=(_0x546912[_0x3d5073(0x205)]||0x0)+_0x5e86b5;const _0x57e940=transformToDrawingPosition(_0x546912,_0x494896),_0x4709cd=transformToAxisAlignPosition(_0x546912,_0x494896),_0x5027f1=_0x2d4518[_0x3d5073(0x210)](),_0x3cbfb8=_0x2d4518[_0x3d5073(0x1a7)](),_0x175a79={'unitId':_0x59ff20,'subUnitId':_0x4b3517,'drawingId':_0x5ad801,'drawingType':DrawingTypeEnum[_0x3d5073(0x209)],'sheetTransform':_0x57e940,'transform':_0x546912,'data':{'shapeType':_0x5027f1,'shapeData':_0x3cbfb8},'axisAlignSheetTransform':_0x4709cd,'allowTransform':!![]},{undo:_0x5b1b54,redo:_0x14f14c,objects:_0x2cc892}=_0x55ffd3['getBatchUpdateOp']([_0x175a79]),_0x302dde=_0x4171b6[_0x3d5073(0x1a3)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x59ff20,'drawings':[_0x175a79]}}),_0x50d93f=[...(_0x353d66=_0x302dde[_0x3d5073(0x1d0)])!==null&&_0x353d66!==void 0x0?_0x353d66:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x59ff20,'subUnitId':_0x4b3517,'op':_0x14f14c,'objects':_0x2cc892,'type':DrawingApplyType[_0x3d5073(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x59ff20]},..._0x302dde['redos']],_0x43daac=[...(_0x419419=_0x302dde[_0x3d5073(0x1c9)])!==null&&_0x419419!==void 0x0?_0x419419:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x59ff20,'subUnitId':_0x4b3517,'op':_0x5b1b54,'objects':_0x2cc892,'type':DrawingApplyType[_0x3d5073(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x59ff20]},..._0x302dde[_0x3d5073(0x18f)]];if(sequenceExecute(_0x50d93f,_0x567e59))return _0x5beb77[_0x3d5073(0x1b0)]({'unitID':_0x59ff20,'undoMutations':_0x43daac,'redoMutations':_0x50d93f}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType['COMMAND'],'id':'sheet.command.set-shape-text-vertical-toggle','handler':(_0x271937,_0x195d88)=>{const _0x568709=_0xad074b;var _0xcbb846;const _0x420067=getSheetCommandTarget(_0x271937[_0x568709(0x202)](IUniverInstanceService),_0x195d88);if(!_0x420067)return![];const {unitId:_0x544b19,subUnitId:_0x5aa0ba}=_0x420067,{shapeId:_0x179908}=_0x195d88,_0xd2a2f3=_0x271937[_0x568709(0x202)](SheetsShapeService)[_0x568709(0x19c)](_0x544b19,_0x5aa0ba,_0x179908);if(!_0xd2a2f3)return![];const _0x52d429=_0xd2a2f3['getShapeTextData'](),_0xd5c2d9=(_0xcbb846=_0x52d429===null||_0x52d429===void 0x0?void 0x0:_0x52d429[_0x568709(0x1cb)])!==null&&_0xcbb846!==void 0x0?_0xcbb846:!![],_0x3fc308=!_0xd5c2d9,_0x207688=_0x271937[_0x568709(0x202)](ICommandService),_0x48cd21=_0x271937[_0x568709(0x202)](IUndoRedoService),_0x36008b={'unitId':_0x544b19,'subUnitId':_0x5aa0ba,'shapeId':_0x179908,'shapeData':{'shapeText':{'isHorizontal':_0x3fc308}}},_0x36f903={'unitId':_0x544b19,'subUnitId':_0x5aa0ba,'shapeId':_0x179908,'shapeData':{'shapeText':{'isHorizontal':_0xd5c2d9}}},_0x2714cf=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x36008b}],_0x58adaa=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x36f903}];if(sequenceExecute(_0x2714cf,_0x207688))return _0x48cd21['pushUndoRedo']({'unitID':_0x544b19,'undoMutations':_0x58adaa,'redoMutations':_0x2714cf}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0xad074b(0x1b7)],'id':_0xad074b(0x1d8),'handler':(_0x542ae8,_0x363f6f)=>{const _0x157d72=_0xad074b;var _0x1aa744,_0x41e476,_0x23141f,_0x499900;const _0x448cc7=getSheetCommandTarget(_0x542ae8['get'](IUniverInstanceService),_0x363f6f);if(!_0x448cc7)return![];const _0x89f51d=_0x542ae8[_0x157d72(0x202)](SheetSkeletonService),{unitId:_0x5c044f,subUnitId:_0x4f5c8b}=_0x448cc7,_0x5b7f2d=_0x89f51d[_0x157d72(0x19f)](_0x5c044f,_0x4f5c8b);if(!_0x5b7f2d)return![];const _0x4a568b=_0x542ae8[_0x157d72(0x202)](ISheetDrawingService),{connectorShapeId:_0x4e51f1,width:_0x1d12a0,height:_0x70a159,left:_0x4b9475,top:_0x474284,flipX:_0x5b2289,flipY:_0x509683,rotation:_0x55e1be,oldAdjustValues:_0x360d25,newAdjustValues:_0x20d677,oldLineType:_0x12e0e3,newLineType:_0x3b986f,oldRelation:_0x1f836d,newRelation:_0x59e7c9}=_0x363f6f,_0x50d6f3=_0x4a568b[_0x157d72(0x204)]({'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'drawingId':_0x4e51f1});if(!_0x50d6f3)return![];const _0x2b83be=_0x542ae8[_0x157d72(0x202)](SheetsShapeService)[_0x157d72(0x19c)](_0x5c044f,_0x4f5c8b,_0x4e51f1);if(!_0x2b83be)return![];const _0xd27796=_0x542ae8[_0x157d72(0x202)](ICommandService),_0x365b60=_0x542ae8[_0x157d72(0x202)](IUndoRedoService),_0x5495e2=_0x542ae8[_0x157d72(0x202)](SheetInterceptorService),_0x4ae683={..._0x50d6f3[_0x157d72(0x1fc)],'width':_0x1d12a0,'height':_0x70a159,'left':_0x4b9475,'top':_0x474284,'flipX':_0x5b2289,'flipY':_0x509683,'angle':(_0x1aa744=_0x55e1be!==null&&_0x55e1be!==void 0x0?_0x55e1be:(_0x41e476=_0x50d6f3['transform'])===null||_0x41e476===void 0x0?void 0x0:_0x41e476['angle'])!==null&&_0x1aa744!==void 0x0?_0x1aa744:0x0},_0x2054c8=transformToDrawingPosition(_0x4ae683,_0x5b7f2d),_0x5c6d9c=transformToAxisAlignPosition(_0x4ae683,_0x5b7f2d),_0x4db4a0=_0x2b83be[_0x157d72(0x210)](),_0x307f8b=_0x2b83be[_0x157d72(0x1a7)](),_0x2ecc1a={'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'drawingId':_0x4e51f1,'drawingType':DrawingTypeEnum[_0x157d72(0x209)],'sheetTransform':_0x2054c8,'transform':_0x4ae683,'data':{'shapeType':_0x3b986f||_0x12e0e3||_0x4db4a0,'shapeData':{..._0x307f8b,'adjustValues':_0x20d677||_0x360d25||(_0x307f8b===null||_0x307f8b===void 0x0?void 0x0:_0x307f8b[_0x157d72(0x197)]),'relation':_0x59e7c9||_0x1f836d||(_0x307f8b===null||_0x307f8b===void 0x0?void 0x0:_0x307f8b[_0x157d72(0x215)])}},'axisAlignSheetTransform':_0x5c6d9c,'allowTransform':!![]},{undo:_0x5f14b8,redo:_0x42d5b0,objects:_0x8a1b6d}=_0x4a568b[_0x157d72(0x181)]([_0x2ecc1a]),_0x2e9b8a=_0x5495e2[_0x157d72(0x1a3)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x5c044f,'drawings':[_0x2ecc1a]}}),_0x337451=[...(_0x23141f=_0x2e9b8a[_0x157d72(0x1d0)])!==null&&_0x23141f!==void 0x0?_0x23141f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'op':_0x42d5b0,'objects':_0x8a1b6d,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5c044f]},..._0x2e9b8a['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'shapeId':_0x4e51f1,'shapeType':_0x3b986f,'shapeData':{'adjustValues':_0x20d677,'relation':_0x59e7c9}}}],_0x37533c=[...(_0x499900=_0x2e9b8a[_0x157d72(0x1c9)])!==null&&_0x499900!==void 0x0?_0x499900:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'op':_0x5f14b8,'objects':_0x8a1b6d,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5c044f]},..._0x2e9b8a[_0x157d72(0x18f)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x5c044f,'subUnitId':_0x4f5c8b,'shapeId':_0x4e51f1,'shapeType':_0x4db4a0,'shapeData':{..._0x307f8b,'adjustValues':_0x360d25||(_0x307f8b===null||_0x307f8b===void 0x0?void 0x0:_0x307f8b[_0x157d72(0x197)]),'relation':_0x1f836d||(_0x307f8b===null||_0x307f8b===void 0x0?void 0x0:_0x307f8b[_0x157d72(0x215)])}}}];if(sequenceExecute(_0x337451,_0xd27796))return _0x365b60[_0x157d72(0x1b0)]({'unitID':_0x5c044f,'undoMutations':_0x37533c,'redoMutations':_0x337451}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0xad074b(0x1b7)],'id':'sheet.command.update-line-shape-resize','handler':(_0x1f931a,_0x556910)=>{const _0x46ab89=_0xad074b;var _0x33a5d0,_0x533d81;const _0x1f2d60=getSheetCommandTarget(_0x1f931a[_0x46ab89(0x202)](IUniverInstanceService),_0x556910);if(!_0x1f2d60)return![];const _0x46505c=_0x1f931a['get'](SheetSkeletonService),{unitId:_0x41f716,subUnitId:_0x358bf0}=_0x1f2d60,_0x38c351=_0x46505c[_0x46ab89(0x19f)](_0x41f716,_0x358bf0);if(!_0x38c351)return![];const _0x280cde=_0x1f931a[_0x46ab89(0x202)](ISheetDrawingService),{shapeId:_0x398cad,width:_0x1879cc,height:_0x2674fc,left:_0x49143e,top:_0x3c6913,flipX:_0x50795f,flipY:_0x3f3a58,angle:_0x3702d9,oldAdjustValues:_0xd6d59c,newAdjustValues:_0xf2a74c,oldLineType:_0x475cfb,newLineType:_0x3b1945}=_0x556910,_0x369d0f=_0x280cde[_0x46ab89(0x204)]({'unitId':_0x41f716,'subUnitId':_0x358bf0,'drawingId':_0x398cad});if(!_0x369d0f)return![];const _0x66aefa=_0x1f931a[_0x46ab89(0x202)](SheetsShapeService)[_0x46ab89(0x19c)](_0x41f716,_0x358bf0,_0x398cad);if(!_0x66aefa)return![];const _0xbd9c40=_0x1f931a[_0x46ab89(0x202)](ICommandService),_0x42c0d4=_0x1f931a[_0x46ab89(0x202)](IUndoRedoService),_0x50b49a=_0x1f931a['get'](SheetInterceptorService),_0x5d8370={..._0x369d0f['transform'],'width':_0x1879cc,'height':_0x2674fc,'left':_0x49143e,'top':_0x3c6913,'flipX':_0x50795f,'flipY':_0x3f3a58,'angle':_0x3702d9},_0x5565c8=transformToDrawingPosition(_0x5d8370,_0x38c351),_0x340d00=transformToAxisAlignPosition(_0x5d8370,_0x38c351),_0x12ed20=_0x66aefa[_0x46ab89(0x210)](),_0x47e0fc=_0x66aefa[_0x46ab89(0x1a7)](),_0x48aba3={'unitId':_0x41f716,'subUnitId':_0x358bf0,'drawingId':_0x398cad,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x5565c8,'transform':_0x5d8370,'data':{'shapeType':_0x3b1945||_0x475cfb||_0x12ed20,'shapeData':{..._0x47e0fc,'adjustValues':_0xf2a74c||_0xd6d59c||(_0x47e0fc===null||_0x47e0fc===void 0x0?void 0x0:_0x47e0fc[_0x46ab89(0x197)])}},'axisAlignSheetTransform':_0x340d00,'allowTransform':!![]},{undo:_0xa2fb2d,redo:_0x16ac82,objects:_0x2cae48}=_0x280cde[_0x46ab89(0x181)]([_0x48aba3]),_0x49646d=_0x50b49a[_0x46ab89(0x1a3)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x41f716,'drawings':[_0x48aba3]}}),_0x2a108d=[...(_0x33a5d0=_0x49646d[_0x46ab89(0x1d0)])!==null&&_0x33a5d0!==void 0x0?_0x33a5d0:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x41f716,'subUnitId':_0x358bf0,'op':_0x16ac82,'objects':_0x2cae48,'type':DrawingApplyType[_0x46ab89(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x41f716]},..._0x49646d['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x41f716,'subUnitId':_0x358bf0,'shapeId':_0x398cad,'shapeType':_0x3b1945,'shapeData':{'adjustValues':_0xf2a74c}}}],_0x3da9e7=[...(_0x533d81=_0x49646d[_0x46ab89(0x1c9)])!==null&&_0x533d81!==void 0x0?_0x533d81:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x41f716,'subUnitId':_0x358bf0,'op':_0xa2fb2d,'objects':_0x2cae48,'type':DrawingApplyType[_0x46ab89(0x1ae)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x41f716]},..._0x49646d[_0x46ab89(0x18f)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x41f716,'subUnitId':_0x358bf0,'shapeId':_0x398cad,'shapeType':_0x12ed20,'shapeData':{..._0x47e0fc,'adjustValues':_0xd6d59c||(_0x47e0fc===null||_0x47e0fc===void 0x0?void 0x0:_0x47e0fc[_0x46ab89(0x197)])}}}];if(sequenceExecute(_0x2a108d,_0xbd9c40))return _0x42c0d4['pushUndoRedo']({'unitID':_0x41f716,'undoMutations':_0x3da9e7,'redoMutations':_0x2a108d}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0xad074b(0x19b),'type':CommandType[_0xad074b(0x1e4)],'handler':(_0x49fb38,_0x22ab35)=>{const _0x2df1ae=_0xad074b,{unitId:_0x5a7047,subUnitId:_0x4d9f9a,shapeType:_0x3ff406,shapeId:_0x4d38ad,shapeData:_0x42ccd7}=_0x22ab35,_0x551fc8=_0x49fb38[_0x2df1ae(0x202)](SheetsShapeService)[_0x2df1ae(0x19c)](_0x5a7047,_0x4d9f9a,_0x4d38ad);if(_0x551fc8){_0x551fc8[_0x2df1ae(0x20a)](_0x3ff406);if(_0x42ccd7)_0x551fc8===null||_0x551fc8===void 0x0||_0x551fc8[_0x2df1ae(0x1e2)](_0x42ccd7);}return!![];}},UpdateSheetsShapeTypeCommand={'id':'sheet.command.update-shape-type','type':CommandType[_0xad074b(0x1b7)],'handler':(_0x2be6f2,_0x372c57)=>{const _0x288506=_0xad074b;if(!_0x372c57)return![];const _0x3c70c0=_0x2be6f2[_0x288506(0x202)](ICommandService),_0x19fc32=_0x2be6f2['get'](SheetsShapeService),_0x463337=_0x2be6f2[_0x288506(0x202)](IUndoRedoService),_0x17a0d9=[],_0x4b1ca5=[],{unitId:_0xee7343,subUnitId:_0x2b7aab,shapeId:_0x45472c,shapeType:_0x560120,shapeData:_0x4257e4}=_0x372c57,_0x52d31f=_0x19fc32[_0x288506(0x19c)](_0xee7343,_0x2b7aab,_0x45472c);if(_0x52d31f){const _0x3ea21a=_0x52d31f[_0x288506(0x210)](),_0x56ae65=Object['assign']({},_0x52d31f['getShapeData']()),_0x487547={'unitId':_0xee7343,'subUnitId':_0x2b7aab,'shapeId':_0x45472c,'shapeType':_0x560120,'shapeData':_0x4257e4},_0x53fb3a={'unitId':_0xee7343,'subUnitId':_0x2b7aab,'shapeId':_0x45472c,'shapeType':_0x3ea21a,'shapeData':_0x56ae65};_0x17a0d9[_0x288506(0x1bb)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x487547}),_0x4b1ca5[_0x288506(0x1bb)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x53fb3a});if(_0x17a0d9[_0x288506(0x1eb)](_0xf95997=>_0x3c70c0[_0x288506(0x208)](_0xf95997['id'],_0xf95997[_0x288506(0x193)])))_0x463337[_0x288506(0x1b0)]({'unitID':_0xee7343,'redoMutations':[..._0x17a0d9],'undoMutations':[..._0x4b1ca5]});return!![];}return![];}};var name=_0xad074b(0x1e7),version='0.21.0';const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0xad074b(0x1c2),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x5fea3a,_0x3290f4,_0xc79a14,_0x48d22e,_0xeca14c){const _0x23598c=_0xad074b;super(),this['_commandService']=_0x5fea3a,this[_0x23598c(0x185)]=_0x3290f4,this[_0x23598c(0x207)]=_0xc79a14,this['_sheetsShapeService']=_0x48d22e,this['_drawingManagerService']=_0xeca14c,this[_0x23598c(0x1cf)](),this['_initCommandInterceptor']();}[_0xad074b(0x1cf)](){const _0xc69841=_0xad074b;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0xc69841(0x1d2)](_0x5ae6cb=>this[_0xc69841(0x1ee)](this[_0xc69841(0x18d)][_0xc69841(0x1ef)](_0x5ae6cb)));}[_0xad074b(0x1d5)](){const _0x174be1=_0xad074b;this[_0x174be1(0x1ee)](this[_0x174be1(0x185)][_0x174be1(0x1b1)]({'getMutations':_0x4ef401=>{const _0x4f0220=_0x174be1;if(_0x4ef401['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0xf7e441}=_0x4ef401[_0x4f0220(0x193)],_0xb4f78e=_0xf7e441[_0x4f0220(0x1fe)](_0x345320=>_0x345320[_0x4f0220(0x219)]===DrawingTypeEnum['DRAWING_SHAPE']);if(_0xb4f78e[_0x4f0220(0x1ce)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x1538c1=[],_0x5390f6=[];return _0xb4f78e[_0x4f0220(0x1d2)](_0x4a47e4=>{const _0x4ff7e4=_0x4f0220,{unitId:_0x4247ef,subUnitId:_0x30202b,drawingId:_0x5c0e56}=_0x4a47e4,_0x410d45=this['_sheetsShapeService']['getShapeModel'](_0x4247ef,_0x30202b,_0x5c0e56);if(!_0x410d45)throw new TypeError(_0x4ff7e4(0x186)+_0x410d45);_0x1538c1[_0x4ff7e4(0x1bb)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x4247ef,'subUnitId':_0x30202b,'shapeId':_0x5c0e56}}),_0x5390f6[_0x4ff7e4(0x1bb)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x4247ef,'subUnitId':_0x30202b,'shapeId':_0x5c0e56,'shapeType':_0x410d45['getShapeType'](),'shapeData':_0x410d45[_0x4ff7e4(0x1a7)]()}});const _0x5d3274=this[_0x4ff7e4(0x18c)][_0x4ff7e4(0x1e5)](_0x4247ef,_0x30202b,_0x5c0e56);if(_0x5d3274)for(const _0x2138a5 of _0x5d3274){const _0x3c0fe4=_0x2138a5[_0x4ff7e4(0x1e9)],_0x5c8b69=_0x2138a5['isFrom'],_0x5c8601=_0x5c8b69?{'from':void 0x0}:{'to':void 0x0},_0x373589=_0x5c8b69?{'from':{'shapeId':_0x2138a5[_0x4ff7e4(0x1d3)],'cxnIndex':_0x2138a5['cxnIndex']}}:{'to':{'shapeId':_0x2138a5['shapeId'],'cxnIndex':_0x2138a5[_0x4ff7e4(0x18b)]}};_0x1538c1['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4247ef,'subUnitId':_0x30202b,'shapeId':_0x3c0fe4,'shapeData':{'relation':_0x5c8601}}}),_0x5390f6['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4247ef,'subUnitId':_0x30202b,'shapeId':_0x3c0fe4,'shapeData':{'relation':_0x373589}}});}}),{'preRedos':_0x1538c1,'redos':[],'preUndos':[],'undos':_0x5390f6};}if(_0x4ef401['id']===SetSheetDrawingCommand['id']){const {drawings:_0x48d21e}=_0x4ef401[_0x4f0220(0x193)],_0x20326c=_0x48d21e[_0x4f0220(0x1fe)](_0x3e83c6=>_0x3e83c6[_0x4f0220(0x219)]===DrawingTypeEnum[_0x4f0220(0x209)]);if(_0x20326c[_0x4f0220(0x1ce)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x271dd0=[],_0x9c101b=[];for(const _0xf8eb4d of _0x20326c){const {unitId:_0x3c6b3e,subUnitId:_0xf9482,drawingId:_0x590098,transform:_0xba7d32}=_0xf8eb4d;if(!_0x3c6b3e||!_0xf9482||!_0x590098||!_0xba7d32)continue;const _0x5d000d=this['_sheetsShapeService']['getShapeModel'](_0x3c6b3e,_0xf9482,_0x590098);if(!_0x5d000d)throw new TypeError(_0x4f0220(0x186)+_0x5d000d);if(isConnectorShape(_0x5d000d[_0x4f0220(0x210)]())){const _0x587625=this[_0x4f0220(0x18c)][_0x4f0220(0x1f9)](_0x3c6b3e,_0xf9482,_0x590098),_0x335543={'from':void 0x0,'to':void 0x0};_0x587625&&(_0x271dd0['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3c6b3e,'subUnitId':_0xf9482,'shapeId':_0x590098,'shapeData':{'relation':_0x335543}}}),_0x9c101b[_0x4f0220(0x1bb)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3c6b3e,'subUnitId':_0xf9482,'shapeId':_0x590098,'shapeData':{'relation':_0x587625}}}));}else{const _0x48059e=this[_0x4f0220(0x18c)][_0x4f0220(0x1e5)](_0x3c6b3e,_0xf9482,_0x590098);if(_0x48059e&&_0x48059e['length']>0x0)for(const _0x231877 of _0x48059e){const _0x15174d=_0x231877['lineShapeId'],_0x5dc512=_0x231877[_0x4f0220(0x1cd)],_0x1e6389=this[_0x4f0220(0x18c)][_0x4f0220(0x19c)](_0x3c6b3e,_0xf9482,_0x15174d);if(!_0x1e6389)continue;const _0x4b63a9=_0x1e6389['getStartConnectInfo'](),_0x309790=_0x1e6389[_0x4f0220(0x1ed)]();if(_0x4b63a9&&_0x309790)this[_0x4f0220(0x187)](_0x3c6b3e,_0xf9482,_0x15174d,_0x1e6389,_0x4b63a9,_0x309790,_0x271dd0,_0x9c101b,_0x590098,_0xba7d32);else this['_addLineFollowShapeUpdates'](_0x3c6b3e,_0xf9482,_0x15174d,_0x1e6389,_0x5dc512?_0x4b63a9:_0x309790,_0x5dc512,_0x271dd0,_0x9c101b,_0x590098,_0xba7d32);}}}return{'preRedos':[],'redos':_0x271dd0,'preUndos':_0x9c101b,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0xad074b(0x1f0)](_0x326f5d,_0x5e62c6,_0x1e3a30,_0x51a9d7,_0x2773b5){const _0x3c81fe=_0xad074b;if(!_0x5e62c6||!_0x1e3a30)return null;const {shapeId:_0x7eee7,cxnIndex:_0x533c7e}=_0x326f5d,_0x59c6fe=this[_0x3c81fe(0x18c)][_0x3c81fe(0x19c)](_0x5e62c6,_0x1e3a30,_0x7eee7);if(!_0x59c6fe)return null;const _0x161865=this[_0x3c81fe(0x20f)][_0x3c81fe(0x204)]({'unitId':_0x5e62c6,'subUnitId':_0x1e3a30,'drawingId':_0x7eee7});if(!(_0x161865===null||_0x161865===void 0x0?void 0x0:_0x161865[_0x3c81fe(0x1fc)]))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x1c6113}=_0x161865[_0x3c81fe(0x1fc)];if(_0x2773b5&&_0x51a9d7===_0x7eee7){var _0x4ba582,_0x119974,_0x227e64,_0x31c371,_0x59a5d0,_0x372b98,_0x10dfef;left=(_0x4ba582=_0x2773b5[_0x3c81fe(0x1a6)])!==null&&_0x4ba582!==void 0x0?_0x4ba582:left,top=(_0x119974=_0x2773b5[_0x3c81fe(0x180)])!==null&&_0x119974!==void 0x0?_0x119974:top,width=(_0x227e64=_0x2773b5[_0x3c81fe(0x216)])!==null&&_0x227e64!==void 0x0?_0x227e64:width,height=(_0x31c371=_0x2773b5[_0x3c81fe(0x17f)])!==null&&_0x31c371!==void 0x0?_0x31c371:height,flipX=(_0x59a5d0=_0x2773b5[_0x3c81fe(0x20e)])!==null&&_0x59a5d0!==void 0x0?_0x59a5d0:flipX,flipY=(_0x372b98=_0x2773b5[_0x3c81fe(0x1f8)])!==null&&_0x372b98!==void 0x0?_0x372b98:flipY,_0x1c6113=(_0x10dfef=_0x2773b5[_0x3c81fe(0x205)])!==null&&_0x10dfef!==void 0x0?_0x10dfef:_0x1c6113;}_0x59c6fe[_0x3c81fe(0x19e)]({'width':width,'height':height});const _0x194f0f=_0x59c6fe[_0x3c81fe(0x1e8)]()[_0x3c81fe(0x1de)](_0x13e2d5=>_0x13e2d5[_0x3c81fe(0x1ad)]===_0x533c7e);if(!_0x194f0f)return null;let _0x5d6a95=flipX?width-_0x194f0f['x']:_0x194f0f['x'],_0x556737=flipY?height-_0x194f0f['y']:_0x194f0f['y'];if(_0x1c6113!==0x0&&_0x1c6113!==void 0x0&&_0x1c6113!==null){const _0x352c6a=_0x1c6113*Math['PI']/0xb4,_0xa8b2c2=Math['cos'](_0x352c6a),_0x4e6cff=Math[_0x3c81fe(0x1fd)](_0x352c6a),_0x4cfc0c=width/0x2,_0x1c4595=height/0x2,_0x5aaa5f=_0x5d6a95-_0x4cfc0c,_0x4c46a3=_0x556737-_0x1c4595;_0x5d6a95=_0x4cfc0c+_0x5aaa5f*_0xa8b2c2-_0x4c46a3*_0x4e6cff,_0x556737=_0x1c4595+_0x5aaa5f*_0x4e6cff+_0x4c46a3*_0xa8b2c2;}_0x5d6a95+=left,_0x556737+=top;let _0x122f97=_0x194f0f[_0x3c81fe(0x1a4)]/0xea60;if(flipX)_0x122f97=0xb4-_0x122f97;if(flipY)_0x122f97=-_0x122f97;_0x122f97+=_0x1c6113||0x0,_0x122f97=(_0x122f97%0x168+0x168)%0x168;const _0x129e2b=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x1c6113||0x0);return{'point':{'x':_0x5d6a95,'y':_0x556737},'angle':_0x122f97,'bounds':_0x129e2b};}[_0xad074b(0x187)](_0x28905d,_0x352c5a,_0x3fa44c,_0x20f8d1,_0x263f50,_0x59ecc2,_0x3fe224,_0x56e789,_0x38291f,_0x230d21){const _0x17bb3a=_0xad074b,_0x367717=this[_0x17bb3a(0x207)][_0x17bb3a(0x19f)](_0x28905d,_0x352c5a);if(!_0x367717)return;const _0x5ecc4e=_0x20f8d1['getShapeRelation'](),_0x576bca=_0x20f8d1['getAdjustNames'](),_0x1af4c9={},_0xda4f45={};_0x576bca[_0x17bb3a(0x1d2)](_0x25eb58=>{const _0x3c4608=_0x17bb3a,_0x4036a6=_0x20f8d1[_0x3c4608(0x1d1)](_0x25eb58);_0xda4f45[_0x25eb58]=_0x4036a6!==null&&_0x4036a6!==void 0x0?_0x4036a6:0x0;});const _0x3662dd=this['_getConnectPointInfo'](_0x263f50,_0x28905d,_0x352c5a,_0x38291f,_0x230d21),_0x571615=this[_0x17bb3a(0x1f0)](_0x59ecc2,_0x28905d,_0x352c5a,_0x38291f,_0x230d21);if(_0x3662dd&&_0x571615){const _0x3d46b4=_0x20f8d1[_0x17bb3a(0x210)](),_0x46019b=routeConnectorLineShape(_0x3662dd,_0x571615,_0x3d46b4);let _0x4a629a=_0x3d46b4;if(_0x46019b){const _0x52d9ca=computeConnectorRouteLayout(_0x46019b,_0x20f8d1[_0x17bb3a(0x210)]()),_0x602312=this[_0x17bb3a(0x20f)]['getDrawingData'](_0x28905d,_0x352c5a);if(_0x602312&&_0x602312[_0x3fa44c]){const _0x325af9=_0x602312[_0x3fa44c];_0x4a629a=_0x52d9ca[_0x17bb3a(0x194)];for(const [_0x125c5c,_0xa9ebba]of Object['entries'](_0x52d9ca['adjustValues']))_0x1af4c9[_0x125c5c]=_0xa9ebba;const _0x191991={..._0x325af9['transform'],'width':_0x52d9ca[_0x17bb3a(0x217)][_0x17bb3a(0x216)],'height':_0x52d9ca['worldRect'][_0x17bb3a(0x17f)],'left':_0x52d9ca['worldRect']['left'],'top':_0x52d9ca[_0x17bb3a(0x217)]['top'],'flipX':_0x52d9ca[_0x17bb3a(0x217)][_0x17bb3a(0x20e)],'flipY':_0x52d9ca['worldRect']['flipY'],'angle':_0x52d9ca[_0x17bb3a(0x1dc)]},_0x173316=transformToDrawingPosition(_0x191991,_0x367717),_0x22b1bb=transformToAxisAlignPosition(_0x191991,_0x367717),_0x1095b1={'unitId':_0x28905d,'subUnitId':_0x352c5a,'drawingType':DrawingTypeEnum[_0x17bb3a(0x209)],'drawingId':_0x3fa44c,'transform':_0x191991,'sheetTransform':_0x173316,'axisAlignSheetTransform':_0x22b1bb},{unitId:_0x333fe3,subUnitId:_0x8d762,undo:_0x99ba3e,redo:_0x3aa976,objects:_0x4f4754}=this['_drawingManagerService']['getBatchUpdateOp']([_0x1095b1]);_0x3fe224[_0x17bb3a(0x1bb)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x333fe3,'subUnitId':_0x8d762,'op':_0x3aa976,'objects':_0x4f4754,'type':DrawingApplyType[_0x17bb3a(0x1ae)]}}),_0x56e789[_0x17bb3a(0x1bb)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x333fe3,'subUnitId':_0x8d762,'op':_0x99ba3e,'objects':_0x4f4754,'type':DrawingApplyType[_0x17bb3a(0x1ae)]}});}_0x20f8d1['removeLinePoints']();}_0x3fe224[_0x17bb3a(0x1bb)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x28905d,'subUnitId':_0x352c5a,'shapeId':_0x3fa44c,'shapeType':_0x4a629a,'shapeData':{'adjustValues':_0x1af4c9,'relation':_0x5ecc4e}}}),_0x56e789['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x28905d,'subUnitId':_0x352c5a,'shapeId':_0x3fa44c,'shapeType':_0x3d46b4,'shapeData':{'adjustValues':_0xda4f45,'relation':_0x5ecc4e}}});}}[_0xad074b(0x1b9)](_0x54e7cc,_0x2d1ea7,_0x5e4f6e,_0x144a5c,_0x6d213a,_0x3105d3,_0x3f60a7,_0x109f2c,_0x14d08c,_0x3e75f5){const _0x2ec304=_0xad074b;var _0x40b2a1;if(!_0x6d213a)return;const _0x589731=this[_0x2ec304(0x207)][_0x2ec304(0x19f)](_0x54e7cc,_0x2d1ea7);if(!_0x589731)return;const _0x3fa545=(_0x40b2a1=this[_0x2ec304(0x20f)][_0x2ec304(0x204)]({'unitId':_0x54e7cc,'subUnitId':_0x2d1ea7,'drawingId':_0x14d08c}))===null||_0x40b2a1===void 0x0?void 0x0:_0x40b2a1[_0x2ec304(0x1fc)];if(!_0x3fa545)return;const _0xfcef72=_0x3fa545[_0x2ec304(0x1a6)]!==_0x3e75f5[_0x2ec304(0x1a6)]||_0x3fa545['top']!==_0x3e75f5[_0x2ec304(0x180)],_0x59d8f6=_0x3fa545[_0x2ec304(0x216)]!==_0x3e75f5[_0x2ec304(0x216)]||_0x3fa545[_0x2ec304(0x17f)]!==_0x3e75f5[_0x2ec304(0x17f)],_0x40cf5c=_0x3fa545[_0x2ec304(0x20e)]!==_0x3e75f5[_0x2ec304(0x20e)]||_0x3fa545[_0x2ec304(0x1f8)]!==_0x3e75f5[_0x2ec304(0x1f8)],_0x154d28=_0x3fa545[_0x2ec304(0x205)]!==_0x3e75f5[_0x2ec304(0x205)];if(_0xfcef72&&!_0x59d8f6&&!_0x40cf5c&&!_0x154d28){var _0x21da39,_0x26e160,_0x7e7346,_0x279688;const _0x2051e0=((_0x21da39=_0x3e75f5[_0x2ec304(0x1a6)])!==null&&_0x21da39!==void 0x0?_0x21da39:0x0)-((_0x26e160=_0x3fa545[_0x2ec304(0x1a6)])!==null&&_0x26e160!==void 0x0?_0x26e160:0x0),_0x53d380=((_0x7e7346=_0x3e75f5[_0x2ec304(0x180)])!==null&&_0x7e7346!==void 0x0?_0x7e7346:0x0)-((_0x279688=_0x3fa545[_0x2ec304(0x180)])!==null&&_0x279688!==void 0x0?_0x279688:0x0),_0x3b0e3f=this[_0x2ec304(0x20f)][_0x2ec304(0x1f6)](_0x54e7cc,_0x2d1ea7);if(_0x3b0e3f&&_0x3b0e3f[_0x5e4f6e]){var _0x2fc099,_0x4983ed,_0xf37c58,_0x105eb0;const _0x4294f7=_0x3b0e3f[_0x5e4f6e],_0x23fd47={..._0x4294f7['transform'],'left':((_0x2fc099=(_0x4983ed=_0x4294f7[_0x2ec304(0x1fc)])===null||_0x4983ed===void 0x0?void 0x0:_0x4983ed[_0x2ec304(0x1a6)])!==null&&_0x2fc099!==void 0x0?_0x2fc099:0x0)+_0x2051e0,'top':((_0xf37c58=(_0x105eb0=_0x4294f7[_0x2ec304(0x1fc)])===null||_0x105eb0===void 0x0?void 0x0:_0x105eb0[_0x2ec304(0x180)])!==null&&_0xf37c58!==void 0x0?_0xf37c58:0x0)+_0x53d380},_0x191517=transformToDrawingPosition(_0x23fd47,_0x589731),_0x3d3234=transformToAxisAlignPosition(_0x23fd47,_0x589731),_0x39fe7d={'unitId':_0x54e7cc,'subUnitId':_0x2d1ea7,'drawingType':DrawingTypeEnum[_0x2ec304(0x209)],'drawingId':_0x5e4f6e,'transform':_0x23fd47,'sheetTransform':_0x191517,'axisAlignSheetTransform':_0x3d3234},{unitId:_0x2f08e9,subUnitId:_0xe90e44,undo:_0x13c9fe,redo:_0x319e16,objects:_0x4f939d}=this['_drawingManagerService'][_0x2ec304(0x181)]([_0x39fe7d]);_0x3f60a7['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2f08e9,'subUnitId':_0xe90e44,'op':_0x319e16,'objects':_0x4f939d,'type':DrawingApplyType[_0x2ec304(0x1ae)]}}),_0x109f2c['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2f08e9,'subUnitId':_0xe90e44,'op':_0x13c9fe,'objects':_0x4f939d,'type':DrawingApplyType['UPDATE']}});}}else{const _0x12a8c5=_0x144a5c[_0x2ec304(0x1a0)](),_0x3dd990=_0x144a5c[_0x2ec304(0x1ed)]();this[_0x2ec304(0x187)](_0x54e7cc,_0x2d1ea7,_0x5e4f6e,_0x144a5c,_0x12a8c5,_0x3dd990,_0x3f60a7,_0x109f2c,_0x14d08c,_0x3e75f5);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x123de4=defaultPluginConfig,_0x46c4be,_0x192001,_0xacfa28){const _0x3094bb=_0xad074b;super(),this[_0x3094bb(0x20c)]=_0x123de4,this[_0x3094bb(0x1e3)]=_0x46c4be,this[_0x3094bb(0x18d)]=_0x192001,this[_0x3094bb(0x1bc)]=_0xacfa28;const {..._0x1d3bfe}=merge({},defaultPluginConfig,this[_0x3094bb(0x20c)]);this[_0x3094bb(0x1bc)][_0x3094bb(0x190)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x1d3bfe);}[_0xad074b(0x1fb)](){const _0x297819=_0xad074b,_0x1d6ec7=this['_injector'];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x297819(0x1d2)](_0x92493d=>_0x1d6ec7[_0x297819(0x1c3)](_0x92493d)),touchDependencies(_0x1d6ec7,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0xad074b(0x198),UniverInstanceType['UNIVER_SHEET']),_defineProperty(UniverSheetsShapePlugin,_0xad074b(0x19d),_0xad074b(0x1c7)),_defineProperty(UniverSheetsShapePlugin,_0xad074b(0x1b5),name),_defineProperty(UniverSheetsShapePlugin,'version',version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};
1
+ const _0x29362c=_0x5c41;(function(_0x41cc0d,_0x449cf8){const _0x5be84b=_0x5c41,_0x25d5a7=_0x41cc0d();while(!![]){try{const _0x5679ec=-parseInt(_0x5be84b(0xd7))/0x1+-parseInt(_0x5be84b(0xd2))/0x2*(parseInt(_0x5be84b(0xbb))/0x3)+parseInt(_0x5be84b(0x124))/0x4*(parseInt(_0x5be84b(0xe5))/0x5)+-parseInt(_0x5be84b(0xd4))/0x6*(parseInt(_0x5be84b(0xe1))/0x7)+parseInt(_0x5be84b(0xf4))/0x8*(-parseInt(_0x5be84b(0x137))/0x9)+parseInt(_0x5be84b(0xfc))/0xa+parseInt(_0x5be84b(0xfd))/0xb*(parseInt(_0x5be84b(0xd6))/0xc);if(_0x5679ec===_0x449cf8)break;else _0x25d5a7['push'](_0x25d5a7['shift']());}catch(_0x503b0e){_0x25d5a7['push'](_0x25d5a7['shift']());}}}(_0x3beb,0x57425));import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';function _0x5c41(_0x56e698,_0x3eb2fc){_0x56e698=_0x56e698-0xb8;const _0x3bebcf=_0x3beb();let _0x5c41d5=_0x3bebcf[_0x56e698];return _0x5c41d5;}import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x4c9aa9){'@babel/helpers - typeof';const _0x2d74c4=_0x5c41;return _typeof=_0x2d74c4(0xbc)==typeof Symbol&&'symbol'==typeof Symbol[_0x2d74c4(0x13a)]?function(_0x5b2b26){return typeof _0x5b2b26;}:function(_0x416bdc){const _0x1aee73=_0x2d74c4;return _0x416bdc&&_0x1aee73(0xbc)==typeof Symbol&&_0x416bdc[_0x1aee73(0xee)]===Symbol&&_0x416bdc!==Symbol[_0x1aee73(0xc6)]?_0x1aee73(0x154):typeof _0x416bdc;},_typeof(_0x4c9aa9);}function toPrimitive(_0x47537d,_0xaeaef9){const _0x1c12cb=_0x5c41;if(_0x1c12cb(0x142)!=_typeof(_0x47537d)||!_0x47537d)return _0x47537d;var _0x1740a6=_0x47537d[Symbol['toPrimitive']];if(void 0x0!==_0x1740a6){var _0x2c53ed=_0x1740a6[_0x1c12cb(0x14b)](_0x47537d,_0xaeaef9||'default');if(_0x1c12cb(0x142)!=_typeof(_0x2c53ed))return _0x2c53ed;throw new TypeError(_0x1c12cb(0xcc));}return(_0x1c12cb(0x115)===_0xaeaef9?String:Number)(_0x47537d);}function toPropertyKey(_0xd94bc1){const _0x2cbaa4=_0x5c41;var _0xf78962=toPrimitive(_0xd94bc1,_0x2cbaa4(0x115));return _0x2cbaa4(0x154)==_typeof(_0xf78962)?_0xf78962:_0xf78962+'';}function _defineProperty(_0x30d4d6,_0x398da7,_0x413a2e){const _0x2a4271=_0x5c41;return(_0x398da7=toPropertyKey(_0x398da7))in _0x30d4d6?Object[_0x2a4271(0xdf)](_0x30d4d6,_0x398da7,{'value':_0x413a2e,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x30d4d6[_0x398da7]=_0x413a2e,_0x30d4d6;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x4dc27=_0x5c41;super(),_defineProperty(this,_0x4dc27(0x12d),new Map()),_defineProperty(this,_0x4dc27(0x118),new Set()),_defineProperty(this,_0x4dc27(0xdc),new Set());}[_0x29362c(0x13c)](_0x541a67,_0x248a10,_0x413529){const _0x59f82c=_0x29362c,_0x46442d=new ShapeModel(_0x541a67,_0x248a10,_0x413529);this['_shapes'][_0x59f82c(0xff)](_0x248a10,_0x46442d);if(isConnectorShape(_0x541a67))this[_0x59f82c(0x118)][_0x59f82c(0xe4)](_0x248a10);return _0x46442d;}[_0x29362c(0x117)](_0x34684b){const _0x3eed6b=_0x29362c,_0x13e767=[];for(const _0x3d78d9 of this[_0x3eed6b(0x118)]){const _0xd85425=this[_0x3eed6b(0x12d)][_0x3eed6b(0x130)](_0x3d78d9);if(_0xd85425){const _0x1368cf=_0xd85425['getShapeRelation']();if(_0x1368cf){var _0x267b9c,_0xbc7e91;if(((_0x267b9c=_0x1368cf[_0x3eed6b(0xfb)])===null||_0x267b9c===void 0x0?void 0x0:_0x267b9c[_0x3eed6b(0xe9)])===_0x34684b)_0x13e767[_0x3eed6b(0xed)]({..._0x1368cf[_0x3eed6b(0xfb)],'lineShapeId':_0x3d78d9,'isFrom':!![]});if(((_0xbc7e91=_0x1368cf['to'])===null||_0xbc7e91===void 0x0?void 0x0:_0xbc7e91[_0x3eed6b(0xe9)])===_0x34684b)_0x13e767['push']({..._0x1368cf['to'],'lineShapeId':_0x3d78d9,'isFrom':![]});}}}return _0x13e767;}[_0x29362c(0x153)](_0x509906){const _0x4217db=_0x29362c,_0x5801b3=this[_0x4217db(0x12d)]['get'](_0x509906);if(_0x5801b3)return _0x5801b3[_0x4217db(0x14c)]();}[_0x29362c(0x12b)](_0x596739){const _0x5d4706=_0x29362c,_0x7cab1=this[_0x5d4706(0x12d)][_0x5d4706(0x130)](_0x596739);if(_0x7cab1)return _0x7cab1['getShapeType']();}[_0x29362c(0xe2)](_0x5736b4){const _0x2274c7=_0x29362c;return this['_shapes'][_0x2274c7(0x126)](_0x5736b4);}[_0x29362c(0xe6)](_0x3c8729){const _0x525090=_0x29362c,_0x1ee457=this[_0x525090(0x12d)][_0x525090(0x130)](_0x3c8729);if(!_0x1ee457)return;if(isConnectorShape(_0x1ee457['getShapeType']()))this['_linesIds'][_0x525090(0xc2)](_0x3c8729);this['_shapes'][_0x525090(0xc2)](_0x3c8729);}[_0x29362c(0x147)](){const _0x5ac23d=_0x29362c,_0x52bc88=[];return this[_0x5ac23d(0x12d)][_0x5ac23d(0x136)](_0x22d0ba=>{const _0x3ea3cb=_0x5ac23d;_0x52bc88['push'](_0x22d0ba[_0x3ea3cb(0x147)]());}),_0x52bc88;}[_0x29362c(0x119)](_0x39b291){const _0x523353=_0x29362c;for(const _0x24b441 of _0x39b291){const {id:_0x4b427e,shapeType:_0x48b96a}=_0x24b441,_0x1428ff=this[_0x523353(0x13c)](_0x48b96a,_0x4b427e,_0x24b441[_0x523353(0x127)]);if(_0x1428ff&&_0x1428ff[_0x523353(0xf2)]())this['_linesIds']['add'](_0x4b427e);}}[_0x29362c(0x10f)](){const _0x2a3e21=_0x29362c;if(this[_0x2a3e21(0x11b)])return;this[_0x2a3e21(0x12d)][_0x2a3e21(0x136)](_0x13164a=>{const _0x4e11c9=_0x2a3e21;_0x13164a[_0x4e11c9(0x10f)]();}),this[_0x2a3e21(0x12d)][_0x2a3e21(0x13e)](),this[_0x2a3e21(0x118)]['clear'](),this[_0x2a3e21(0xdc)]['clear'](),super[_0x2a3e21(0x10f)]();}};function __decorateParam(_0xcf8436,_0x5143cb){return function(_0x25e3a6,_0x2f4df6){_0x5143cb(_0x25e3a6,_0x2f4df6,_0xcf8436);};}function __decorate(_0x31ed8c,_0x309357,_0x301ad3,_0x20e823){const _0x41c907=_0x29362c;var _0x23aca7=arguments[_0x41c907(0xf0)],_0x5e12af=_0x23aca7<0x3?_0x309357:_0x20e823===null?_0x20e823=Object['getOwnPropertyDescriptor'](_0x309357,_0x301ad3):_0x20e823,_0x19533d;if(typeof Reflect===_0x41c907(0x142)&&typeof Reflect['decorate']===_0x41c907(0xbc))_0x5e12af=Reflect[_0x41c907(0xca)](_0x31ed8c,_0x309357,_0x301ad3,_0x20e823);else{for(var _0x45cf14=_0x31ed8c[_0x41c907(0xf0)]-0x1;_0x45cf14>=0x0;_0x45cf14--)if(_0x19533d=_0x31ed8c[_0x45cf14])_0x5e12af=(_0x23aca7<0x3?_0x19533d(_0x5e12af):_0x23aca7>0x3?_0x19533d(_0x309357,_0x301ad3,_0x5e12af):_0x19533d(_0x309357,_0x301ad3))||_0x5e12af;}return _0x23aca7>0x3&&_0x5e12af&&Object[_0x41c907(0xdf)](_0x309357,_0x301ad3,_0x5e12af),_0x5e12af;}const SHEET_SHAPE_PLUGIN=_0x29362c(0x10b);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x3caaa2){const _0x56353c=_0x29362c;super(),this[_0x56353c(0xe3)]=_0x3caaa2,_defineProperty(this,_0x56353c(0xe0),new Map()),this[_0x56353c(0x120)]();}[_0x29362c(0xde)](_0x1d3452,_0x392402){const _0x52d4ed=_0x29362c;let _0x923b84=this[_0x52d4ed(0xe0)][_0x52d4ed(0x130)](_0x1d3452);!_0x923b84&&(_0x923b84=new Map(),this[_0x52d4ed(0xe0)][_0x52d4ed(0xff)](_0x1d3452,_0x923b84));let _0x56fb73=_0x923b84[_0x52d4ed(0x130)](_0x392402);return!_0x56fb73&&(_0x56fb73=new SheetShapeModelManager(),_0x923b84[_0x52d4ed(0xff)](_0x392402,_0x56fb73)),_0x56fb73;}['insertShape'](_0x522570,_0x4788f2,_0x7853cf,_0x2cd408,_0x472af1){const _0x362695=_0x29362c;this[_0x362695(0xde)](_0x522570,_0x4788f2)[_0x362695(0x13c)](_0x7853cf,_0x2cd408,_0x472af1);}['removeShape'](_0x103aee,_0x19d5e5,_0x3008b1){const _0x2b84a3=_0x29362c;this['_ensureShapeModelManager'](_0x103aee,_0x19d5e5)[_0x2b84a3(0xe6)](_0x3008b1);}[_0x29362c(0x106)](_0x4ce094,_0x57a829,_0x3e5f5d){const _0x2a8772=_0x29362c;return this[_0x2a8772(0xde)](_0x4ce094,_0x57a829)[_0x2a8772(0x12b)](_0x3e5f5d);}[_0x29362c(0x12b)](_0x47ef51,_0x41981c,_0x3c5fb5){const _0x10d0b7=_0x29362c;return this[_0x10d0b7(0xde)](_0x47ef51,_0x41981c)['getShapeType'](_0x3c5fb5);}[_0x29362c(0xe2)](_0x468462,_0x414017,_0x548400){const _0x205b0f=_0x29362c;return this['_ensureShapeModelManager'](_0x468462,_0x414017)[_0x205b0f(0xe2)](_0x548400);}[_0x29362c(0xf7)](_0x261e80,_0x52c9ee,_0x50829c){const _0x59c579=_0x29362c;return this[_0x59c579(0xde)](_0x261e80,_0x52c9ee)[_0x59c579(0x12b)](_0x50829c);}[_0x29362c(0xeb)](_0x3dfbc9,_0x53adc3,_0x1c7fff){const _0x1e2edf=_0x29362c,_0xfbfd47=this[_0x1e2edf(0xde)](_0x3dfbc9,_0x53adc3);if(!_0xfbfd47[_0x1e2edf(0x12b)](_0x1c7fff))return;const _0x12655e=_0xfbfd47['_shapes'][_0x1e2edf(0x130)](_0x1c7fff);if(!_0x12655e)return;return _0x12655e[_0x1e2edf(0x10c)]();}[_0x29362c(0xf6)](_0x2e6398,_0x5e5416,_0x2e3a5d){const _0x38e09b=_0x29362c;return this[_0x38e09b(0xde)](_0x2e6398,_0x5e5416)['_shapes'][_0x38e09b(0x130)](_0x2e3a5d);}[_0x29362c(0x117)](_0x1e9677,_0x10aace,_0x5e259e){const _0x25bc3a=_0x29362c;return this[_0x25bc3a(0xde)](_0x1e9677,_0x10aace)[_0x25bc3a(0x117)](_0x5e259e);}['getLineShapeRelation'](_0x4569a1,_0x4a52a2,_0x3182bf){const _0x4bdc1e=_0x29362c,_0x4556cb=this[_0x4bdc1e(0xde)](_0x4569a1,_0x4a52a2)[_0x4bdc1e(0x12d)][_0x4bdc1e(0x130)](_0x3182bf);if(!_0x4556cb)return;return _0x4556cb[_0x4bdc1e(0x14c)]();}[_0x29362c(0x143)](){}[_0x29362c(0x131)](_0x271d83){const _0x4617d3=_0x29362c,_0x5b37f3={},_0x29da8a=this[_0x4617d3(0xe0)][_0x4617d3(0x130)](_0x271d83);if(_0x29da8a)_0x29da8a[_0x4617d3(0x136)]((_0x6373aa,_0x5f3954)=>{const _0x122e42=_0x4617d3,_0x2f4822=_0x6373aa[_0x122e42(0x147)]();if(_0x2f4822[_0x122e42(0xf0)]>0x0)_0x5b37f3[_0x5f3954]=_0x2f4822;});return JSON['stringify'](_0x5b37f3);}['_deserializeShapeForUnit'](_0x474596,_0x328632){const _0x167569=_0x29362c;Object[_0x167569(0x13f)](_0x328632)['forEach'](_0x2f6f7e=>{const _0x367a4f=_0x167569;this[_0x367a4f(0xde)](_0x474596,_0x2f6f7e)[_0x367a4f(0x119)](_0x328632[_0x2f6f7e]);});}['toJSON'](){const _0x47dbd7=_0x29362c,_0x5323b6={};return this[_0x47dbd7(0xe0)][_0x47dbd7(0x136)]((_0xbc0c8,_0xcdae5d)=>{const _0xe72dd1=_0x47dbd7;_0x5323b6[_0xcdae5d]={},_0xbc0c8[_0xe72dd1(0x136)]((_0x4a1373,_0x489e64)=>{const _0x4e4cf3=_0xe72dd1;_0x5323b6[_0xcdae5d][_0x489e64]=_0x4a1373[_0x4e4cf3(0x147)]();});}),_0x5323b6;}[_0x29362c(0x119)](_0x1678cd){const _0x22b415=_0x29362c;Object[_0x22b415(0x13f)](_0x1678cd)[_0x22b415(0x136)](_0x1918cd=>{const _0x1ad9d6=_0x22b415,_0x59e508=_0x1678cd[_0x1918cd];Object[_0x1ad9d6(0x13f)](_0x59e508)[_0x1ad9d6(0x136)](_0x4f970a=>{const _0x353727=_0x1ad9d6;this[_0x353727(0xde)](_0x1918cd,_0x4f970a)[_0x353727(0x119)](_0x59e508[_0x4f970a]);});});}[_0x29362c(0x120)](){const _0x3720e=_0x29362c;this[_0x3720e(0xe3)][_0x3720e(0x149)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType[_0x3720e(0x109)]],'toJson':_0x169639=>this[_0x3720e(0x131)](_0x169639),'parseJson':_0x268a88=>JSON[_0x3720e(0x10a)](_0x268a88),'onLoad':(_0x5078e5,_0x2b7702)=>{const _0xec3893=_0x3720e;this[_0xec3893(0x14e)](_0x5078e5,_0x2b7702);},'onUnLoad':_0x3a84f3=>{const _0x54ea20=_0x3720e,_0xce6002=this[_0x54ea20(0xe0)]['get'](_0x3a84f3);_0xce6002&&(_0xce6002[_0x54ea20(0x136)](_0x4be9a3=>{_0x4be9a3['dispose']();}),this['_shapeModelManagerMap'][_0x54ea20(0xc2)](_0x3a84f3));}});}[_0x29362c(0x10f)](){const _0x18d0ea=_0x29362c;this[_0x18d0ea(0xe0)][_0x18d0ea(0x136)](_0x51922c=>{_0x51922c['forEach'](_0x47a7d5=>{_0x47a7d5['dispose']();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':_0x29362c(0x105),'type':CommandType[_0x29362c(0xfe)],'handler':(_0x3070b5,_0x387a31)=>{const _0x21bca4=_0x29362c,{unitId:_0x1c15f3,subUnitId:_0x5656eb,shapeType:_0x49beba,shapeId:_0x56563e,shapeData:_0x8266b7}=_0x387a31;return _0x3070b5[_0x21bca4(0x130)](SheetsShapeService)[_0x21bca4(0xda)](_0x1c15f3,_0x5656eb,_0x49beba,_0x56563e,_0x8266b7),!![];}},RemoveSheetsShapeMutation={'id':'sheet.mutation.remove-shape','type':CommandType[_0x29362c(0xfe)],'handler':(_0x393eb5,_0x407d68)=>{const _0x5daaed=_0x29362c,{unitId:_0x27cfd4,subUnitId:_0x2d85fd,shapeId:_0x33b160}=_0x407d68;return _0x393eb5[_0x5daaed(0x130)](SheetsShapeService)['removeShape'](_0x27cfd4,_0x2d85fd,_0x33b160),!![];}},InsertShapeCommand={'type':CommandType['COMMAND'],'id':_0x29362c(0xd8),'handler':(_0xfa7e0e,_0x1b7a24)=>{const _0x25f623=_0x29362c;var _0x16b9dd,_0x5b8223;const _0x579317=getSheetCommandTarget(_0xfa7e0e[_0x25f623(0x130)](IUniverInstanceService),_0x1b7a24);if(!_0x579317)return![];const _0x33633e=_0xfa7e0e[_0x25f623(0x130)](SheetSkeletonService),{unitId:_0x5d96cd,subUnitId:_0x19749a}=_0x579317,_0x5bf944=_0x33633e[_0x25f623(0xdb)](_0x5d96cd,_0x19749a);if(!_0x5bf944)return![];const _0x194d6a=_0xfa7e0e[_0x25f623(0x130)](ICommandService),_0x1e0cb7=_0xfa7e0e[_0x25f623(0x130)](IUndoRedoService),_0x3a68af=_0xfa7e0e[_0x25f623(0x130)](SheetInterceptorService),_0x218f78=_0xfa7e0e[_0x25f623(0x130)](ISheetDrawingService),{shapeType:_0x1c592a,shapeData:_0x5ea4d9}=_0x1b7a24,_0x26d615=_0x1b7a24[_0x25f623(0xe9)]||generateRandomId(),_0x35736f={'unitId':_0x5d96cd,'subUnitId':_0x19749a,'shapeId':_0x26d615,'shapeType':_0x1c592a,'shapeData':_0x5ea4d9},_0x570487=_0x1b7a24[_0x25f623(0xc8)]||0xc8,_0x187610=_0x1b7a24['height']||0xc8;let _0x1f6731=0x0,_0x301c76=0x0,_0x2272be={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x59457e={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x1b7a24[_0x25f623(0x146)]){const {x:_0x50eb21,y:_0x4f690a}=_0x1b7a24[_0x25f623(0x146)];_0x1f6731=_0x50eb21,_0x301c76=_0x4f690a,_0x2272be=_0x5bf944[_0x25f623(0x102)](_0x50eb21,_0x4f690a),_0x59457e=_0x5bf944[_0x25f623(0x102)](_0x50eb21+_0x570487,_0x4f690a+_0x187610);}else{if(_0x1b7a24[_0x25f623(0x103)]){const {startRow:_0x139f70,startColumn:_0x222baa}=_0x1b7a24[_0x25f623(0x103)],_0xeecda=0xa,_0x2710d1=0xa;_0x2272be={'row':_0x139f70,'rowOffset':_0xeecda,'column':_0x222baa,'columnOffset':_0x2710d1};const _0x16ad55=_0x5bf944['getCellWithCoordByIndex'](_0x139f70,_0x222baa);_0x1f6731=_0x16ad55['startX']+_0x2710d1,_0x301c76=_0x16ad55['startY']+_0xeecda,_0x59457e=_0x5bf944['getCellIndexAndOffsetByPosition'](_0x1f6731+_0x570487,_0x301c76+_0x187610);}}const _0x4dda76={'from':_0x2272be,'to':_0x59457e},_0x269832={'unitId':_0x5d96cd,'subUnitId':_0x19749a,'drawingId':_0x26d615,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x4dda76,'transform':{'left':_0x1f6731,'top':_0x301c76,'width':_0x570487,'height':_0x187610},'data':{'shapeType':_0x1c592a,'shapeData':_0x5ea4d9},'axisAlignSheetTransform':_0x4dda76,'allowTransform':!![]};isConnectorShape(_0x1c592a)&&(_0x269832[_0x25f623(0xc1)][_0x25f623(0x12f)]=![],_0x269832['data'][_0x25f623(0xc9)]=![],_0x269832[_0x25f623(0xc1)][_0x25f623(0xc3)]=![],_0x269832[_0x25f623(0xc1)][_0x25f623(0xc7)]=![],_0x269832[_0x25f623(0x13b)]['rotateEnabled']=![],_0x269832[_0x25f623(0x13b)][_0x25f623(0xc3)]=![],_0x269832[_0x25f623(0x13b)][_0x25f623(0xc7)]=![]);const {undo:_0x432471,redo:_0x10b83b,objects:_0x50c0e6}=_0x218f78[_0x25f623(0x101)]([_0x269832]),_0x15661a=_0x3a68af[_0x25f623(0xea)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x5d96cd,'drawings':[_0x269832]}}),_0x11739c=[...(_0x16b9dd=_0x15661a[_0x25f623(0x128)])!==null&&_0x16b9dd!==void 0x0?_0x16b9dd:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'op':_0x10b83b,'objects':_0x50c0e6,'type':DrawingApplyType[_0x25f623(0x121)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5d96cd]},..._0x15661a['redos'],{'id':InsertSheetsShapeMutation['id'],'params':_0x35736f}],_0x32ec73=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'shapeId':_0x26d615}},...(_0x5b8223=_0x15661a[_0x25f623(0xdd)])!==null&&_0x5b8223!==void 0x0?_0x5b8223:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x5d96cd,'subUnitId':_0x19749a,'op':_0x432471,'objects':_0x50c0e6,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x5d96cd]},..._0x15661a[_0x25f623(0x11d)]];if(sequenceExecute(_0x11739c,_0x194d6a))return _0x1e0cb7['pushUndoRedo']({'unitID':_0x5d96cd,'undoMutations':_0x32ec73,'redoMutations':_0x11739c}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':_0x29362c(0xcf),'type':CommandType['MUTATION'],'handler':(_0x4278a5,_0x44cb08)=>{const _0x3f215d=_0x29362c,{unitId:_0x33f2b1,subUnitId:_0x20c4f5,shapeType:_0x3c0c8e,shapeId:_0x296daa,shapeData:_0x3baad3}=_0x44cb08,_0x3ec7f5=_0x4278a5[_0x3f215d(0x130)](SheetsShapeService)[_0x3f215d(0xf6)](_0x33f2b1,_0x20c4f5,_0x296daa);if(_0x3ec7f5){if(_0x3c0c8e!==void 0x0)_0x3ec7f5[_0x3f215d(0x143)](_0x3c0c8e);if(_0x3baad3)_0x3ec7f5===null||_0x3ec7f5===void 0x0||_0x3ec7f5['setShapeData'](_0x3baad3,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType['COMMAND'],'id':'sheet.command.set-shape-drawing-data','handler':(_0x4ce1e9,_0x31cc5b)=>{const _0x275cf7=_0x29362c;var _0x53fad9,_0x223bdb;const _0x34fd6c=getSheetCommandTarget(_0x4ce1e9[_0x275cf7(0x130)](IUniverInstanceService),_0x31cc5b);if(!_0x34fd6c)return![];const _0x514af6=_0x4ce1e9[_0x275cf7(0x130)](SheetSkeletonService),{unitId:_0x213722,subUnitId:_0x807364}=_0x34fd6c,_0xb877cd=_0x514af6[_0x275cf7(0xdb)](_0x213722,_0x807364);if(!_0xb877cd)return![];const _0x4d4b8f=_0x4ce1e9[_0x275cf7(0x130)](SheetsShapeService),{shapeId:_0x4521e6,shapeType:_0x2873c5,shapeData:_0x66623e,position:_0x5cbb5d,width:_0x577323,height:_0xa102ad}=_0x31cc5b,_0x19e200=_0x4d4b8f['getShapeModel'](_0x213722,_0x807364,_0x4521e6);if(!_0x19e200)return![];const _0xfead06=_0x4ce1e9[_0x275cf7(0x130)](ICommandService),_0x4652be=_0x4ce1e9[_0x275cf7(0x130)](IUndoRedoService),_0x323c00=_0x4ce1e9[_0x275cf7(0x130)](SheetInterceptorService),_0x442d10=_0x4ce1e9[_0x275cf7(0x130)](ISheetDrawingService),_0x477de1={'unitId':_0x213722,'subUnitId':_0x807364,'shapeId':_0x4521e6,'shapeType':_0x2873c5,'shapeData':_0x66623e},_0x48cf02=_0x19e200[_0x275cf7(0x12b)](),_0x58022f=_0x19e200['getShapeData'](),{x:_0x294bde,y:_0x403489}=_0x5cbb5d,_0x5ab0cb={'from':_0xb877cd['getCellIndexAndOffsetByPosition'](_0x294bde,_0x403489),'to':_0xb877cd[_0x275cf7(0x102)](_0x294bde+_0x577323,_0x403489+_0xa102ad)},_0x5ca7d1={'unitId':_0x213722,'subUnitId':_0x807364,'drawingId':_0x4521e6,'drawingType':DrawingTypeEnum[_0x275cf7(0x152)],'sheetTransform':_0x5ab0cb,'transform':{'left':_0x294bde,'top':_0x403489,'width':_0x577323,'height':_0xa102ad},'data':{'shapeType':_0x2873c5,'shapeData':_0x66623e},'axisAlignSheetTransform':_0x5ab0cb,'allowTransform':!![]};isConnectorShape(_0x2873c5)&&(_0x5ca7d1['data'][_0x275cf7(0x12f)]=![],_0x5ca7d1['data'][_0x275cf7(0xc9)]=![],_0x5ca7d1[_0x275cf7(0xc1)][_0x275cf7(0xc3)]=![],_0x5ca7d1[_0x275cf7(0xc1)][_0x275cf7(0xc7)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc9)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc3)]=![],_0x5ca7d1[_0x275cf7(0x13b)][_0x275cf7(0xc7)]=![]);const {undo:_0x2a6a0d,redo:_0x10da6b,objects:_0x3aeba4}=_0x442d10[_0x275cf7(0x11c)]([_0x5ca7d1]),_0x32ac06=_0x323c00[_0x275cf7(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x213722,'drawings':[_0x5ca7d1]}}),_0x3d4af0=[...(_0x53fad9=_0x32ac06[_0x275cf7(0x128)])!==null&&_0x53fad9!==void 0x0?_0x53fad9:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'op':_0x10da6b,'objects':_0x3aeba4,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x213722]},..._0x32ac06[_0x275cf7(0xcd)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x477de1}],_0x331c20=[...(_0x223bdb=_0x32ac06[_0x275cf7(0xdd)])!==null&&_0x223bdb!==void 0x0?_0x223bdb:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'op':_0x2a6a0d,'objects':_0x3aeba4,'type':DrawingApplyType[_0x275cf7(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x213722]},..._0x32ac06['undos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x213722,'subUnitId':_0x807364,'shapeType':_0x48cf02,'shapeId':_0x4521e6,'shapeData':_0x58022f}}];if(sequenceExecute(_0x3d4af0,_0xfead06))return _0x4652be[_0x275cf7(0xf5)]({'unitID':_0x213722,'undoMutations':_0x331c20,'redoMutations':_0x3d4af0}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType['COMMAND'],'id':_0x29362c(0x135),'handler':(_0x5b7bdf,_0x795913)=>{const _0x348acc=_0x29362c;var _0x1a3b1d,_0x2efe83;const _0x3b4ae3=getSheetCommandTarget(_0x5b7bdf[_0x348acc(0x130)](IUniverInstanceService),_0x795913);if(!_0x3b4ae3)return![];const _0x1cf4f9=_0x5b7bdf[_0x348acc(0x130)](SheetSkeletonService),{unitId:_0x2d4d10,subUnitId:_0x25f0e0}=_0x3b4ae3,_0x174664=_0x1cf4f9[_0x348acc(0x145)](_0x2d4d10,_0x25f0e0);if(!_0x174664)return![];const _0x1c3fc6=_0x5b7bdf[_0x348acc(0x130)](ISheetDrawingService),{shapeId:_0x36c1e1,flipH:_0x2adfd4,flipV:_0x35aff2}=_0x795913,_0x315d3a=_0x1c3fc6['getDrawingByParam']({'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'drawingId':_0x36c1e1});if(!_0x315d3a)return![];const _0x3a4f2d=_0x5b7bdf[_0x348acc(0x130)](SheetsShapeService)[_0x348acc(0xf6)](_0x2d4d10,_0x25f0e0,_0x36c1e1);if(!_0x3a4f2d)return![];const _0xef3e55=_0x5b7bdf[_0x348acc(0x130)](ICommandService),_0x24de29=_0x5b7bdf[_0x348acc(0x130)](IUndoRedoService),_0x53e351=_0x5b7bdf[_0x348acc(0x130)](SheetInterceptorService),_0x20200f={..._0x315d3a[_0x348acc(0x13b)]};if(_0x2adfd4!==void 0x0)_0x20200f[_0x348acc(0x14f)]=!_0x20200f['flipX'];if(_0x35aff2!==void 0x0)_0x20200f[_0x348acc(0x14a)]=!_0x20200f[_0x348acc(0x14a)];const _0xf54611=transformToDrawingPosition(_0x20200f,_0x174664),_0x30b366=transformToAxisAlignPosition(_0x20200f,_0x174664),_0x2191c9=_0x3a4f2d[_0x348acc(0x12b)](),_0x44d0e0=_0x3a4f2d[_0x348acc(0x10c)](),_0x53405c={'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'drawingId':_0x36c1e1,'drawingType':DrawingTypeEnum[_0x348acc(0x152)],'sheetTransform':_0xf54611,'transform':_0x20200f,'data':{'shapeType':_0x2191c9,'shapeData':_0x44d0e0},'axisAlignSheetTransform':_0x30b366,'allowTransform':!![]},{undo:_0x2a43cf,redo:_0x34dad4,objects:_0x5ebf20}=_0x1c3fc6['getBatchUpdateOp']([_0x53405c]),_0x4858ac=_0x53e351[_0x348acc(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x2d4d10,'drawings':[_0x53405c]}}),_0x2bd079=[...(_0x1a3b1d=_0x4858ac[_0x348acc(0x128)])!==null&&_0x1a3b1d!==void 0x0?_0x1a3b1d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'op':_0x34dad4,'objects':_0x5ebf20,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2d4d10]},..._0x4858ac[_0x348acc(0xcd)]],_0x2d3075=[...(_0x2efe83=_0x4858ac[_0x348acc(0xdd)])!==null&&_0x2efe83!==void 0x0?_0x2efe83:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'op':_0x2a43cf,'objects':_0x5ebf20,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2d4d10]},..._0x4858ac[_0x348acc(0x11d)]];if(isConnectorShape(_0x2191c9)){const _0x128ab4=_0x3a4f2d[_0x348acc(0x14c)]();if(_0x128ab4){const _0x2abcb2={..._0x128ab4};_0x2abcb2[_0x348acc(0xfb)]=void 0x0,_0x2abcb2['to']=void 0x0,_0x2bd079[_0x348acc(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'shapeId':_0x36c1e1,'shapeType':_0x2191c9,'shapeData':{'relation':_0x2abcb2}}}),_0x2d3075[_0x348acc(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x2d4d10,'subUnitId':_0x25f0e0,'shapeId':_0x36c1e1,'shapeType':_0x2191c9,'shapeData':{'relation':_0x128ab4}}});}}if(sequenceExecute(_0x2bd079,_0xef3e55))return _0x24de29[_0x348acc(0xf5)]({'unitID':_0x2d4d10,'undoMutations':_0x2d3075,'redoMutations':_0x2bd079}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0xf3),'handler':(_0x344c95,_0x419449)=>{const _0x544f88=_0x29362c;var _0x1ca0bd,_0x42669d;const _0x51c589=getSheetCommandTarget(_0x344c95[_0x544f88(0x130)](IUniverInstanceService),_0x419449);if(!_0x51c589)return![];const _0x9e32d3=_0x344c95[_0x544f88(0x130)](SheetSkeletonService),{unitId:_0x12a735,subUnitId:_0x4afb5b}=_0x51c589,_0x41d3eb=_0x9e32d3[_0x544f88(0x145)](_0x12a735,_0x4afb5b);if(!_0x41d3eb)return![];const _0x41e888=_0x344c95[_0x544f88(0x130)](ISheetDrawingService),{shapeId:_0x4c9227,rotate:_0x42a12f}=_0x419449,_0x813090=_0x41e888[_0x544f88(0xc5)]({'unitId':_0x12a735,'subUnitId':_0x4afb5b,'drawingId':_0x4c9227});if(!_0x813090)return![];const _0x1e6035=_0x344c95[_0x544f88(0x130)](SheetsShapeService)[_0x544f88(0xf6)](_0x12a735,_0x4afb5b,_0x4c9227);if(!_0x1e6035)return![];const _0x2df2de=_0x344c95[_0x544f88(0x130)](ICommandService),_0x44ea75=_0x344c95[_0x544f88(0x130)](IUndoRedoService),_0x20f0ef=_0x344c95[_0x544f88(0x130)](SheetInterceptorService),_0x215477={..._0x813090['transform']};if(_0x42a12f!==void 0x0)_0x215477['angle']=(_0x215477[_0x544f88(0x134)]||0x0)+_0x42a12f;const _0x15e2f1=transformToDrawingPosition(_0x215477,_0x41d3eb),_0x1f8019=transformToAxisAlignPosition(_0x215477,_0x41d3eb),_0x18c24e=_0x1e6035[_0x544f88(0x12b)](),_0x323c6b=_0x1e6035['getShapeData'](),_0x4e2e02={'unitId':_0x12a735,'subUnitId':_0x4afb5b,'drawingId':_0x4c9227,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x15e2f1,'transform':_0x215477,'data':{'shapeType':_0x18c24e,'shapeData':_0x323c6b},'axisAlignSheetTransform':_0x1f8019,'allowTransform':!![]},{undo:_0x366832,redo:_0x3ac9a0,objects:_0x15ef57}=_0x41e888['getBatchUpdateOp']([_0x4e2e02]),_0x2cf90c=_0x20f0ef[_0x544f88(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x12a735,'drawings':[_0x4e2e02]}}),_0x4fa956=[...(_0x1ca0bd=_0x2cf90c[_0x544f88(0x128)])!==null&&_0x1ca0bd!==void 0x0?_0x1ca0bd:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x12a735,'subUnitId':_0x4afb5b,'op':_0x3ac9a0,'objects':_0x15ef57,'type':DrawingApplyType[_0x544f88(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x12a735]},..._0x2cf90c['redos']],_0xebc8ca=[...(_0x42669d=_0x2cf90c[_0x544f88(0xdd)])!==null&&_0x42669d!==void 0x0?_0x42669d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x12a735,'subUnitId':_0x4afb5b,'op':_0x366832,'objects':_0x15ef57,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x12a735]},..._0x2cf90c['undos']];if(sequenceExecute(_0x4fa956,_0x2df2de))return _0x44ea75['pushUndoRedo']({'unitID':_0x12a735,'undoMutations':_0xebc8ca,'redoMutations':_0x4fa956}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x14d),'handler':(_0x3ddade,_0xdbdec8)=>{const _0x259b91=_0x29362c;var _0x21909e;const _0x558164=getSheetCommandTarget(_0x3ddade[_0x259b91(0x130)](IUniverInstanceService),_0xdbdec8);if(!_0x558164)return![];const {unitId:_0x2d7119,subUnitId:_0x141b8c}=_0x558164,{shapeId:_0x2c6847}=_0xdbdec8,_0x37615e=_0x3ddade[_0x259b91(0x130)](SheetsShapeService)['getShapeModel'](_0x2d7119,_0x141b8c,_0x2c6847);if(!_0x37615e)return![];const _0x599a8a=_0x37615e[_0x259b91(0x10e)](),_0x362dc7=(_0x21909e=_0x599a8a===null||_0x599a8a===void 0x0?void 0x0:_0x599a8a[_0x259b91(0x100)])!==null&&_0x21909e!==void 0x0?_0x21909e:!![],_0x1295b5=!_0x362dc7,_0x5c2ccc=_0x3ddade[_0x259b91(0x130)](ICommandService),_0x1440e9=_0x3ddade[_0x259b91(0x130)](IUndoRedoService),_0x1f2985={'unitId':_0x2d7119,'subUnitId':_0x141b8c,'shapeId':_0x2c6847,'shapeData':{'shapeText':{'isHorizontal':_0x1295b5}}},_0xf4cae9={'unitId':_0x2d7119,'subUnitId':_0x141b8c,'shapeId':_0x2c6847,'shapeData':{'shapeText':{'isHorizontal':_0x362dc7}}},_0x2fe501=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x1f2985}],_0x39754c=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0xf4cae9}];if(sequenceExecute(_0x2fe501,_0x5c2ccc))return _0x1440e9['pushUndoRedo']({'unitID':_0x2d7119,'undoMutations':_0x39754c,'redoMutations':_0x2fe501}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x132),'handler':(_0x430658,_0x572ec9)=>{const _0x278b17=_0x29362c;var _0x43609d,_0xdc9b05,_0x297d34,_0x2ef89b;const _0x39fda9=getSheetCommandTarget(_0x430658[_0x278b17(0x130)](IUniverInstanceService),_0x572ec9);if(!_0x39fda9)return![];const _0x179d1b=_0x430658['get'](SheetSkeletonService),{unitId:_0xb7c1e3,subUnitId:_0x3ae862}=_0x39fda9,_0x37504d=_0x179d1b[_0x278b17(0x145)](_0xb7c1e3,_0x3ae862);if(!_0x37504d)return![];const _0x134130=_0x430658[_0x278b17(0x130)](ISheetDrawingService),{connectorShapeId:_0xa7e3f4,width:_0x29d3e5,height:_0x1bcab6,left:_0x2b9067,top:_0x493b1f,flipX:_0x412fd5,flipY:_0x3b765e,rotation:_0x4d1c4f,oldAdjustValues:_0x32edc4,newAdjustValues:_0x20f541,oldLineType:_0x8255a6,newLineType:_0x5332d6,oldRelation:_0x38be44,newRelation:_0x5a01c6}=_0x572ec9,_0x5b2482=_0x134130['getDrawingByParam']({'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'drawingId':_0xa7e3f4});if(!_0x5b2482)return![];const _0x4c5b4e=_0x430658['get'](SheetsShapeService)[_0x278b17(0xf6)](_0xb7c1e3,_0x3ae862,_0xa7e3f4);if(!_0x4c5b4e)return![];const _0x1bd9ed=_0x430658['get'](ICommandService),_0x55e65d=_0x430658[_0x278b17(0x130)](IUndoRedoService),_0x6eb173=_0x430658[_0x278b17(0x130)](SheetInterceptorService),_0x5c5d16={..._0x5b2482[_0x278b17(0x13b)],'width':_0x29d3e5,'height':_0x1bcab6,'left':_0x2b9067,'top':_0x493b1f,'flipX':_0x412fd5,'flipY':_0x3b765e,'angle':(_0x43609d=_0x4d1c4f!==null&&_0x4d1c4f!==void 0x0?_0x4d1c4f:(_0xdc9b05=_0x5b2482[_0x278b17(0x13b)])===null||_0xdc9b05===void 0x0?void 0x0:_0xdc9b05[_0x278b17(0x134)])!==null&&_0x43609d!==void 0x0?_0x43609d:0x0},_0x294ff5=transformToDrawingPosition(_0x5c5d16,_0x37504d),_0x1bbc9e=transformToAxisAlignPosition(_0x5c5d16,_0x37504d),_0x424d62=_0x4c5b4e[_0x278b17(0x12b)](),_0x28d28f=_0x4c5b4e[_0x278b17(0x10c)](),_0x16452d={'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'drawingId':_0xa7e3f4,'drawingType':DrawingTypeEnum[_0x278b17(0x152)],'sheetTransform':_0x294ff5,'transform':_0x5c5d16,'data':{'shapeType':_0x5332d6||_0x8255a6||_0x424d62,'shapeData':{..._0x28d28f,'adjustValues':_0x20f541||_0x32edc4||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f[_0x278b17(0x108)]),'relation':_0x5a01c6||_0x38be44||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f['relation'])}},'axisAlignSheetTransform':_0x1bbc9e,'allowTransform':!![]},{undo:_0x7cc7f2,redo:_0x2e398d,objects:_0x2ed0b1}=_0x134130[_0x278b17(0x11c)]([_0x16452d]),_0x406335=_0x6eb173[_0x278b17(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0xb7c1e3,'drawings':[_0x16452d]}}),_0x46bca3=[...(_0x297d34=_0x406335['preRedos'])!==null&&_0x297d34!==void 0x0?_0x297d34:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'op':_0x2e398d,'objects':_0x2ed0b1,'type':DrawingApplyType[_0x278b17(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0xb7c1e3]},..._0x406335['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'shapeId':_0xa7e3f4,'shapeType':_0x5332d6,'shapeData':{'adjustValues':_0x20f541,'relation':_0x5a01c6}}}],_0x3e9c7b=[...(_0x2ef89b=_0x406335[_0x278b17(0xdd)])!==null&&_0x2ef89b!==void 0x0?_0x2ef89b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'op':_0x7cc7f2,'objects':_0x2ed0b1,'type':DrawingApplyType[_0x278b17(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0xb7c1e3]},..._0x406335['undos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xb7c1e3,'subUnitId':_0x3ae862,'shapeId':_0xa7e3f4,'shapeType':_0x424d62,'shapeData':{..._0x28d28f,'adjustValues':_0x32edc4||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f[_0x278b17(0x108)]),'relation':_0x38be44||(_0x28d28f===null||_0x28d28f===void 0x0?void 0x0:_0x28d28f['relation'])}}}];if(sequenceExecute(_0x46bca3,_0x1bd9ed))return _0x55e65d[_0x278b17(0xf5)]({'unitID':_0xb7c1e3,'undoMutations':_0x3e9c7b,'redoMutations':_0x46bca3}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0x29362c(0x150)],'id':_0x29362c(0x113),'handler':(_0xbf2b88,_0x41d1e4)=>{const _0x4b67f4=_0x29362c;var _0x4c974a,_0x32c221;const _0x514b56=getSheetCommandTarget(_0xbf2b88[_0x4b67f4(0x130)](IUniverInstanceService),_0x41d1e4);if(!_0x514b56)return![];const _0x2bf110=_0xbf2b88[_0x4b67f4(0x130)](SheetSkeletonService),{unitId:_0x35e646,subUnitId:_0x49784d}=_0x514b56,_0x20eaee=_0x2bf110[_0x4b67f4(0x145)](_0x35e646,_0x49784d);if(!_0x20eaee)return![];const _0x51d891=_0xbf2b88['get'](ISheetDrawingService),{shapeId:_0x1e8651,width:_0x4b5ce8,height:_0x472531,left:_0x2f15e2,top:_0x4dd666,flipX:_0x184d91,flipY:_0x3cba55,angle:_0x1f2d42,oldAdjustValues:_0x46ae1d,newAdjustValues:_0x4a5962,oldLineType:_0x183502,newLineType:_0x9cc689}=_0x41d1e4,_0x4524a9=_0x51d891[_0x4b67f4(0xc5)]({'unitId':_0x35e646,'subUnitId':_0x49784d,'drawingId':_0x1e8651});if(!_0x4524a9)return![];const _0x4db404=_0xbf2b88['get'](SheetsShapeService)[_0x4b67f4(0xf6)](_0x35e646,_0x49784d,_0x1e8651);if(!_0x4db404)return![];const _0x8ed6d6=_0xbf2b88[_0x4b67f4(0x130)](ICommandService),_0x4effec=_0xbf2b88[_0x4b67f4(0x130)](IUndoRedoService),_0x5ca586=_0xbf2b88[_0x4b67f4(0x130)](SheetInterceptorService),_0xbfd355={..._0x4524a9[_0x4b67f4(0x13b)],'width':_0x4b5ce8,'height':_0x472531,'left':_0x2f15e2,'top':_0x4dd666,'flipX':_0x184d91,'flipY':_0x3cba55,'angle':_0x1f2d42},_0x5877fb=transformToDrawingPosition(_0xbfd355,_0x20eaee),_0x37c620=transformToAxisAlignPosition(_0xbfd355,_0x20eaee),_0x5f5130=_0x4db404['getShapeType'](),_0x1a13a0=_0x4db404[_0x4b67f4(0x10c)](),_0x512945={'unitId':_0x35e646,'subUnitId':_0x49784d,'drawingId':_0x1e8651,'drawingType':DrawingTypeEnum[_0x4b67f4(0x152)],'sheetTransform':_0x5877fb,'transform':_0xbfd355,'data':{'shapeType':_0x9cc689||_0x183502||_0x5f5130,'shapeData':{..._0x1a13a0,'adjustValues':_0x4a5962||_0x46ae1d||(_0x1a13a0===null||_0x1a13a0===void 0x0?void 0x0:_0x1a13a0['adjustValues'])}},'axisAlignSheetTransform':_0x37c620,'allowTransform':!![]},{undo:_0x3eb377,redo:_0x43e2fb,objects:_0x222af9}=_0x51d891['getBatchUpdateOp']([_0x512945]),_0x254d10=_0x5ca586[_0x4b67f4(0xea)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x35e646,'drawings':[_0x512945]}}),_0xcefa4a=[...(_0x4c974a=_0x254d10[_0x4b67f4(0x128)])!==null&&_0x4c974a!==void 0x0?_0x4c974a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'op':_0x43e2fb,'objects':_0x222af9,'type':DrawingApplyType[_0x4b67f4(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35e646]},..._0x254d10['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'shapeId':_0x1e8651,'shapeType':_0x9cc689,'shapeData':{'adjustValues':_0x4a5962}}}],_0x542f8c=[...(_0x32c221=_0x254d10['preUndos'])!==null&&_0x32c221!==void 0x0?_0x32c221:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'op':_0x3eb377,'objects':_0x222af9,'type':DrawingApplyType[_0x4b67f4(0x141)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35e646]},..._0x254d10[_0x4b67f4(0x11d)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x35e646,'subUnitId':_0x49784d,'shapeId':_0x1e8651,'shapeType':_0x5f5130,'shapeData':{..._0x1a13a0,'adjustValues':_0x46ae1d||(_0x1a13a0===null||_0x1a13a0===void 0x0?void 0x0:_0x1a13a0['adjustValues'])}}}];if(sequenceExecute(_0xcefa4a,_0x8ed6d6))return _0x4effec[_0x4b67f4(0xf5)]({'unitID':_0x35e646,'undoMutations':_0x542f8c,'redoMutations':_0xcefa4a}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x29362c(0x112),'type':CommandType['MUTATION'],'handler':(_0x514d6b,_0x4cd122)=>{const _0x5a96c8=_0x29362c,{unitId:_0x5d1b18,subUnitId:_0xacfbe0,shapeType:_0x31ab0f,shapeId:_0x30658d,shapeData:_0x358ef8}=_0x4cd122,_0x144e1c=_0x514d6b['get'](SheetsShapeService)[_0x5a96c8(0xf6)](_0x5d1b18,_0xacfbe0,_0x30658d);if(_0x144e1c){_0x144e1c['setShapeType'](_0x31ab0f);if(_0x358ef8)_0x144e1c===null||_0x144e1c===void 0x0||_0x144e1c[_0x5a96c8(0xf9)](_0x358ef8);}return!![];}},UpdateSheetsShapeTypeCommand={'id':'sheet.command.update-shape-type','type':CommandType[_0x29362c(0x150)],'handler':(_0x5202d8,_0x2d69a0)=>{const _0x4b9e73=_0x29362c;if(!_0x2d69a0)return![];const _0x2a50bd=_0x5202d8[_0x4b9e73(0x130)](ICommandService),_0x309a05=_0x5202d8[_0x4b9e73(0x130)](SheetsShapeService),_0x2db40b=_0x5202d8[_0x4b9e73(0x130)](IUndoRedoService),_0x43e3e6=[],_0x4557a2=[],{unitId:_0x44bb41,subUnitId:_0x57ec5e,shapeId:_0x25cf7b,shapeType:_0x5f8f6c,shapeData:_0x21bc90}=_0x2d69a0,_0x119cdf=_0x309a05[_0x4b9e73(0xf6)](_0x44bb41,_0x57ec5e,_0x25cf7b);if(_0x119cdf){const _0x5c2329=_0x119cdf[_0x4b9e73(0x12b)](),_0x4b37ce=Object[_0x4b9e73(0xcb)]({},_0x119cdf[_0x4b9e73(0x10c)]()),_0x541304={'unitId':_0x44bb41,'subUnitId':_0x57ec5e,'shapeId':_0x25cf7b,'shapeType':_0x5f8f6c,'shapeData':_0x21bc90},_0x3dd53d={'unitId':_0x44bb41,'subUnitId':_0x57ec5e,'shapeId':_0x25cf7b,'shapeType':_0x5c2329,'shapeData':_0x4b37ce};_0x43e3e6[_0x4b9e73(0xed)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x541304}),_0x4557a2[_0x4b9e73(0xed)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3dd53d});if(_0x43e3e6[_0x4b9e73(0x12c)](_0x316233=>_0x2a50bd[_0x4b9e73(0xbe)](_0x316233['id'],_0x316233[_0x4b9e73(0x11e)])))_0x2db40b['pushUndoRedo']({'unitID':_0x44bb41,'redoMutations':[..._0x43e3e6],'undoMutations':[..._0x4557a2]});return!![];}return![];}};var name=_0x29362c(0xd3),version=_0x29362c(0xba);const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0x29362c(0xec),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x46857e,_0x31a945,_0x384908,_0x4c016b,_0x528ffa){const _0x5476e4=_0x29362c;super(),this['_commandService']=_0x46857e,this[_0x5476e4(0x144)]=_0x31a945,this[_0x5476e4(0xef)]=_0x384908,this[_0x5476e4(0xe7)]=_0x4c016b,this['_drawingManagerService']=_0x528ffa,this[_0x5476e4(0x123)](),this[_0x5476e4(0xf8)]();}[_0x29362c(0x123)](){const _0x96a29b=_0x29362c;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0x96a29b(0x136)](_0x51e79a=>this[_0x96a29b(0x151)](this[_0x96a29b(0xbf)][_0x96a29b(0x11f)](_0x51e79a)));}[_0x29362c(0xf8)](){const _0x32ff96=_0x29362c;this[_0x32ff96(0x151)](this[_0x32ff96(0x144)][_0x32ff96(0xb8)]({'getMutations':_0x587a01=>{const _0x1a20e5=_0x32ff96;if(_0x587a01['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x3a94b7}=_0x587a01[_0x1a20e5(0x11e)],_0x5adc4d=_0x3a94b7['filter'](_0x4e7176=>_0x4e7176[_0x1a20e5(0x116)]===DrawingTypeEnum[_0x1a20e5(0x152)]);if(_0x5adc4d[_0x1a20e5(0xf0)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x47569a=[],_0xe9513c=[];return _0x5adc4d[_0x1a20e5(0x136)](_0x1deace=>{const _0x206c2f=_0x1a20e5,{unitId:_0x176a72,subUnitId:_0x1793c7,drawingId:_0x561e65}=_0x1deace,_0x59195a=this[_0x206c2f(0xe7)][_0x206c2f(0xf6)](_0x176a72,_0x1793c7,_0x561e65);if(!_0x59195a)throw new TypeError(_0x206c2f(0xd0)+_0x59195a);_0x47569a[_0x206c2f(0xed)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0x561e65}}),_0xe9513c['push']({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0x561e65,'shapeType':_0x59195a[_0x206c2f(0x12b)](),'shapeData':_0x59195a[_0x206c2f(0x10c)]()}});const _0x213374=this[_0x206c2f(0xe7)]['getBasicShapeRelation'](_0x176a72,_0x1793c7,_0x561e65);if(_0x213374)for(const _0x2ad257 of _0x213374){const _0xfc4c6a=_0x2ad257[_0x206c2f(0x125)],_0x10c489=_0x2ad257[_0x206c2f(0x140)],_0x522947=_0x10c489?{'from':void 0x0}:{'to':void 0x0},_0x24bc2f=_0x10c489?{'from':{'shapeId':_0x2ad257[_0x206c2f(0xe9)],'cxnIndex':_0x2ad257[_0x206c2f(0xd9)]}}:{'to':{'shapeId':_0x2ad257['shapeId'],'cxnIndex':_0x2ad257[_0x206c2f(0xd9)]}};_0x47569a[_0x206c2f(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0xfc4c6a,'shapeData':{'relation':_0x522947}}}),_0xe9513c[_0x206c2f(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x176a72,'subUnitId':_0x1793c7,'shapeId':_0xfc4c6a,'shapeData':{'relation':_0x24bc2f}}});}}),{'preRedos':_0x47569a,'redos':[],'preUndos':[],'undos':_0xe9513c};}if(_0x587a01['id']===SetSheetDrawingCommand['id']){const {drawings:_0x5e2c76}=_0x587a01[_0x1a20e5(0x11e)],_0x351429=_0x5e2c76[_0x1a20e5(0xc0)](_0xf80053=>_0xf80053[_0x1a20e5(0x116)]===DrawingTypeEnum[_0x1a20e5(0x152)]);if(_0x351429['length']===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x31c367=[],_0xf831f1=[];for(const _0xe08b6 of _0x351429){const {unitId:_0x3ac195,subUnitId:_0x3ec3e9,drawingId:_0x2aeea6,transform:_0x241bfd}=_0xe08b6;if(!_0x3ac195||!_0x3ec3e9||!_0x2aeea6||!_0x241bfd)continue;const _0x2d95e8=this[_0x1a20e5(0xe7)][_0x1a20e5(0xf6)](_0x3ac195,_0x3ec3e9,_0x2aeea6);if(!_0x2d95e8)throw new TypeError(_0x1a20e5(0xd0)+_0x2d95e8);if(isConnectorShape(_0x2d95e8[_0x1a20e5(0x12b)]())){const _0x780ee3=this[_0x1a20e5(0xe7)][_0x1a20e5(0x153)](_0x3ac195,_0x3ec3e9,_0x2aeea6),_0x34430d={'from':void 0x0,'to':void 0x0};_0x780ee3&&(_0x31c367[_0x1a20e5(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3ac195,'subUnitId':_0x3ec3e9,'shapeId':_0x2aeea6,'shapeData':{'relation':_0x34430d}}}),_0xf831f1['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3ac195,'subUnitId':_0x3ec3e9,'shapeId':_0x2aeea6,'shapeData':{'relation':_0x780ee3}}}));}else{const _0x35320f=this['_sheetsShapeService'][_0x1a20e5(0x117)](_0x3ac195,_0x3ec3e9,_0x2aeea6);if(_0x35320f&&_0x35320f[_0x1a20e5(0xf0)]>0x0)for(const _0xecafc9 of _0x35320f){const _0x43bcbf=_0xecafc9[_0x1a20e5(0x125)],_0x58dc85=_0xecafc9['isFrom'],_0x2a3180=this['_sheetsShapeService'][_0x1a20e5(0xf6)](_0x3ac195,_0x3ec3e9,_0x43bcbf);if(!_0x2a3180)continue;const _0x39f7da=_0x2a3180[_0x1a20e5(0x110)](),_0x168787=_0x2a3180[_0x1a20e5(0x12e)]();if(_0x39f7da&&_0x168787)this[_0x1a20e5(0xfa)](_0x3ac195,_0x3ec3e9,_0x43bcbf,_0x2a3180,_0x39f7da,_0x168787,_0x31c367,_0xf831f1,_0x2aeea6,_0x241bfd);else this[_0x1a20e5(0x11a)](_0x3ac195,_0x3ec3e9,_0x43bcbf,_0x2a3180,_0x58dc85?_0x39f7da:_0x168787,_0x58dc85,_0x31c367,_0xf831f1,_0x2aeea6,_0x241bfd);}}}return{'preRedos':[],'redos':_0x31c367,'preUndos':_0xf831f1,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x29362c(0xe8)](_0x1b7ccc,_0x3679a8,_0x575dc7,_0x57d640,_0x5471b4){const _0x51fa07=_0x29362c;if(!_0x3679a8||!_0x575dc7)return null;const {shapeId:_0x59fdb7,cxnIndex:_0x43b04e}=_0x1b7ccc,_0x46be6d=this['_sheetsShapeService'][_0x51fa07(0xf6)](_0x3679a8,_0x575dc7,_0x59fdb7);if(!_0x46be6d)return null;const _0x177b5f=this[_0x51fa07(0xc4)]['getDrawingByParam']({'unitId':_0x3679a8,'subUnitId':_0x575dc7,'drawingId':_0x59fdb7});if(!(_0x177b5f===null||_0x177b5f===void 0x0?void 0x0:_0x177b5f['transform']))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x4fb386}=_0x177b5f[_0x51fa07(0x13b)];if(_0x5471b4&&_0x57d640===_0x59fdb7){var _0x24c099,_0x28810a,_0x4a62cf,_0x25a606,_0x5cf40a,_0x1f3701,_0x5d7b04;left=(_0x24c099=_0x5471b4[_0x51fa07(0xd5)])!==null&&_0x24c099!==void 0x0?_0x24c099:left,top=(_0x28810a=_0x5471b4[_0x51fa07(0x133)])!==null&&_0x28810a!==void 0x0?_0x28810a:top,width=(_0x4a62cf=_0x5471b4['width'])!==null&&_0x4a62cf!==void 0x0?_0x4a62cf:width,height=(_0x25a606=_0x5471b4['height'])!==null&&_0x25a606!==void 0x0?_0x25a606:height,flipX=(_0x5cf40a=_0x5471b4[_0x51fa07(0x14f)])!==null&&_0x5cf40a!==void 0x0?_0x5cf40a:flipX,flipY=(_0x1f3701=_0x5471b4['flipY'])!==null&&_0x1f3701!==void 0x0?_0x1f3701:flipY,_0x4fb386=(_0x5d7b04=_0x5471b4[_0x51fa07(0x134)])!==null&&_0x5d7b04!==void 0x0?_0x5d7b04:_0x4fb386;}_0x46be6d[_0x51fa07(0xf1)]({'width':width,'height':height});const _0x47fa39=_0x46be6d[_0x51fa07(0xce)]()['find'](_0x51c307=>_0x51c307['index']===_0x43b04e);if(!_0x47fa39)return null;let _0xaf5969=flipX?width-_0x47fa39['x']:_0x47fa39['x'],_0x2e9c99=flipY?height-_0x47fa39['y']:_0x47fa39['y'];if(_0x4fb386!==0x0&&_0x4fb386!==void 0x0&&_0x4fb386!==null){const _0x5c51fb=_0x4fb386*Math['PI']/0xb4,_0x11247c=Math['cos'](_0x5c51fb),_0x301be4=Math[_0x51fa07(0x114)](_0x5c51fb),_0x2338c6=width/0x2,_0x2e9354=height/0x2,_0x4e3dd5=_0xaf5969-_0x2338c6,_0x300b0c=_0x2e9c99-_0x2e9354;_0xaf5969=_0x2338c6+_0x4e3dd5*_0x11247c-_0x300b0c*_0x301be4,_0x2e9c99=_0x2e9354+_0x4e3dd5*_0x301be4+_0x300b0c*_0x11247c;}_0xaf5969+=left,_0x2e9c99+=top;let _0x5adde2=_0x47fa39[_0x51fa07(0x122)]/0xea60;if(flipX)_0x5adde2=0xb4-_0x5adde2;if(flipY)_0x5adde2=-_0x5adde2;_0x5adde2+=_0x4fb386||0x0,_0x5adde2=(_0x5adde2%0x168+0x168)%0x168;const _0x4282ea=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x4fb386||0x0);return{'point':{'x':_0xaf5969,'y':_0x2e9c99},'angle':_0x5adde2,'bounds':_0x4282ea};}[_0x29362c(0xfa)](_0x1ce11c,_0x4a8091,_0x5d9d0e,_0x122929,_0x203240,_0x346e80,_0x5e7497,_0x206f8b,_0x2adcab,_0x10c9d1){const _0x1a947e=_0x29362c,_0x1d9c06=this['_sheetSkeletonService']['getSkeleton'](_0x1ce11c,_0x4a8091);if(!_0x1d9c06)return;const _0x505ccf=_0x122929[_0x1a947e(0x14c)](),_0x541d51=_0x122929['getAdjustNames'](),_0x560ea4={},_0x5582dd={};_0x541d51[_0x1a947e(0x136)](_0x3b80b9=>{const _0x3d1b12=_0x122929['getAdjustValueByName'](_0x3b80b9);_0x5582dd[_0x3b80b9]=_0x3d1b12!==null&&_0x3d1b12!==void 0x0?_0x3d1b12:0x0;});const _0x78a02f=this[_0x1a947e(0xe8)](_0x203240,_0x1ce11c,_0x4a8091,_0x2adcab,_0x10c9d1),_0x3f4f26=this['_getConnectPointInfo'](_0x346e80,_0x1ce11c,_0x4a8091,_0x2adcab,_0x10c9d1);if(_0x78a02f&&_0x3f4f26){const _0x20f83a=_0x122929[_0x1a947e(0x12b)](),_0x22f86f=routeConnectorLineShape(_0x78a02f,_0x3f4f26,_0x20f83a);let _0x5c4a1a=_0x20f83a;if(_0x22f86f){const _0x5546cf=computeConnectorRouteLayout(_0x22f86f,_0x122929[_0x1a947e(0x12b)]()),_0x40a77a=this[_0x1a947e(0xc4)]['getDrawingData'](_0x1ce11c,_0x4a8091);if(_0x40a77a&&_0x40a77a[_0x5d9d0e]){const _0x2e8986=_0x40a77a[_0x5d9d0e];_0x5c4a1a=_0x5546cf['lineType'];for(const [_0x360097,_0x25af38]of Object[_0x1a947e(0x13d)](_0x5546cf[_0x1a947e(0x108)]))_0x560ea4[_0x360097]=_0x25af38;const _0x19f22f={..._0x2e8986['transform'],'width':_0x5546cf[_0x1a947e(0x148)]['width'],'height':_0x5546cf[_0x1a947e(0x148)]['height'],'left':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0xd5)],'top':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x133)],'flipX':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x14f)],'flipY':_0x5546cf[_0x1a947e(0x148)][_0x1a947e(0x14a)],'angle':_0x5546cf[_0x1a947e(0x12a)]},_0x13dec2=transformToDrawingPosition(_0x19f22f,_0x1d9c06),_0x40148b=transformToAxisAlignPosition(_0x19f22f,_0x1d9c06),_0x3f691a={'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'drawingType':DrawingTypeEnum[_0x1a947e(0x152)],'drawingId':_0x5d9d0e,'transform':_0x19f22f,'sheetTransform':_0x13dec2,'axisAlignSheetTransform':_0x40148b},{unitId:_0x451153,subUnitId:_0x4fa966,undo:_0x1959e2,redo:_0x4061e6,objects:_0x3bcf1e}=this[_0x1a947e(0xc4)][_0x1a947e(0x11c)]([_0x3f691a]);_0x5e7497[_0x1a947e(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x451153,'subUnitId':_0x4fa966,'op':_0x4061e6,'objects':_0x3bcf1e,'type':DrawingApplyType['UPDATE']}}),_0x206f8b[_0x1a947e(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x451153,'subUnitId':_0x4fa966,'op':_0x1959e2,'objects':_0x3bcf1e,'type':DrawingApplyType['UPDATE']}});}_0x122929[_0x1a947e(0x10d)]();}_0x5e7497[_0x1a947e(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'shapeId':_0x5d9d0e,'shapeType':_0x5c4a1a,'shapeData':{'adjustValues':_0x560ea4,'relation':_0x505ccf}}}),_0x206f8b[_0x1a947e(0xed)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ce11c,'subUnitId':_0x4a8091,'shapeId':_0x5d9d0e,'shapeType':_0x20f83a,'shapeData':{'adjustValues':_0x5582dd,'relation':_0x505ccf}}});}}[_0x29362c(0x11a)](_0x237b0a,_0x24ac17,_0x418571,_0x46e6bc,_0x24e0fe,_0x26bb4b,_0x59c7f3,_0x34831b,_0x2b7ab8,_0x59327b){const _0x125167=_0x29362c;var _0x169e95;if(!_0x24e0fe)return;const _0x16e570=this[_0x125167(0xef)][_0x125167(0x145)](_0x237b0a,_0x24ac17);if(!_0x16e570)return;const _0x3cb9b9=(_0x169e95=this[_0x125167(0xc4)][_0x125167(0xc5)]({'unitId':_0x237b0a,'subUnitId':_0x24ac17,'drawingId':_0x2b7ab8}))===null||_0x169e95===void 0x0?void 0x0:_0x169e95[_0x125167(0x13b)];if(!_0x3cb9b9)return;const _0x2f21d8=_0x3cb9b9[_0x125167(0xd5)]!==_0x59327b[_0x125167(0xd5)]||_0x3cb9b9['top']!==_0x59327b[_0x125167(0x133)],_0x570b27=_0x3cb9b9[_0x125167(0xc8)]!==_0x59327b[_0x125167(0xc8)]||_0x3cb9b9[_0x125167(0x139)]!==_0x59327b[_0x125167(0x139)],_0xc9f6b=_0x3cb9b9['flipX']!==_0x59327b[_0x125167(0x14f)]||_0x3cb9b9['flipY']!==_0x59327b[_0x125167(0x14a)],_0x730604=_0x3cb9b9['angle']!==_0x59327b[_0x125167(0x134)];if(_0x2f21d8&&!_0x570b27&&!_0xc9f6b&&!_0x730604){var _0x12fa29,_0x47d7b5,_0x1e9631,_0x261ff9;const _0x5a9c89=((_0x12fa29=_0x59327b[_0x125167(0xd5)])!==null&&_0x12fa29!==void 0x0?_0x12fa29:0x0)-((_0x47d7b5=_0x3cb9b9[_0x125167(0xd5)])!==null&&_0x47d7b5!==void 0x0?_0x47d7b5:0x0),_0x15b39d=((_0x1e9631=_0x59327b[_0x125167(0x133)])!==null&&_0x1e9631!==void 0x0?_0x1e9631:0x0)-((_0x261ff9=_0x3cb9b9[_0x125167(0x133)])!==null&&_0x261ff9!==void 0x0?_0x261ff9:0x0),_0x3ced84=this[_0x125167(0xc4)]['getDrawingData'](_0x237b0a,_0x24ac17);if(_0x3ced84&&_0x3ced84[_0x418571]){var _0x2abc13,_0x2773c4,_0x11857b,_0x364b05;const _0x42e2a4=_0x3ced84[_0x418571],_0x374d19={..._0x42e2a4[_0x125167(0x13b)],'left':((_0x2abc13=(_0x2773c4=_0x42e2a4['transform'])===null||_0x2773c4===void 0x0?void 0x0:_0x2773c4[_0x125167(0xd5)])!==null&&_0x2abc13!==void 0x0?_0x2abc13:0x0)+_0x5a9c89,'top':((_0x11857b=(_0x364b05=_0x42e2a4['transform'])===null||_0x364b05===void 0x0?void 0x0:_0x364b05[_0x125167(0x133)])!==null&&_0x11857b!==void 0x0?_0x11857b:0x0)+_0x15b39d},_0x51a2e3=transformToDrawingPosition(_0x374d19,_0x16e570),_0x3da1d8=transformToAxisAlignPosition(_0x374d19,_0x16e570),_0x3a4380={'unitId':_0x237b0a,'subUnitId':_0x24ac17,'drawingType':DrawingTypeEnum[_0x125167(0x152)],'drawingId':_0x418571,'transform':_0x374d19,'sheetTransform':_0x51a2e3,'axisAlignSheetTransform':_0x3da1d8},{unitId:_0x506803,subUnitId:_0x41cb51,undo:_0x45841f,redo:_0x1c5002,objects:_0xe7a3bc}=this[_0x125167(0xc4)][_0x125167(0x11c)]([_0x3a4380]);_0x59c7f3[_0x125167(0xed)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x506803,'subUnitId':_0x41cb51,'op':_0x1c5002,'objects':_0xe7a3bc,'type':DrawingApplyType[_0x125167(0x141)]}}),_0x34831b['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x506803,'subUnitId':_0x41cb51,'op':_0x45841f,'objects':_0xe7a3bc,'type':DrawingApplyType[_0x125167(0x141)]}});}}else{const _0x5b1510=_0x46e6bc['getStartConnectInfo'](),_0x35beaf=_0x46e6bc[_0x125167(0x12e)]();this[_0x125167(0xfa)](_0x237b0a,_0x24ac17,_0x418571,_0x46e6bc,_0x5b1510,_0x35beaf,_0x59c7f3,_0x34831b,_0x2b7ab8,_0x59327b);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x22dd4d=defaultPluginConfig,_0x5e3daa,_0x974dbe,_0x3e4133){const _0x1727ad=_0x29362c;super(),this[_0x1727ad(0xbd)]=_0x22dd4d,this[_0x1727ad(0xb9)]=_0x5e3daa,this[_0x1727ad(0xbf)]=_0x974dbe,this[_0x1727ad(0x138)]=_0x3e4133;const {..._0x5283ec}=merge({},defaultPluginConfig,this[_0x1727ad(0xbd)]);this[_0x1727ad(0x138)][_0x1727ad(0x107)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x5283ec);}[_0x29362c(0x104)](){const _0x57cf17=_0x29362c,_0x23bf79=this[_0x57cf17(0xb9)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x57cf17(0x136)](_0x32f857=>_0x23bf79[_0x57cf17(0xe4)](_0x32f857)),touchDependencies(_0x23bf79,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x29362c(0xd1),UniverInstanceType['UNIVER_SHEET']),_defineProperty(UniverSheetsShapePlugin,_0x29362c(0x129),_0x29362c(0x10b)),_defineProperty(UniverSheetsShapePlugin,'packageName',name),_defineProperty(UniverSheetsShapePlugin,_0x29362c(0x111),version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};function _0x3beb(){const _0x6c41b8=['transform','addShape','entries','clear','keys','isFrom','UPDATE','object','setShapeType','_sheetInterceptorService','getSkeleton','position','toJSON','worldRect','registerPluginResource','flipY','call','getShapeRelation','sheet.command.set-shape-text-vertical-toggle','_deserializeShapeForUnit','flipX','COMMAND','disposeWithMe','DRAWING_SHAPE','getLineShapeRelation','symbol','interceptCommand','_injector','0.21.1','1052613gcHLXK','function','_config','syncExecuteCommand','_commandService','filter','data','delete','resizeEnabled','_drawingManagerService','getDrawingByParam','prototype','borderEnabled','width','rotateEnabled','decorate','assign','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','redos','getConnectionSiteList','sheet.mutation.update-shape-data','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','type','2BjeakJ','@univerjs-pro/sheets-shape','261882HIbwAQ','left','60fbqDWf','11586WnGKHb','sheet.command.insert-shape','cxnIndex','insertShape','ensureSkeleton','_groupIds','preUndos','_ensureShapeModelManager','defineProperty','_shapeModelManagerMap','7HhPdfq','hasShape','_resourcesManagerService','add','5ItIDTY','removeShape','_sheetsShapeService','_getConnectPointInfo','shapeId','onCommandExecute','getShapeDataById','sheets-shape.config','push','constructor','_sheetSkeletonService','length','updateContext','isLineShape','sheet.command.set-shape-rotate','643328PnDiGE','pushUndoRedo','getShapeModel','getShapeTypeById','_initCommandInterceptor','setShapeData','_addLineRerouteUpdates','from','1725850CbpKfI','1050841NZnOmr','MUTATION','set','isHorizontal','getBatchAddOp','getCellIndexAndOffsetByPosition','range','onStarting','sheet.mutation.insert-shape','getBasicShapeType','setConfig','adjustValues','UNIVER_SHEET','parse','SHEET_SHAPE_PLUGIN','getShapeData','removeLinePoints','getShapeTextData','dispose','getStartConnectInfo','version','sheet.mutation.update-shape-type','sheet.command.update-line-shape-resize','sin','string','drawingType','getBasicShapeRelation','_linesIds','fromJSON','_addLineFollowShapeUpdates','_disposed','getBatchUpdateOp','undos','params','registerCommand','_initSnapshot','INSERT','ang','_initCommands','1096436oMOdAJ','lineShapeId','has','shapeData','preRedos','pluginName','rotation','getShapeType','every','_shapes','getEndConnectInfo','fill','get','_serializeShapeForUnit','sheet.command.update-connector-relation','top','angle','sheet.command.toggle-shape-flip','forEach','18MvxRmQ','_configService','height','iterator'];_0x3beb=function(){return _0x6c41b8;};return _0x3beb();}