@univerjs-pro/sheets-shape 0.22.0 → 0.22.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/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/es/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1c0943=_0x52ab;(function(_0x467b1e,_0x39d3e4){const _0x53259a=_0x52ab,_0x170fdb=_0x467b1e();while(!![]){try{const _0x5cbaa8=-parseInt(_0x53259a(0x14a))/0x1*(-parseInt(_0x53259a(0x13a))/0x2)+-parseInt(_0x53259a(0x141))/0x3+parseInt(_0x53259a(0x181))/0x4*(parseInt(_0x53259a(0x128))/0x5)+parseInt(_0x53259a(0x17b))/0x6*(-parseInt(_0x53259a(0x143))/0x7)+parseInt(_0x53259a(0x14f))/0x8*(parseInt(_0x53259a(0x14e))/0x9)+parseInt(_0x53259a(0x161))/0xa+parseInt(_0x53259a(0x142))/0xb*(-parseInt(_0x53259a(0x172))/0xc);if(_0x5cbaa8===_0x39d3e4)break;else _0x170fdb['push'](_0x170fdb['shift']());}catch(_0x43c391){_0x170fdb['push'](_0x170fdb['shift']());}}}(_0x14c7,0x5ab2e));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';function _0x52ab(_0x5149af,_0x21bfa2){_0x5149af=_0x5149af-0x108;const _0x14c7ab=_0x14c7();let _0x52abf6=_0x14c7ab[_0x5149af];return _0x52abf6;}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[_0x1c0943(0x10c)](){return ShapeTypeEnum;}get[_0x1c0943(0x156)](){return ShapeFillEnum;}get[_0x1c0943(0x174)](){return ShapeGradientTypeEnum;}get[_0x1c0943(0x189)](){return ShapeLineTypeEnum;}get[_0x1c0943(0x13b)](){return ShapeLineDashEnum;}get[_0x1c0943(0x138)](){return ShapeLineCapEnum;}get['ShapeLineJoinEnum'](){return ShapeLineJoinEnum;}get[_0x1c0943(0x17a)](){return ShapeArrowTypeEnum;}get[_0x1c0943(0x16c)](){return ShapeArrowSizeEnum;}};FEnum['extend'](FSheetsShapeEnumMixin);function _typeof(_0x484222){'@babel/helpers - typeof';const _0x4ee288=_0x1c0943;return _typeof=_0x4ee288(0x18a)==typeof Symbol&&_0x4ee288(0x182)==typeof Symbol['iterator']?function(_0x540e9f){return typeof _0x540e9f;}:function(_0x10b36b){const _0x465649=_0x4ee288;return _0x10b36b&&_0x465649(0x18a)==typeof Symbol&&_0x10b36b['constructor']===Symbol&&_0x10b36b!==Symbol['prototype']?'symbol':typeof _0x10b36b;},_typeof(_0x484222);}function toPrimitive(_0x3576b7,_0x4c4280){const _0x3f8a97=_0x1c0943;if('object'!=_typeof(_0x3576b7)||!_0x3576b7)return _0x3576b7;var _0x2448b6=_0x3576b7[Symbol[_0x3f8a97(0x184)]];if(void 0x0!==_0x2448b6){var _0x367437=_0x2448b6['call'](_0x3576b7,_0x4c4280||'default');if(_0x3f8a97(0x162)!=_typeof(_0x367437))return _0x367437;throw new TypeError(_0x3f8a97(0x185));}return(_0x3f8a97(0x144)===_0x4c4280?String:Number)(_0x3576b7);}function _0x14c7(){const _0x4658a5=['getSheetId','connectionSiteIndex',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','getSize','SolidFill','size','setShapeGradientFill','parse','ShapeLineCapEnum','stroke','10562CerUdF','ShapeLineDashEnum','setHeight','_injector','Skeleton\x20for\x20unitId\x20','getShapeModel','get','371763hhvTST','3097105RKQBCL','42gFWFKv','string','setStrokeColor','endArrow','setStrokeWidth','newConnector','updateContext','108emOiGC','dashType','shapeId','point','32517NMooIE','440AeVlcS','executeCommand','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','getConnectionSites','cxnIndex','left','drawId','ShapeFillEnum','getEndConnectInfo','flipX','drawingType','lineType','getAdjustValueByName','worldRect','ensureSkeleton','sin','defineProperty','getConnectorLinePoints','2823630JRLxwW','object','startArrow','NoFill','extend','type','adjustValues','_preloadShapeProperties','getDrawingByParam','abs','stringify','ShapeArrowSizeEnum','setStartArrowType','_resolveEndpoints','width','top','getStartConnectInfo','24VWozcP','_resolveExistingOrFreeEndpoint','ShapeGradientTypeEnum','setPosition','newShape','isLineShape','relation','insertShape','ShapeArrowTypeEnum','457716cyCjQf','opacity','\x20not\x20found','from','build','setStrokeLineDashType','36TFQigZ','symbol','lineStrokeType','toPrimitive','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setWidth','removeShape','length','ShapeLineTypeEnum','function','gradientStops','getWorkbook','setEndArrowType','\x20and\x20subUnitId\x20','getShapeType','transform','getShapeData','setStrokeLineJoinType','ShapeTypeEnum','push','subUnitId','shapeData','keys','fill','setShapeSolidFill','setAbsolutePosition','getShapeId','shape','gradientType','getConnectionSiteList','getShapeRelation','connectShapes','getAdjustPoints','_commandService','setShapeType','getUnitId','setStrokeLineCapType','height','GradientFill','shapeType','color','entries','find','DRAWING_SHAPE','fillType','setStrokeOpacity','258235buLQpV','lineJoinType','updateShape','setNoneFill','localToWorld','getPosition','setStrokeLineType','unitId'];_0x14c7=function(){return _0x4658a5;};return _0x14c7();}function toPropertyKey(_0xa8165b){const _0x947360=_0x1c0943;var _0x1e9de6=toPrimitive(_0xa8165b,'string');return _0x947360(0x182)==_typeof(_0x1e9de6)?_0x1e9de6:_0x1e9de6+'';}function _defineProperty(_0x41a28a,_0x2467eb,_0xdd1e38){const _0x213a00=_0x1c0943;return(_0x2467eb=toPropertyKey(_0x2467eb))in _0x41a28a?Object[_0x213a00(0x15f)](_0x41a28a,_0x2467eb,{'value':_0xdd1e38,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x41a28a[_0x2467eb]=_0xdd1e38,_0x41a28a;}var FShape=class{constructor(_0x363fcf,_0x527c2a,_0x191348,_0x4dcd18){const _0x53d8cf=_0x1c0943;_defineProperty(this,_0x53d8cf(0x12f),void 0x0),_defineProperty(this,_0x53d8cf(0x10e),void 0x0),_defineProperty(this,_0x53d8cf(0x155),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x53d8cf(0x16f),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x53d8cf(0x11f),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x53d8cf(0x121),void 0x0),_defineProperty(this,'shapeData',{}),_defineProperty(this,_0x53d8cf(0x13d),void 0x0),this[_0x53d8cf(0x12f)]=_0x363fcf,this[_0x53d8cf(0x10e)]=_0x527c2a,this[_0x53d8cf(0x155)]=_0x191348||generateRandomId(),this[_0x53d8cf(0x13d)]=_0x4dcd18;}[_0x1c0943(0x175)](_0x9e0542,_0x278d14,_0x79e600,_0x34f7df){const _0x482bb9=_0x1c0943,_0x33b653=this[_0x482bb9(0x13d)][_0x482bb9(0x140)](SheetSkeletonService)['ensureSkeleton'](this[_0x482bb9(0x12f)],this['subUnitId']);if(!_0x33b653)throw new Error(_0x482bb9(0x13e)+this['unitId']+_0x482bb9(0x18e)+this[_0x482bb9(0x10e)]+_0x482bb9(0x17d));const {transform:_0x1f8216}=convertPositionCellToSheetOverGrid(this[_0x482bb9(0x12f)],this[_0x482bb9(0x10e)],{'row':_0x9e0542,'column':_0x278d14,'rowOffset':_0x79e600,'columnOffset':_0x34f7df},0x1,0x1,_0x33b653);return this['x']=_0x1f8216[_0x482bb9(0x154)],this['y']=_0x1f8216[_0x482bb9(0x170)],this;}[_0x1c0943(0x113)](_0x2d7d49,_0x33ef79){return this['x']=_0x2d7d49,this['y']=_0x33ef79,this;}['setShapeType'](_0x59e87b){const _0x24240d=_0x1c0943;return this[_0x24240d(0x121)]=_0x59e87b,this;}[_0x1c0943(0x112)](_0x53d3a7,_0x556971){const _0x242a12=_0x1c0943;if(!this['shapeData'][_0x242a12(0x111)])this['shapeData'][_0x242a12(0x111)]={};this[_0x242a12(0x10f)][_0x242a12(0x111)][_0x242a12(0x126)]=ShapeFillEnum[_0x242a12(0x134)];if(_0x53d3a7!==void 0x0)this[_0x242a12(0x10f)][_0x242a12(0x111)]['color']=_0x53d3a7;if(_0x556971!==void 0x0)this['shapeData']['fill']['opacity']=_0x556971;return this;}[_0x1c0943(0x136)](_0x5718ea,_0x411868,_0x5d836b){const _0x265bd3=_0x1c0943;if(_0x411868===void 0x0||_0x411868[_0x265bd3(0x188)]===0x0)throw new Error('colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.');if(!this[_0x265bd3(0x10f)]['fill'])this[_0x265bd3(0x10f)]['fill']={};this['shapeData']['fill'][_0x265bd3(0x18b)]=_0x411868,this[_0x265bd3(0x10f)][_0x265bd3(0x111)][_0x265bd3(0x126)]=ShapeFillEnum[_0x265bd3(0x120)],this[_0x265bd3(0x10f)]['fill'][_0x265bd3(0x116)]=_0x5718ea;if(_0x5d836b!==void 0x0)this[_0x265bd3(0x10f)][_0x265bd3(0x111)]['gradientAngle']=_0x5d836b;return this;}[_0x1c0943(0x12b)](){const _0x1bd810=_0x1c0943;return this[_0x1bd810(0x10f)][_0x1bd810(0x111)]={'fillType':ShapeFillEnum[_0x1bd810(0x164)]},this;}[_0x1c0943(0x145)](_0x295f7d){const _0x23636d=_0x1c0943;if(!this[_0x23636d(0x10f)]['stroke'])this[_0x23636d(0x10f)][_0x23636d(0x139)]={};return this[_0x23636d(0x10f)][_0x23636d(0x139)][_0x23636d(0x122)]=_0x295f7d,this;}[_0x1c0943(0x147)](_0xfc98c1){const _0x30ec5b=_0x1c0943;if(!this[_0x30ec5b(0x10f)][_0x30ec5b(0x139)])this[_0x30ec5b(0x10f)][_0x30ec5b(0x139)]={};return this['shapeData'][_0x30ec5b(0x139)]['width']=_0xfc98c1,this;}[_0x1c0943(0x180)](_0x5e2e77){const _0x22ebe4=_0x1c0943;if(!this[_0x22ebe4(0x10f)]['stroke'])this[_0x22ebe4(0x10f)][_0x22ebe4(0x139)]={};return this['shapeData'][_0x22ebe4(0x139)][_0x22ebe4(0x14b)]=_0x5e2e77,this;}[_0x1c0943(0x10b)](_0xceff2c){const _0xffb65e=_0x1c0943;if(!this[_0xffb65e(0x10f)][_0xffb65e(0x139)])this[_0xffb65e(0x10f)][_0xffb65e(0x139)]={};return this[_0xffb65e(0x10f)][_0xffb65e(0x139)][_0xffb65e(0x129)]=_0xceff2c,this;}[_0x1c0943(0x11e)](_0x46366d){const _0x4a308c=_0x1c0943;if(!this[_0x4a308c(0x10f)]['stroke'])this[_0x4a308c(0x10f)]['stroke']={};return this['shapeData'][_0x4a308c(0x139)]['capType']=_0x46366d,this;}[_0x1c0943(0x127)](_0x594e4c){const _0x1b6fdc=_0x1c0943;if(!this[_0x1b6fdc(0x10f)][_0x1b6fdc(0x139)])this['shapeData'][_0x1b6fdc(0x139)]={};return this[_0x1b6fdc(0x10f)][_0x1b6fdc(0x139)][_0x1b6fdc(0x17c)]=_0x594e4c,this;}[_0x1c0943(0x12e)](_0x1266f0){const _0x41af5c=_0x1c0943;if(!this[_0x41af5c(0x10f)]['stroke'])this['shapeData'][_0x41af5c(0x139)]={};return this['shapeData'][_0x41af5c(0x139)][_0x41af5c(0x183)]=_0x1266f0,this;}[_0x1c0943(0x186)](_0xd231b7){const _0xa6b36=_0x1c0943;return this[_0xa6b36(0x16f)]=_0xd231b7,this;}[_0x1c0943(0x13c)](_0x4cf34c){const _0x59c451=_0x1c0943;return this[_0x59c451(0x11f)]=_0x4cf34c,this;}[_0x1c0943(0x177)](){const _0x5785be=_0x1c0943,_0x573d1=this[_0x5785be(0x13d)][_0x5785be(0x140)](SheetsShapeService)[_0x5785be(0x13f)](this[_0x5785be(0x12f)],this[_0x5785be(0x10e)],this[_0x5785be(0x155)]);if(_0x573d1)return isConnectorShape(_0x573d1['getShapeType']());if(this['shapeType'])return isConnectorShape(this[_0x5785be(0x121)]);return![];}[_0x1c0943(0x152)](){const _0x3bf9f6=_0x1c0943,_0x4be607=this[_0x3bf9f6(0x13d)][_0x3bf9f6(0x140)](SheetsShapeService)[_0x3bf9f6(0x13f)](this[_0x3bf9f6(0x12f)],this[_0x3bf9f6(0x10e)],this[_0x3bf9f6(0x155)]);if(!_0x4be607)return[];const _0x2a474e=this[_0x3bf9f6(0x13d)][_0x3bf9f6(0x140)](IDrawingManagerService)[_0x3bf9f6(0x169)]({'unitId':this[_0x3bf9f6(0x12f)],'subUnitId':this[_0x3bf9f6(0x10e)],'drawingId':this['drawId']});if(!(_0x2a474e===null||_0x2a474e===void 0x0?void 0x0:_0x2a474e[_0x3bf9f6(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x2a474e[_0x3bf9f6(0x109)];return _0x4be607[_0x3bf9f6(0x149)]({'width':width,'height':height}),_0x4be607[_0x3bf9f6(0x117)]();}[_0x1c0943(0x11a)](){const _0x4b5a75=_0x1c0943,_0x4f7684=this[_0x4b5a75(0x13d)][_0x4b5a75(0x140)](SheetsShapeService)['getShapeModel'](this['unitId'],this[_0x4b5a75(0x10e)],this[_0x4b5a75(0x155)]);if(!_0x4f7684)return[];const _0x51c046=this[_0x4b5a75(0x13d)][_0x4b5a75(0x140)](IDrawingManagerService)['getDrawingByParam']({'unitId':this[_0x4b5a75(0x12f)],'subUnitId':this[_0x4b5a75(0x10e)],'drawingId':this['drawId']});if(!(_0x51c046===null||_0x51c046===void 0x0?void 0x0:_0x51c046[_0x4b5a75(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x51c046['transform'];return _0x4f7684[_0x4b5a75(0x149)]({'width':width,'height':height}),_0x4f7684['getDrawingPoints']();}[_0x1c0943(0x160)](){const _0x3be83d=_0x1c0943,_0x729323=this[_0x3be83d(0x13d)][_0x3be83d(0x140)](SheetsShapeService)[_0x3be83d(0x13f)](this[_0x3be83d(0x12f)],this[_0x3be83d(0x10e)],this[_0x3be83d(0x155)]);if(!_0x729323)return[];if(!isConnectorShape(_0x729323[_0x3be83d(0x108)]()))return[];const _0x3593d1=this[_0x3be83d(0x13d)][_0x3be83d(0x140)](IDrawingManagerService)[_0x3be83d(0x169)]({'unitId':this[_0x3be83d(0x12f)],'subUnitId':this[_0x3be83d(0x10e)],'drawingId':this[_0x3be83d(0x155)]});if(!(_0x3593d1===null||_0x3593d1===void 0x0?void 0x0:_0x3593d1[_0x3be83d(0x109)]))return[];const {width:width=0x0,height:height=0x0}=_0x3593d1['transform'];return _0x729323[_0x3be83d(0x149)]({'width':width,'height':height}),_0x729323[_0x3be83d(0x160)]();}[_0x1c0943(0x171)](){const _0x4b69b1=_0x1c0943;var _0x1cd7b0;const _0x171296=this['_injector'][_0x4b69b1(0x140)](SheetsShapeService)[_0x4b69b1(0x13f)](this['unitId'],this[_0x4b69b1(0x10e)],this[_0x4b69b1(0x155)]);if(!_0x171296)return null;return(_0x1cd7b0=_0x171296[_0x4b69b1(0x171)]())!==null&&_0x1cd7b0!==void 0x0?_0x1cd7b0:null;}['getEndConnectInfo'](){const _0x4f679c=_0x1c0943;var _0x2719df;const _0x20303e=this['_injector'][_0x4f679c(0x140)](SheetsShapeService)[_0x4f679c(0x13f)](this[_0x4f679c(0x12f)],this[_0x4f679c(0x10e)],this['drawId']);if(!_0x20303e)return null;return(_0x2719df=_0x20303e[_0x4f679c(0x157)]())!==null&&_0x2719df!==void 0x0?_0x2719df:null;}[_0x1c0943(0x17f)](){const _0x1cc1b8=_0x1c0943;var _0x1afff0,_0x58776e;if(!this[_0x1cc1b8(0x121)])throw new Error('Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().');if(this['x']===0x0||this['y']===0x0){const _0x2fcd34=this[_0x1cc1b8(0x13d)]['get'](SheetSkeletonService)[_0x1cc1b8(0x15d)](this['unitId'],this['subUnitId']);if(!_0x2fcd34)throw new Error(_0x1cc1b8(0x13e)+this[_0x1cc1b8(0x12f)]+_0x1cc1b8(0x18e)+this['subUnitId']+_0x1cc1b8(0x17d));const {transform:_0x2c6a68}=convertPositionCellToSheetOverGrid(this[_0x1cc1b8(0x12f)],this[_0x1cc1b8(0x10e)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x2fcd34);this['x']=this['x']>0x0?this['x']:_0x2c6a68[_0x1cc1b8(0x154)],this['y']=this['y']>0x0?this['y']:_0x2c6a68['top'];}return this['width']=(_0x1afff0=this[_0x1cc1b8(0x16f)])!==null&&_0x1afff0!==void 0x0?_0x1afff0:DEFAULT_SHAPE_WIDTH,this[_0x1cc1b8(0x11f)]=(_0x58776e=this[_0x1cc1b8(0x11f)])!==null&&_0x58776e!==void 0x0?_0x58776e:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x1cc1b8(0x12f)],'subUnitId':this['subUnitId'],'shapeId':this[_0x1cc1b8(0x155)],'shapeType':this['shapeType'],'shapeData':Object[_0x1cc1b8(0x110)](this[_0x1cc1b8(0x10f)])[_0x1cc1b8(0x188)]>0x0?this[_0x1cc1b8(0x10f)]:void 0x0,'x':this['x'],'y':this['y'],'width':this['width'],'height':this[_0x1cc1b8(0x11f)]};}[_0x1c0943(0x114)](){const _0x146040=_0x1c0943;return this[_0x146040(0x155)];}[_0x1c0943(0x108)](){const _0x5b17c1=_0x1c0943;return this[_0x5b17c1(0x121)];}[_0x1c0943(0x10a)](){return this['shapeData'];}[_0x1c0943(0x12d)](){return{'x':this['x'],'y':this['y']};}[_0x1c0943(0x133)](){const _0x302a4a=_0x1c0943;return{'width':this[_0x302a4a(0x16f)],'height':this[_0x302a4a(0x11f)]};}},FConnectorShape=class extends FShape{constructor(_0x296028,_0x312eb5,_0x1580bf,_0x3c8013){const _0xd0f88a=_0x1c0943;super(_0x296028,_0x312eb5,_0x1580bf,_0x3c8013),_defineProperty(this,_0xd0f88a(0x10f),{});}[_0x1c0943(0x11c)](_0x3a53a4){const _0x58190d=_0x1c0943;if(!isConnectorShape(_0x3a53a4))throw new Error(_0x58190d(0x151)+_0x3a53a4+_0x58190d(0x132));return super[_0x58190d(0x11c)](_0x3a53a4),this;}[_0x1c0943(0x16d)](_0x33c702){const _0x34f738=_0x1c0943;var _0x50c021,_0x231b17;if(!((_0x50c021=this[_0x34f738(0x10f)])===null||_0x50c021===void 0x0?void 0x0:_0x50c021['ln']))this[_0x34f738(0x10f)]['ln']={};if(!((_0x231b17=this[_0x34f738(0x10f)])===null||_0x231b17===void 0x0||(_0x231b17=_0x231b17['ln'])===null||_0x231b17===void 0x0?void 0x0:_0x231b17['startArrow']))this[_0x34f738(0x10f)]['ln']['startArrow']={};return this[_0x34f738(0x10f)]['ln'][_0x34f738(0x163)][_0x34f738(0x166)]=_0x33c702,this;}[_0x1c0943(0x18d)](_0x5ad584){const _0x2b8595=_0x1c0943;var _0x4b7442,_0x5d4df7;if(!((_0x4b7442=this[_0x2b8595(0x10f)])===null||_0x4b7442===void 0x0?void 0x0:_0x4b7442['ln']))this[_0x2b8595(0x10f)]['ln']={};if(!((_0x5d4df7=this[_0x2b8595(0x10f)])===null||_0x5d4df7===void 0x0||(_0x5d4df7=_0x5d4df7['ln'])===null||_0x5d4df7===void 0x0?void 0x0:_0x5d4df7[_0x2b8595(0x146)]))this[_0x2b8595(0x10f)]['ln'][_0x2b8595(0x146)]={};return this['shapeData']['ln'][_0x2b8595(0x146)]['type']=_0x5ad584,this;}['setStartArrowSize'](_0x46d6bd){const _0x597488=_0x1c0943;var _0xb6e64d,_0x4592b8;if(!((_0xb6e64d=this[_0x597488(0x10f)])===null||_0xb6e64d===void 0x0?void 0x0:_0xb6e64d['ln']))this[_0x597488(0x10f)]['ln']={};if(!((_0x4592b8=this[_0x597488(0x10f)])===null||_0x4592b8===void 0x0||(_0x4592b8=_0x4592b8['ln'])===null||_0x4592b8===void 0x0?void 0x0:_0x4592b8[_0x597488(0x163)]))this['shapeData']['ln'][_0x597488(0x163)]={};return this[_0x597488(0x10f)]['ln'][_0x597488(0x163)][_0x597488(0x135)]=_0x46d6bd,this;}['setEndArrowSize'](_0x1a93e7){const _0x2340e9=_0x1c0943;var _0x2973d7,_0x410bd9;if(!((_0x2973d7=this['shapeData'])===null||_0x2973d7===void 0x0?void 0x0:_0x2973d7['ln']))this['shapeData']['ln']={};if(!((_0x410bd9=this[_0x2340e9(0x10f)])===null||_0x410bd9===void 0x0||(_0x410bd9=_0x410bd9['ln'])===null||_0x410bd9===void 0x0?void 0x0:_0x410bd9[_0x2340e9(0x146)]))this[_0x2340e9(0x10f)]['ln']['endArrow']={};return this[_0x2340e9(0x10f)]['ln'][_0x2340e9(0x146)][_0x2340e9(0x135)]=_0x1a93e7,this;}['build'](){return super['build']();}[_0x1c0943(0x157)](){var _0x416489;return((_0x416489=this['shapeData'])===null||_0x416489===void 0x0||(_0x416489=_0x416489['relation'])===null||_0x416489===void 0x0?void 0x0:_0x416489['to'])||null;}[_0x1c0943(0x171)](){const _0x10bb52=_0x1c0943;var _0x3e2829;return((_0x3e2829=this[_0x10bb52(0x10f)])===null||_0x3e2829===void 0x0||(_0x3e2829=_0x3e2829[_0x10bb52(0x178)])===null||_0x3e2829===void 0x0?void 0x0:_0x3e2829[_0x10bb52(0x17e)])||null;}};function computeConnectionPointInfo(_0x3444df,_0x2ca9c9,_0x36b22d,_0x5b5e13,_0x527fbc,_0x2a1e5e){const _0x1bae22=_0x1c0943,_0xc67215=_0x527fbc['getShapeModel'](_0x3444df,_0x2ca9c9,_0x36b22d);if(!_0xc67215)return null;const _0x507f4c=_0x2a1e5e[_0x1bae22(0x169)]({'unitId':_0x3444df,'subUnitId':_0x2ca9c9,'drawingId':_0x36b22d});if(!(_0x507f4c===null||_0x507f4c===void 0x0?void 0x0:_0x507f4c[_0x1bae22(0x109)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x18e887}=_0x507f4c[_0x1bae22(0x109)];_0xc67215[_0x1bae22(0x149)]({'width':width,'height':height});const _0x2f5a03=_0xc67215[_0x1bae22(0x117)]()[_0x1bae22(0x124)](_0x276f29=>_0x276f29['index']===_0x5b5e13);if(!_0x2f5a03)return null;let _0x6be10d=flipX?width-_0x2f5a03['x']:_0x2f5a03['x'],_0x2020d5=flipY?height-_0x2f5a03['y']:_0x2f5a03['y'];if(_0x18e887&&_0x18e887!==0x0){const _0x32d616=_0x18e887*Math['PI']/0xb4,_0x2680b4=Math['cos'](_0x32d616),_0x255cb3=Math[_0x1bae22(0x15e)](_0x32d616),_0x5302af=width/0x2,_0x2e8cc6=height/0x2,_0x4d02d4=_0x6be10d-_0x5302af,_0x4e9a67=_0x2020d5-_0x2e8cc6;_0x6be10d=_0x5302af+_0x4d02d4*_0x2680b4-_0x4e9a67*_0x255cb3,_0x2020d5=_0x2e8cc6+_0x4d02d4*_0x255cb3+_0x4e9a67*_0x2680b4;}_0x6be10d+=left,_0x2020d5+=top;let _0x46d042=_0x2f5a03['ang']/0xea60;if(flipX)_0x46d042=0xb4-_0x46d042;if(flipY)_0x46d042=-_0x46d042;_0x46d042+=_0x18e887||0x0,_0x46d042=(_0x46d042%0x168+0x168)%0x168;const _0x5bead0=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x18e887||0x0);return{'point':{'x':_0x6be10d,'y':_0x2020d5},'angle':_0x46d042,'bounds':_0x5bead0};}function calculateFreeEndpointAngle(_0x27609e,_0x48cc9e){const _0xeeab98=_0x1c0943,_0x834cf2=_0x48cc9e['x']-_0x27609e['x'],_0x296ed7=_0x48cc9e['y']-_0x27609e['y'];if(Math[_0xeeab98(0x16a)](_0x834cf2)>=Math[_0xeeab98(0x16a)](_0x296ed7))return _0x834cf2>=0x0?0xb4:0x0;return _0x296ed7>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x12231b,_0x6524c4,_0x18568a,_0x431b1c,_0xe7632b,_0x59b8d7,_0x105f2c){const _0x341cc5=_0x1c0943,_0xb0fc43=_0x59b8d7['getShapeModel'](_0x12231b,_0x6524c4,_0x18568a);if(!_0xb0fc43)return null;const _0x33e61b=_0x105f2c[_0x341cc5(0x169)]({'unitId':_0x12231b,'subUnitId':_0x6524c4,'drawingId':_0x18568a});if(!(_0x33e61b===null||_0x33e61b===void 0x0?void 0x0:_0x33e61b['transform']))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x33e61b[_0x341cc5(0x109)];_0xb0fc43[_0x341cc5(0x149)]({'width':width,'height':height});const _0x339b99=_0xb0fc43[_0x341cc5(0x160)]();if(_0x339b99['length']<0x2)return null;const _0x55ab4f=_0x431b1c?_0x339b99[0x0]:_0x339b99[_0x339b99[_0x341cc5(0x188)]-0x1],_0xd3bf8f=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x341cc5(0x12c)](_0x55ab4f);return{'point':_0xd3bf8f,'angle':calculateFreeEndpointAngle(_0xe7632b[_0x341cc5(0x14d)],_0xd3bf8f),'bounds':{'left':_0xd3bf8f['x'],'top':_0xd3bf8f['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x1c0943(0x179)](_0x2a08dc){const _0x179c35=_0x1c0943,{unitId:_0x2088d4,subUnitId:_0x140f8b,shapeId:_0x33bc7d,shapeType:_0x133569,shapeData:_0x2f951b,x:_0x5b9ccc,y:_0x27b942,width:_0x49f3ba,height:_0x7560a3}=_0x2a08dc;return this[_0x179c35(0x11b)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x2088d4,'subUnitId':_0x140f8b,'shapeId':_0x33bc7d,'shapeType':_0x133569,'shapeData':_0x2f951b,'position':{'x':_0x5b9ccc,'y':_0x27b942},'width':_0x49f3ba,'height':_0x7560a3});}async[_0x1c0943(0x12a)](_0xfda1a2){const _0x5b3ece=_0x1c0943,{unitId:_0x4791ca,subUnitId:_0x339e75,shapeId:_0x32ef15,shapeType:_0x568d59,shapeData:_0x2c4422,x:_0x433d70,y:_0x29152e,width:_0x4e9193,height:_0x57667e}=_0xfda1a2;return this[_0x5b3ece(0x11b)][_0x5b3ece(0x150)](SetShapeDrawingDataCommand['id'],{'unitId':_0x4791ca,'subUnitId':_0x339e75,'shapeId':_0x32ef15,'shapeType':_0x568d59,'shapeData':_0x2c4422,'position':{'x':_0x433d70,'y':_0x29152e},'width':_0x4e9193,'height':_0x57667e});}[_0x1c0943(0x176)](_0x489672){const _0xd8e9cd=_0x1c0943,_0x571516=this['getWorkbook']()[_0xd8e9cd(0x11d)](),_0xce0a76=this['getSheetId']();if(_0x489672){const _0x5172ff=new FShape(_0x571516,_0xce0a76,_0x489672[_0xd8e9cd(0x155)],this[_0xd8e9cd(0x13d)]);return this[_0xd8e9cd(0x168)](_0x5172ff,_0x571516,_0xce0a76,_0x489672[_0xd8e9cd(0x155)]),_0x5172ff;}return new FShape(_0x571516,_0xce0a76,generateRandomId(),this[_0xd8e9cd(0x13d)]);}[_0x1c0943(0x148)](_0x3a2e2e){const _0x1eb909=_0x1c0943,_0x250e55=this[_0x1eb909(0x18c)]()[_0x1eb909(0x11d)](),_0x487447=this[_0x1eb909(0x130)]();if(_0x3a2e2e){const _0x5ce809=new FConnectorShape(_0x250e55,_0x487447,_0x3a2e2e['drawId'],this['_injector']);return this[_0x1eb909(0x168)](_0x5ce809,_0x250e55,_0x487447,_0x3a2e2e['drawId']),_0x5ce809;}return new FConnectorShape(_0x250e55,_0x487447,generateRandomId(),this['_injector']);}['getShapes'](){const _0x4190f4=_0x1c0943,_0x119f00=this[_0x4190f4(0x13d)][_0x4190f4(0x140)](ISheetDrawingService),_0x33ce8e=this[_0x4190f4(0x18c)]()[_0x4190f4(0x11d)](),_0x929bce=this[_0x4190f4(0x130)](),_0x24088a=_0x119f00['getDrawingData'](_0x33ce8e,_0x929bce);if(!_0x24088a)return[];const _0x2a0960=[];for(const [_0x2bb0e2,_0x55d4f2]of Object[_0x4190f4(0x123)](_0x24088a))if(_0x55d4f2&&_0x55d4f2[_0x4190f4(0x159)]===DrawingTypeEnum['DRAWING_SHAPE']){const _0xb14264=new FShape(_0x33ce8e,_0x929bce,_0x2bb0e2,this[_0x4190f4(0x13d)]);this[_0x4190f4(0x168)](_0xb14264,_0x33ce8e,_0x929bce,_0x2bb0e2),_0x2a0960[_0x4190f4(0x10d)](_0xb14264);}return _0x2a0960;}[_0x1c0943(0x187)](_0x7d6d6){const _0x464a15=_0x1c0943,{unitId:_0x10045e,subUnitId:_0x17131c,drawId:_0x14770f}=_0x7d6d6;return this[_0x464a15(0x11b)][_0x464a15(0x150)](RemoveSheetDrawingCommand['id'],{'unitId':_0x10045e,'drawings':[{'unitId':_0x10045e,'subUnitId':_0x17131c,'drawingId':_0x14770f,'drawingType':DrawingTypeEnum[_0x464a15(0x125)]}]});}async[_0x1c0943(0x119)](_0x13965a){const _0x1a4b06=_0x1c0943,{connector:_0x4293fb,startTarget:_0x162f14,endTarget:_0x566454}=_0x13965a;if(!_0x162f14&&!_0x566454)return![];const _0xa9cb22=this[_0x1a4b06(0x18c)]()[_0x1a4b06(0x11d)](),_0x2183f1=this[_0x1a4b06(0x130)](),_0xfcdbef=this[_0x1a4b06(0x13d)][_0x1a4b06(0x140)](SheetsShapeService),_0x31ab05=this[_0x1a4b06(0x13d)][_0x1a4b06(0x140)](IDrawingManagerService),_0x1cf142=_0xfcdbef[_0x1a4b06(0x13f)](_0xa9cb22,_0x2183f1,_0x4293fb[_0x1a4b06(0x155)]);if(!_0x1cf142)return![];const _0x123596=_0x1cf142['getShapeType'](),_0x17ed94=_0x1cf142[_0x1a4b06(0x118)](),_0x6465d5={};for(const _0x347a71 of _0x1cf142['getAdjustNames']()){const _0x18cc21=_0x1cf142[_0x1a4b06(0x15b)](_0x347a71);if(_0x18cc21!==void 0x0)_0x6465d5[_0x347a71]=_0x18cc21;}const {startInfo:_0x141c3e,endInfo:_0x1576aa}=this[_0x1a4b06(0x16e)](_0xa9cb22,_0x2183f1,_0x4293fb,_0x1cf142,_0x162f14,_0x566454,_0xfcdbef,_0x31ab05,_0x17ed94);if(!_0x141c3e||!_0x1576aa)return![];const _0x5bb586=computeConnectorRouteLayout(routeConnectorLineShape(_0x141c3e,_0x1576aa,_0x123596),_0x123596),_0x169042={};if(_0x162f14)_0x169042[_0x1a4b06(0x17e)]={'shapeId':_0x162f14[_0x1a4b06(0x115)][_0x1a4b06(0x155)],'cxnIndex':_0x162f14[_0x1a4b06(0x131)]};else{if(_0x17ed94===null||_0x17ed94===void 0x0?void 0x0:_0x17ed94['from'])_0x169042[_0x1a4b06(0x17e)]=_0x17ed94[_0x1a4b06(0x17e)];}if(_0x566454)_0x169042['to']={'shapeId':_0x566454['shape'][_0x1a4b06(0x155)],'cxnIndex':_0x566454[_0x1a4b06(0x131)]};else{if(_0x17ed94===null||_0x17ed94===void 0x0?void 0x0:_0x17ed94['to'])_0x169042['to']=_0x17ed94['to'];}return this[_0x1a4b06(0x11b)][_0x1a4b06(0x150)](UpdateConnectorRelationCommand['id'],{'unitId':_0xa9cb22,'subUnitId':_0x2183f1,'connectorShapeId':_0x4293fb['drawId'],'width':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x16f)],'height':_0x5bb586[_0x1a4b06(0x15c)]['height'],'left':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x154)],'top':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x170)],'flipX':_0x5bb586[_0x1a4b06(0x15c)][_0x1a4b06(0x158)]||![],'flipY':_0x5bb586[_0x1a4b06(0x15c)]['flipY']||![],'oldAdjustValues':_0x6465d5,'newAdjustValues':_0x5bb586[_0x1a4b06(0x167)],'newLineType':_0x5bb586[_0x1a4b06(0x15a)],'oldLineType':_0x123596,'rotation':_0x5bb586['rotation'],'oldRelation':_0x17ed94,'newRelation':_0x169042});}[_0x1c0943(0x168)](_0x43a9ef,_0xfe3973,_0x13fac9,_0x499fb5){const _0x26ca79=_0x1c0943,_0x3e3dba=this[_0x26ca79(0x13d)][_0x26ca79(0x140)](IDrawingManagerService)[_0x26ca79(0x169)]({'unitId':_0xfe3973,'subUnitId':_0x13fac9,'drawingId':_0x499fb5});if(_0x3e3dba===null||_0x3e3dba===void 0x0?void 0x0:_0x3e3dba['transform']){var _0x427ff4,_0x65f86,_0x1a0263,_0x3810e5;_0x43a9ef['x']=(_0x427ff4=_0x3e3dba[_0x26ca79(0x109)]['left'])!==null&&_0x427ff4!==void 0x0?_0x427ff4:0x0,_0x43a9ef['y']=(_0x65f86=_0x3e3dba[_0x26ca79(0x109)][_0x26ca79(0x170)])!==null&&_0x65f86!==void 0x0?_0x65f86:0x0,_0x43a9ef[_0x26ca79(0x16f)]=(_0x1a0263=_0x3e3dba['transform'][_0x26ca79(0x16f)])!==null&&_0x1a0263!==void 0x0?_0x1a0263:_0x43a9ef[_0x26ca79(0x16f)],_0x43a9ef[_0x26ca79(0x11f)]=(_0x3810e5=_0x3e3dba[_0x26ca79(0x109)]['height'])!==null&&_0x3810e5!==void 0x0?_0x3810e5:_0x43a9ef['height'];}const _0x102311=this[_0x26ca79(0x13d)][_0x26ca79(0x140)](SheetsShapeService)[_0x26ca79(0x13f)](_0xfe3973,_0x13fac9,_0x499fb5);if(_0x102311){_0x43a9ef[_0x26ca79(0x121)]=_0x102311[_0x26ca79(0x108)]();const _0x664667=_0x102311[_0x26ca79(0x10a)]();if(_0x664667)_0x43a9ef[_0x26ca79(0x10f)]=JSON[_0x26ca79(0x137)](JSON[_0x26ca79(0x16b)](_0x664667));}}[_0x1c0943(0x16e)](_0x369373,_0x291e7a,_0x81569b,_0x274b3d,_0x21513b,_0x188f6a,_0x5d5f8c,_0x43522e,_0x3a9834){const _0x13471b=_0x1c0943;let _0x59d4c5=null,_0x6fd587=null;if(_0x21513b)_0x59d4c5=computeConnectionPointInfo(_0x369373,_0x291e7a,_0x21513b['shape'][_0x13471b(0x155)],_0x21513b['connectionSiteIndex'],_0x5d5f8c,_0x43522e);if(_0x188f6a)_0x6fd587=computeConnectionPointInfo(_0x369373,_0x291e7a,_0x188f6a['shape'][_0x13471b(0x155)],_0x188f6a[_0x13471b(0x131)],_0x5d5f8c,_0x43522e);if(!_0x59d4c5)_0x59d4c5=this[_0x13471b(0x173)](_0x369373,_0x291e7a,_0x81569b[_0x13471b(0x155)],!![],_0x6fd587,_0x3a9834===null||_0x3a9834===void 0x0?void 0x0:_0x3a9834['from'],_0x5d5f8c,_0x43522e);if(!_0x6fd587)_0x6fd587=this[_0x13471b(0x173)](_0x369373,_0x291e7a,_0x81569b['drawId'],![],_0x59d4c5,_0x3a9834===null||_0x3a9834===void 0x0?void 0x0:_0x3a9834['to'],_0x5d5f8c,_0x43522e);return{'startInfo':_0x59d4c5,'endInfo':_0x6fd587};}[_0x1c0943(0x173)](_0x32eaa4,_0x1ceac4,_0xcc1712,_0x21adca,_0x5e2c1d,_0xb83e95,_0x14f5a7,_0x2ed87a){const _0x53b544=_0x1c0943;if(_0xb83e95){const _0x3b3b32=computeConnectionPointInfo(_0x32eaa4,_0x1ceac4,_0xb83e95[_0x53b544(0x14c)],_0xb83e95[_0x53b544(0x153)],_0x14f5a7,_0x2ed87a);if(_0x3b3b32)return _0x3b3b32;}if(!_0x5e2c1d)return null;return computeFreeEndpointInfo(_0x32eaa4,_0x1ceac4,_0xcc1712,_0x21adca,_0x5e2c1d,_0x14f5a7,_0x2ed87a);}};FWorksheet[_0x1c0943(0x165)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
|
|
1
|
+
const _0x4296b1=_0x26cd;(function(_0x11a5d5,_0x5933f5){const _0x997147=_0x26cd,_0x5beee3=_0x11a5d5();while(!![]){try{const _0x439401=parseInt(_0x997147(0x1b4))/0x1+-parseInt(_0x997147(0x1ae))/0x2+-parseInt(_0x997147(0x19e))/0x3+-parseInt(_0x997147(0x1c2))/0x4*(parseInt(_0x997147(0x18d))/0x5)+-parseInt(_0x997147(0x1cc))/0x6*(parseInt(_0x997147(0x1ee))/0x7)+-parseInt(_0x997147(0x188))/0x8*(-parseInt(_0x997147(0x1c8))/0x9)+-parseInt(_0x997147(0x1a4))/0xa*(-parseInt(_0x997147(0x190))/0xb);if(_0x439401===_0x5933f5)break;else _0x5beee3['push'](_0x5beee3['shift']());}catch(_0x29eaf4){_0x5beee3['push'](_0x5beee3['shift']());}}}(_0x5bfe,0x595f7));function _0x26cd(_0xfe032f,_0x713fc4){_0xfe032f=_0xfe032f-0x16d;const _0x5bfe3d=_0x5bfe();let _0x26cd83=_0x5bfe3d[_0xfe032f];return _0x26cd83;}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';function _0x5bfe(){const _0x38145f=['type','removeShape','insertShape','ShapeLineCapEnum','shapeData','executeCommand','function','_injector','getConnectionSiteList','SolidFill','setStartArrowSize','\x20and\x20subUnitId\x20','updateContext','default','extend','worldRect','gradientAngle','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','symbol','gradientType','ShapeLineTypeEnum','8ZFdEUZ','parse','DRAWING_SHAPE','ang','_resolveExistingOrFreeEndpoint','85ZBBizl','height','newConnector','2962212aUratN','gradientStops','dashType','getWorkbook','sin','fillType','flipX','getShapeModel','setNoneFill','getPosition','size','setEndArrowType','adjustValues','left','579720flBQMy','getUnitId','toPrimitive','setStrokeColor','getSize','shape','20jNrRfB','length','stringify','flipY','string',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','lineJoinType','ShapeGradientTypeEnum','shapeId','get','941798UtfsNP','getEndConnectInfo','ShapeArrowTypeEnum','Skeleton\x20for\x20unitId\x20','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','ensureSkeleton','625093PQSgek','setStrokeLineCapType','transform','keys','getSheetId','newShape','fill','getConnectorLinePoints','width','entries','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setStrokeLineJoinType','from','_preloadShapeProperties','6164fkaPgq','rotation','_commandService','setStrokeLineDashType','color','getAdjustNames','4182471ghtBAB','call','getAdjustPoints','getShapeRelation','311994agMSRI','iterator','startArrow','setStrokeLineType','setStrokeOpacity','getAdjustValueByName','build','top','ShapeLineJoinEnum','drawId','setHeight','getDrawingByParam','setShapeSolidFill','object','\x20not\x20found','cos','ShapeLineDashEnum','setShapeType','stroke','getShapeData','setWidth','shapeType','opacity','setPosition','connectShapes','abs','localToWorld','getStartConnectInfo','getDrawingPoints','getShapeType','unitId','connectionSiteIndex','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','prototype','77vBAHdu','updateShape','getShapeId','getConnectionSites','_resolveEndpoints','subUnitId','find','endArrow'];_0x5bfe=function(){return _0x38145f;};return _0x5bfe();}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['ShapeFillEnum'](){return ShapeFillEnum;}get[_0x4296b1(0x1ab)](){return ShapeGradientTypeEnum;}get[_0x4296b1(0x187)](){return ShapeLineTypeEnum;}get[_0x4296b1(0x1dc)](){return ShapeLineDashEnum;}get[_0x4296b1(0x176)](){return ShapeLineCapEnum;}get[_0x4296b1(0x1d4)](){return ShapeLineJoinEnum;}get[_0x4296b1(0x1b0)](){return ShapeArrowTypeEnum;}get['ShapeArrowSizeEnum'](){return ShapeArrowSizeEnum;}};FEnum[_0x4296b1(0x181)](FSheetsShapeEnumMixin);function _typeof(_0xd175e8){'@babel/helpers - typeof';const _0x53c326=_0x4296b1;return _typeof=_0x53c326(0x179)==typeof Symbol&&_0x53c326(0x185)==typeof Symbol[_0x53c326(0x1cd)]?function(_0x261472){return typeof _0x261472;}:function(_0xb8e2e5){const _0x34ce11=_0x53c326;return _0xb8e2e5&&_0x34ce11(0x179)==typeof Symbol&&_0xb8e2e5['constructor']===Symbol&&_0xb8e2e5!==Symbol[_0x34ce11(0x1ed)]?_0x34ce11(0x185):typeof _0xb8e2e5;},_typeof(_0xd175e8);}function toPrimitive(_0x42ffe3,_0x2193ff){const _0x543da3=_0x4296b1;if(_0x543da3(0x1d9)!=_typeof(_0x42ffe3)||!_0x42ffe3)return _0x42ffe3;var _0x1f93a5=_0x42ffe3[Symbol[_0x543da3(0x1a0)]];if(void 0x0!==_0x1f93a5){var _0x4819c1=_0x1f93a5[_0x543da3(0x1c9)](_0x42ffe3,_0x2193ff||_0x543da3(0x180));if('object'!=_typeof(_0x4819c1))return _0x4819c1;throw new TypeError(_0x543da3(0x1be));}return(_0x543da3(0x1a8)===_0x2193ff?String:Number)(_0x42ffe3);}function toPropertyKey(_0x52c7bd){const _0x4502a3=_0x4296b1;var _0x711b55=toPrimitive(_0x52c7bd,'string');return _0x4502a3(0x185)==_typeof(_0x711b55)?_0x711b55:_0x711b55+'';}function _defineProperty(_0x101f93,_0x301b06,_0x28d40c){return(_0x301b06=toPropertyKey(_0x301b06))in _0x101f93?Object['defineProperty'](_0x101f93,_0x301b06,{'value':_0x28d40c,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x101f93[_0x301b06]=_0x28d40c,_0x101f93;}var FShape=class{constructor(_0x24e252,_0x2d85e6,_0x4ad9e6,_0xd4c48b){const _0x266ae0=_0x4296b1;_defineProperty(this,_0x266ae0(0x1ea),void 0x0),_defineProperty(this,'subUnitId',void 0x0),_defineProperty(this,_0x266ae0(0x1d5),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x266ae0(0x1bc),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x266ae0(0x18e),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x266ae0(0x1e1),void 0x0),_defineProperty(this,_0x266ae0(0x177),{}),_defineProperty(this,'_injector',void 0x0),this[_0x266ae0(0x1ea)]=_0x24e252,this['subUnitId']=_0x2d85e6,this[_0x266ae0(0x1d5)]=_0x4ad9e6||generateRandomId(),this[_0x266ae0(0x17a)]=_0xd4c48b;}[_0x4296b1(0x1e3)](_0x4b97e9,_0x140d84,_0x5a849e,_0x332ded){const _0x2c163d=_0x4296b1,_0x81bec1=this[_0x2c163d(0x17a)][_0x2c163d(0x1ad)](SheetSkeletonService)['ensureSkeleton'](this[_0x2c163d(0x1ea)],this['subUnitId']);if(!_0x81bec1)throw new Error('Skeleton\x20for\x20unitId\x20'+this[_0x2c163d(0x1ea)]+'\x20and\x20subUnitId\x20'+this[_0x2c163d(0x170)]+'\x20not\x20found');const {transform:_0x547883}=convertPositionCellToSheetOverGrid(this['unitId'],this['subUnitId'],{'row':_0x4b97e9,'column':_0x140d84,'rowOffset':_0x5a849e,'columnOffset':_0x332ded},0x1,0x1,_0x81bec1);return this['x']=_0x547883[_0x2c163d(0x19d)],this['y']=_0x547883[_0x2c163d(0x1d3)],this;}['setAbsolutePosition'](_0x30e167,_0x4a894a){return this['x']=_0x30e167,this['y']=_0x4a894a,this;}[_0x4296b1(0x1dd)](_0x489677){const _0x4b04c3=_0x4296b1;return this[_0x4b04c3(0x1e1)]=_0x489677,this;}[_0x4296b1(0x1d8)](_0x1899dc,_0x42aac6){const _0x405364=_0x4296b1;if(!this[_0x405364(0x177)]['fill'])this['shapeData'][_0x405364(0x1ba)]={};this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x195)]=ShapeFillEnum[_0x405364(0x17c)];if(_0x1899dc!==void 0x0)this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x1c6)]=_0x1899dc;if(_0x42aac6!==void 0x0)this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x1e2)]=_0x42aac6;return this;}['setShapeGradientFill'](_0x75a39d,_0x4efb58,_0x2c4d6f){const _0x9da8d2=_0x4296b1;if(_0x4efb58===void 0x0||_0x4efb58['length']===0x0)throw new Error(_0x9da8d2(0x184));if(!this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)])this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)]={};this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)][_0x9da8d2(0x191)]=_0x4efb58,this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)][_0x9da8d2(0x195)]=ShapeFillEnum['GradientFill'],this['shapeData'][_0x9da8d2(0x1ba)][_0x9da8d2(0x186)]=_0x75a39d;if(_0x2c4d6f!==void 0x0)this['shapeData'][_0x9da8d2(0x1ba)][_0x9da8d2(0x183)]=_0x2c4d6f;return this;}[_0x4296b1(0x198)](){const _0x26c4d6=_0x4296b1;return this[_0x26c4d6(0x177)]['fill']={'fillType':ShapeFillEnum['NoFill']},this;}[_0x4296b1(0x1a1)](_0x52eb5c){const _0x12f2e7=_0x4296b1;if(!this[_0x12f2e7(0x177)][_0x12f2e7(0x1de)])this[_0x12f2e7(0x177)][_0x12f2e7(0x1de)]={};return this[_0x12f2e7(0x177)]['stroke'][_0x12f2e7(0x1c6)]=_0x52eb5c,this;}['setStrokeWidth'](_0x308bea){const _0x4e06f9=_0x4296b1;if(!this[_0x4e06f9(0x177)][_0x4e06f9(0x1de)])this['shapeData']['stroke']={};return this[_0x4e06f9(0x177)]['stroke'][_0x4e06f9(0x1bc)]=_0x308bea,this;}[_0x4296b1(0x1c5)](_0x4df6c0){const _0x15c4fc=_0x4296b1;if(!this[_0x15c4fc(0x177)]['stroke'])this['shapeData'][_0x15c4fc(0x1de)]={};return this['shapeData'][_0x15c4fc(0x1de)][_0x15c4fc(0x192)]=_0x4df6c0,this;}[_0x4296b1(0x1bf)](_0x508c3f){const _0x1e8420=_0x4296b1;if(!this[_0x1e8420(0x177)][_0x1e8420(0x1de)])this[_0x1e8420(0x177)][_0x1e8420(0x1de)]={};return this[_0x1e8420(0x177)][_0x1e8420(0x1de)][_0x1e8420(0x1aa)]=_0x508c3f,this;}[_0x4296b1(0x1b5)](_0x1af8ef){const _0x1bfd1f=_0x4296b1;if(!this[_0x1bfd1f(0x177)][_0x1bfd1f(0x1de)])this[_0x1bfd1f(0x177)][_0x1bfd1f(0x1de)]={};return this[_0x1bfd1f(0x177)]['stroke']['capType']=_0x1af8ef,this;}[_0x4296b1(0x1d0)](_0x5d22d1){const _0xe8716b=_0x4296b1;if(!this[_0xe8716b(0x177)][_0xe8716b(0x1de)])this[_0xe8716b(0x177)]['stroke']={};return this[_0xe8716b(0x177)][_0xe8716b(0x1de)][_0xe8716b(0x1e2)]=_0x5d22d1,this;}[_0x4296b1(0x1cf)](_0x1fc1e4){const _0x36f9b3=_0x4296b1;if(!this[_0x36f9b3(0x177)]['stroke'])this[_0x36f9b3(0x177)][_0x36f9b3(0x1de)]={};return this[_0x36f9b3(0x177)][_0x36f9b3(0x1de)]['lineStrokeType']=_0x1fc1e4,this;}[_0x4296b1(0x1e0)](_0x45ea76){const _0xba6e4d=_0x4296b1;return this[_0xba6e4d(0x1bc)]=_0x45ea76,this;}[_0x4296b1(0x1d6)](_0x4987e2){const _0x58758c=_0x4296b1;return this[_0x58758c(0x18e)]=_0x4987e2,this;}['isLineShape'](){const _0xcc2e99=_0x4296b1,_0x295e09=this['_injector'][_0xcc2e99(0x1ad)](SheetsShapeService)[_0xcc2e99(0x197)](this[_0xcc2e99(0x1ea)],this[_0xcc2e99(0x170)],this[_0xcc2e99(0x1d5)]);if(_0x295e09)return isConnectorShape(_0x295e09[_0xcc2e99(0x1e9)]());if(this[_0xcc2e99(0x1e1)])return isConnectorShape(this[_0xcc2e99(0x1e1)]);return![];}[_0x4296b1(0x16e)](){const _0xd83d62=_0x4296b1,_0x2ed5f7=this['_injector']['get'](SheetsShapeService)[_0xd83d62(0x197)](this['unitId'],this[_0xd83d62(0x170)],this[_0xd83d62(0x1d5)]);if(!_0x2ed5f7)return[];const _0x441a09=this[_0xd83d62(0x17a)][_0xd83d62(0x1ad)](IDrawingManagerService)[_0xd83d62(0x1d7)]({'unitId':this['unitId'],'subUnitId':this[_0xd83d62(0x170)],'drawingId':this[_0xd83d62(0x1d5)]});if(!(_0x441a09===null||_0x441a09===void 0x0?void 0x0:_0x441a09['transform']))return[];const {width:width=0x0,height:height=0x0}=_0x441a09[_0xd83d62(0x1b6)];return _0x2ed5f7['updateContext']({'width':width,'height':height}),_0x2ed5f7[_0xd83d62(0x17b)]();}[_0x4296b1(0x1ca)](){const _0x4a736a=_0x4296b1,_0x58a463=this[_0x4a736a(0x17a)][_0x4a736a(0x1ad)](SheetsShapeService)[_0x4a736a(0x197)](this[_0x4a736a(0x1ea)],this[_0x4a736a(0x170)],this[_0x4a736a(0x1d5)]);if(!_0x58a463)return[];const _0x310927=this[_0x4a736a(0x17a)][_0x4a736a(0x1ad)](IDrawingManagerService)[_0x4a736a(0x1d7)]({'unitId':this['unitId'],'subUnitId':this[_0x4a736a(0x170)],'drawingId':this['drawId']});if(!(_0x310927===null||_0x310927===void 0x0?void 0x0:_0x310927[_0x4a736a(0x1b6)]))return[];const {width:width=0x0,height:height=0x0}=_0x310927['transform'];return _0x58a463[_0x4a736a(0x17f)]({'width':width,'height':height}),_0x58a463[_0x4a736a(0x1e8)]();}[_0x4296b1(0x1bb)](){const _0xc19b01=_0x4296b1,_0x227083=this[_0xc19b01(0x17a)]['get'](SheetsShapeService)[_0xc19b01(0x197)](this['unitId'],this['subUnitId'],this[_0xc19b01(0x1d5)]);if(!_0x227083)return[];if(!isConnectorShape(_0x227083[_0xc19b01(0x1e9)]()))return[];const _0x23795a=this[_0xc19b01(0x17a)][_0xc19b01(0x1ad)](IDrawingManagerService)[_0xc19b01(0x1d7)]({'unitId':this[_0xc19b01(0x1ea)],'subUnitId':this[_0xc19b01(0x170)],'drawingId':this['drawId']});if(!(_0x23795a===null||_0x23795a===void 0x0?void 0x0:_0x23795a[_0xc19b01(0x1b6)]))return[];const {width:width=0x0,height:height=0x0}=_0x23795a[_0xc19b01(0x1b6)];return _0x227083[_0xc19b01(0x17f)]({'width':width,'height':height}),_0x227083[_0xc19b01(0x1bb)]();}[_0x4296b1(0x1e7)](){const _0x589962=_0x4296b1;var _0x1a2caf;const _0x4239ee=this['_injector'][_0x589962(0x1ad)](SheetsShapeService)[_0x589962(0x197)](this['unitId'],this['subUnitId'],this[_0x589962(0x1d5)]);if(!_0x4239ee)return null;return(_0x1a2caf=_0x4239ee[_0x589962(0x1e7)]())!==null&&_0x1a2caf!==void 0x0?_0x1a2caf:null;}[_0x4296b1(0x1af)](){const _0x45bb25=_0x4296b1;var _0x207fbd;const _0xe1c07f=this[_0x45bb25(0x17a)][_0x45bb25(0x1ad)](SheetsShapeService)[_0x45bb25(0x197)](this[_0x45bb25(0x1ea)],this['subUnitId'],this[_0x45bb25(0x1d5)]);if(!_0xe1c07f)return null;return(_0x207fbd=_0xe1c07f['getEndConnectInfo']())!==null&&_0x207fbd!==void 0x0?_0x207fbd:null;}['build'](){const _0x5ddd54=_0x4296b1;var _0x30e3a6,_0x1cedc9;if(!this[_0x5ddd54(0x1e1)])throw new Error(_0x5ddd54(0x1ec));if(this['x']===0x0||this['y']===0x0){const _0xc90448=this[_0x5ddd54(0x17a)][_0x5ddd54(0x1ad)](SheetSkeletonService)[_0x5ddd54(0x1b3)](this[_0x5ddd54(0x1ea)],this[_0x5ddd54(0x170)]);if(!_0xc90448)throw new Error(_0x5ddd54(0x1b1)+this['unitId']+_0x5ddd54(0x17e)+this[_0x5ddd54(0x170)]+_0x5ddd54(0x1da));const {transform:_0x21cf9d}=convertPositionCellToSheetOverGrid(this[_0x5ddd54(0x1ea)],this[_0x5ddd54(0x170)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0xc90448);this['x']=this['x']>0x0?this['x']:_0x21cf9d[_0x5ddd54(0x19d)],this['y']=this['y']>0x0?this['y']:_0x21cf9d['top'];}return this[_0x5ddd54(0x1bc)]=(_0x30e3a6=this[_0x5ddd54(0x1bc)])!==null&&_0x30e3a6!==void 0x0?_0x30e3a6:DEFAULT_SHAPE_WIDTH,this[_0x5ddd54(0x18e)]=(_0x1cedc9=this[_0x5ddd54(0x18e)])!==null&&_0x1cedc9!==void 0x0?_0x1cedc9:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x5ddd54(0x1ea)],'subUnitId':this['subUnitId'],'shapeId':this['drawId'],'shapeType':this['shapeType'],'shapeData':Object[_0x5ddd54(0x1b7)](this[_0x5ddd54(0x177)])[_0x5ddd54(0x1a5)]>0x0?this[_0x5ddd54(0x177)]:void 0x0,'x':this['x'],'y':this['y'],'width':this['width'],'height':this['height']};}[_0x4296b1(0x16d)](){return this['drawId'];}[_0x4296b1(0x1e9)](){const _0xb9b10d=_0x4296b1;return this[_0xb9b10d(0x1e1)];}[_0x4296b1(0x1df)](){const _0x380fff=_0x4296b1;return this[_0x380fff(0x177)];}[_0x4296b1(0x199)](){return{'x':this['x'],'y':this['y']};}[_0x4296b1(0x1a2)](){const _0x4b024c=_0x4296b1;return{'width':this[_0x4b024c(0x1bc)],'height':this['height']};}},FConnectorShape=class extends FShape{constructor(_0x545d83,_0x2e3df6,_0x3437e8,_0x3b9d35){const _0x1dfb4e=_0x4296b1;super(_0x545d83,_0x2e3df6,_0x3437e8,_0x3b9d35),_defineProperty(this,_0x1dfb4e(0x177),{});}['setShapeType'](_0x38dd2d){const _0x302968=_0x4296b1;if(!isConnectorShape(_0x38dd2d))throw new Error(_0x302968(0x1b2)+_0x38dd2d+_0x302968(0x1a9));return super[_0x302968(0x1dd)](_0x38dd2d),this;}['setStartArrowType'](_0xd2b8ec){const _0x4f48ba=_0x4296b1;var _0x2df4c5,_0x2f88e9;if(!((_0x2df4c5=this[_0x4f48ba(0x177)])===null||_0x2df4c5===void 0x0?void 0x0:_0x2df4c5['ln']))this[_0x4f48ba(0x177)]['ln']={};if(!((_0x2f88e9=this[_0x4f48ba(0x177)])===null||_0x2f88e9===void 0x0||(_0x2f88e9=_0x2f88e9['ln'])===null||_0x2f88e9===void 0x0?void 0x0:_0x2f88e9[_0x4f48ba(0x1ce)]))this[_0x4f48ba(0x177)]['ln'][_0x4f48ba(0x1ce)]={};return this['shapeData']['ln'][_0x4f48ba(0x1ce)]['type']=_0xd2b8ec,this;}[_0x4296b1(0x19b)](_0x5302af){const _0x4053a6=_0x4296b1;var _0x3588cf,_0x590902;if(!((_0x3588cf=this[_0x4053a6(0x177)])===null||_0x3588cf===void 0x0?void 0x0:_0x3588cf['ln']))this[_0x4053a6(0x177)]['ln']={};if(!((_0x590902=this['shapeData'])===null||_0x590902===void 0x0||(_0x590902=_0x590902['ln'])===null||_0x590902===void 0x0?void 0x0:_0x590902['endArrow']))this[_0x4053a6(0x177)]['ln'][_0x4053a6(0x172)]={};return this[_0x4053a6(0x177)]['ln'][_0x4053a6(0x172)][_0x4053a6(0x173)]=_0x5302af,this;}[_0x4296b1(0x17d)](_0x2e5bd4){const _0x5ec447=_0x4296b1;var _0xda075e,_0x3a1207;if(!((_0xda075e=this[_0x5ec447(0x177)])===null||_0xda075e===void 0x0?void 0x0:_0xda075e['ln']))this['shapeData']['ln']={};if(!((_0x3a1207=this[_0x5ec447(0x177)])===null||_0x3a1207===void 0x0||(_0x3a1207=_0x3a1207['ln'])===null||_0x3a1207===void 0x0?void 0x0:_0x3a1207[_0x5ec447(0x1ce)]))this[_0x5ec447(0x177)]['ln'][_0x5ec447(0x1ce)]={};return this['shapeData']['ln'][_0x5ec447(0x1ce)][_0x5ec447(0x19a)]=_0x2e5bd4,this;}['setEndArrowSize'](_0x17dd49){const _0x479f1c=_0x4296b1;var _0x444d95,_0x4b808d;if(!((_0x444d95=this[_0x479f1c(0x177)])===null||_0x444d95===void 0x0?void 0x0:_0x444d95['ln']))this[_0x479f1c(0x177)]['ln']={};if(!((_0x4b808d=this[_0x479f1c(0x177)])===null||_0x4b808d===void 0x0||(_0x4b808d=_0x4b808d['ln'])===null||_0x4b808d===void 0x0?void 0x0:_0x4b808d['endArrow']))this[_0x479f1c(0x177)]['ln']['endArrow']={};return this['shapeData']['ln'][_0x479f1c(0x172)][_0x479f1c(0x19a)]=_0x17dd49,this;}[_0x4296b1(0x1d2)](){return super['build']();}[_0x4296b1(0x1af)](){var _0x510935;return((_0x510935=this['shapeData'])===null||_0x510935===void 0x0||(_0x510935=_0x510935['relation'])===null||_0x510935===void 0x0?void 0x0:_0x510935['to'])||null;}[_0x4296b1(0x1e7)](){const _0x123950=_0x4296b1;var _0x43b1ba;return((_0x43b1ba=this[_0x123950(0x177)])===null||_0x43b1ba===void 0x0||(_0x43b1ba=_0x43b1ba['relation'])===null||_0x43b1ba===void 0x0?void 0x0:_0x43b1ba[_0x123950(0x1c0)])||null;}};function computeConnectionPointInfo(_0x3aabea,_0x5ee288,_0x51e515,_0x7e8a40,_0x380c1d,_0x122970){const _0x3184ab=_0x4296b1,_0x43671c=_0x380c1d[_0x3184ab(0x197)](_0x3aabea,_0x5ee288,_0x51e515);if(!_0x43671c)return null;const _0x5f4c3=_0x122970[_0x3184ab(0x1d7)]({'unitId':_0x3aabea,'subUnitId':_0x5ee288,'drawingId':_0x51e515});if(!(_0x5f4c3===null||_0x5f4c3===void 0x0?void 0x0:_0x5f4c3[_0x3184ab(0x1b6)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x13eca9}=_0x5f4c3[_0x3184ab(0x1b6)];_0x43671c[_0x3184ab(0x17f)]({'width':width,'height':height});const _0xcef540=_0x43671c[_0x3184ab(0x17b)]()[_0x3184ab(0x171)](_0x641d2d=>_0x641d2d['index']===_0x7e8a40);if(!_0xcef540)return null;let _0x29dd94=flipX?width-_0xcef540['x']:_0xcef540['x'],_0x48d2a7=flipY?height-_0xcef540['y']:_0xcef540['y'];if(_0x13eca9&&_0x13eca9!==0x0){const _0x2a2f29=_0x13eca9*Math['PI']/0xb4,_0x3e3f40=Math[_0x3184ab(0x1db)](_0x2a2f29),_0x2f288e=Math[_0x3184ab(0x194)](_0x2a2f29),_0x288407=width/0x2,_0x20f3af=height/0x2,_0x536eeb=_0x29dd94-_0x288407,_0x1bdb50=_0x48d2a7-_0x20f3af;_0x29dd94=_0x288407+_0x536eeb*_0x3e3f40-_0x1bdb50*_0x2f288e,_0x48d2a7=_0x20f3af+_0x536eeb*_0x2f288e+_0x1bdb50*_0x3e3f40;}_0x29dd94+=left,_0x48d2a7+=top;let _0x498542=_0xcef540[_0x3184ab(0x18b)]/0xea60;if(flipX)_0x498542=0xb4-_0x498542;if(flipY)_0x498542=-_0x498542;_0x498542+=_0x13eca9||0x0,_0x498542=(_0x498542%0x168+0x168)%0x168;const _0x7df8cb=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x13eca9||0x0);return{'point':{'x':_0x29dd94,'y':_0x48d2a7},'angle':_0x498542,'bounds':_0x7df8cb};}function calculateFreeEndpointAngle(_0x382f26,_0x49e5df){const _0x45635b=_0x4296b1,_0x32d072=_0x49e5df['x']-_0x382f26['x'],_0x30b5e5=_0x49e5df['y']-_0x382f26['y'];if(Math[_0x45635b(0x1e5)](_0x32d072)>=Math['abs'](_0x30b5e5))return _0x32d072>=0x0?0xb4:0x0;return _0x30b5e5>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x502745,_0x3f0c48,_0x3651d2,_0x419f03,_0x355d1a,_0x2d3e3b,_0x4b7aa0){const _0x2a71a1=_0x4296b1,_0x27091f=_0x2d3e3b[_0x2a71a1(0x197)](_0x502745,_0x3f0c48,_0x3651d2);if(!_0x27091f)return null;const _0x2098c1=_0x4b7aa0['getDrawingByParam']({'unitId':_0x502745,'subUnitId':_0x3f0c48,'drawingId':_0x3651d2});if(!(_0x2098c1===null||_0x2098c1===void 0x0?void 0x0:_0x2098c1[_0x2a71a1(0x1b6)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x2098c1['transform'];_0x27091f[_0x2a71a1(0x17f)]({'width':width,'height':height});const _0x434dee=_0x27091f[_0x2a71a1(0x1bb)]();if(_0x434dee[_0x2a71a1(0x1a5)]<0x2)return null;const _0x1f585a=_0x419f03?_0x434dee[0x0]:_0x434dee[_0x434dee[_0x2a71a1(0x1a5)]-0x1],_0x2db3a1=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x2a71a1(0x1e6)](_0x1f585a);return{'point':_0x2db3a1,'angle':calculateFreeEndpointAngle(_0x355d1a['point'],_0x2db3a1),'bounds':{'left':_0x2db3a1['x'],'top':_0x2db3a1['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x4296b1(0x175)](_0x59fdfd){const _0x2e0bcb=_0x4296b1,{unitId:_0x5a542e,subUnitId:_0x127d02,shapeId:_0x31b02a,shapeType:_0x5537b9,shapeData:_0x11494a,x:_0xbe9019,y:_0x570793,width:_0x502b7a,height:_0x29d44b}=_0x59fdfd;return this['_commandService'][_0x2e0bcb(0x178)](InsertShapeCommand['id'],{'unitId':_0x5a542e,'subUnitId':_0x127d02,'shapeId':_0x31b02a,'shapeType':_0x5537b9,'shapeData':_0x11494a,'position':{'x':_0xbe9019,'y':_0x570793},'width':_0x502b7a,'height':_0x29d44b});}async[_0x4296b1(0x1ef)](_0x415ccd){const _0x408cb4=_0x4296b1,{unitId:_0x39eab7,subUnitId:_0x59024b,shapeId:_0x1c6674,shapeType:_0x35f437,shapeData:_0x36b1be,x:_0x253a1a,y:_0x28b9ce,width:_0x56e549,height:_0x13b20a}=_0x415ccd;return this[_0x408cb4(0x1c4)][_0x408cb4(0x178)](SetShapeDrawingDataCommand['id'],{'unitId':_0x39eab7,'subUnitId':_0x59024b,'shapeId':_0x1c6674,'shapeType':_0x35f437,'shapeData':_0x36b1be,'position':{'x':_0x253a1a,'y':_0x28b9ce},'width':_0x56e549,'height':_0x13b20a});}[_0x4296b1(0x1b9)](_0x3e1d0b){const _0xfdf40=_0x4296b1,_0x2c4d69=this[_0xfdf40(0x193)]()[_0xfdf40(0x19f)](),_0x4bda6b=this[_0xfdf40(0x1b8)]();if(_0x3e1d0b){const _0x187976=new FShape(_0x2c4d69,_0x4bda6b,_0x3e1d0b[_0xfdf40(0x1d5)],this[_0xfdf40(0x17a)]);return this['_preloadShapeProperties'](_0x187976,_0x2c4d69,_0x4bda6b,_0x3e1d0b['drawId']),_0x187976;}return new FShape(_0x2c4d69,_0x4bda6b,generateRandomId(),this[_0xfdf40(0x17a)]);}[_0x4296b1(0x18f)](_0x2bf1f3){const _0x2d9923=_0x4296b1,_0x185826=this[_0x2d9923(0x193)]()[_0x2d9923(0x19f)](),_0x51c78f=this[_0x2d9923(0x1b8)]();if(_0x2bf1f3){const _0x4c5b91=new FConnectorShape(_0x185826,_0x51c78f,_0x2bf1f3[_0x2d9923(0x1d5)],this[_0x2d9923(0x17a)]);return this[_0x2d9923(0x1c1)](_0x4c5b91,_0x185826,_0x51c78f,_0x2bf1f3[_0x2d9923(0x1d5)]),_0x4c5b91;}return new FConnectorShape(_0x185826,_0x51c78f,generateRandomId(),this['_injector']);}['getShapes'](){const _0x27b81a=_0x4296b1,_0x183efd=this[_0x27b81a(0x17a)]['get'](ISheetDrawingService),_0x1b6ff2=this[_0x27b81a(0x193)]()[_0x27b81a(0x19f)](),_0x58579e=this[_0x27b81a(0x1b8)](),_0x4e9109=_0x183efd['getDrawingData'](_0x1b6ff2,_0x58579e);if(!_0x4e9109)return[];const _0x2bdffc=[];for(const [_0x7993b8,_0x4a8792]of Object[_0x27b81a(0x1bd)](_0x4e9109))if(_0x4a8792&&_0x4a8792['drawingType']===DrawingTypeEnum[_0x27b81a(0x18a)]){const _0x15d2c1=new FShape(_0x1b6ff2,_0x58579e,_0x7993b8,this[_0x27b81a(0x17a)]);this[_0x27b81a(0x1c1)](_0x15d2c1,_0x1b6ff2,_0x58579e,_0x7993b8),_0x2bdffc['push'](_0x15d2c1);}return _0x2bdffc;}[_0x4296b1(0x174)](_0x140c0e){const _0x590d17=_0x4296b1,{unitId:_0x5398c5,subUnitId:_0x2c1a0a,drawId:_0x39da9c}=_0x140c0e;return this[_0x590d17(0x1c4)][_0x590d17(0x178)](RemoveSheetDrawingCommand['id'],{'unitId':_0x5398c5,'drawings':[{'unitId':_0x5398c5,'subUnitId':_0x2c1a0a,'drawingId':_0x39da9c,'drawingType':DrawingTypeEnum['DRAWING_SHAPE']}]});}async[_0x4296b1(0x1e4)](_0x149288){const _0x31e303=_0x4296b1,{connector:_0xb6bcee,startTarget:_0x151dbe,endTarget:_0x3c4595}=_0x149288;if(!_0x151dbe&&!_0x3c4595)return![];const _0x1b26e7=this[_0x31e303(0x193)]()[_0x31e303(0x19f)](),_0xbb405f=this[_0x31e303(0x1b8)](),_0x2694c0=this['_injector']['get'](SheetsShapeService),_0x1f1d63=this[_0x31e303(0x17a)][_0x31e303(0x1ad)](IDrawingManagerService),_0xb504c=_0x2694c0['getShapeModel'](_0x1b26e7,_0xbb405f,_0xb6bcee[_0x31e303(0x1d5)]);if(!_0xb504c)return![];const _0x4a4471=_0xb504c[_0x31e303(0x1e9)](),_0x1efcde=_0xb504c[_0x31e303(0x1cb)](),_0x37ac88={};for(const _0x36ae1b of _0xb504c[_0x31e303(0x1c7)]()){const _0x3fe095=_0xb504c[_0x31e303(0x1d1)](_0x36ae1b);if(_0x3fe095!==void 0x0)_0x37ac88[_0x36ae1b]=_0x3fe095;}const {startInfo:_0x29ec96,endInfo:_0x28b1ea}=this[_0x31e303(0x16f)](_0x1b26e7,_0xbb405f,_0xb6bcee,_0xb504c,_0x151dbe,_0x3c4595,_0x2694c0,_0x1f1d63,_0x1efcde);if(!_0x29ec96||!_0x28b1ea)return![];const _0x42224d=computeConnectorRouteLayout(routeConnectorLineShape(_0x29ec96,_0x28b1ea,_0x4a4471),_0x4a4471),_0x48d06d={};if(_0x151dbe)_0x48d06d[_0x31e303(0x1c0)]={'shapeId':_0x151dbe[_0x31e303(0x1a3)][_0x31e303(0x1d5)],'cxnIndex':_0x151dbe['connectionSiteIndex']};else{if(_0x1efcde===null||_0x1efcde===void 0x0?void 0x0:_0x1efcde[_0x31e303(0x1c0)])_0x48d06d['from']=_0x1efcde[_0x31e303(0x1c0)];}if(_0x3c4595)_0x48d06d['to']={'shapeId':_0x3c4595[_0x31e303(0x1a3)]['drawId'],'cxnIndex':_0x3c4595['connectionSiteIndex']};else{if(_0x1efcde===null||_0x1efcde===void 0x0?void 0x0:_0x1efcde['to'])_0x48d06d['to']=_0x1efcde['to'];}return this['_commandService']['executeCommand'](UpdateConnectorRelationCommand['id'],{'unitId':_0x1b26e7,'subUnitId':_0xbb405f,'connectorShapeId':_0xb6bcee[_0x31e303(0x1d5)],'width':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1bc)],'height':_0x42224d['worldRect'][_0x31e303(0x18e)],'left':_0x42224d[_0x31e303(0x182)][_0x31e303(0x19d)],'top':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1d3)],'flipX':_0x42224d['worldRect'][_0x31e303(0x196)]||![],'flipY':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1a7)]||![],'oldAdjustValues':_0x37ac88,'newAdjustValues':_0x42224d[_0x31e303(0x19c)],'newLineType':_0x42224d['lineType'],'oldLineType':_0x4a4471,'rotation':_0x42224d[_0x31e303(0x1c3)],'oldRelation':_0x1efcde,'newRelation':_0x48d06d});}[_0x4296b1(0x1c1)](_0x334790,_0x767677,_0x1f7997,_0x68ffac){const _0xd7caa5=_0x4296b1,_0x59a1bf=this[_0xd7caa5(0x17a)][_0xd7caa5(0x1ad)](IDrawingManagerService)[_0xd7caa5(0x1d7)]({'unitId':_0x767677,'subUnitId':_0x1f7997,'drawingId':_0x68ffac});if(_0x59a1bf===null||_0x59a1bf===void 0x0?void 0x0:_0x59a1bf[_0xd7caa5(0x1b6)]){var _0x4b61b8,_0x112f1e,_0x3fc427,_0x10ba6f;_0x334790['x']=(_0x4b61b8=_0x59a1bf[_0xd7caa5(0x1b6)]['left'])!==null&&_0x4b61b8!==void 0x0?_0x4b61b8:0x0,_0x334790['y']=(_0x112f1e=_0x59a1bf[_0xd7caa5(0x1b6)][_0xd7caa5(0x1d3)])!==null&&_0x112f1e!==void 0x0?_0x112f1e:0x0,_0x334790[_0xd7caa5(0x1bc)]=(_0x3fc427=_0x59a1bf[_0xd7caa5(0x1b6)]['width'])!==null&&_0x3fc427!==void 0x0?_0x3fc427:_0x334790[_0xd7caa5(0x1bc)],_0x334790['height']=(_0x10ba6f=_0x59a1bf[_0xd7caa5(0x1b6)][_0xd7caa5(0x18e)])!==null&&_0x10ba6f!==void 0x0?_0x10ba6f:_0x334790[_0xd7caa5(0x18e)];}const _0x261fed=this['_injector'][_0xd7caa5(0x1ad)](SheetsShapeService)[_0xd7caa5(0x197)](_0x767677,_0x1f7997,_0x68ffac);if(_0x261fed){_0x334790[_0xd7caa5(0x1e1)]=_0x261fed['getShapeType']();const _0x1ad07e=_0x261fed[_0xd7caa5(0x1df)]();if(_0x1ad07e)_0x334790[_0xd7caa5(0x177)]=JSON[_0xd7caa5(0x189)](JSON[_0xd7caa5(0x1a6)](_0x1ad07e));}}[_0x4296b1(0x16f)](_0x43c675,_0x11c40f,_0x18bc0f,_0x1134ce,_0x12a4d8,_0x44bb2b,_0x537a15,_0x4a3154,_0x920042){const _0x2f10ed=_0x4296b1;let _0x4c6609=null,_0x446331=null;if(_0x12a4d8)_0x4c6609=computeConnectionPointInfo(_0x43c675,_0x11c40f,_0x12a4d8['shape']['drawId'],_0x12a4d8['connectionSiteIndex'],_0x537a15,_0x4a3154);if(_0x44bb2b)_0x446331=computeConnectionPointInfo(_0x43c675,_0x11c40f,_0x44bb2b[_0x2f10ed(0x1a3)]['drawId'],_0x44bb2b[_0x2f10ed(0x1eb)],_0x537a15,_0x4a3154);if(!_0x4c6609)_0x4c6609=this[_0x2f10ed(0x18c)](_0x43c675,_0x11c40f,_0x18bc0f['drawId'],!![],_0x446331,_0x920042===null||_0x920042===void 0x0?void 0x0:_0x920042['from'],_0x537a15,_0x4a3154);if(!_0x446331)_0x446331=this['_resolveExistingOrFreeEndpoint'](_0x43c675,_0x11c40f,_0x18bc0f[_0x2f10ed(0x1d5)],![],_0x4c6609,_0x920042===null||_0x920042===void 0x0?void 0x0:_0x920042['to'],_0x537a15,_0x4a3154);return{'startInfo':_0x4c6609,'endInfo':_0x446331};}[_0x4296b1(0x18c)](_0x335f37,_0x2905b5,_0x315790,_0x566a80,_0x2a802b,_0x5445e4,_0x2398c7,_0x22811f){const _0x2788c6=_0x4296b1;if(_0x5445e4){const _0x1dc872=computeConnectionPointInfo(_0x335f37,_0x2905b5,_0x5445e4[_0x2788c6(0x1ac)],_0x5445e4['cxnIndex'],_0x2398c7,_0x22811f);if(_0x1dc872)return _0x1dc872;}if(!_0x2a802b)return null;return computeFreeEndpointInfo(_0x335f37,_0x2905b5,_0x315790,_0x566a80,_0x2a802b,_0x2398c7,_0x22811f);}};FWorksheet[_0x4296b1(0x181)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x331e47=_0x1f87;(function(_0x4ae334,_0x22fdb0){const _0x106f5d=_0x1f87,_0x5c0b17=_0x4ae334();while(!![]){try{const _0x47b09e=-parseInt(_0x106f5d(0x150))/0x1*(parseInt(_0x106f5d(0x105))/0x2)+parseInt(_0x106f5d(0x113))/0x3*(parseInt(_0x106f5d(0xea))/0x4)+-parseInt(_0x106f5d(0x14f))/0x5+-parseInt(_0x106f5d(0x121))/0x6+parseInt(_0x106f5d(0xf4))/0x7*(-parseInt(_0x106f5d(0xe3))/0x8)+-parseInt(_0x106f5d(0x124))/0x9*(-parseInt(_0x106f5d(0xfe))/0xa)+parseInt(_0x106f5d(0xf0))/0xb;if(_0x47b09e===_0x22fdb0)break;else _0x5c0b17['push'](_0x5c0b17['shift']());}catch(_0x4b27a3){_0x5c0b17['push'](_0x5c0b17['shift']());}}}(_0x2c0a,0x7625c));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(_0x3cce5d){'@babel/helpers - typeof';const _0x4e76bf=_0x1f87;return _typeof=_0x4e76bf(0x132)==typeof Symbol&&_0x4e76bf(0xfb)==typeof Symbol[_0x4e76bf(0x12c)]?function(_0x18924d){return typeof _0x18924d;}:function(_0xed9ad7){const _0x468c84=_0x4e76bf;return _0xed9ad7&&_0x468c84(0x132)==typeof Symbol&&_0xed9ad7[_0x468c84(0xe1)]===Symbol&&_0xed9ad7!==Symbol['prototype']?_0x468c84(0xfb):typeof _0xed9ad7;},_typeof(_0x3cce5d);}function toPrimitive(_0x155ce3,_0x5cc320){const _0xb75b22=_0x1f87;if('object'!=_typeof(_0x155ce3)||!_0x155ce3)return _0x155ce3;var _0x1e2a8e=_0x155ce3[Symbol[_0xb75b22(0x127)]];if(void 0x0!==_0x1e2a8e){var _0x127ae7=_0x1e2a8e['call'](_0x155ce3,_0x5cc320||'default');if(_0xb75b22(0x116)!=_typeof(_0x127ae7))return _0x127ae7;throw new TypeError(_0xb75b22(0x11f));}return(_0xb75b22(0xe9)===_0x5cc320?String:Number)(_0x155ce3);}function toPropertyKey(_0x4b48bd){const _0x39dd42=_0x1f87;var _0x23c402=toPrimitive(_0x4b48bd,_0x39dd42(0xe9));return'symbol'==_typeof(_0x23c402)?_0x23c402:_0x23c402+'';}function _defineProperty(_0x8147f6,_0x4b0672,_0x20ad8b){return(_0x4b0672=toPropertyKey(_0x4b0672))in _0x8147f6?Object['defineProperty'](_0x8147f6,_0x4b0672,{'value':_0x20ad8b,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x8147f6[_0x4b0672]=_0x20ad8b,_0x8147f6;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x26e1b3=_0x1f87;super(),_defineProperty(this,_0x26e1b3(0x111),new Map()),_defineProperty(this,_0x26e1b3(0xc5),new Set()),_defineProperty(this,'_groupIds',new Set());}[_0x331e47(0x159)](_0x14da9c,_0x53d50,_0x16dad8){const _0x153a78=_0x331e47,_0x5a1894=new ShapeModel(_0x14da9c,_0x53d50,_0x16dad8);this['_shapes'][_0x153a78(0xd4)](_0x53d50,_0x5a1894);if(isConnectorShape(_0x14da9c))this[_0x153a78(0xc5)][_0x153a78(0x146)](_0x53d50);return _0x5a1894;}[_0x331e47(0xcd)](_0x3f9a1d){const _0x505c8a=_0x331e47,_0x52ee8c=[];for(const _0x1147a8 of this[_0x505c8a(0xc5)]){const _0x5bb11e=this['_shapes'][_0x505c8a(0x15c)](_0x1147a8);if(_0x5bb11e){const _0x34b225=_0x5bb11e['getShapeRelation']();if(_0x34b225){var _0x4da954,_0x10da91;if(((_0x4da954=_0x34b225[_0x505c8a(0x149)])===null||_0x4da954===void 0x0?void 0x0:_0x4da954[_0x505c8a(0xf8)])===_0x3f9a1d)_0x52ee8c['push']({..._0x34b225['from'],'lineShapeId':_0x1147a8,'isFrom':!![]});if(((_0x10da91=_0x34b225['to'])===null||_0x10da91===void 0x0?void 0x0:_0x10da91[_0x505c8a(0xf8)])===_0x3f9a1d)_0x52ee8c[_0x505c8a(0xca)]({..._0x34b225['to'],'lineShapeId':_0x1147a8,'isFrom':![]});}}}return _0x52ee8c;}[_0x331e47(0xfd)](_0x267948){const _0x2c23ac=_0x331e47,_0x446f9e=this['_shapes'][_0x2c23ac(0x15c)](_0x267948);if(_0x446f9e)return _0x446f9e[_0x2c23ac(0x10a)]();}[_0x331e47(0x135)](_0x41fa46){const _0x4f9e8c=_0x331e47,_0x1a707e=this['_shapes']['get'](_0x41fa46);if(_0x1a707e)return _0x1a707e[_0x4f9e8c(0x135)]();}[_0x331e47(0x118)](_0x113a41){const _0x43396a=_0x331e47;return this['_shapes'][_0x43396a(0x126)](_0x113a41);}[_0x331e47(0x11e)](_0x9fa814){const _0x582e03=_0x331e47,_0x10177b=this[_0x582e03(0x111)][_0x582e03(0x15c)](_0x9fa814);if(!_0x10177b)return;if(isConnectorShape(_0x10177b[_0x582e03(0x135)]()))this[_0x582e03(0xc5)][_0x582e03(0xf2)](_0x9fa814);this['_shapes']['delete'](_0x9fa814);}['toJSON'](){const _0x12db5b=_0x331e47,_0x30b19d=[];return this[_0x12db5b(0x111)][_0x12db5b(0x107)](_0xeb5f67=>{const _0x5caeef=_0x12db5b;_0x30b19d[_0x5caeef(0xca)](_0xeb5f67['toJSON']());}),_0x30b19d;}[_0x331e47(0x13d)](_0x14bbf8){const _0x10c963=_0x331e47;for(const _0x1be5d8 of _0x14bbf8){const {id:_0x2078c4,shapeType:_0xcdbb01}=_0x1be5d8,_0xe3354b=this['addShape'](_0xcdbb01,_0x2078c4,_0x1be5d8[_0x10c963(0xd2)]);if(_0xe3354b&&_0xe3354b[_0x10c963(0x119)]())this['_linesIds'][_0x10c963(0x146)](_0x2078c4);}}[_0x331e47(0x12b)](){const _0x32675f=_0x331e47;if(this[_0x32675f(0xc2)])return;this['_shapes'][_0x32675f(0x107)](_0x13e61f=>{const _0x12898c=_0x32675f;_0x13e61f[_0x12898c(0x12b)]();}),this['_shapes'][_0x32675f(0x133)](),this[_0x32675f(0xc5)][_0x32675f(0x133)](),this[_0x32675f(0x145)][_0x32675f(0x133)](),super[_0x32675f(0x12b)]();}};function __decorateParam(_0x12e038,_0x17f22b){return function(_0x2c923a,_0x330287){_0x17f22b(_0x2c923a,_0x330287,_0x12e038);};}function __decorate(_0x18b972,_0x5ba947,_0x22f080,_0x5cc4cb){const _0x53d514=_0x331e47;var _0x3f0a16=arguments[_0x53d514(0x12e)],_0x150a75=_0x3f0a16<0x3?_0x5ba947:_0x5cc4cb===null?_0x5cc4cb=Object[_0x53d514(0x15d)](_0x5ba947,_0x22f080):_0x5cc4cb,_0x429b47;if(typeof Reflect===_0x53d514(0x116)&&typeof Reflect[_0x53d514(0xc1)]===_0x53d514(0x132))_0x150a75=Reflect[_0x53d514(0xc1)](_0x18b972,_0x5ba947,_0x22f080,_0x5cc4cb);else{for(var _0x51da3f=_0x18b972['length']-0x1;_0x51da3f>=0x0;_0x51da3f--)if(_0x429b47=_0x18b972[_0x51da3f])_0x150a75=(_0x3f0a16<0x3?_0x429b47(_0x150a75):_0x3f0a16>0x3?_0x429b47(_0x5ba947,_0x22f080,_0x150a75):_0x429b47(_0x5ba947,_0x22f080))||_0x150a75;}return _0x3f0a16>0x3&&_0x150a75&&Object['defineProperty'](_0x5ba947,_0x22f080,_0x150a75),_0x150a75;}const SHEET_SHAPE_PLUGIN=_0x331e47(0xf9);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x4bdf6f){const _0x986abb=_0x331e47;super(),this['_resourcesManagerService']=_0x4bdf6f,_defineProperty(this,_0x986abb(0xff),new Map()),this['_initSnapshot']();}['_ensureShapeModelManager'](_0x2808c7,_0x3b7ba7){const _0x3aa827=_0x331e47;let _0x3fa100=this[_0x3aa827(0xff)][_0x3aa827(0x15c)](_0x2808c7);!_0x3fa100&&(_0x3fa100=new Map(),this['_shapeModelManagerMap'][_0x3aa827(0xd4)](_0x2808c7,_0x3fa100));let _0x55c0b4=_0x3fa100[_0x3aa827(0x15c)](_0x3b7ba7);return!_0x55c0b4&&(_0x55c0b4=new SheetShapeModelManager(),_0x3fa100['set'](_0x3b7ba7,_0x55c0b4)),_0x55c0b4;}[_0x331e47(0xe4)](_0x2d4ca7,_0x492c1d,_0x75ef88,_0x2123c8,_0x1dc98f){const _0x59f890=_0x331e47;this[_0x59f890(0x14d)](_0x2d4ca7,_0x492c1d)[_0x59f890(0x159)](_0x75ef88,_0x2123c8,_0x1dc98f);}[_0x331e47(0x11e)](_0x2765eb,_0x52a788,_0x3ce671){const _0x401558=_0x331e47;this[_0x401558(0x14d)](_0x2765eb,_0x52a788)[_0x401558(0x11e)](_0x3ce671);}[_0x331e47(0x117)](_0x1386ae,_0x2fb855,_0x4eab38){const _0x1294ac=_0x331e47;return this['_ensureShapeModelManager'](_0x1386ae,_0x2fb855)[_0x1294ac(0x135)](_0x4eab38);}[_0x331e47(0x135)](_0x217039,_0x4c4e84,_0x1a7d5d){const _0x452df7=_0x331e47;return this[_0x452df7(0x14d)](_0x217039,_0x4c4e84)[_0x452df7(0x135)](_0x1a7d5d);}[_0x331e47(0x118)](_0x20a600,_0x29e96f,_0x40485c){const _0x2e5466=_0x331e47;return this[_0x2e5466(0x14d)](_0x20a600,_0x29e96f)[_0x2e5466(0x118)](_0x40485c);}['getShapeTypeById'](_0x481097,_0x77622f,_0x3808b0){const _0xd949c3=_0x331e47;return this[_0xd949c3(0x14d)](_0x481097,_0x77622f)['getShapeType'](_0x3808b0);}[_0x331e47(0xdc)](_0x524d55,_0x2e7610,_0x141a5a){const _0x58a51e=_0x331e47,_0x1e2a18=this[_0x58a51e(0x14d)](_0x524d55,_0x2e7610);if(!_0x1e2a18[_0x58a51e(0x135)](_0x141a5a))return;const _0x45e4fa=_0x1e2a18['_shapes'][_0x58a51e(0x15c)](_0x141a5a);if(!_0x45e4fa)return;return _0x45e4fa[_0x58a51e(0xec)]();}[_0x331e47(0x10e)](_0x1e46c3,_0x461f67,_0x104d2b){const _0x5858b6=_0x331e47;return this[_0x5858b6(0x14d)](_0x1e46c3,_0x461f67)[_0x5858b6(0x111)][_0x5858b6(0x15c)](_0x104d2b);}[_0x331e47(0xcd)](_0x195625,_0x423fe0,_0x5db248){const _0x289d7a=_0x331e47;return this['_ensureShapeModelManager'](_0x195625,_0x423fe0)[_0x289d7a(0xcd)](_0x5db248);}[_0x331e47(0xfd)](_0x31a2f3,_0x1f32a4,_0x442a73){const _0x427b89=_0x331e47,_0x2f1a6c=this[_0x427b89(0x14d)](_0x31a2f3,_0x1f32a4)[_0x427b89(0x111)][_0x427b89(0x15c)](_0x442a73);if(!_0x2f1a6c)return;return _0x2f1a6c[_0x427b89(0x10a)]();}[_0x331e47(0xd3)](){}[_0x331e47(0x122)](_0x21c2d1){const _0x111ce6=_0x331e47,_0x1b3ec4={},_0x24be21=this[_0x111ce6(0xff)][_0x111ce6(0x15c)](_0x21c2d1);if(_0x24be21)_0x24be21['forEach']((_0x571bfa,_0x5003fe)=>{const _0x114849=_0x111ce6,_0x183bb1=_0x571bfa[_0x114849(0x142)]();if(_0x183bb1[_0x114849(0x12e)]>0x0)_0x1b3ec4[_0x5003fe]=_0x183bb1;});return JSON[_0x111ce6(0x110)](_0x1b3ec4);}[_0x331e47(0xc6)](_0x3e1cb0,_0x16c81e){const _0x55c172=_0x331e47;Object[_0x55c172(0xc7)](_0x16c81e)[_0x55c172(0x107)](_0x5bc150=>{const _0x1139e7=_0x55c172;this[_0x1139e7(0x14d)](_0x3e1cb0,_0x5bc150)['fromJSON'](_0x16c81e[_0x5bc150]);});}[_0x331e47(0x142)](){const _0x26a232=_0x331e47,_0x4b30d9={};return this[_0x26a232(0xff)][_0x26a232(0x107)]((_0x2e9453,_0x2382fb)=>{const _0x15eb9a=_0x26a232;_0x4b30d9[_0x2382fb]={},_0x2e9453[_0x15eb9a(0x107)]((_0x2ae2f6,_0xcbe6c2)=>{const _0x170cdf=_0x15eb9a;_0x4b30d9[_0x2382fb][_0xcbe6c2]=_0x2ae2f6[_0x170cdf(0x142)]();});}),_0x4b30d9;}[_0x331e47(0x13d)](_0x8473c2){const _0x141aa1=_0x331e47;Object['keys'](_0x8473c2)[_0x141aa1(0x107)](_0x3c3b5a=>{const _0x3f95d4=_0x141aa1,_0x3c8549=_0x8473c2[_0x3c3b5a];Object[_0x3f95d4(0xc7)](_0x3c8549)['forEach'](_0x40fb07=>{this['_ensureShapeModelManager'](_0x3c3b5a,_0x40fb07)['fromJSON'](_0x3c8549[_0x40fb07]);});});}['_initSnapshot'](){const _0x50a8c5=_0x331e47;this[_0x50a8c5(0xe6)][_0x50a8c5(0x131)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType['UNIVER_SHEET']],'toJson':_0x3c6472=>this[_0x50a8c5(0x122)](_0x3c6472),'parseJson':_0x3d3a84=>JSON[_0x50a8c5(0x11c)](_0x3d3a84),'onLoad':(_0x2b4478,_0x25396b)=>{const _0x2aef20=_0x50a8c5;this[_0x2aef20(0xc6)](_0x2b4478,_0x25396b);},'onUnLoad':_0x2e8fea=>{const _0x55240f=_0x50a8c5,_0x1aaed6=this[_0x55240f(0xff)]['get'](_0x2e8fea);_0x1aaed6&&(_0x1aaed6[_0x55240f(0x107)](_0x4fa00f=>{const _0x3a0823=_0x55240f;_0x4fa00f[_0x3a0823(0x12b)]();}),this[_0x55240f(0xff)]['delete'](_0x2e8fea));}});}[_0x331e47(0x12b)](){const _0x47e7f2=_0x331e47;this[_0x47e7f2(0xff)][_0x47e7f2(0x107)](_0x2ac525=>{const _0x479420=_0x47e7f2;_0x2ac525[_0x479420(0x107)](_0x1542ef=>{const _0x1dfa37=_0x479420;_0x1542ef[_0x1dfa37(0x12b)]();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':'sheet.mutation.insert-shape','type':CommandType[_0x331e47(0xf1)],'handler':(_0x53e9f6,_0x127450)=>{const _0x52a25d=_0x331e47,{unitId:_0x2870ab,subUnitId:_0x5deb7a,shapeType:_0x597414,shapeId:_0x19ddb,shapeData:_0x3eea78}=_0x127450;return _0x53e9f6[_0x52a25d(0x15c)](SheetsShapeService)[_0x52a25d(0xe4)](_0x2870ab,_0x5deb7a,_0x597414,_0x19ddb,_0x3eea78),!![];}},RemoveSheetsShapeMutation={'id':_0x331e47(0x13f),'type':CommandType[_0x331e47(0xf1)],'handler':(_0x1068c4,_0xd82d1c)=>{const _0x51d8db=_0x331e47,{unitId:_0x1c5fc1,subUnitId:_0xa2f6b0,shapeId:_0x1cbd5a}=_0xd82d1c;return _0x1068c4[_0x51d8db(0x15c)](SheetsShapeService)['removeShape'](_0x1c5fc1,_0xa2f6b0,_0x1cbd5a),!![];}},InsertShapeCommand={'type':CommandType['COMMAND'],'id':_0x331e47(0x11b),'handler':(_0x3acf34,_0x44538d)=>{const _0x17d0d4=_0x331e47;var _0x5b39a0,_0x2e7b9b;const _0x4c0a2a=getSheetCommandTarget(_0x3acf34[_0x17d0d4(0x15c)](IUniverInstanceService),_0x44538d);if(!_0x4c0a2a)return![];const _0x184cc2=_0x3acf34[_0x17d0d4(0x15c)](SheetSkeletonService),{unitId:_0x346c90,subUnitId:_0x2149f0}=_0x4c0a2a,_0x4e2f6d=_0x184cc2[_0x17d0d4(0x12d)](_0x346c90,_0x2149f0);if(!_0x4e2f6d)return![];const _0xe73cee=_0x3acf34[_0x17d0d4(0x15c)](ICommandService),_0xc41818=_0x3acf34[_0x17d0d4(0x15c)](IUndoRedoService),_0x31d757=_0x3acf34['get'](SheetInterceptorService),_0x4e9335=_0x3acf34[_0x17d0d4(0x15c)](ISheetDrawingService),{shapeType:_0x242c76,shapeData:_0x499c35}=_0x44538d,_0x35be0b=_0x44538d[_0x17d0d4(0xf8)]||generateRandomId(),_0x4db212={'unitId':_0x346c90,'subUnitId':_0x2149f0,'shapeId':_0x35be0b,'shapeType':_0x242c76,'shapeData':_0x499c35},_0x4373dc=_0x44538d['width']||0xc8,_0x4cfe1b=_0x44538d[_0x17d0d4(0x136)]||0xc8;let _0x313102=0x0,_0x10c059=0x0,_0x3e9c47={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x2c20ad={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x44538d[_0x17d0d4(0x14c)]){const {x:_0x8d2136,y:_0x4016f4}=_0x44538d[_0x17d0d4(0x14c)];_0x313102=_0x8d2136,_0x10c059=_0x4016f4,_0x3e9c47=_0x4e2f6d['getCellIndexAndOffsetByPosition'](_0x8d2136,_0x4016f4),_0x2c20ad=_0x4e2f6d[_0x17d0d4(0x130)](_0x8d2136+_0x4373dc,_0x4016f4+_0x4cfe1b);}else{if(_0x44538d[_0x17d0d4(0x123)]){const {startRow:_0x2a3347,startColumn:_0xba072c}=_0x44538d[_0x17d0d4(0x123)],_0x67fbce=0xa,_0x37bd84=0xa;_0x3e9c47={'row':_0x2a3347,'rowOffset':_0x67fbce,'column':_0xba072c,'columnOffset':_0x37bd84};const _0x39d362=_0x4e2f6d[_0x17d0d4(0x15a)](_0x2a3347,_0xba072c);_0x313102=_0x39d362[_0x17d0d4(0x139)]+_0x37bd84,_0x10c059=_0x39d362[_0x17d0d4(0xed)]+_0x67fbce,_0x2c20ad=_0x4e2f6d[_0x17d0d4(0x130)](_0x313102+_0x4373dc,_0x10c059+_0x4cfe1b);}}const _0x19007a={'from':_0x3e9c47,'to':_0x2c20ad},_0x14b42f={'unitId':_0x346c90,'subUnitId':_0x2149f0,'drawingId':_0x35be0b,'drawingType':DrawingTypeEnum[_0x17d0d4(0xe2)],'sheetTransform':_0x19007a,'transform':{'left':_0x313102,'top':_0x10c059,'width':_0x4373dc,'height':_0x4cfe1b},'data':{'shapeType':_0x242c76,'shapeData':_0x499c35},'axisAlignSheetTransform':_0x19007a,'allowTransform':!![]};isConnectorShape(_0x242c76)&&(_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0xd1)]=![],_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0x109)]=![],_0x14b42f[_0x17d0d4(0x15e)]['resizeEnabled']=![],_0x14b42f[_0x17d0d4(0x15e)][_0x17d0d4(0xcf)]=![],_0x14b42f[_0x17d0d4(0x104)][_0x17d0d4(0x109)]=![],_0x14b42f[_0x17d0d4(0x104)]['resizeEnabled']=![],_0x14b42f[_0x17d0d4(0x104)][_0x17d0d4(0xcf)]=![]);const {undo:_0x4c0873,redo:_0x3b3f0b,objects:_0x7120ba}=_0x4e9335[_0x17d0d4(0x12f)]([_0x14b42f]),_0x17b87f=_0x31d757[_0x17d0d4(0x147)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x346c90,'drawings':[_0x14b42f]}}),_0x1b5fdf=[...(_0x5b39a0=_0x17b87f['preRedos'])!==null&&_0x5b39a0!==void 0x0?_0x5b39a0:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'op':_0x3b3f0b,'objects':_0x7120ba,'type':DrawingApplyType[_0x17d0d4(0x138)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x346c90]},..._0x17b87f[_0x17d0d4(0x112)],{'id':InsertSheetsShapeMutation['id'],'params':_0x4db212}],_0x2bc39b=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'shapeId':_0x35be0b}},...(_0x2e7b9b=_0x17b87f['preUndos'])!==null&&_0x2e7b9b!==void 0x0?_0x2e7b9b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x346c90,'subUnitId':_0x2149f0,'op':_0x4c0873,'objects':_0x7120ba,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x346c90]},..._0x17b87f[_0x17d0d4(0xc0)]];if(sequenceExecute(_0x1b5fdf,_0xe73cee)[_0x17d0d4(0xf5)])return _0xc41818[_0x17d0d4(0xcb)]({'unitID':_0x346c90,'undoMutations':_0x2bc39b,'redoMutations':_0x1b5fdf}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':'sheet.mutation.update-shape-data','type':CommandType[_0x331e47(0xf1)],'handler':(_0x6c8a13,_0x518b76)=>{const _0x379aac=_0x331e47,{unitId:_0x358178,subUnitId:_0x329ad9,shapeType:_0x3ed231,shapeId:_0x228d83,shapeData:_0x39c8a0}=_0x518b76,_0x484a56=_0x6c8a13[_0x379aac(0x15c)](SheetsShapeService)[_0x379aac(0x10e)](_0x358178,_0x329ad9,_0x228d83);if(_0x484a56){if(_0x3ed231!==void 0x0)_0x484a56['setShapeType'](_0x3ed231);if(_0x39c8a0)_0x484a56===null||_0x484a56===void 0x0||_0x484a56[_0x379aac(0x13a)](_0x39c8a0,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0x120),'handler':(_0x2b1103,_0x2d4cf2)=>{const _0x4d9a41=_0x331e47;var _0x2ed0c5,_0x20d694;const _0x5422b6=getSheetCommandTarget(_0x2b1103[_0x4d9a41(0x15c)](IUniverInstanceService),_0x2d4cf2);if(!_0x5422b6)return![];const _0x1666e9=_0x2b1103[_0x4d9a41(0x15c)](SheetSkeletonService),{unitId:_0x1ecf0e,subUnitId:_0x214080}=_0x5422b6,_0x5ce3ce=_0x1666e9[_0x4d9a41(0x12d)](_0x1ecf0e,_0x214080);if(!_0x5ce3ce)return![];const _0x4bb2fe=_0x2b1103[_0x4d9a41(0x15c)](SheetsShapeService),{shapeId:_0x2a553e,shapeType:_0x580d11,shapeData:_0x422053,position:_0x44e042,width:_0x452fc6,height:_0x1b651d}=_0x2d4cf2,_0x131e8e=_0x4bb2fe[_0x4d9a41(0x10e)](_0x1ecf0e,_0x214080,_0x2a553e);if(!_0x131e8e)return![];const _0x461490=_0x2b1103[_0x4d9a41(0x15c)](ICommandService),_0x3eeda0=_0x2b1103[_0x4d9a41(0x15c)](IUndoRedoService),_0x4e2110=_0x2b1103[_0x4d9a41(0x15c)](SheetInterceptorService),_0x141881=_0x2b1103[_0x4d9a41(0x15c)](ISheetDrawingService),_0x401b2e={'unitId':_0x1ecf0e,'subUnitId':_0x214080,'shapeId':_0x2a553e,'shapeType':_0x580d11,'shapeData':_0x422053},_0x3857fb=_0x131e8e[_0x4d9a41(0x135)](),_0x4026da=_0x131e8e[_0x4d9a41(0xec)](),{x:_0x1b12da,y:_0xa543b8}=_0x44e042,_0x37adb5={'from':_0x5ce3ce[_0x4d9a41(0x130)](_0x1b12da,_0xa543b8),'to':_0x5ce3ce[_0x4d9a41(0x130)](_0x1b12da+_0x452fc6,_0xa543b8+_0x1b651d)},_0x258a05={'unitId':_0x1ecf0e,'subUnitId':_0x214080,'drawingId':_0x2a553e,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x37adb5,'transform':{'left':_0x1b12da,'top':_0xa543b8,'width':_0x452fc6,'height':_0x1b651d},'data':{'shapeType':_0x580d11,'shapeData':_0x422053},'axisAlignSheetTransform':_0x37adb5,'allowTransform':!![]};isConnectorShape(_0x580d11)&&(_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0xd1)]=![],_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0x109)]=![],_0x258a05['data']['resizeEnabled']=![],_0x258a05[_0x4d9a41(0x15e)][_0x4d9a41(0xcf)]=![],_0x258a05['transform'][_0x4d9a41(0x109)]=![],_0x258a05[_0x4d9a41(0x104)][_0x4d9a41(0x125)]=![],_0x258a05[_0x4d9a41(0x104)][_0x4d9a41(0xcf)]=![]);const {undo:_0xeefabf,redo:_0x36a56d,objects:_0x3cd26c}=_0x141881[_0x4d9a41(0x143)]([_0x258a05]),_0x4fedb8=_0x4e2110['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x1ecf0e,'drawings':[_0x258a05]}}),_0x110952=[...(_0x2ed0c5=_0x4fedb8[_0x4d9a41(0xfc)])!==null&&_0x2ed0c5!==void 0x0?_0x2ed0c5:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'op':_0x36a56d,'objects':_0x3cd26c,'type':DrawingApplyType[_0x4d9a41(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1ecf0e]},..._0x4fedb8[_0x4d9a41(0x112)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x401b2e}],_0x5c8ddb=[...(_0x20d694=_0x4fedb8[_0x4d9a41(0x15b)])!==null&&_0x20d694!==void 0x0?_0x20d694:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'op':_0xeefabf,'objects':_0x3cd26c,'type':DrawingApplyType[_0x4d9a41(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1ecf0e]},..._0x4fedb8[_0x4d9a41(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1ecf0e,'subUnitId':_0x214080,'shapeType':_0x3857fb,'shapeId':_0x2a553e,'shapeData':_0x4026da}}];if(sequenceExecute(_0x110952,_0x461490)[_0x4d9a41(0xf5)])return _0x3eeda0[_0x4d9a41(0xcb)]({'unitID':_0x1ecf0e,'undoMutations':_0x5c8ddb,'redoMutations':_0x110952}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0x11a),'handler':(_0x510f3c,_0x355af1)=>{const _0x70fc3c=_0x331e47;var _0x51b264,_0x789b6a;const _0x592ed9=getSheetCommandTarget(_0x510f3c[_0x70fc3c(0x15c)](IUniverInstanceService),_0x355af1);if(!_0x592ed9)return![];const _0x45df6e=_0x510f3c[_0x70fc3c(0x15c)](SheetSkeletonService),{unitId:_0x268392,subUnitId:_0x5460ad}=_0x592ed9,_0x4cbc7f=_0x45df6e[_0x70fc3c(0x151)](_0x268392,_0x5460ad);if(!_0x4cbc7f)return![];const _0x206048=_0x510f3c[_0x70fc3c(0x15c)](ISheetDrawingService),{shapeId:_0x46a777,flipH:_0x8fa859,flipV:_0x2d7578}=_0x355af1,_0x289351=_0x206048[_0x70fc3c(0x13e)]({'unitId':_0x268392,'subUnitId':_0x5460ad,'drawingId':_0x46a777});if(!_0x289351)return![];const _0x289fe5=_0x510f3c['get'](SheetsShapeService)['getShapeModel'](_0x268392,_0x5460ad,_0x46a777);if(!_0x289fe5)return![];const _0x2ac8ea=_0x510f3c[_0x70fc3c(0x15c)](ICommandService),_0x1e8147=_0x510f3c[_0x70fc3c(0x15c)](IUndoRedoService),_0x3440d0=_0x510f3c[_0x70fc3c(0x15c)](SheetInterceptorService),_0x48b6f3={..._0x289351['transform']};if(_0x8fa859!==void 0x0)_0x48b6f3[_0x70fc3c(0x102)]=!_0x48b6f3['flipX'];if(_0x2d7578!==void 0x0)_0x48b6f3[_0x70fc3c(0xe7)]=!_0x48b6f3[_0x70fc3c(0xe7)];const _0x248e08=transformToDrawingPosition(_0x48b6f3,_0x4cbc7f),_0x1ee56f=transformToAxisAlignPosition(_0x48b6f3,_0x4cbc7f),_0x1a2105=_0x289fe5['getShapeType'](),_0x5c2f4b=_0x289fe5['getShapeData'](),_0x18c50a={'unitId':_0x268392,'subUnitId':_0x5460ad,'drawingId':_0x46a777,'drawingType':DrawingTypeEnum[_0x70fc3c(0xe2)],'sheetTransform':_0x248e08,'transform':_0x48b6f3,'data':{'shapeType':_0x1a2105,'shapeData':_0x5c2f4b},'axisAlignSheetTransform':_0x1ee56f,'allowTransform':!![]},{undo:_0x546fd1,redo:_0x207943,objects:_0x3cdb67}=_0x206048['getBatchUpdateOp']([_0x18c50a]),_0x3beccd=_0x3440d0[_0x70fc3c(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x268392,'drawings':[_0x18c50a]}}),_0x4a1820=[...(_0x51b264=_0x3beccd[_0x70fc3c(0xfc)])!==null&&_0x51b264!==void 0x0?_0x51b264:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'op':_0x207943,'objects':_0x3cdb67,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x268392]},..._0x3beccd['redos']],_0x30596d=[...(_0x789b6a=_0x3beccd[_0x70fc3c(0x15b)])!==null&&_0x789b6a!==void 0x0?_0x789b6a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'op':_0x546fd1,'objects':_0x3cdb67,'type':DrawingApplyType[_0x70fc3c(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x268392]},..._0x3beccd[_0x70fc3c(0xc0)]];if(isConnectorShape(_0x1a2105)){const _0x4394f7=_0x289fe5[_0x70fc3c(0x10a)]();if(_0x4394f7){const _0x5cba5d={..._0x4394f7};_0x5cba5d[_0x70fc3c(0x149)]=void 0x0,_0x5cba5d['to']=void 0x0,_0x4a1820['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'shapeId':_0x46a777,'shapeType':_0x1a2105,'shapeData':{'relation':_0x5cba5d}}}),_0x30596d[_0x70fc3c(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x268392,'subUnitId':_0x5460ad,'shapeId':_0x46a777,'shapeType':_0x1a2105,'shapeData':{'relation':_0x4394f7}}});}}if(sequenceExecute(_0x4a1820,_0x2ac8ea)[_0x70fc3c(0xf5)])return _0x1e8147['pushUndoRedo']({'unitID':_0x268392,'undoMutations':_0x30596d,'redoMutations':_0x4a1820}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType['COMMAND'],'id':_0x331e47(0xc9),'handler':(_0xc5aba1,_0x3f2e36)=>{const _0x457c2b=_0x331e47;var _0x12622d,_0x495f82;const _0x4d6ab0=getSheetCommandTarget(_0xc5aba1['get'](IUniverInstanceService),_0x3f2e36);if(!_0x4d6ab0)return![];const _0xde10dc=_0xc5aba1['get'](SheetSkeletonService),{unitId:_0x625cfc,subUnitId:_0x1e59f8}=_0x4d6ab0,_0x1643f5=_0xde10dc[_0x457c2b(0x151)](_0x625cfc,_0x1e59f8);if(!_0x1643f5)return![];const _0x4b4896=_0xc5aba1[_0x457c2b(0x15c)](ISheetDrawingService),{shapeId:_0xaa0963,rotate:_0x4c9e72}=_0x3f2e36,_0x14781a=_0x4b4896['getDrawingByParam']({'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'drawingId':_0xaa0963});if(!_0x14781a)return![];const _0x3e0beb=_0xc5aba1[_0x457c2b(0x15c)](SheetsShapeService)['getShapeModel'](_0x625cfc,_0x1e59f8,_0xaa0963);if(!_0x3e0beb)return![];const _0x24034d=_0xc5aba1[_0x457c2b(0x15c)](ICommandService),_0x1236b7=_0xc5aba1['get'](IUndoRedoService),_0xb2c0f8=_0xc5aba1['get'](SheetInterceptorService),_0x5465ad={..._0x14781a['transform']};if(_0x4c9e72!==void 0x0)_0x5465ad['angle']=(_0x5465ad['angle']||0x0)+_0x4c9e72;const _0x82f558=transformToDrawingPosition(_0x5465ad,_0x1643f5),_0x13c0c9=transformToAxisAlignPosition(_0x5465ad,_0x1643f5),_0x2377dd=_0x3e0beb[_0x457c2b(0x135)](),_0x414efc=_0x3e0beb[_0x457c2b(0xec)](),_0x4e685d={'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'drawingId':_0xaa0963,'drawingType':DrawingTypeEnum[_0x457c2b(0xe2)],'sheetTransform':_0x82f558,'transform':_0x5465ad,'data':{'shapeType':_0x2377dd,'shapeData':_0x414efc},'axisAlignSheetTransform':_0x13c0c9,'allowTransform':!![]},{undo:_0x3f5be2,redo:_0x97595e,objects:_0x3463b7}=_0x4b4896[_0x457c2b(0x143)]([_0x4e685d]),_0x463bed=_0xb2c0f8[_0x457c2b(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x625cfc,'drawings':[_0x4e685d]}}),_0x1359d3=[...(_0x12622d=_0x463bed[_0x457c2b(0xfc)])!==null&&_0x12622d!==void 0x0?_0x12622d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'op':_0x97595e,'objects':_0x3463b7,'type':DrawingApplyType[_0x457c2b(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x625cfc]},..._0x463bed[_0x457c2b(0x112)]],_0x2c5ce8=[...(_0x495f82=_0x463bed[_0x457c2b(0x15b)])!==null&&_0x495f82!==void 0x0?_0x495f82:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x625cfc,'subUnitId':_0x1e59f8,'op':_0x3f5be2,'objects':_0x3463b7,'type':DrawingApplyType[_0x457c2b(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x625cfc]},..._0x463bed[_0x457c2b(0xc0)]];if(sequenceExecute(_0x1359d3,_0x24034d)[_0x457c2b(0xf5)])return _0x1236b7['pushUndoRedo']({'unitID':_0x625cfc,'undoMutations':_0x2c5ce8,'redoMutations':_0x1359d3}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x331e47(0x10c)],'id':'sheet.command.set-shape-text-vertical-toggle','handler':(_0x1daee1,_0x3f33d3)=>{const _0x2090ba=_0x331e47;var _0x46891a;const _0x2c559d=getSheetCommandTarget(_0x1daee1[_0x2090ba(0x15c)](IUniverInstanceService),_0x3f33d3);if(!_0x2c559d)return![];const {unitId:_0x5582b4,subUnitId:_0x378090}=_0x2c559d,{shapeId:_0xa210bb}=_0x3f33d3,_0x124bd0=_0x1daee1[_0x2090ba(0x15c)](SheetsShapeService)[_0x2090ba(0x10e)](_0x5582b4,_0x378090,_0xa210bb);if(!_0x124bd0)return![];const _0x3fa518=_0x124bd0['getShapeTextData'](),_0x124aa1=(_0x46891a=_0x3fa518===null||_0x3fa518===void 0x0?void 0x0:_0x3fa518[_0x2090ba(0x140)])!==null&&_0x46891a!==void 0x0?_0x46891a:!![],_0x1657fa=!_0x124aa1,_0x405677=_0x1daee1['get'](ICommandService),_0x1cc068=_0x1daee1['get'](IUndoRedoService),_0x44720f={'unitId':_0x5582b4,'subUnitId':_0x378090,'shapeId':_0xa210bb,'shapeData':{'shapeText':{'isHorizontal':_0x1657fa}}},_0x2e9b58={'unitId':_0x5582b4,'subUnitId':_0x378090,'shapeId':_0xa210bb,'shapeData':{'shapeText':{'isHorizontal':_0x124aa1}}},_0x58a2e0=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x44720f}],_0x46f31b=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x2e9b58}];if(sequenceExecute(_0x58a2e0,_0x405677)[_0x2090ba(0xf5)])return _0x1cc068[_0x2090ba(0xcb)]({'unitID':_0x5582b4,'undoMutations':_0x46f31b,'redoMutations':_0x58a2e0}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x331e47(0x10c)],'id':'sheet.command.update-connector-relation','handler':(_0x431f79,_0x35f92d)=>{const _0x4a2f63=_0x331e47;var _0x215ee1,_0x35d4ef,_0x437a0f,_0xb4905b;const _0x1432ea=getSheetCommandTarget(_0x431f79[_0x4a2f63(0x15c)](IUniverInstanceService),_0x35f92d);if(!_0x1432ea)return![];const _0x5b0135=_0x431f79[_0x4a2f63(0x15c)](SheetSkeletonService),{unitId:_0x47e927,subUnitId:_0x21d173}=_0x1432ea,_0x1c53d0=_0x5b0135['getSkeleton'](_0x47e927,_0x21d173);if(!_0x1c53d0)return![];const _0x12352c=_0x431f79['get'](ISheetDrawingService),{connectorShapeId:_0x563bd0,width:_0x1e7eef,height:_0x1bd34a,left:_0x53b3c9,top:_0x5dd2b5,flipX:_0x25dfb7,flipY:_0x25f2af,rotation:_0x1ef9d3,oldAdjustValues:_0x4f558c,newAdjustValues:_0x48e522,oldLineType:_0x2fe04c,newLineType:_0x550fe1,oldRelation:_0x1d6c9a,newRelation:_0x1bc224}=_0x35f92d,_0x608c3f=_0x12352c[_0x4a2f63(0x13e)]({'unitId':_0x47e927,'subUnitId':_0x21d173,'drawingId':_0x563bd0});if(!_0x608c3f)return![];const _0x276ab9=_0x431f79[_0x4a2f63(0x15c)](SheetsShapeService)[_0x4a2f63(0x10e)](_0x47e927,_0x21d173,_0x563bd0);if(!_0x276ab9)return![];const _0x4653c6=_0x431f79['get'](ICommandService),_0x44c153=_0x431f79[_0x4a2f63(0x15c)](IUndoRedoService),_0x31e33d=_0x431f79[_0x4a2f63(0x15c)](SheetInterceptorService),_0x2a8d61={..._0x608c3f[_0x4a2f63(0x104)],'width':_0x1e7eef,'height':_0x1bd34a,'left':_0x53b3c9,'top':_0x5dd2b5,'flipX':_0x25dfb7,'flipY':_0x25f2af,'angle':(_0x215ee1=_0x1ef9d3!==null&&_0x1ef9d3!==void 0x0?_0x1ef9d3:(_0x35d4ef=_0x608c3f[_0x4a2f63(0x104)])===null||_0x35d4ef===void 0x0?void 0x0:_0x35d4ef['angle'])!==null&&_0x215ee1!==void 0x0?_0x215ee1:0x0},_0x1012d8=transformToDrawingPosition(_0x2a8d61,_0x1c53d0),_0x459db6=transformToAxisAlignPosition(_0x2a8d61,_0x1c53d0),_0x118e4c=_0x276ab9[_0x4a2f63(0x135)](),_0x1a1fd3=_0x276ab9['getShapeData'](),_0x3b44ee={'unitId':_0x47e927,'subUnitId':_0x21d173,'drawingId':_0x563bd0,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x1012d8,'transform':_0x2a8d61,'data':{'shapeType':_0x550fe1||_0x2fe04c||_0x118e4c,'shapeData':{..._0x1a1fd3,'adjustValues':_0x48e522||_0x4f558c||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0x137)]),'relation':_0x1bc224||_0x1d6c9a||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3['relation'])}},'axisAlignSheetTransform':_0x459db6,'allowTransform':!![]},{undo:_0x4ff57b,redo:_0x5c46ad,objects:_0x2203f3}=_0x12352c[_0x4a2f63(0x143)]([_0x3b44ee]),_0xe69055=_0x31e33d[_0x4a2f63(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x47e927,'drawings':[_0x3b44ee]}}),_0x2e350c=[...(_0x437a0f=_0xe69055[_0x4a2f63(0xfc)])!==null&&_0x437a0f!==void 0x0?_0x437a0f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'op':_0x5c46ad,'objects':_0x2203f3,'type':DrawingApplyType[_0x4a2f63(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x47e927]},..._0xe69055['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'shapeId':_0x563bd0,'shapeType':_0x550fe1,'shapeData':{'adjustValues':_0x48e522,'relation':_0x1bc224}}}],_0x4c496f=[...(_0xb4905b=_0xe69055['preUndos'])!==null&&_0xb4905b!==void 0x0?_0xb4905b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'op':_0x4ff57b,'objects':_0x2203f3,'type':DrawingApplyType[_0x4a2f63(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x47e927]},..._0xe69055[_0x4a2f63(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x47e927,'subUnitId':_0x21d173,'shapeId':_0x563bd0,'shapeType':_0x118e4c,'shapeData':{..._0x1a1fd3,'adjustValues':_0x4f558c||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0x137)]),'relation':_0x1d6c9a||(_0x1a1fd3===null||_0x1a1fd3===void 0x0?void 0x0:_0x1a1fd3[_0x4a2f63(0xdd)])}}}];if(sequenceExecute(_0x2e350c,_0x4653c6)['result'])return _0x44c153['pushUndoRedo']({'unitID':_0x47e927,'undoMutations':_0x4c496f,'redoMutations':_0x2e350c}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0x331e47(0x10c)],'id':_0x331e47(0xeb),'handler':(_0x2ca3d4,_0x2d8042)=>{const _0x22815d=_0x331e47;var _0x8119b1,_0x16dc1d;const _0x487ea7=getSheetCommandTarget(_0x2ca3d4[_0x22815d(0x15c)](IUniverInstanceService),_0x2d8042);if(!_0x487ea7)return![];const _0x379bc0=_0x2ca3d4[_0x22815d(0x15c)](SheetSkeletonService),{unitId:_0x4c0431,subUnitId:_0x551548}=_0x487ea7,_0x19efd6=_0x379bc0['getSkeleton'](_0x4c0431,_0x551548);if(!_0x19efd6)return![];const _0x4de5ea=_0x2ca3d4[_0x22815d(0x15c)](ISheetDrawingService),{shapeId:_0x318d9f,width:_0x258cf7,height:_0x7aa75e,left:_0x27c471,top:_0x2c775c,flipX:_0x3c5bff,flipY:_0x2655ec,angle:_0x277c9f,oldAdjustValues:_0x3de831,newAdjustValues:_0x358c1f,oldLineType:_0x24db98,newLineType:_0x46e990}=_0x2d8042,_0x23a3a7=_0x4de5ea[_0x22815d(0x13e)]({'unitId':_0x4c0431,'subUnitId':_0x551548,'drawingId':_0x318d9f});if(!_0x23a3a7)return![];const _0x7deff6=_0x2ca3d4[_0x22815d(0x15c)](SheetsShapeService)[_0x22815d(0x10e)](_0x4c0431,_0x551548,_0x318d9f);if(!_0x7deff6)return![];const _0xe504d8=_0x2ca3d4[_0x22815d(0x15c)](ICommandService),_0x44e5d7=_0x2ca3d4[_0x22815d(0x15c)](IUndoRedoService),_0x37f569=_0x2ca3d4[_0x22815d(0x15c)](SheetInterceptorService),_0xffeaab={..._0x23a3a7[_0x22815d(0x104)],'width':_0x258cf7,'height':_0x7aa75e,'left':_0x27c471,'top':_0x2c775c,'flipX':_0x3c5bff,'flipY':_0x2655ec,'angle':_0x277c9f},_0xf273c0=transformToDrawingPosition(_0xffeaab,_0x19efd6),_0x5f1de3=transformToAxisAlignPosition(_0xffeaab,_0x19efd6),_0x37934d=_0x7deff6[_0x22815d(0x135)](),_0x298d7d=_0x7deff6[_0x22815d(0xec)](),_0x246ad0={'unitId':_0x4c0431,'subUnitId':_0x551548,'drawingId':_0x318d9f,'drawingType':DrawingTypeEnum[_0x22815d(0xe2)],'sheetTransform':_0xf273c0,'transform':_0xffeaab,'data':{'shapeType':_0x46e990||_0x24db98||_0x37934d,'shapeData':{..._0x298d7d,'adjustValues':_0x358c1f||_0x3de831||(_0x298d7d===null||_0x298d7d===void 0x0?void 0x0:_0x298d7d[_0x22815d(0x137)])}},'axisAlignSheetTransform':_0x5f1de3,'allowTransform':!![]},{undo:_0x2008c1,redo:_0x57e65c,objects:_0x40ad26}=_0x4de5ea[_0x22815d(0x143)]([_0x246ad0]),_0x3ad3ea=_0x37f569[_0x22815d(0x147)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x4c0431,'drawings':[_0x246ad0]}}),_0x362dbb=[...(_0x8119b1=_0x3ad3ea['preRedos'])!==null&&_0x8119b1!==void 0x0?_0x8119b1:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'op':_0x57e65c,'objects':_0x40ad26,'type':DrawingApplyType[_0x22815d(0x129)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4c0431]},..._0x3ad3ea['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'shapeId':_0x318d9f,'shapeType':_0x46e990,'shapeData':{'adjustValues':_0x358c1f}}}],_0x39c00c=[...(_0x16dc1d=_0x3ad3ea[_0x22815d(0x15b)])!==null&&_0x16dc1d!==void 0x0?_0x16dc1d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'op':_0x2008c1,'objects':_0x40ad26,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4c0431]},..._0x3ad3ea[_0x22815d(0xc0)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4c0431,'subUnitId':_0x551548,'shapeId':_0x318d9f,'shapeType':_0x37934d,'shapeData':{..._0x298d7d,'adjustValues':_0x3de831||(_0x298d7d===null||_0x298d7d===void 0x0?void 0x0:_0x298d7d[_0x22815d(0x137)])}}}];if(sequenceExecute(_0x362dbb,_0xe504d8)[_0x22815d(0xf5)])return _0x44e5d7[_0x22815d(0xcb)]({'unitID':_0x4c0431,'undoMutations':_0x39c00c,'redoMutations':_0x362dbb}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x331e47(0xd7),'type':CommandType['MUTATION'],'handler':(_0x4c37f7,_0x50761d)=>{const _0x11bb60=_0x331e47,{unitId:_0x3939f6,subUnitId:_0x2a1381,shapeType:_0xf06002,shapeId:_0x42d002,shapeData:_0x2493d6}=_0x50761d,_0x54a7ba=_0x4c37f7[_0x11bb60(0x15c)](SheetsShapeService)['getShapeModel'](_0x3939f6,_0x2a1381,_0x42d002);if(_0x54a7ba){_0x54a7ba['setShapeType'](_0xf06002);if(_0x2493d6)_0x54a7ba===null||_0x54a7ba===void 0x0||_0x54a7ba[_0x11bb60(0x13a)](_0x2493d6);}return!![];}},UpdateSheetsShapeTypeCommand={'id':_0x331e47(0xf7),'type':CommandType['COMMAND'],'handler':(_0xf06dbc,_0x4f3b8e)=>{const _0x1e9312=_0x331e47;if(!_0x4f3b8e)return![];const _0x10c5fd=_0xf06dbc[_0x1e9312(0x15c)](ICommandService),_0x53188c=_0xf06dbc[_0x1e9312(0x15c)](SheetsShapeService),_0x1acc45=_0xf06dbc[_0x1e9312(0x15c)](IUndoRedoService),_0x5d430f=[],_0x4d10cc=[],{unitId:_0x3e4dd3,subUnitId:_0x2af8c1,shapeId:_0x2f3cb4,shapeType:_0x240775,shapeData:_0xbe5d9d}=_0x4f3b8e,_0x5f4b73=_0x53188c['getShapeModel'](_0x3e4dd3,_0x2af8c1,_0x2f3cb4);if(_0x5f4b73){const _0x31c6dc=_0x5f4b73[_0x1e9312(0x135)](),_0x28f448=Object[_0x1e9312(0x10d)]({},_0x5f4b73['getShapeData']()),_0x9240d8={'unitId':_0x3e4dd3,'subUnitId':_0x2af8c1,'shapeId':_0x2f3cb4,'shapeType':_0x240775,'shapeData':_0xbe5d9d},_0x3236b3={'unitId':_0x3e4dd3,'subUnitId':_0x2af8c1,'shapeId':_0x2f3cb4,'shapeType':_0x31c6dc,'shapeData':_0x28f448};_0x5d430f[_0x1e9312(0xca)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x9240d8}),_0x4d10cc[_0x1e9312(0xca)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3236b3});if(_0x5d430f[_0x1e9312(0xd9)](_0x1c3d93=>_0x10c5fd[_0x1e9312(0x10b)](_0x1c3d93['id'],_0x1c3d93[_0x1e9312(0x101)])))_0x1acc45[_0x1e9312(0xcb)]({'unitID':_0x3e4dd3,'redoMutations':[..._0x5d430f],'undoMutations':[..._0x4d10cc]});return!![];}return![];}};var name=_0x331e47(0x12a),version=_0x331e47(0x154);function _0x1f87(_0x12bff7,_0x3faad0){_0x12bff7=_0x12bff7-0xc0;const _0x2c0a56=_0x2c0a();let _0x1f87ff=_0x2c0a56[_0x12bff7];return _0x1f87ff;}const SHEETS_SHAPE_PLUGIN_CONFIG_KEY='sheets-shape.config',configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x2dee15,_0x4aa9db,_0x384cee,_0x3bbe31,_0x508ec4){const _0x25a1be=_0x331e47;super(),this[_0x25a1be(0x108)]=_0x2dee15,this['_sheetInterceptorService']=_0x4aa9db,this['_sheetSkeletonService']=_0x384cee,this[_0x25a1be(0x158)]=_0x3bbe31,this[_0x25a1be(0xe8)]=_0x508ec4,this['_initCommands'](),this[_0x25a1be(0xce)]();}[_0x331e47(0xcc)](){const _0x140ebf=_0x331e47;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation]['forEach'](_0x41b41d=>this[_0x140ebf(0x128)](this[_0x140ebf(0x108)]['registerCommand'](_0x41b41d)));}['_initCommandInterceptor'](){const _0x48932c=_0x331e47;this[_0x48932c(0x128)](this['_sheetInterceptorService'][_0x48932c(0x100)]({'getMutations':_0x2f5216=>{const _0x3f1785=_0x48932c;if(_0x2f5216['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x4e71d6}=_0x2f5216['params'],_0xbeec6=_0x4e71d6[_0x3f1785(0xf3)](_0x32346c=>_0x32346c[_0x3f1785(0x144)]===DrawingTypeEnum['DRAWING_SHAPE']);if(_0xbeec6[_0x3f1785(0x12e)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x1d50ec=[],_0x23d6f1=[];return _0xbeec6[_0x3f1785(0x107)](_0x271b73=>{const _0x2139f8=_0x3f1785,{unitId:_0x482ec8,subUnitId:_0x3f8d73,drawingId:_0x199f92}=_0x271b73,_0x3376f3=this[_0x2139f8(0x158)][_0x2139f8(0x10e)](_0x482ec8,_0x3f8d73,_0x199f92);if(!_0x3376f3)throw new TypeError(_0x2139f8(0x156)+_0x3376f3);_0x1d50ec[_0x2139f8(0xca)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x199f92}}),_0x23d6f1[_0x2139f8(0xca)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x199f92,'shapeType':_0x3376f3['getShapeType'](),'shapeData':_0x3376f3[_0x2139f8(0xec)]()}});const _0x24b0ff=this['_sheetsShapeService'][_0x2139f8(0xcd)](_0x482ec8,_0x3f8d73,_0x199f92);if(_0x24b0ff)for(const _0x42151a of _0x24b0ff){const _0x31276a=_0x42151a[_0x2139f8(0xfa)],_0x2e284a=_0x42151a[_0x2139f8(0xc4)],_0x219e70=_0x2e284a?{'from':void 0x0}:{'to':void 0x0},_0xf093c7=_0x2e284a?{'from':{'shapeId':_0x42151a[_0x2139f8(0xf8)],'cxnIndex':_0x42151a['cxnIndex']}}:{'to':{'shapeId':_0x42151a[_0x2139f8(0xf8)],'cxnIndex':_0x42151a[_0x2139f8(0x10f)]}};_0x1d50ec[_0x2139f8(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x31276a,'shapeData':{'relation':_0x219e70}}}),_0x23d6f1['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x482ec8,'subUnitId':_0x3f8d73,'shapeId':_0x31276a,'shapeData':{'relation':_0xf093c7}}});}}),{'preRedos':_0x1d50ec,'redos':[],'preUndos':[],'undos':_0x23d6f1};}if(_0x2f5216['id']===SetSheetDrawingCommand['id']){const {drawings:_0x8fe1e3}=_0x2f5216['params'],_0x435334=_0x8fe1e3[_0x3f1785(0xf3)](_0x4c0f84=>_0x4c0f84[_0x3f1785(0x144)]===DrawingTypeEnum[_0x3f1785(0xe2)]);if(_0x435334[_0x3f1785(0x12e)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x43e57c=[],_0xe135a5=[];for(const _0x6c9966 of _0x435334){const {unitId:_0x318c85,subUnitId:_0x13f314,drawingId:_0x479fe6,transform:_0x5a76b6}=_0x6c9966;if(!_0x318c85||!_0x13f314||!_0x479fe6||!_0x5a76b6)continue;const _0x4be04e=this[_0x3f1785(0x158)]['getShapeModel'](_0x318c85,_0x13f314,_0x479fe6);if(!_0x4be04e)throw new TypeError(_0x3f1785(0x156)+_0x4be04e);if(isConnectorShape(_0x4be04e[_0x3f1785(0x135)]())){const _0x24fa46=this[_0x3f1785(0x158)][_0x3f1785(0xfd)](_0x318c85,_0x13f314,_0x479fe6),_0x3f3d98={'from':void 0x0,'to':void 0x0};_0x24fa46&&(_0x43e57c[_0x3f1785(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x318c85,'subUnitId':_0x13f314,'shapeId':_0x479fe6,'shapeData':{'relation':_0x3f3d98}}}),_0xe135a5[_0x3f1785(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x318c85,'subUnitId':_0x13f314,'shapeId':_0x479fe6,'shapeData':{'relation':_0x24fa46}}}));}else{const _0x2768dc=this[_0x3f1785(0x158)][_0x3f1785(0xcd)](_0x318c85,_0x13f314,_0x479fe6);if(_0x2768dc&&_0x2768dc[_0x3f1785(0x12e)]>0x0)for(const _0x3a4365 of _0x2768dc){const _0x240333=_0x3a4365['lineShapeId'],_0x417900=_0x3a4365[_0x3f1785(0xc4)],_0x4094b1=this[_0x3f1785(0x158)][_0x3f1785(0x10e)](_0x318c85,_0x13f314,_0x240333);if(!_0x4094b1)continue;const _0xcb6e01=_0x4094b1[_0x3f1785(0xd8)](),_0x5a0dd2=_0x4094b1[_0x3f1785(0xda)]();if(_0xcb6e01&&_0x5a0dd2)this['_addLineRerouteUpdates'](_0x318c85,_0x13f314,_0x240333,_0x4094b1,_0xcb6e01,_0x5a0dd2,_0x43e57c,_0xe135a5,_0x479fe6,_0x5a76b6);else this[_0x3f1785(0xd6)](_0x318c85,_0x13f314,_0x240333,_0x4094b1,_0x417900?_0xcb6e01:_0x5a0dd2,_0x417900,_0x43e57c,_0xe135a5,_0x479fe6,_0x5a76b6);}}}return{'preRedos':[],'redos':_0x43e57c,'preUndos':_0xe135a5,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x331e47(0xdb)](_0x205212,_0x39060f,_0x512278,_0x24f49f,_0x506531){const _0x553f=_0x331e47;if(!_0x39060f||!_0x512278)return null;const {shapeId:_0x483486,cxnIndex:_0x22fd5e}=_0x205212,_0x392f07=this[_0x553f(0x158)][_0x553f(0x10e)](_0x39060f,_0x512278,_0x483486);if(!_0x392f07)return null;const _0x9af3e9=this['_drawingManagerService'][_0x553f(0x13e)]({'unitId':_0x39060f,'subUnitId':_0x512278,'drawingId':_0x483486});if(!(_0x9af3e9===null||_0x9af3e9===void 0x0?void 0x0:_0x9af3e9[_0x553f(0x104)]))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x295379}=_0x9af3e9[_0x553f(0x104)];if(_0x506531&&_0x24f49f===_0x483486){var _0x3f2d0b,_0x3f175e,_0x12b707,_0x4d8ea2,_0x1444c0,_0x31aa53,_0x29fc86;left=(_0x3f2d0b=_0x506531[_0x553f(0x152)])!==null&&_0x3f2d0b!==void 0x0?_0x3f2d0b:left,top=(_0x3f175e=_0x506531[_0x553f(0x13b)])!==null&&_0x3f175e!==void 0x0?_0x3f175e:top,width=(_0x12b707=_0x506531[_0x553f(0x14a)])!==null&&_0x12b707!==void 0x0?_0x12b707:width,height=(_0x4d8ea2=_0x506531['height'])!==null&&_0x4d8ea2!==void 0x0?_0x4d8ea2:height,flipX=(_0x1444c0=_0x506531[_0x553f(0x102)])!==null&&_0x1444c0!==void 0x0?_0x1444c0:flipX,flipY=(_0x31aa53=_0x506531[_0x553f(0xe7)])!==null&&_0x31aa53!==void 0x0?_0x31aa53:flipY,_0x295379=(_0x29fc86=_0x506531[_0x553f(0x114)])!==null&&_0x29fc86!==void 0x0?_0x29fc86:_0x295379;}_0x392f07[_0x553f(0xdf)]({'width':width,'height':height});const _0x4fc773=_0x392f07[_0x553f(0x134)]()['find'](_0x44a81d=>_0x44a81d['index']===_0x22fd5e);if(!_0x4fc773)return null;let _0x332f40=flipX?width-_0x4fc773['x']:_0x4fc773['x'],_0x3d25c2=flipY?height-_0x4fc773['y']:_0x4fc773['y'];if(_0x295379!==0x0&&_0x295379!==void 0x0&&_0x295379!==null){const _0xe29ae5=_0x295379*Math['PI']/0xb4,_0x5caf06=Math[_0x553f(0xc3)](_0xe29ae5),_0x150f55=Math[_0x553f(0xf6)](_0xe29ae5),_0x1f656=width/0x2,_0x37354c=height/0x2,_0x15dc81=_0x332f40-_0x1f656,_0x4544d3=_0x3d25c2-_0x37354c;_0x332f40=_0x1f656+_0x15dc81*_0x5caf06-_0x4544d3*_0x150f55,_0x3d25c2=_0x37354c+_0x15dc81*_0x150f55+_0x4544d3*_0x5caf06;}_0x332f40+=left,_0x3d25c2+=top;let _0x66c2bb=_0x4fc773[_0x553f(0x11d)]/0xea60;if(flipX)_0x66c2bb=0xb4-_0x66c2bb;if(flipY)_0x66c2bb=-_0x66c2bb;_0x66c2bb+=_0x295379||0x0,_0x66c2bb=(_0x66c2bb%0x168+0x168)%0x168;const _0x109de3=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x295379||0x0);return{'point':{'x':_0x332f40,'y':_0x3d25c2},'angle':_0x66c2bb,'bounds':_0x109de3};}[_0x331e47(0x115)](_0xeb8006,_0x5db83d,_0x55423e,_0x492a99,_0x10c229,_0x218873,_0x40daff,_0x3940f6,_0x13ecf0,_0x47c932){const _0x192391=_0x331e47,_0x3cb88c=this[_0x192391(0xde)][_0x192391(0x151)](_0xeb8006,_0x5db83d);if(!_0x3cb88c)return;const _0x1970b6=_0x492a99[_0x192391(0x10a)](),_0x341d6d=_0x492a99[_0x192391(0xd5)](),_0x1d9e2e={},_0x2b6d60={};_0x341d6d[_0x192391(0x107)](_0x3d8a51=>{const _0x59b1c7=_0x192391,_0xf78bb0=_0x492a99[_0x59b1c7(0x153)](_0x3d8a51);_0x2b6d60[_0x3d8a51]=_0xf78bb0!==null&&_0xf78bb0!==void 0x0?_0xf78bb0:0x0;});const _0x33bd94=this[_0x192391(0xdb)](_0x10c229,_0xeb8006,_0x5db83d,_0x13ecf0,_0x47c932),_0x48c1a4=this[_0x192391(0xdb)](_0x218873,_0xeb8006,_0x5db83d,_0x13ecf0,_0x47c932);if(_0x33bd94&&_0x48c1a4){const _0x397129=_0x492a99[_0x192391(0x135)](),_0x1f2a96=routeConnectorLineShape(_0x33bd94,_0x48c1a4,_0x397129);let _0x21cfde=_0x397129;if(_0x1f2a96){const _0x584a46=computeConnectorRouteLayout(_0x1f2a96,_0x492a99['getShapeType']()),_0x516018=this[_0x192391(0xe8)][_0x192391(0xef)](_0xeb8006,_0x5db83d);if(_0x516018&&_0x516018[_0x55423e]){const _0x482576=_0x516018[_0x55423e];_0x21cfde=_0x584a46[_0x192391(0xc8)];for(const [_0x487218,_0x5b8724]of Object[_0x192391(0xe5)](_0x584a46[_0x192391(0x137)]))_0x1d9e2e[_0x487218]=_0x5b8724;const _0x191599={..._0x482576[_0x192391(0x104)],'width':_0x584a46[_0x192391(0x14b)][_0x192391(0x14a)],'height':_0x584a46[_0x192391(0x14b)]['height'],'left':_0x584a46['worldRect'][_0x192391(0x152)],'top':_0x584a46['worldRect'][_0x192391(0x13b)],'flipX':_0x584a46[_0x192391(0x14b)][_0x192391(0x102)],'flipY':_0x584a46[_0x192391(0x14b)]['flipY'],'angle':_0x584a46['rotation']},_0x2d6bab=transformToDrawingPosition(_0x191599,_0x3cb88c),_0x50ed03=transformToAxisAlignPosition(_0x191599,_0x3cb88c),_0x4f4ffb={'unitId':_0xeb8006,'subUnitId':_0x5db83d,'drawingType':DrawingTypeEnum[_0x192391(0xe2)],'drawingId':_0x55423e,'transform':_0x191599,'sheetTransform':_0x2d6bab,'axisAlignSheetTransform':_0x50ed03},{unitId:_0x43d1c5,subUnitId:_0x1f886a,undo:_0x406e47,redo:_0x4d6bae,objects:_0x5311db}=this[_0x192391(0xe8)][_0x192391(0x143)]([_0x4f4ffb]);_0x40daff[_0x192391(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x43d1c5,'subUnitId':_0x1f886a,'op':_0x4d6bae,'objects':_0x5311db,'type':DrawingApplyType[_0x192391(0x129)]}}),_0x3940f6[_0x192391(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x43d1c5,'subUnitId':_0x1f886a,'op':_0x406e47,'objects':_0x5311db,'type':DrawingApplyType['UPDATE']}});}_0x492a99[_0x192391(0x103)]();}_0x40daff[_0x192391(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xeb8006,'subUnitId':_0x5db83d,'shapeId':_0x55423e,'shapeType':_0x21cfde,'shapeData':{'adjustValues':_0x1d9e2e,'relation':_0x1970b6}}}),_0x3940f6[_0x192391(0xca)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xeb8006,'subUnitId':_0x5db83d,'shapeId':_0x55423e,'shapeType':_0x397129,'shapeData':{'adjustValues':_0x2b6d60,'relation':_0x1970b6}}});}}[_0x331e47(0xd6)](_0x331943,_0xeff3d2,_0x218681,_0xa02121,_0x47c09e,_0x55b181,_0x1ac30f,_0x2147b0,_0x43be01,_0x535caa){const _0x4e4c34=_0x331e47;var _0xf61a79;if(!_0x47c09e)return;const _0x1aabc7=this[_0x4e4c34(0xde)][_0x4e4c34(0x151)](_0x331943,_0xeff3d2);if(!_0x1aabc7)return;const _0x1d4c45=(_0xf61a79=this[_0x4e4c34(0xe8)]['getDrawingByParam']({'unitId':_0x331943,'subUnitId':_0xeff3d2,'drawingId':_0x43be01}))===null||_0xf61a79===void 0x0?void 0x0:_0xf61a79['transform'];if(!_0x1d4c45)return;const _0x1f414c=_0x1d4c45['left']!==_0x535caa[_0x4e4c34(0x152)]||_0x1d4c45[_0x4e4c34(0x13b)]!==_0x535caa[_0x4e4c34(0x13b)],_0x349919=_0x1d4c45['width']!==_0x535caa[_0x4e4c34(0x14a)]||_0x1d4c45[_0x4e4c34(0x136)]!==_0x535caa[_0x4e4c34(0x136)],_0x2dac66=_0x1d4c45[_0x4e4c34(0x102)]!==_0x535caa[_0x4e4c34(0x102)]||_0x1d4c45[_0x4e4c34(0xe7)]!==_0x535caa['flipY'],_0x56e78b=_0x1d4c45['angle']!==_0x535caa[_0x4e4c34(0x114)];if(_0x1f414c&&!_0x349919&&!_0x2dac66&&!_0x56e78b){var _0x93133d,_0x6675c4,_0x2518dd,_0x341b04;const _0x161eaa=((_0x93133d=_0x535caa[_0x4e4c34(0x152)])!==null&&_0x93133d!==void 0x0?_0x93133d:0x0)-((_0x6675c4=_0x1d4c45[_0x4e4c34(0x152)])!==null&&_0x6675c4!==void 0x0?_0x6675c4:0x0),_0x1f55fd=((_0x2518dd=_0x535caa[_0x4e4c34(0x13b)])!==null&&_0x2518dd!==void 0x0?_0x2518dd:0x0)-((_0x341b04=_0x1d4c45[_0x4e4c34(0x13b)])!==null&&_0x341b04!==void 0x0?_0x341b04:0x0),_0x1a1ab9=this[_0x4e4c34(0xe8)][_0x4e4c34(0xef)](_0x331943,_0xeff3d2);if(_0x1a1ab9&&_0x1a1ab9[_0x218681]){var _0xdf05e6,_0xa89259,_0x4ceb4b,_0x4fa38c;const _0x6a28ad=_0x1a1ab9[_0x218681],_0x2cb97d={..._0x6a28ad['transform'],'left':((_0xdf05e6=(_0xa89259=_0x6a28ad[_0x4e4c34(0x104)])===null||_0xa89259===void 0x0?void 0x0:_0xa89259[_0x4e4c34(0x152)])!==null&&_0xdf05e6!==void 0x0?_0xdf05e6:0x0)+_0x161eaa,'top':((_0x4ceb4b=(_0x4fa38c=_0x6a28ad[_0x4e4c34(0x104)])===null||_0x4fa38c===void 0x0?void 0x0:_0x4fa38c['top'])!==null&&_0x4ceb4b!==void 0x0?_0x4ceb4b:0x0)+_0x1f55fd},_0x1c3ab6=transformToDrawingPosition(_0x2cb97d,_0x1aabc7),_0x116ea4=transformToAxisAlignPosition(_0x2cb97d,_0x1aabc7),_0x35f38b={'unitId':_0x331943,'subUnitId':_0xeff3d2,'drawingType':DrawingTypeEnum[_0x4e4c34(0xe2)],'drawingId':_0x218681,'transform':_0x2cb97d,'sheetTransform':_0x1c3ab6,'axisAlignSheetTransform':_0x116ea4},{unitId:_0x2ad709,subUnitId:_0x230533,undo:_0x5f5194,redo:_0x2160a9,objects:_0x56934f}=this[_0x4e4c34(0xe8)][_0x4e4c34(0x143)]([_0x35f38b]);_0x1ac30f[_0x4e4c34(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2ad709,'subUnitId':_0x230533,'op':_0x2160a9,'objects':_0x56934f,'type':DrawingApplyType[_0x4e4c34(0x129)]}}),_0x2147b0[_0x4e4c34(0xca)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2ad709,'subUnitId':_0x230533,'op':_0x5f5194,'objects':_0x56934f,'type':DrawingApplyType[_0x4e4c34(0x129)]}});}}else{const _0x1731c8=_0xa02121[_0x4e4c34(0xd8)](),_0xfe30d7=_0xa02121[_0x4e4c34(0xda)]();this[_0x4e4c34(0x115)](_0x331943,_0xeff3d2,_0x218681,_0xa02121,_0x1731c8,_0xfe30d7,_0x1ac30f,_0x2147b0,_0x43be01,_0x535caa);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);function _0x2c0a(){const _0x542a6f=['registerPluginResource','function','clear','getConnectionSiteList','getShapeType','height','adjustValues','INSERT','startX','setShapeData','top','_injector','fromJSON','getDrawingByParam','sheet.mutation.remove-shape','isHorizontal','type','toJSON','getBatchUpdateOp','drawingType','_groupIds','add','onCommandExecute','packageName','from','width','worldRect','position','_ensureShapeModelManager','version','4798650mYvWIv','9039NTdYIM','getSkeleton','left','getAdjustValueByName','0.22.0','_config','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','_configService','_sheetsShapeService','addShape','getCellWithCoordByIndex','preUndos','get','getOwnPropertyDescriptor','data','undos','decorate','_disposed','cos','isFrom','_linesIds','_deserializeShapeForUnit','keys','lineType','sheet.command.set-shape-rotate','push','pushUndoRedo','_initCommands','getBasicShapeRelation','_initCommandInterceptor','borderEnabled','UNIVER_SHEET','fill','shapeData','setShapeType','set','getAdjustNames','_addLineFollowShapeUpdates','sheet.mutation.update-shape-type','getStartConnectInfo','every','getEndConnectInfo','_getConnectPointInfo','getShapeDataById','relation','_sheetSkeletonService','updateContext','onStarting','constructor','DRAWING_SHAPE','424jcpDLy','insertShape','entries','_resourcesManagerService','flipY','_drawingManagerService','string','16rwdyOl','sheet.command.update-line-shape-resize','getShapeData','startY','pluginName','getDrawingData','16996903PfrULp','MUTATION','delete','filter','15169HdLucD','result','sin','sheet.command.update-shape-type','shapeId','SHEET_SHAPE_PLUGIN','lineShapeId','symbol','preRedos','getLineShapeRelation','92060ZzJWvv','_shapeModelManagerMap','interceptCommand','params','flipX','removeLinePoints','transform','198qfWnZs','setConfig','forEach','_commandService','rotateEnabled','getShapeRelation','syncExecuteCommand','COMMAND','assign','getShapeModel','cxnIndex','stringify','_shapes','redos','78387mYTekj','angle','_addLineRerouteUpdates','object','getBasicShapeType','hasShape','isLineShape','sheet.command.toggle-shape-flip','sheet.command.insert-shape','parse','ang','removeShape','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','sheet.command.set-shape-drawing-data','370074TCjuOS','_serializeShapeForUnit','range','846fIUYDu','resizeEnabled','has','toPrimitive','disposeWithMe','UPDATE','@univerjs-pro/sheets-shape','dispose','iterator','ensureSkeleton','length','getBatchAddOp','getCellIndexAndOffsetByPosition'];_0x2c0a=function(){return _0x542a6f;};return _0x2c0a();}let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x148550=defaultPluginConfig,_0x228e51,_0x24a1e7,_0x405e4e){const _0x32e942=_0x331e47;super(),this[_0x32e942(0x155)]=_0x148550,this[_0x32e942(0x13c)]=_0x228e51,this[_0x32e942(0x108)]=_0x24a1e7,this[_0x32e942(0x157)]=_0x405e4e;const {..._0x3cd1df}=merge({},defaultPluginConfig,this[_0x32e942(0x155)]);this[_0x32e942(0x157)][_0x32e942(0x106)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x3cd1df);}[_0x331e47(0xe0)](){const _0x1b6fe2=_0x331e47,_0x57b5ff=this[_0x1b6fe2(0x13c)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x1b6fe2(0x107)](_0x46f3ce=>_0x57b5ff[_0x1b6fe2(0x146)](_0x46f3ce)),touchDependencies(_0x57b5ff,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x141),UniverInstanceType[_0x331e47(0xd0)]),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0xee),_0x331e47(0xf9)),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x148),name),_defineProperty(UniverSheetsShapePlugin,_0x331e47(0x14e),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 _0x341a97=_0x16de;(function(_0x4f3524,_0x5b9a4a){const _0x593e3c=_0x16de,_0x3614b0=_0x4f3524();while(!![]){try{const _0x224736=-parseInt(_0x593e3c(0x11a))/0x1*(parseInt(_0x593e3c(0x150))/0x2)+-parseInt(_0x593e3c(0x184))/0x3+parseInt(_0x593e3c(0x175))/0x4*(-parseInt(_0x593e3c(0x11e))/0x5)+-parseInt(_0x593e3c(0x1a4))/0x6+-parseInt(_0x593e3c(0x190))/0x7+-parseInt(_0x593e3c(0x15c))/0x8*(parseInt(_0x593e3c(0x142))/0x9)+parseInt(_0x593e3c(0x111))/0xa;if(_0x224736===_0x5b9a4a)break;else _0x3614b0['push'](_0x3614b0['shift']());}catch(_0x2d68e5){_0x3614b0['push'](_0x3614b0['shift']());}}}(_0x2d10,0x95c63));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(_0x2669e1){'@babel/helpers - typeof';const _0x37c67b=_0x16de;return _typeof=_0x37c67b(0x159)==typeof Symbol&&'symbol'==typeof Symbol[_0x37c67b(0x156)]?function(_0x5e5feb){return typeof _0x5e5feb;}:function(_0x4c746f){const _0x1c219e=_0x37c67b;return _0x4c746f&&_0x1c219e(0x159)==typeof Symbol&&_0x4c746f[_0x1c219e(0x185)]===Symbol&&_0x4c746f!==Symbol[_0x1c219e(0x117)]?_0x1c219e(0x135):typeof _0x4c746f;},_typeof(_0x2669e1);}function toPrimitive(_0x54ee,_0x25aac4){const _0x53f496=_0x16de;if(_0x53f496(0x168)!=_typeof(_0x54ee)||!_0x54ee)return _0x54ee;var _0x2f5eee=_0x54ee[Symbol[_0x53f496(0x174)]];if(void 0x0!==_0x2f5eee){var _0x5366eb=_0x2f5eee[_0x53f496(0x18b)](_0x54ee,_0x25aac4||'default');if(_0x53f496(0x168)!=_typeof(_0x5366eb))return _0x5366eb;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x53f496(0x126)===_0x25aac4?String:Number)(_0x54ee);}function toPropertyKey(_0x36e67c){const _0x24f02e=_0x16de;var _0x2791d2=toPrimitive(_0x36e67c,_0x24f02e(0x126));return _0x24f02e(0x135)==_typeof(_0x2791d2)?_0x2791d2:_0x2791d2+'';}function _defineProperty(_0x1cc10b,_0x29ad56,_0x3472fc){return(_0x29ad56=toPropertyKey(_0x29ad56))in _0x1cc10b?Object['defineProperty'](_0x1cc10b,_0x29ad56,{'value':_0x3472fc,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1cc10b[_0x29ad56]=_0x3472fc,_0x1cc10b;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x272193=_0x16de;super(),_defineProperty(this,'_shapes',new Map()),_defineProperty(this,_0x272193(0x141),new Set()),_defineProperty(this,'_groupIds',new Set());}[_0x341a97(0x187)](_0x279b3a,_0x57ee2c,_0x587886){const _0x3cda98=_0x341a97,_0x8a372f=new ShapeModel(_0x279b3a,_0x57ee2c,_0x587886);this[_0x3cda98(0x13e)][_0x3cda98(0x119)](_0x57ee2c,_0x8a372f);if(isConnectorShape(_0x279b3a))this['_linesIds'][_0x3cda98(0x1ab)](_0x57ee2c);return _0x8a372f;}[_0x341a97(0x148)](_0x24a515){const _0x52779c=_0x341a97,_0x49a4f5=[];for(const _0x74d4ae of this[_0x52779c(0x141)]){const _0x111d4f=this[_0x52779c(0x13e)][_0x52779c(0x17f)](_0x74d4ae);if(_0x111d4f){const _0x4c0fb5=_0x111d4f['getShapeRelation']();if(_0x4c0fb5){var _0x3e2c62,_0x65980d;if(((_0x3e2c62=_0x4c0fb5[_0x52779c(0x11d)])===null||_0x3e2c62===void 0x0?void 0x0:_0x3e2c62['shapeId'])===_0x24a515)_0x49a4f5[_0x52779c(0x12d)]({..._0x4c0fb5[_0x52779c(0x11d)],'lineShapeId':_0x74d4ae,'isFrom':!![]});if(((_0x65980d=_0x4c0fb5['to'])===null||_0x65980d===void 0x0?void 0x0:_0x65980d[_0x52779c(0x125)])===_0x24a515)_0x49a4f5[_0x52779c(0x12d)]({..._0x4c0fb5['to'],'lineShapeId':_0x74d4ae,'isFrom':![]});}}}return _0x49a4f5;}[_0x341a97(0x12e)](_0x427227){const _0x5a542c=_0x341a97,_0x184419=this[_0x5a542c(0x13e)][_0x5a542c(0x17f)](_0x427227);if(_0x184419)return _0x184419['getShapeRelation']();}[_0x341a97(0x144)](_0x267b0e){const _0x5dd0c7=_0x341a97,_0x100caf=this[_0x5dd0c7(0x13e)][_0x5dd0c7(0x17f)](_0x267b0e);if(_0x100caf)return _0x100caf['getShapeType']();}[_0x341a97(0x12a)](_0x5bb6ba){const _0x1462c5=_0x341a97;return this['_shapes'][_0x1462c5(0x192)](_0x5bb6ba);}[_0x341a97(0x127)](_0x5a795d){const _0x52ee82=_0x341a97,_0x2e986a=this[_0x52ee82(0x13e)][_0x52ee82(0x17f)](_0x5a795d);if(!_0x2e986a)return;if(isConnectorShape(_0x2e986a[_0x52ee82(0x144)]()))this['_linesIds'][_0x52ee82(0x121)](_0x5a795d);this[_0x52ee82(0x13e)][_0x52ee82(0x121)](_0x5a795d);}[_0x341a97(0x131)](){const _0x474c3c=_0x341a97,_0x2955f3=[];return this[_0x474c3c(0x13e)]['forEach'](_0x44a1f8=>{const _0x51d558=_0x474c3c;_0x2955f3[_0x51d558(0x12d)](_0x44a1f8[_0x51d558(0x131)]());}),_0x2955f3;}['fromJSON'](_0x42f7a0){const _0x5a1bfd=_0x341a97;for(const _0x581ddf of _0x42f7a0){const {id:_0x5bde8a,shapeType:_0x489eb4}=_0x581ddf,_0x20fde0=this[_0x5a1bfd(0x187)](_0x489eb4,_0x5bde8a,_0x581ddf[_0x5a1bfd(0x176)]);if(_0x20fde0&&_0x20fde0[_0x5a1bfd(0x151)]())this[_0x5a1bfd(0x141)]['add'](_0x5bde8a);}}[_0x341a97(0x15b)](){const _0xd97997=_0x341a97;if(this[_0xd97997(0x166)])return;this[_0xd97997(0x13e)][_0xd97997(0x116)](_0x3468b4=>{const _0x42e427=_0xd97997;_0x3468b4[_0x42e427(0x15b)]();}),this[_0xd97997(0x13e)][_0xd97997(0x1a5)](),this[_0xd97997(0x141)][_0xd97997(0x1a5)](),this[_0xd97997(0x170)][_0xd97997(0x1a5)](),super['dispose']();}};function __decorateParam(_0x9bd393,_0x2844da){return function(_0x1827c0,_0x20c69a){_0x2844da(_0x1827c0,_0x20c69a,_0x9bd393);};}function __decorate(_0x2ae185,_0x46abe8,_0x254137,_0x114744){const _0x265121=_0x341a97;var _0x81c0e2=arguments[_0x265121(0x17c)],_0x55803d=_0x81c0e2<0x3?_0x46abe8:_0x114744===null?_0x114744=Object[_0x265121(0x12b)](_0x46abe8,_0x254137):_0x114744,_0x7744f1;if(typeof Reflect===_0x265121(0x168)&&typeof Reflect[_0x265121(0x122)]===_0x265121(0x159))_0x55803d=Reflect[_0x265121(0x122)](_0x2ae185,_0x46abe8,_0x254137,_0x114744);else{for(var _0x4934bb=_0x2ae185[_0x265121(0x17c)]-0x1;_0x4934bb>=0x0;_0x4934bb--)if(_0x7744f1=_0x2ae185[_0x4934bb])_0x55803d=(_0x81c0e2<0x3?_0x7744f1(_0x55803d):_0x81c0e2>0x3?_0x7744f1(_0x46abe8,_0x254137,_0x55803d):_0x7744f1(_0x46abe8,_0x254137))||_0x55803d;}return _0x81c0e2>0x3&&_0x55803d&&Object[_0x265121(0x194)](_0x46abe8,_0x254137,_0x55803d),_0x55803d;}const SHEET_SHAPE_PLUGIN=_0x341a97(0x186);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x32407f){const _0x4c878e=_0x341a97;super(),this['_resourcesManagerService']=_0x32407f,_defineProperty(this,_0x4c878e(0x1a8),new Map()),this[_0x4c878e(0x183)]();}[_0x341a97(0x147)](_0x559ca7,_0x46b586){const _0x4d05a5=_0x341a97;let _0x46bc41=this['_shapeModelManagerMap'][_0x4d05a5(0x17f)](_0x559ca7);!_0x46bc41&&(_0x46bc41=new Map(),this[_0x4d05a5(0x1a8)][_0x4d05a5(0x119)](_0x559ca7,_0x46bc41));let _0x1daa2e=_0x46bc41[_0x4d05a5(0x17f)](_0x46b586);return!_0x1daa2e&&(_0x1daa2e=new SheetShapeModelManager(),_0x46bc41[_0x4d05a5(0x119)](_0x46b586,_0x1daa2e)),_0x1daa2e;}[_0x341a97(0x124)](_0xd1e571,_0x1027b7,_0x25a95a,_0x323e0b,_0x37da63){const _0x4dd39d=_0x341a97;this['_ensureShapeModelManager'](_0xd1e571,_0x1027b7)[_0x4dd39d(0x187)](_0x25a95a,_0x323e0b,_0x37da63);}[_0x341a97(0x127)](_0x4d38fa,_0x2e6a61,_0x24019c){const _0x48ef05=_0x341a97;this[_0x48ef05(0x147)](_0x4d38fa,_0x2e6a61)[_0x48ef05(0x127)](_0x24019c);}[_0x341a97(0x172)](_0x5b832f,_0x55bb92,_0x10bbbb){const _0xda7489=_0x341a97;return this[_0xda7489(0x147)](_0x5b832f,_0x55bb92)['getShapeType'](_0x10bbbb);}[_0x341a97(0x144)](_0x316469,_0x1806bb,_0x47b36e){const _0x3584b0=_0x341a97;return this[_0x3584b0(0x147)](_0x316469,_0x1806bb)[_0x3584b0(0x144)](_0x47b36e);}['hasShape'](_0x558732,_0x2b279a,_0x18d227){const _0x5b6701=_0x341a97;return this[_0x5b6701(0x147)](_0x558732,_0x2b279a)[_0x5b6701(0x12a)](_0x18d227);}[_0x341a97(0x18e)](_0x210b74,_0x24cda0,_0x1b8332){const _0x234d88=_0x341a97;return this[_0x234d88(0x147)](_0x210b74,_0x24cda0)[_0x234d88(0x144)](_0x1b8332);}[_0x341a97(0x19b)](_0x3f9f2d,_0x10abdb,_0x11fc0b){const _0x2a3bc9=_0x341a97,_0x3714bd=this[_0x2a3bc9(0x147)](_0x3f9f2d,_0x10abdb);if(!_0x3714bd[_0x2a3bc9(0x144)](_0x11fc0b))return;const _0x8588ad=_0x3714bd[_0x2a3bc9(0x13e)][_0x2a3bc9(0x17f)](_0x11fc0b);if(!_0x8588ad)return;return _0x8588ad[_0x2a3bc9(0x1a0)]();}[_0x341a97(0x16d)](_0x3c22e0,_0x1d9b4b,_0x515c85){return this['_ensureShapeModelManager'](_0x3c22e0,_0x1d9b4b)['_shapes']['get'](_0x515c85);}['getBasicShapeRelation'](_0x1bde01,_0x1e0f6e,_0x359289){return this['_ensureShapeModelManager'](_0x1bde01,_0x1e0f6e)['getBasicShapeRelation'](_0x359289);}[_0x341a97(0x12e)](_0x5efbda,_0x526671,_0x96b5b2){const _0x2ac4c4=_0x341a97,_0x4a3792=this[_0x2ac4c4(0x147)](_0x5efbda,_0x526671)[_0x2ac4c4(0x13e)][_0x2ac4c4(0x17f)](_0x96b5b2);if(!_0x4a3792)return;return _0x4a3792[_0x2ac4c4(0x18a)]();}[_0x341a97(0x198)](){}[_0x341a97(0x161)](_0x271158){const _0x1e14e4=_0x341a97,_0x37f95b={},_0x29ce57=this[_0x1e14e4(0x1a8)]['get'](_0x271158);if(_0x29ce57)_0x29ce57['forEach']((_0x2871ed,_0x1e9600)=>{const _0x4abc43=_0x1e14e4,_0x5384fd=_0x2871ed['toJSON']();if(_0x5384fd[_0x4abc43(0x17c)]>0x0)_0x37f95b[_0x1e9600]=_0x5384fd;});return JSON[_0x1e14e4(0x158)](_0x37f95b);}['_deserializeShapeForUnit'](_0x21f8f9,_0x1cf0fc){const _0x3fa576=_0x341a97;Object[_0x3fa576(0x118)](_0x1cf0fc)['forEach'](_0x5a9d62=>{const _0xa800df=_0x3fa576;this[_0xa800df(0x147)](_0x21f8f9,_0x5a9d62)['fromJSON'](_0x1cf0fc[_0x5a9d62]);});}[_0x341a97(0x131)](){const _0x4e5855=_0x341a97,_0x5beba2={};return this[_0x4e5855(0x1a8)][_0x4e5855(0x116)]((_0x153e29,_0x1bcbd6)=>{const _0x1ae90c=_0x4e5855;_0x5beba2[_0x1bcbd6]={},_0x153e29[_0x1ae90c(0x116)]((_0x296f6d,_0x28794d)=>{_0x5beba2[_0x1bcbd6][_0x28794d]=_0x296f6d['toJSON']();});}),_0x5beba2;}[_0x341a97(0x191)](_0x46108a){const _0x2221cf=_0x341a97;Object[_0x2221cf(0x118)](_0x46108a)[_0x2221cf(0x116)](_0x2b780b=>{const _0x5c191c=_0x46108a[_0x2b780b];Object['keys'](_0x5c191c)['forEach'](_0x168f91=>{const _0x42adc3=_0x16de;this['_ensureShapeModelManager'](_0x2b780b,_0x168f91)[_0x42adc3(0x191)](_0x5c191c[_0x168f91]);});});}['_initSnapshot'](){const _0x937193=_0x341a97;this[_0x937193(0x11b)][_0x937193(0x15e)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType[_0x937193(0x162)]],'toJson':_0x220d32=>this[_0x937193(0x161)](_0x220d32),'parseJson':_0x458af6=>JSON[_0x937193(0x14c)](_0x458af6),'onLoad':(_0x48b65a,_0x387713)=>{this['_deserializeShapeForUnit'](_0x48b65a,_0x387713);},'onUnLoad':_0x314f15=>{const _0x90b8ef=_0x937193,_0x3d7235=this[_0x90b8ef(0x1a8)][_0x90b8ef(0x17f)](_0x314f15);_0x3d7235&&(_0x3d7235[_0x90b8ef(0x116)](_0x35e3c3=>{const _0x249525=_0x90b8ef;_0x35e3c3[_0x249525(0x15b)]();}),this[_0x90b8ef(0x1a8)]['delete'](_0x314f15));}});}[_0x341a97(0x15b)](){const _0x235e58=_0x341a97;this[_0x235e58(0x1a8)]['forEach'](_0xec4182=>{const _0x445d10=_0x235e58;_0xec4182[_0x445d10(0x116)](_0x904b00=>{_0x904b00['dispose']();});});}};function _0x16de(_0x402efb,_0x2ea7c8){_0x402efb=_0x402efb-0x110;const _0x2d10cc=_0x2d10();let _0x16deec=_0x2d10cc[_0x402efb];return _0x16deec;}SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);function _0x2d10(){const _0x4c1a7c=['get','sheet.command.set-shape-text-vertical-toggle','startX','fill','_initSnapshot','3167433KJfYbE','constructor','SHEET_SHAPE_PLUGIN','addShape','getAdjustValueByName','_addLineFollowShapeUpdates','getShapeRelation','call','getCellIndexAndOffsetByPosition','setShapeData','getShapeTypeById','registerCommand','5653774MGPmwG','fromJSON','has','getEndConnectInfo','defineProperty','setConfig','isHorizontal','pushUndoRedo','setShapeType','sheet.command.update-shape-type','@univerjs-pro/sheets-shape','getShapeDataById','rotateEnabled','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','ang','type','getShapeData','getDrawingByParam','ensureSkeleton','preRedos','3054546iKzjbQ','clear','_sheetsShapeService','adjustValues','_shapeModelManagerMap','MUTATION','worldRect','add','cxnIndex','45180070FIWdck','0.22.1','getDrawingData','sheet.command.update-line-shape-resize','width','forEach','prototype','keys','set','1srcwpK','_resourcesManagerService','_commandService','from','155MQXZrd','sheet.command.toggle-shape-flip','_addLineRerouteUpdates','delete','decorate','_injector','insertShape','shapeId','string','removeShape','_getConnectPointInfo','lineShapeId','hasShape','getOwnPropertyDescriptor','index','push','getLineShapeRelation','drawingType','getCellWithCoordByIndex','toJSON','onStarting','flipX','redos','symbol','sheet.mutation.update-shape-type','data','_drawingManagerService','_configService','COMMAND','top','DRAWING_SHAPE','flipY','_shapes','result','position','_linesIds','2486853XWgQPU','startY','getShapeType','pluginName','undos','_ensureShapeModelManager','getBasicShapeRelation','left','getSkeleton','getStartConnectInfo','parse','packageName','getBatchUpdateOp','_initCommandInterceptor','1303970XjErvP','isLineShape','sheets-shape.config','getConnectionSiteList','onCommandExecute','params','iterator','UPDATE','stringify','function','range','dispose','16INLsCw','getShapeTextData','registerPluginResource','cos','_initCommands','_serializeShapeForUnit','UNIVER_SHEET','preUndos','_sheetSkeletonService','height','_disposed','INSERT','object','borderEnabled','_config','interceptCommand','disposeWithMe','getShapeModel','getAdjustNames','lineType','_groupIds','_sheetInterceptorService','getBasicShapeType','removeLinePoints','toPrimitive','42236DLVzpz','shapeData','angle','isFrom','filter','resizeEnabled','sheet.command.update-connector-relation','length','relation','transform'];_0x2d10=function(){return _0x4c1a7c;};return _0x2d10();}const InsertSheetsShapeMutation={'id':'sheet.mutation.insert-shape','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x1d32c0,_0x5360ae)=>{const _0x2138b1=_0x341a97,{unitId:_0x4ec7e5,subUnitId:_0x42eec3,shapeType:_0x2227f2,shapeId:_0x63442d,shapeData:_0x201495}=_0x5360ae;return _0x1d32c0['get'](SheetsShapeService)[_0x2138b1(0x124)](_0x4ec7e5,_0x42eec3,_0x2227f2,_0x63442d,_0x201495),!![];}},RemoveSheetsShapeMutation={'id':'sheet.mutation.remove-shape','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x526b66,_0x3097df)=>{const _0x3dd609=_0x341a97,{unitId:_0xa54f39,subUnitId:_0x1de393,shapeId:_0x32c41c}=_0x3097df;return _0x526b66[_0x3dd609(0x17f)](SheetsShapeService)[_0x3dd609(0x127)](_0xa54f39,_0x1de393,_0x32c41c),!![];}},InsertShapeCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.insert-shape','handler':(_0x4c0466,_0x396c57)=>{const _0x5c8558=_0x341a97;var _0x2de56b,_0x94cb09;const _0x515c34=getSheetCommandTarget(_0x4c0466['get'](IUniverInstanceService),_0x396c57);if(!_0x515c34)return![];const _0x4db599=_0x4c0466['get'](SheetSkeletonService),{unitId:_0x31dcc9,subUnitId:_0x319fce}=_0x515c34,_0x4824ec=_0x4db599[_0x5c8558(0x1a2)](_0x31dcc9,_0x319fce);if(!_0x4824ec)return![];const _0x923d1a=_0x4c0466['get'](ICommandService),_0x3fd453=_0x4c0466[_0x5c8558(0x17f)](IUndoRedoService),_0x230197=_0x4c0466[_0x5c8558(0x17f)](SheetInterceptorService),_0x20770b=_0x4c0466[_0x5c8558(0x17f)](ISheetDrawingService),{shapeType:_0x1a0f34,shapeData:_0x34bcb3}=_0x396c57,_0x6a9ffe=_0x396c57[_0x5c8558(0x125)]||generateRandomId(),_0x4c7fd6={'unitId':_0x31dcc9,'subUnitId':_0x319fce,'shapeId':_0x6a9ffe,'shapeType':_0x1a0f34,'shapeData':_0x34bcb3},_0x3d0e0e=_0x396c57[_0x5c8558(0x115)]||0xc8,_0x57c21f=_0x396c57[_0x5c8558(0x165)]||0xc8;let _0x48aa94=0x0,_0x56c44c=0x0,_0x42c8ab={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x2c12d3={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x396c57[_0x5c8558(0x140)]){const {x:_0x24fce8,y:_0x43d395}=_0x396c57['position'];_0x48aa94=_0x24fce8,_0x56c44c=_0x43d395,_0x42c8ab=_0x4824ec[_0x5c8558(0x18c)](_0x24fce8,_0x43d395),_0x2c12d3=_0x4824ec[_0x5c8558(0x18c)](_0x24fce8+_0x3d0e0e,_0x43d395+_0x57c21f);}else{if(_0x396c57[_0x5c8558(0x15a)]){const {startRow:_0x4590e4,startColumn:_0x497a90}=_0x396c57['range'],_0xedbba0=0xa,_0x53194e=0xa;_0x42c8ab={'row':_0x4590e4,'rowOffset':_0xedbba0,'column':_0x497a90,'columnOffset':_0x53194e};const _0x299300=_0x4824ec[_0x5c8558(0x130)](_0x4590e4,_0x497a90);_0x48aa94=_0x299300[_0x5c8558(0x181)]+_0x53194e,_0x56c44c=_0x299300[_0x5c8558(0x143)]+_0xedbba0,_0x2c12d3=_0x4824ec[_0x5c8558(0x18c)](_0x48aa94+_0x3d0e0e,_0x56c44c+_0x57c21f);}}const _0x1f6228={'from':_0x42c8ab,'to':_0x2c12d3},_0x4769a2={'unitId':_0x31dcc9,'subUnitId':_0x319fce,'drawingId':_0x6a9ffe,'drawingType':DrawingTypeEnum[_0x5c8558(0x13c)],'sheetTransform':_0x1f6228,'transform':{'left':_0x48aa94,'top':_0x56c44c,'width':_0x3d0e0e,'height':_0x57c21f},'data':{'shapeType':_0x1a0f34,'shapeData':_0x34bcb3},'axisAlignSheetTransform':_0x1f6228,'allowTransform':!![]};isConnectorShape(_0x1a0f34)&&(_0x4769a2[_0x5c8558(0x137)][_0x5c8558(0x182)]=![],_0x4769a2[_0x5c8558(0x137)]['rotateEnabled']=![],_0x4769a2[_0x5c8558(0x137)]['resizeEnabled']=![],_0x4769a2['data'][_0x5c8558(0x169)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x19c)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x17a)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x169)]=![]);const {undo:_0x451dbc,redo:_0x21dcc2,objects:_0x3eb3ff}=_0x20770b['getBatchAddOp']([_0x4769a2]),_0x817e0d=_0x230197[_0x5c8558(0x154)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x31dcc9,'drawings':[_0x4769a2]}}),_0x45f808=[...(_0x2de56b=_0x817e0d['preRedos'])!==null&&_0x2de56b!==void 0x0?_0x2de56b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'op':_0x21dcc2,'objects':_0x3eb3ff,'type':DrawingApplyType[_0x5c8558(0x167)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x31dcc9]},..._0x817e0d[_0x5c8558(0x134)],{'id':InsertSheetsShapeMutation['id'],'params':_0x4c7fd6}],_0x50d74a=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'shapeId':_0x6a9ffe}},...(_0x94cb09=_0x817e0d['preUndos'])!==null&&_0x94cb09!==void 0x0?_0x94cb09:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'op':_0x451dbc,'objects':_0x3eb3ff,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x31dcc9]},..._0x817e0d[_0x5c8558(0x146)]];if(sequenceExecute(_0x45f808,_0x923d1a)[_0x5c8558(0x13f)])return _0x3fd453['pushUndoRedo']({'unitID':_0x31dcc9,'undoMutations':_0x50d74a,'redoMutations':_0x45f808}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':'sheet.mutation.update-shape-data','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x4fe054,_0x4135f5)=>{const _0x43f2a3=_0x341a97,{unitId:_0x5ea515,subUnitId:_0x5b4115,shapeType:_0x3bfdb2,shapeId:_0x3d543c,shapeData:_0x3e0d5d}=_0x4135f5,_0x11a179=_0x4fe054[_0x43f2a3(0x17f)](SheetsShapeService)['getShapeModel'](_0x5ea515,_0x5b4115,_0x3d543c);if(_0x11a179){if(_0x3bfdb2!==void 0x0)_0x11a179[_0x43f2a3(0x198)](_0x3bfdb2);if(_0x3e0d5d)_0x11a179===null||_0x11a179===void 0x0||_0x11a179['setShapeData'](_0x3e0d5d,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.set-shape-drawing-data','handler':(_0x11dafe,_0x20fba0)=>{const _0x441b0d=_0x341a97;var _0x4a088f,_0x32f7ab;const _0x3fcd4c=getSheetCommandTarget(_0x11dafe['get'](IUniverInstanceService),_0x20fba0);if(!_0x3fcd4c)return![];const _0x1bca65=_0x11dafe['get'](SheetSkeletonService),{unitId:_0x4eab77,subUnitId:_0x745007}=_0x3fcd4c,_0x4ac798=_0x1bca65['ensureSkeleton'](_0x4eab77,_0x745007);if(!_0x4ac798)return![];const _0x552c21=_0x11dafe['get'](SheetsShapeService),{shapeId:_0x32a5b2,shapeType:_0x4f6aa6,shapeData:_0x469cbc,position:_0x42a4f8,width:_0x18c5de,height:_0x366661}=_0x20fba0,_0x22b269=_0x552c21[_0x441b0d(0x16d)](_0x4eab77,_0x745007,_0x32a5b2);if(!_0x22b269)return![];const _0xb405a1=_0x11dafe[_0x441b0d(0x17f)](ICommandService),_0x4951db=_0x11dafe['get'](IUndoRedoService),_0xd72277=_0x11dafe[_0x441b0d(0x17f)](SheetInterceptorService),_0xd92001=_0x11dafe[_0x441b0d(0x17f)](ISheetDrawingService),_0x46f7ad={'unitId':_0x4eab77,'subUnitId':_0x745007,'shapeId':_0x32a5b2,'shapeType':_0x4f6aa6,'shapeData':_0x469cbc},_0x20873c=_0x22b269[_0x441b0d(0x144)](),_0x555d73=_0x22b269[_0x441b0d(0x1a0)](),{x:_0x5a0711,y:_0x34ea67}=_0x42a4f8,_0x14c47f={'from':_0x4ac798['getCellIndexAndOffsetByPosition'](_0x5a0711,_0x34ea67),'to':_0x4ac798['getCellIndexAndOffsetByPosition'](_0x5a0711+_0x18c5de,_0x34ea67+_0x366661)},_0x54e06b={'unitId':_0x4eab77,'subUnitId':_0x745007,'drawingId':_0x32a5b2,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x14c47f,'transform':{'left':_0x5a0711,'top':_0x34ea67,'width':_0x18c5de,'height':_0x366661},'data':{'shapeType':_0x4f6aa6,'shapeData':_0x469cbc},'axisAlignSheetTransform':_0x14c47f,'allowTransform':!![]};isConnectorShape(_0x4f6aa6)&&(_0x54e06b['data'][_0x441b0d(0x182)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x19c)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x17a)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x169)]=![],_0x54e06b['transform'][_0x441b0d(0x19c)]=![],_0x54e06b[_0x441b0d(0x17e)][_0x441b0d(0x17a)]=![],_0x54e06b['transform'][_0x441b0d(0x169)]=![]);const {undo:_0x512cb0,redo:_0x457490,objects:_0x2c0519}=_0xd92001[_0x441b0d(0x14e)]([_0x54e06b]),_0x248a34=_0xd72277['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x4eab77,'drawings':[_0x54e06b]}}),_0x4bb8cd=[...(_0x4a088f=_0x248a34[_0x441b0d(0x1a3)])!==null&&_0x4a088f!==void 0x0?_0x4a088f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'op':_0x457490,'objects':_0x2c0519,'type':DrawingApplyType[_0x441b0d(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4eab77]},..._0x248a34[_0x441b0d(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x46f7ad}],_0x101770=[...(_0x32f7ab=_0x248a34[_0x441b0d(0x163)])!==null&&_0x32f7ab!==void 0x0?_0x32f7ab:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'op':_0x512cb0,'objects':_0x2c0519,'type':DrawingApplyType[_0x441b0d(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4eab77]},..._0x248a34[_0x441b0d(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'shapeType':_0x20873c,'shapeId':_0x32a5b2,'shapeData':_0x555d73}}];if(sequenceExecute(_0x4bb8cd,_0xb405a1)[_0x441b0d(0x13f)])return _0x4951db[_0x441b0d(0x197)]({'unitID':_0x4eab77,'undoMutations':_0x101770,'redoMutations':_0x4bb8cd}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x11f),'handler':(_0x15961c,_0x210597)=>{const _0x16ff56=_0x341a97;var _0x3a851a,_0x5eca0a;const _0xd7cde9=getSheetCommandTarget(_0x15961c['get'](IUniverInstanceService),_0x210597);if(!_0xd7cde9)return![];const _0x226829=_0x15961c[_0x16ff56(0x17f)](SheetSkeletonService),{unitId:_0x116fa8,subUnitId:_0x239305}=_0xd7cde9,_0x56efe4=_0x226829[_0x16ff56(0x14a)](_0x116fa8,_0x239305);if(!_0x56efe4)return![];const _0x1e0228=_0x15961c['get'](ISheetDrawingService),{shapeId:_0x121cec,flipH:_0x427530,flipV:_0x1dc414}=_0x210597,_0x392f0f=_0x1e0228[_0x16ff56(0x1a1)]({'unitId':_0x116fa8,'subUnitId':_0x239305,'drawingId':_0x121cec});if(!_0x392f0f)return![];const _0x1d28d0=_0x15961c[_0x16ff56(0x17f)](SheetsShapeService)[_0x16ff56(0x16d)](_0x116fa8,_0x239305,_0x121cec);if(!_0x1d28d0)return![];const _0xacb2cd=_0x15961c['get'](ICommandService),_0x49a2c5=_0x15961c['get'](IUndoRedoService),_0x35bacc=_0x15961c['get'](SheetInterceptorService),_0x486c91={..._0x392f0f[_0x16ff56(0x17e)]};if(_0x427530!==void 0x0)_0x486c91[_0x16ff56(0x133)]=!_0x486c91[_0x16ff56(0x133)];if(_0x1dc414!==void 0x0)_0x486c91[_0x16ff56(0x13d)]=!_0x486c91['flipY'];const _0x5e9727=transformToDrawingPosition(_0x486c91,_0x56efe4),_0x35b72d=transformToAxisAlignPosition(_0x486c91,_0x56efe4),_0x4ffc74=_0x1d28d0[_0x16ff56(0x144)](),_0xc05404=_0x1d28d0['getShapeData'](),_0x18960f={'unitId':_0x116fa8,'subUnitId':_0x239305,'drawingId':_0x121cec,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x5e9727,'transform':_0x486c91,'data':{'shapeType':_0x4ffc74,'shapeData':_0xc05404},'axisAlignSheetTransform':_0x35b72d,'allowTransform':!![]},{undo:_0x212cfb,redo:_0x103f5a,objects:_0x419ed7}=_0x1e0228[_0x16ff56(0x14e)]([_0x18960f]),_0x6575d3=_0x35bacc['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x116fa8,'drawings':[_0x18960f]}}),_0x27948e=[...(_0x3a851a=_0x6575d3[_0x16ff56(0x1a3)])!==null&&_0x3a851a!==void 0x0?_0x3a851a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'op':_0x103f5a,'objects':_0x419ed7,'type':DrawingApplyType[_0x16ff56(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x116fa8]},..._0x6575d3[_0x16ff56(0x134)]],_0x194211=[...(_0x5eca0a=_0x6575d3['preUndos'])!==null&&_0x5eca0a!==void 0x0?_0x5eca0a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'op':_0x212cfb,'objects':_0x419ed7,'type':DrawingApplyType[_0x16ff56(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x116fa8]},..._0x6575d3[_0x16ff56(0x146)]];if(isConnectorShape(_0x4ffc74)){const _0x5a17fb=_0x1d28d0['getShapeRelation']();if(_0x5a17fb){const _0x4d4559={..._0x5a17fb};_0x4d4559[_0x16ff56(0x11d)]=void 0x0,_0x4d4559['to']=void 0x0,_0x27948e[_0x16ff56(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'shapeId':_0x121cec,'shapeType':_0x4ffc74,'shapeData':{'relation':_0x4d4559}}}),_0x194211['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'shapeId':_0x121cec,'shapeType':_0x4ffc74,'shapeData':{'relation':_0x5a17fb}}});}}if(sequenceExecute(_0x27948e,_0xacb2cd)[_0x16ff56(0x13f)])return _0x49a2c5[_0x16ff56(0x197)]({'unitID':_0x116fa8,'undoMutations':_0x194211,'redoMutations':_0x27948e}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.set-shape-rotate','handler':(_0x26cd92,_0x7a8ba7)=>{const _0x2d6af2=_0x341a97;var _0x4b96b8,_0x55972b;const _0xe82bad=getSheetCommandTarget(_0x26cd92[_0x2d6af2(0x17f)](IUniverInstanceService),_0x7a8ba7);if(!_0xe82bad)return![];const _0x24a1a5=_0x26cd92[_0x2d6af2(0x17f)](SheetSkeletonService),{unitId:_0x3acd4d,subUnitId:_0x4d34e0}=_0xe82bad,_0x3ad027=_0x24a1a5[_0x2d6af2(0x14a)](_0x3acd4d,_0x4d34e0);if(!_0x3ad027)return![];const _0xb0da03=_0x26cd92['get'](ISheetDrawingService),{shapeId:_0xceb1c9,rotate:_0xcfdb3b}=_0x7a8ba7,_0x157100=_0xb0da03['getDrawingByParam']({'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'drawingId':_0xceb1c9});if(!_0x157100)return![];const _0x37271b=_0x26cd92[_0x2d6af2(0x17f)](SheetsShapeService)[_0x2d6af2(0x16d)](_0x3acd4d,_0x4d34e0,_0xceb1c9);if(!_0x37271b)return![];const _0x574c07=_0x26cd92[_0x2d6af2(0x17f)](ICommandService),_0x1dd945=_0x26cd92[_0x2d6af2(0x17f)](IUndoRedoService),_0x545699=_0x26cd92[_0x2d6af2(0x17f)](SheetInterceptorService),_0x2de8e2={..._0x157100['transform']};if(_0xcfdb3b!==void 0x0)_0x2de8e2[_0x2d6af2(0x177)]=(_0x2de8e2[_0x2d6af2(0x177)]||0x0)+_0xcfdb3b;const _0x44d370=transformToDrawingPosition(_0x2de8e2,_0x3ad027),_0x5c390e=transformToAxisAlignPosition(_0x2de8e2,_0x3ad027),_0x54b1b3=_0x37271b[_0x2d6af2(0x144)](),_0x3f8622=_0x37271b[_0x2d6af2(0x1a0)](),_0x7e192d={'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'drawingId':_0xceb1c9,'drawingType':DrawingTypeEnum[_0x2d6af2(0x13c)],'sheetTransform':_0x44d370,'transform':_0x2de8e2,'data':{'shapeType':_0x54b1b3,'shapeData':_0x3f8622},'axisAlignSheetTransform':_0x5c390e,'allowTransform':!![]},{undo:_0x4a7256,redo:_0x54d9cb,objects:_0xfccf9a}=_0xb0da03[_0x2d6af2(0x14e)]([_0x7e192d]),_0x323277=_0x545699[_0x2d6af2(0x154)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x3acd4d,'drawings':[_0x7e192d]}}),_0x466e57=[...(_0x4b96b8=_0x323277[_0x2d6af2(0x1a3)])!==null&&_0x4b96b8!==void 0x0?_0x4b96b8:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'op':_0x54d9cb,'objects':_0xfccf9a,'type':DrawingApplyType[_0x2d6af2(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3acd4d]},..._0x323277['redos']],_0x59aa1c=[...(_0x55972b=_0x323277['preUndos'])!==null&&_0x55972b!==void 0x0?_0x55972b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'op':_0x4a7256,'objects':_0xfccf9a,'type':DrawingApplyType[_0x2d6af2(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3acd4d]},..._0x323277[_0x2d6af2(0x146)]];if(sequenceExecute(_0x466e57,_0x574c07)[_0x2d6af2(0x13f)])return _0x1dd945[_0x2d6af2(0x197)]({'unitID':_0x3acd4d,'undoMutations':_0x59aa1c,'redoMutations':_0x466e57}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x180),'handler':(_0x2fc3c0,_0x83e9e8)=>{const _0x408c64=_0x341a97;var _0x11b845;const _0x155142=getSheetCommandTarget(_0x2fc3c0[_0x408c64(0x17f)](IUniverInstanceService),_0x83e9e8);if(!_0x155142)return![];const {unitId:_0x20614c,subUnitId:_0x37a35d}=_0x155142,{shapeId:_0x4a49ea}=_0x83e9e8,_0x35f10c=_0x2fc3c0[_0x408c64(0x17f)](SheetsShapeService)['getShapeModel'](_0x20614c,_0x37a35d,_0x4a49ea);if(!_0x35f10c)return![];const _0xd1dce5=_0x35f10c[_0x408c64(0x15d)](),_0x10f4f0=(_0x11b845=_0xd1dce5===null||_0xd1dce5===void 0x0?void 0x0:_0xd1dce5[_0x408c64(0x196)])!==null&&_0x11b845!==void 0x0?_0x11b845:!![],_0xd70d8a=!_0x10f4f0,_0x21756a=_0x2fc3c0[_0x408c64(0x17f)](ICommandService),_0x5c2fb7=_0x2fc3c0[_0x408c64(0x17f)](IUndoRedoService),_0x2ce2a9={'unitId':_0x20614c,'subUnitId':_0x37a35d,'shapeId':_0x4a49ea,'shapeData':{'shapeText':{'isHorizontal':_0xd70d8a}}},_0x453dc5={'unitId':_0x20614c,'subUnitId':_0x37a35d,'shapeId':_0x4a49ea,'shapeData':{'shapeText':{'isHorizontal':_0x10f4f0}}},_0x5ca4a2=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x2ce2a9}],_0x5e4330=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x453dc5}];if(sequenceExecute(_0x5ca4a2,_0x21756a)['result'])return _0x5c2fb7[_0x408c64(0x197)]({'unitID':_0x20614c,'undoMutations':_0x5e4330,'redoMutations':_0x5ca4a2}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x17b),'handler':(_0x46efbc,_0x30959f)=>{const _0x1938ab=_0x341a97;var _0x16e480,_0x56ad39,_0x14b513,_0x54064f;const _0x153ded=getSheetCommandTarget(_0x46efbc[_0x1938ab(0x17f)](IUniverInstanceService),_0x30959f);if(!_0x153ded)return![];const _0x317455=_0x46efbc['get'](SheetSkeletonService),{unitId:_0x45c90e,subUnitId:_0x4153c6}=_0x153ded,_0x4b8984=_0x317455['getSkeleton'](_0x45c90e,_0x4153c6);if(!_0x4b8984)return![];const _0x1e370b=_0x46efbc[_0x1938ab(0x17f)](ISheetDrawingService),{connectorShapeId:_0xc75386,width:_0x4e428a,height:_0x4dd56b,left:_0x53385a,top:_0x47794d,flipX:_0x42826e,flipY:_0x50f0d5,rotation:_0x3896c1,oldAdjustValues:_0x5ddb7e,newAdjustValues:_0x154331,oldLineType:_0x2975cf,newLineType:_0x8ef532,oldRelation:_0x3163b7,newRelation:_0x35a282}=_0x30959f,_0x2bff1e=_0x1e370b['getDrawingByParam']({'unitId':_0x45c90e,'subUnitId':_0x4153c6,'drawingId':_0xc75386});if(!_0x2bff1e)return![];const _0x346660=_0x46efbc[_0x1938ab(0x17f)](SheetsShapeService)[_0x1938ab(0x16d)](_0x45c90e,_0x4153c6,_0xc75386);if(!_0x346660)return![];const _0x3a4bb6=_0x46efbc[_0x1938ab(0x17f)](ICommandService),_0x45d8b1=_0x46efbc[_0x1938ab(0x17f)](IUndoRedoService),_0x45b2fb=_0x46efbc[_0x1938ab(0x17f)](SheetInterceptorService),_0x490df8={..._0x2bff1e['transform'],'width':_0x4e428a,'height':_0x4dd56b,'left':_0x53385a,'top':_0x47794d,'flipX':_0x42826e,'flipY':_0x50f0d5,'angle':(_0x16e480=_0x3896c1!==null&&_0x3896c1!==void 0x0?_0x3896c1:(_0x56ad39=_0x2bff1e[_0x1938ab(0x17e)])===null||_0x56ad39===void 0x0?void 0x0:_0x56ad39[_0x1938ab(0x177)])!==null&&_0x16e480!==void 0x0?_0x16e480:0x0},_0x4c9ec7=transformToDrawingPosition(_0x490df8,_0x4b8984),_0x473bca=transformToAxisAlignPosition(_0x490df8,_0x4b8984),_0x51c1f7=_0x346660[_0x1938ab(0x144)](),_0x4cb55e=_0x346660[_0x1938ab(0x1a0)](),_0x1f286c={'unitId':_0x45c90e,'subUnitId':_0x4153c6,'drawingId':_0xc75386,'drawingType':DrawingTypeEnum[_0x1938ab(0x13c)],'sheetTransform':_0x4c9ec7,'transform':_0x490df8,'data':{'shapeType':_0x8ef532||_0x2975cf||_0x51c1f7,'shapeData':{..._0x4cb55e,'adjustValues':_0x154331||_0x5ddb7e||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x1a7)]),'relation':_0x35a282||_0x3163b7||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x17d)])}},'axisAlignSheetTransform':_0x473bca,'allowTransform':!![]},{undo:_0xcf3d79,redo:_0x307c1b,objects:_0x341393}=_0x1e370b[_0x1938ab(0x14e)]([_0x1f286c]),_0x4a8d0c=_0x45b2fb['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x45c90e,'drawings':[_0x1f286c]}}),_0x34e09f=[...(_0x14b513=_0x4a8d0c[_0x1938ab(0x1a3)])!==null&&_0x14b513!==void 0x0?_0x14b513:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'op':_0x307c1b,'objects':_0x341393,'type':DrawingApplyType[_0x1938ab(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x45c90e]},..._0x4a8d0c[_0x1938ab(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'shapeId':_0xc75386,'shapeType':_0x8ef532,'shapeData':{'adjustValues':_0x154331,'relation':_0x35a282}}}],_0x5c9f86=[...(_0x54064f=_0x4a8d0c['preUndos'])!==null&&_0x54064f!==void 0x0?_0x54064f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'op':_0xcf3d79,'objects':_0x341393,'type':DrawingApplyType[_0x1938ab(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x45c90e]},..._0x4a8d0c[_0x1938ab(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'shapeId':_0xc75386,'shapeType':_0x51c1f7,'shapeData':{..._0x4cb55e,'adjustValues':_0x5ddb7e||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x1a7)]),'relation':_0x3163b7||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x17d)])}}}];if(sequenceExecute(_0x34e09f,_0x3a4bb6)[_0x1938ab(0x13f)])return _0x45d8b1[_0x1938ab(0x197)]({'unitID':_0x45c90e,'undoMutations':_0x5c9f86,'redoMutations':_0x34e09f}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType['COMMAND'],'id':_0x341a97(0x114),'handler':(_0x1f13ce,_0x42dec3)=>{const _0x146e4a=_0x341a97;var _0x17fba3,_0x5b7ce6;const _0x4ce93b=getSheetCommandTarget(_0x1f13ce['get'](IUniverInstanceService),_0x42dec3);if(!_0x4ce93b)return![];const _0x3e63bb=_0x1f13ce[_0x146e4a(0x17f)](SheetSkeletonService),{unitId:_0x20b49b,subUnitId:_0x5a9bb0}=_0x4ce93b,_0x2cc0ee=_0x3e63bb['getSkeleton'](_0x20b49b,_0x5a9bb0);if(!_0x2cc0ee)return![];const _0x2eab1b=_0x1f13ce['get'](ISheetDrawingService),{shapeId:_0x1551b2,width:_0xba5c2c,height:_0x12f435,left:_0x2de522,top:_0x4b0e11,flipX:_0x24a8e0,flipY:_0x20ab62,angle:_0x4d649d,oldAdjustValues:_0x204c6b,newAdjustValues:_0x34fce7,oldLineType:_0x18686f,newLineType:_0x8b81c4}=_0x42dec3,_0x57d9d6=_0x2eab1b[_0x146e4a(0x1a1)]({'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'drawingId':_0x1551b2});if(!_0x57d9d6)return![];const _0x2400b4=_0x1f13ce[_0x146e4a(0x17f)](SheetsShapeService)['getShapeModel'](_0x20b49b,_0x5a9bb0,_0x1551b2);if(!_0x2400b4)return![];const _0x8621d0=_0x1f13ce['get'](ICommandService),_0x5d95f3=_0x1f13ce[_0x146e4a(0x17f)](IUndoRedoService),_0x4c15da=_0x1f13ce[_0x146e4a(0x17f)](SheetInterceptorService),_0x336f73={..._0x57d9d6['transform'],'width':_0xba5c2c,'height':_0x12f435,'left':_0x2de522,'top':_0x4b0e11,'flipX':_0x24a8e0,'flipY':_0x20ab62,'angle':_0x4d649d},_0xe4bdd0=transformToDrawingPosition(_0x336f73,_0x2cc0ee),_0x48a849=transformToAxisAlignPosition(_0x336f73,_0x2cc0ee),_0x92cc2a=_0x2400b4['getShapeType'](),_0x3f58e3=_0x2400b4[_0x146e4a(0x1a0)](),_0x98ff93={'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'drawingId':_0x1551b2,'drawingType':DrawingTypeEnum[_0x146e4a(0x13c)],'sheetTransform':_0xe4bdd0,'transform':_0x336f73,'data':{'shapeType':_0x8b81c4||_0x18686f||_0x92cc2a,'shapeData':{..._0x3f58e3,'adjustValues':_0x34fce7||_0x204c6b||(_0x3f58e3===null||_0x3f58e3===void 0x0?void 0x0:_0x3f58e3[_0x146e4a(0x1a7)])}},'axisAlignSheetTransform':_0x48a849,'allowTransform':!![]},{undo:_0xb8eb7b,redo:_0x5520e5,objects:_0x173ef0}=_0x2eab1b[_0x146e4a(0x14e)]([_0x98ff93]),_0x35bc12=_0x4c15da[_0x146e4a(0x154)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x20b49b,'drawings':[_0x98ff93]}}),_0x2ab597=[...(_0x17fba3=_0x35bc12[_0x146e4a(0x1a3)])!==null&&_0x17fba3!==void 0x0?_0x17fba3:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'op':_0x5520e5,'objects':_0x173ef0,'type':DrawingApplyType[_0x146e4a(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x20b49b]},..._0x35bc12[_0x146e4a(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'shapeId':_0x1551b2,'shapeType':_0x8b81c4,'shapeData':{'adjustValues':_0x34fce7}}}],_0x3b08e4=[...(_0x5b7ce6=_0x35bc12[_0x146e4a(0x163)])!==null&&_0x5b7ce6!==void 0x0?_0x5b7ce6:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'op':_0xb8eb7b,'objects':_0x173ef0,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x20b49b]},..._0x35bc12[_0x146e4a(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'shapeId':_0x1551b2,'shapeType':_0x92cc2a,'shapeData':{..._0x3f58e3,'adjustValues':_0x204c6b||(_0x3f58e3===null||_0x3f58e3===void 0x0?void 0x0:_0x3f58e3['adjustValues'])}}}];if(sequenceExecute(_0x2ab597,_0x8621d0)[_0x146e4a(0x13f)])return _0x5d95f3['pushUndoRedo']({'unitID':_0x20b49b,'undoMutations':_0x3b08e4,'redoMutations':_0x2ab597}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x341a97(0x136),'type':CommandType[_0x341a97(0x1a9)],'handler':(_0x1a4d66,_0x5f0800)=>{const _0x374d14=_0x341a97,{unitId:_0x44794d,subUnitId:_0x11b27c,shapeType:_0x5462e4,shapeId:_0x167f93,shapeData:_0x3f0d8a}=_0x5f0800,_0x4630b9=_0x1a4d66[_0x374d14(0x17f)](SheetsShapeService)['getShapeModel'](_0x44794d,_0x11b27c,_0x167f93);if(_0x4630b9){_0x4630b9[_0x374d14(0x198)](_0x5462e4);if(_0x3f0d8a)_0x4630b9===null||_0x4630b9===void 0x0||_0x4630b9[_0x374d14(0x18d)](_0x3f0d8a);}return!![];}},UpdateSheetsShapeTypeCommand={'id':_0x341a97(0x199),'type':CommandType[_0x341a97(0x13a)],'handler':(_0x1f98e9,_0x2b8649)=>{const _0x572eb4=_0x341a97;if(!_0x2b8649)return![];const _0x10e09e=_0x1f98e9['get'](ICommandService),_0x122434=_0x1f98e9[_0x572eb4(0x17f)](SheetsShapeService),_0x5c42f2=_0x1f98e9[_0x572eb4(0x17f)](IUndoRedoService),_0x261d1a=[],_0x5f9b68=[],{unitId:_0x1a0385,subUnitId:_0x4b33ef,shapeId:_0x32001a,shapeType:_0x1ea431,shapeData:_0x22e565}=_0x2b8649,_0xa5638=_0x122434['getShapeModel'](_0x1a0385,_0x4b33ef,_0x32001a);if(_0xa5638){const _0x261ede=_0xa5638['getShapeType'](),_0x5460fb=Object['assign']({},_0xa5638[_0x572eb4(0x1a0)]()),_0x3a8d7c={'unitId':_0x1a0385,'subUnitId':_0x4b33ef,'shapeId':_0x32001a,'shapeType':_0x1ea431,'shapeData':_0x22e565},_0x461769={'unitId':_0x1a0385,'subUnitId':_0x4b33ef,'shapeId':_0x32001a,'shapeType':_0x261ede,'shapeData':_0x5460fb};_0x261d1a[_0x572eb4(0x12d)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3a8d7c}),_0x5f9b68[_0x572eb4(0x12d)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x461769});if(_0x261d1a['every'](_0x4fc471=>_0x10e09e['syncExecuteCommand'](_0x4fc471['id'],_0x4fc471[_0x572eb4(0x155)])))_0x5c42f2['pushUndoRedo']({'unitID':_0x1a0385,'redoMutations':[..._0x261d1a],'undoMutations':[..._0x5f9b68]});return!![];}return![];}};var name=_0x341a97(0x19a),version=_0x341a97(0x112);const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0x341a97(0x152),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x55ecd7,_0x2780d7,_0x2427e8,_0x5bd2f,_0x2c5182){const _0x432e5a=_0x341a97;super(),this[_0x432e5a(0x11c)]=_0x55ecd7,this[_0x432e5a(0x171)]=_0x2780d7,this[_0x432e5a(0x164)]=_0x2427e8,this[_0x432e5a(0x1a6)]=_0x5bd2f,this[_0x432e5a(0x138)]=_0x2c5182,this[_0x432e5a(0x160)](),this[_0x432e5a(0x14f)]();}[_0x341a97(0x160)](){const _0x21a786=_0x341a97;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0x21a786(0x116)](_0x29f886=>this[_0x21a786(0x16c)](this[_0x21a786(0x11c)][_0x21a786(0x18f)](_0x29f886)));}['_initCommandInterceptor'](){const _0x25fcf4=_0x341a97;this['disposeWithMe'](this[_0x25fcf4(0x171)][_0x25fcf4(0x16b)]({'getMutations':_0x2d12b5=>{const _0x26fbb5=_0x25fcf4;if(_0x2d12b5['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x10f03a}=_0x2d12b5[_0x26fbb5(0x155)],_0x23e175=_0x10f03a[_0x26fbb5(0x179)](_0x1d903c=>_0x1d903c[_0x26fbb5(0x12f)]===DrawingTypeEnum['DRAWING_SHAPE']);if(_0x23e175[_0x26fbb5(0x17c)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x3484da=[],_0x3e5bb2=[];return _0x23e175[_0x26fbb5(0x116)](_0x35020a=>{const _0x4f0835=_0x26fbb5,{unitId:_0x39af9f,subUnitId:_0xaf745,drawingId:_0x18c98a}=_0x35020a,_0x4550d7=this[_0x4f0835(0x1a6)]['getShapeModel'](_0x39af9f,_0xaf745,_0x18c98a);if(!_0x4550d7)throw new TypeError(_0x4f0835(0x19d)+_0x4550d7);_0x3484da['push']({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x18c98a}}),_0x3e5bb2[_0x4f0835(0x12d)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x18c98a,'shapeType':_0x4550d7[_0x4f0835(0x144)](),'shapeData':_0x4550d7[_0x4f0835(0x1a0)]()}});const _0x13aba7=this[_0x4f0835(0x1a6)][_0x4f0835(0x148)](_0x39af9f,_0xaf745,_0x18c98a);if(_0x13aba7)for(const _0x5002e7 of _0x13aba7){const _0x21c301=_0x5002e7[_0x4f0835(0x129)],_0x5d795c=_0x5002e7[_0x4f0835(0x178)],_0x3165cf=_0x5d795c?{'from':void 0x0}:{'to':void 0x0},_0x4efe4b=_0x5d795c?{'from':{'shapeId':_0x5002e7[_0x4f0835(0x125)],'cxnIndex':_0x5002e7[_0x4f0835(0x110)]}}:{'to':{'shapeId':_0x5002e7[_0x4f0835(0x125)],'cxnIndex':_0x5002e7[_0x4f0835(0x110)]}};_0x3484da['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x21c301,'shapeData':{'relation':_0x3165cf}}}),_0x3e5bb2[_0x4f0835(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x21c301,'shapeData':{'relation':_0x4efe4b}}});}}),{'preRedos':_0x3484da,'redos':[],'preUndos':[],'undos':_0x3e5bb2};}if(_0x2d12b5['id']===SetSheetDrawingCommand['id']){const {drawings:_0x318d17}=_0x2d12b5[_0x26fbb5(0x155)],_0x1a5143=_0x318d17[_0x26fbb5(0x179)](_0x3f8f45=>_0x3f8f45[_0x26fbb5(0x12f)]===DrawingTypeEnum[_0x26fbb5(0x13c)]);if(_0x1a5143[_0x26fbb5(0x17c)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x13dbef=[],_0x42792b=[];for(const _0x7e791f of _0x1a5143){const {unitId:_0x234d0e,subUnitId:_0x2e9720,drawingId:_0xb56d0e,transform:_0x78dd7e}=_0x7e791f;if(!_0x234d0e||!_0x2e9720||!_0xb56d0e||!_0x78dd7e)continue;const _0x421265=this[_0x26fbb5(0x1a6)][_0x26fbb5(0x16d)](_0x234d0e,_0x2e9720,_0xb56d0e);if(!_0x421265)throw new TypeError('Fail\x20to\x20get\x20shape\x20model,\x20get:\x20'+_0x421265);if(isConnectorShape(_0x421265['getShapeType']())){const _0x38c47f=this[_0x26fbb5(0x1a6)]['getLineShapeRelation'](_0x234d0e,_0x2e9720,_0xb56d0e),_0x259fe4={'from':void 0x0,'to':void 0x0};_0x38c47f&&(_0x13dbef['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x234d0e,'subUnitId':_0x2e9720,'shapeId':_0xb56d0e,'shapeData':{'relation':_0x259fe4}}}),_0x42792b[_0x26fbb5(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x234d0e,'subUnitId':_0x2e9720,'shapeId':_0xb56d0e,'shapeData':{'relation':_0x38c47f}}}));}else{const _0x4e7133=this['_sheetsShapeService'][_0x26fbb5(0x148)](_0x234d0e,_0x2e9720,_0xb56d0e);if(_0x4e7133&&_0x4e7133[_0x26fbb5(0x17c)]>0x0)for(const _0x16a20f of _0x4e7133){const _0x1434e2=_0x16a20f[_0x26fbb5(0x129)],_0x1eee69=_0x16a20f['isFrom'],_0x22d791=this[_0x26fbb5(0x1a6)][_0x26fbb5(0x16d)](_0x234d0e,_0x2e9720,_0x1434e2);if(!_0x22d791)continue;const _0x5bea7b=_0x22d791[_0x26fbb5(0x14b)](),_0x31c2e0=_0x22d791['getEndConnectInfo']();if(_0x5bea7b&&_0x31c2e0)this[_0x26fbb5(0x120)](_0x234d0e,_0x2e9720,_0x1434e2,_0x22d791,_0x5bea7b,_0x31c2e0,_0x13dbef,_0x42792b,_0xb56d0e,_0x78dd7e);else this[_0x26fbb5(0x189)](_0x234d0e,_0x2e9720,_0x1434e2,_0x22d791,_0x1eee69?_0x5bea7b:_0x31c2e0,_0x1eee69,_0x13dbef,_0x42792b,_0xb56d0e,_0x78dd7e);}}}return{'preRedos':[],'redos':_0x13dbef,'preUndos':_0x42792b,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x341a97(0x128)](_0x53b388,_0x58614f,_0xe14842,_0x5d5a26,_0x47e603){const _0x46f1ec=_0x341a97;if(!_0x58614f||!_0xe14842)return null;const {shapeId:_0x46bdce,cxnIndex:_0x261feb}=_0x53b388,_0x1b1757=this[_0x46f1ec(0x1a6)]['getShapeModel'](_0x58614f,_0xe14842,_0x46bdce);if(!_0x1b1757)return null;const _0x4bf59c=this['_drawingManagerService'][_0x46f1ec(0x1a1)]({'unitId':_0x58614f,'subUnitId':_0xe14842,'drawingId':_0x46bdce});if(!(_0x4bf59c===null||_0x4bf59c===void 0x0?void 0x0:_0x4bf59c[_0x46f1ec(0x17e)]))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x5b5bac}=_0x4bf59c[_0x46f1ec(0x17e)];if(_0x47e603&&_0x5d5a26===_0x46bdce){var _0x259e62,_0x445f7c,_0x1590e7,_0x14f501,_0x42aff3,_0x17cd8b,_0x45b485;left=(_0x259e62=_0x47e603['left'])!==null&&_0x259e62!==void 0x0?_0x259e62:left,top=(_0x445f7c=_0x47e603[_0x46f1ec(0x13b)])!==null&&_0x445f7c!==void 0x0?_0x445f7c:top,width=(_0x1590e7=_0x47e603[_0x46f1ec(0x115)])!==null&&_0x1590e7!==void 0x0?_0x1590e7:width,height=(_0x14f501=_0x47e603[_0x46f1ec(0x165)])!==null&&_0x14f501!==void 0x0?_0x14f501:height,flipX=(_0x42aff3=_0x47e603['flipX'])!==null&&_0x42aff3!==void 0x0?_0x42aff3:flipX,flipY=(_0x17cd8b=_0x47e603[_0x46f1ec(0x13d)])!==null&&_0x17cd8b!==void 0x0?_0x17cd8b:flipY,_0x5b5bac=(_0x45b485=_0x47e603[_0x46f1ec(0x177)])!==null&&_0x45b485!==void 0x0?_0x45b485:_0x5b5bac;}_0x1b1757['updateContext']({'width':width,'height':height});const _0x27df96=_0x1b1757[_0x46f1ec(0x153)]()['find'](_0x793e08=>_0x793e08[_0x46f1ec(0x12c)]===_0x261feb);if(!_0x27df96)return null;let _0x1c22a3=flipX?width-_0x27df96['x']:_0x27df96['x'],_0x49b04d=flipY?height-_0x27df96['y']:_0x27df96['y'];if(_0x5b5bac!==0x0&&_0x5b5bac!==void 0x0&&_0x5b5bac!==null){const _0x334e1d=_0x5b5bac*Math['PI']/0xb4,_0x388bf4=Math[_0x46f1ec(0x15f)](_0x334e1d),_0x1fdb65=Math['sin'](_0x334e1d),_0x17c5b5=width/0x2,_0x4cd26f=height/0x2,_0x712111=_0x1c22a3-_0x17c5b5,_0x3cac0c=_0x49b04d-_0x4cd26f;_0x1c22a3=_0x17c5b5+_0x712111*_0x388bf4-_0x3cac0c*_0x1fdb65,_0x49b04d=_0x4cd26f+_0x712111*_0x1fdb65+_0x3cac0c*_0x388bf4;}_0x1c22a3+=left,_0x49b04d+=top;let _0x42b729=_0x27df96[_0x46f1ec(0x19e)]/0xea60;if(flipX)_0x42b729=0xb4-_0x42b729;if(flipY)_0x42b729=-_0x42b729;_0x42b729+=_0x5b5bac||0x0,_0x42b729=(_0x42b729%0x168+0x168)%0x168;const _0x3e27e2=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x5b5bac||0x0);return{'point':{'x':_0x1c22a3,'y':_0x49b04d},'angle':_0x42b729,'bounds':_0x3e27e2};}[_0x341a97(0x120)](_0x898107,_0x120937,_0x25dd1d,_0x529417,_0x13b2a7,_0x1fce68,_0x324e27,_0x360b13,_0x5af694,_0x21d4c0){const _0x159015=_0x341a97,_0x4df202=this[_0x159015(0x164)][_0x159015(0x14a)](_0x898107,_0x120937);if(!_0x4df202)return;const _0x100869=_0x529417[_0x159015(0x18a)](),_0x1c80c6=_0x529417[_0x159015(0x16e)](),_0x47609e={},_0x21c28d={};_0x1c80c6[_0x159015(0x116)](_0x10c5a6=>{const _0x4230ad=_0x159015,_0x20c6ab=_0x529417[_0x4230ad(0x188)](_0x10c5a6);_0x21c28d[_0x10c5a6]=_0x20c6ab!==null&&_0x20c6ab!==void 0x0?_0x20c6ab:0x0;});const _0x1da5ba=this[_0x159015(0x128)](_0x13b2a7,_0x898107,_0x120937,_0x5af694,_0x21d4c0),_0x50a22f=this[_0x159015(0x128)](_0x1fce68,_0x898107,_0x120937,_0x5af694,_0x21d4c0);if(_0x1da5ba&&_0x50a22f){const _0x5932ad=_0x529417['getShapeType'](),_0x483feb=routeConnectorLineShape(_0x1da5ba,_0x50a22f,_0x5932ad);let _0x24e160=_0x5932ad;if(_0x483feb){const _0x29572c=computeConnectorRouteLayout(_0x483feb,_0x529417[_0x159015(0x144)]()),_0x795777=this['_drawingManagerService'][_0x159015(0x113)](_0x898107,_0x120937);if(_0x795777&&_0x795777[_0x25dd1d]){const _0x4a0b79=_0x795777[_0x25dd1d];_0x24e160=_0x29572c[_0x159015(0x16f)];for(const [_0x520860,_0x3ec193]of Object['entries'](_0x29572c[_0x159015(0x1a7)]))_0x47609e[_0x520860]=_0x3ec193;const _0x142e68={..._0x4a0b79[_0x159015(0x17e)],'width':_0x29572c['worldRect'][_0x159015(0x115)],'height':_0x29572c[_0x159015(0x1aa)]['height'],'left':_0x29572c['worldRect'][_0x159015(0x149)],'top':_0x29572c[_0x159015(0x1aa)][_0x159015(0x13b)],'flipX':_0x29572c[_0x159015(0x1aa)]['flipX'],'flipY':_0x29572c[_0x159015(0x1aa)]['flipY'],'angle':_0x29572c['rotation']},_0x496876=transformToDrawingPosition(_0x142e68,_0x4df202),_0x563867=transformToAxisAlignPosition(_0x142e68,_0x4df202),_0xc3d02c={'unitId':_0x898107,'subUnitId':_0x120937,'drawingType':DrawingTypeEnum[_0x159015(0x13c)],'drawingId':_0x25dd1d,'transform':_0x142e68,'sheetTransform':_0x496876,'axisAlignSheetTransform':_0x563867},{unitId:_0x53cd12,subUnitId:_0x4f6a54,undo:_0x2821c6,redo:_0x255e66,objects:_0x2be59}=this['_drawingManagerService'][_0x159015(0x14e)]([_0xc3d02c]);_0x324e27[_0x159015(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x53cd12,'subUnitId':_0x4f6a54,'op':_0x255e66,'objects':_0x2be59,'type':DrawingApplyType['UPDATE']}}),_0x360b13[_0x159015(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x53cd12,'subUnitId':_0x4f6a54,'op':_0x2821c6,'objects':_0x2be59,'type':DrawingApplyType[_0x159015(0x157)]}});}_0x529417[_0x159015(0x173)]();}_0x324e27[_0x159015(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x898107,'subUnitId':_0x120937,'shapeId':_0x25dd1d,'shapeType':_0x24e160,'shapeData':{'adjustValues':_0x47609e,'relation':_0x100869}}}),_0x360b13[_0x159015(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x898107,'subUnitId':_0x120937,'shapeId':_0x25dd1d,'shapeType':_0x5932ad,'shapeData':{'adjustValues':_0x21c28d,'relation':_0x100869}}});}}[_0x341a97(0x189)](_0x5480a9,_0x301915,_0x7a7d8f,_0x49169d,_0x1e727e,_0xda7fa4,_0x4e0bf1,_0x2bee4b,_0x5a6d8c,_0x3592c0){const _0x5e402d=_0x341a97;var _0x20610f;if(!_0x1e727e)return;const _0x2fa567=this[_0x5e402d(0x164)]['getSkeleton'](_0x5480a9,_0x301915);if(!_0x2fa567)return;const _0x5effe1=(_0x20610f=this['_drawingManagerService']['getDrawingByParam']({'unitId':_0x5480a9,'subUnitId':_0x301915,'drawingId':_0x5a6d8c}))===null||_0x20610f===void 0x0?void 0x0:_0x20610f[_0x5e402d(0x17e)];if(!_0x5effe1)return;const _0x1882e7=_0x5effe1['left']!==_0x3592c0[_0x5e402d(0x149)]||_0x5effe1[_0x5e402d(0x13b)]!==_0x3592c0[_0x5e402d(0x13b)],_0x5b6c71=_0x5effe1[_0x5e402d(0x115)]!==_0x3592c0[_0x5e402d(0x115)]||_0x5effe1[_0x5e402d(0x165)]!==_0x3592c0['height'],_0x2907c2=_0x5effe1[_0x5e402d(0x133)]!==_0x3592c0[_0x5e402d(0x133)]||_0x5effe1['flipY']!==_0x3592c0['flipY'],_0x58427a=_0x5effe1[_0x5e402d(0x177)]!==_0x3592c0[_0x5e402d(0x177)];if(_0x1882e7&&!_0x5b6c71&&!_0x2907c2&&!_0x58427a){var _0x1f1678,_0x4c76aa,_0x5cdb31,_0x396f07;const _0x427697=((_0x1f1678=_0x3592c0[_0x5e402d(0x149)])!==null&&_0x1f1678!==void 0x0?_0x1f1678:0x0)-((_0x4c76aa=_0x5effe1[_0x5e402d(0x149)])!==null&&_0x4c76aa!==void 0x0?_0x4c76aa:0x0),_0x3b95c5=((_0x5cdb31=_0x3592c0[_0x5e402d(0x13b)])!==null&&_0x5cdb31!==void 0x0?_0x5cdb31:0x0)-((_0x396f07=_0x5effe1['top'])!==null&&_0x396f07!==void 0x0?_0x396f07:0x0),_0x47411d=this[_0x5e402d(0x138)][_0x5e402d(0x113)](_0x5480a9,_0x301915);if(_0x47411d&&_0x47411d[_0x7a7d8f]){var _0x16e103,_0x46f685,_0x5d0ac4,_0x340f8a;const _0x4f4001=_0x47411d[_0x7a7d8f],_0xc77154={..._0x4f4001[_0x5e402d(0x17e)],'left':((_0x16e103=(_0x46f685=_0x4f4001[_0x5e402d(0x17e)])===null||_0x46f685===void 0x0?void 0x0:_0x46f685['left'])!==null&&_0x16e103!==void 0x0?_0x16e103:0x0)+_0x427697,'top':((_0x5d0ac4=(_0x340f8a=_0x4f4001['transform'])===null||_0x340f8a===void 0x0?void 0x0:_0x340f8a[_0x5e402d(0x13b)])!==null&&_0x5d0ac4!==void 0x0?_0x5d0ac4:0x0)+_0x3b95c5},_0x44a130=transformToDrawingPosition(_0xc77154,_0x2fa567),_0x49b020=transformToAxisAlignPosition(_0xc77154,_0x2fa567),_0xc01ac2={'unitId':_0x5480a9,'subUnitId':_0x301915,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'drawingId':_0x7a7d8f,'transform':_0xc77154,'sheetTransform':_0x44a130,'axisAlignSheetTransform':_0x49b020},{unitId:_0x10f4ff,subUnitId:_0x2e7741,undo:_0x50b8a9,redo:_0x30b010,objects:_0x49212e}=this[_0x5e402d(0x138)][_0x5e402d(0x14e)]([_0xc01ac2]);_0x4e0bf1[_0x5e402d(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x10f4ff,'subUnitId':_0x2e7741,'op':_0x30b010,'objects':_0x49212e,'type':DrawingApplyType[_0x5e402d(0x157)]}}),_0x2bee4b[_0x5e402d(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x10f4ff,'subUnitId':_0x2e7741,'op':_0x50b8a9,'objects':_0x49212e,'type':DrawingApplyType[_0x5e402d(0x157)]}});}}else{const _0x5e9645=_0x49169d[_0x5e402d(0x14b)](),_0x36fe34=_0x49169d[_0x5e402d(0x193)]();this[_0x5e402d(0x120)](_0x5480a9,_0x301915,_0x7a7d8f,_0x49169d,_0x5e9645,_0x36fe34,_0x4e0bf1,_0x2bee4b,_0x5a6d8c,_0x3592c0);}}};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(_0x3b452b=defaultPluginConfig,_0x2ff48,_0x48da89,_0x399d6d){const _0xb82596=_0x341a97;super(),this[_0xb82596(0x16a)]=_0x3b452b,this[_0xb82596(0x123)]=_0x2ff48,this['_commandService']=_0x48da89,this[_0xb82596(0x139)]=_0x399d6d;const {..._0x2351fb}=merge({},defaultPluginConfig,this[_0xb82596(0x16a)]);this[_0xb82596(0x139)][_0xb82596(0x195)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x2351fb);}[_0x341a97(0x132)](){const _0x9bcc93=_0x341a97,_0x582692=this[_0x9bcc93(0x123)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x9bcc93(0x116)](_0x2aa18b=>_0x582692['add'](_0x2aa18b)),touchDependencies(_0x582692,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x19f),UniverInstanceType[_0x341a97(0x162)]),_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x145),_0x341a97(0x186)),_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x14d),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};
|