@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
9 lines • 1.42 MB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[54],Array(406).concat([function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"f",(function(){return c})),n.d(e,"d",(function(){return h}));var r,i,o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(n){var r=t.call(this,n)||this;return r.name="CustomersCanvasException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e.prototype.toString=function(){return this.name+": "+this.message},e.prototype.toJSON=function(){return{name:this.name,innerException:this.innerException,message:this.message}},e}(Error),s=function(t){function e(n){var r=t.call(this,n)||this;return r.name="NotImplementedException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),l=function(t){function e(n){var r=t.call(this,n)||this;return r.name="ArgumentException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),u=function(t){function e(n){var r=t.call(this,n)||this;return r.name="ArgumentNullException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(l),c=function(t){function e(n){var r=t.call(this,n)||this;return r.name="OutOfRangeException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),h=function(t){function e(n){var r=t.call(this,n)||this;return r.name="InvalidOperationException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a);o((function t(e){var n=i.call(this,e)||this;return n.name="UnexpectedDataException",Object.setPrototypeOf(n,t.prototype),n}),i=a)},function(t,e,n){"use strict";n.r(e),n.d(e,"getOrientedSquare",(function(){return r.h})),n.d(e,"getBounds",(function(){return r.f})),n.d(e,"getTriangleAngle",(function(){return r.l})),n.d(e,"normalizeAngle",(function(){return r.m})),n.d(e,"getScalarProduct",(function(){return r.i})),n.d(e,"getSquareDistanceToSegment",(function(){return r.k})),n.d(e,"getSquareDistanceToPoint",(function(){return r.j})),n.d(e,"getLineWidth",(function(){return r.g})),n.d(e,"ConvertDegreeToRadian",(function(){return r.c})),n.d(e,"ConvertRadianToDegree",(function(){return r.d})),n.d(e,"Clamp",(function(){return r.a})),n.d(e,"EqualsOfFloatNumbers",(function(){return r.e})),n.d(e,"CompareRectangels",(function(){return r.b})),n.d(e,"Matrix",(function(){return i.a})),n.d(e,"PathSegment",(function(){return o.b})),n.d(e,"Path",(function(){return o.a})),n.d(e,"PointF",(function(){return a.a})),n.d(e,"RectangleF",(function(){return s.a})),n.d(e,"RotatedRectangleF",(function(){return c})),n.d(e,"SizeF",(function(){return h})),n.d(e,"Transform",(function(){return l.a}));var r=n(422),i=n(474),o=n(455),a=n(434),s=n(430),l=n(456),u=n(406),c=function(){function t(t,e,n,r,i){this.centerX=t||0,this.centerY=e||0,this.width=n||0===n?n:2,this.height=r||0===r?r:2,this.angle=i||0}return t.prototype.getSimplifiedObject=function(){return{centerX:this.centerX,centerY:this.centerY,width:this.width,height:this.height,angle:this.angle}},t.prototype.clone=function(){return new t(this.centerX,this.centerY,this.width,this.height,this.angle)},Object.defineProperty(t.prototype,"bounds",{get:function(){for(var t=new a.a(this.centerX,this.centerY),e=this.width,n=this.height,r=[new a.a(-e/2,-n/2),new a.a(-e/2,n/2),new a.a(e/2,-n/2),new a.a(e/2,n/2)],i=0,o=0,l=0,u=0,c=0;c<4;c++)r[c].rotate(this.angle),(r[c].x<i||0===c)&&(i=r[c].x),(r[c].y<o||0===c)&&(o=r[c].y),(r[c].x>l||0===c)&&(l=r[c].x),(r[c].y>u||0===c)&&(u=r[c].y);return new s.a(i+t.x,o+t.y,l-i,u-o)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t,e){return null!=t&&Object(r.e)(this.centerX,t.centerX,e)&&Object(r.e)(this.centerY,t.centerY,e)&&Object(r.e)(this.width,t.width,e)&&Object(r.e)(this.height,t.height,e)&&Object(r.e)(this.angle,t.angle,e)},t.prototype.getUpperLeftCorner=function(){var t=new a.a(-this.width/2,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getUpperCenterPoint=function(){var t=new a.a(0,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getLeftCenterPoint=function(){var t=new a.a(-this.width/2,0);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getRightCenterPoint=function(){var t=new a.a(this.width/2,0);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getUpperRightCorner=function(){var t=new a.a(this.width/2,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomRightCorner=function(){var t=new a.a(this.width/2,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomLeftCorner=function(){var t=new a.a(-this.width/2,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomCenterPoint=function(){var t=new a.a(0,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype._checkProjectionIntersection=function(t,e){var n=this._getProjections(t),r=this._getProjections(e);return n.left<=r.right&&n.right>=r.left&&n.top<=r.bottom&&n.bottom>=r.top},t.prototype._getProjections=function(t){var e,n,r,i;e=n=t[0].x,r=i=t[0].y;for(var o=1;o<t.length;o++)e=Math.min(e,t[o].x),n=Math.max(n,t[o].x),r=Math.min(r,t[o].y),i=Math.max(i,t[o].y);return{left:e,right:n,top:r,bottom:i}},t.prototype.intersectsWith=function(t){var e=this.clone(),n=t.clone();if(!Object(r.e)(this.angle,0)){var i=e.angle;e.angle=0,(o=n.center).rotateAt(-i,e.center),n.center=o,n.angle-=i}var o,a=[e.getUpperLeftCorner(),e.getUpperRightCorner(),e.getBottomRightCorner(),e.getBottomLeftCorner()],s=[n.getUpperLeftCorner(),n.getUpperRightCorner(),n.getBottomRightCorner(),n.getBottomLeftCorner()],l=this._checkProjectionIntersection(a,s),u=!0;l&&!Object(r.e)(this.angle,t.angle)&&(e=this.clone(),i=(n=t.clone()).angle,n.angle=0,(o=e.center).rotateAt(-i,n.center),e.center=o,e.angle-=i,a=[e.getUpperLeftCorner(),e.getUpperRightCorner(),e.getBottomRightCorner(),e.getBottomLeftCorner()],s=[n.getUpperLeftCorner(),n.getUpperRightCorner(),n.getBottomRightCorner(),n.getBottomLeftCorner()],u=this._checkProjectionIntersection(a,s));return l&&u},Object.defineProperty(t.prototype,"location",{get:function(){return this.getUpperLeftCorner()},set:function(t){var e=this.getUpperLeftCorner();this.centerX=this.centerX+(t.x-e.x),this.centerY=this.centerY+(t.y-e.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new a.a(this.centerX,this.centerY)},set:function(t){this.centerX=t.x,this.centerY=t.y},enumerable:!0,configurable:!0}),t.prototype.rotateAt=function(t,e){var n=this.center;return n.rotateAt(t,e),this.center=n,this.angle+=t,this},t.prototype.translate=function(t,e){this.centerX+=t,this.centerY+=e},t.prototype.setTransform=function(t){null==t||t.equals(new l.a)||(this.width*=t.scaleX,this.height*=t.scaleY,this.angle+=t.angle,this.centerX+=t.translateX,this.centerY+=t.translateY)},t.prototype.getTransform=function(t){if(null==t||this.equals(t))return new l.a;var e=0===t.width?0:this.width/t.width,n=0===t.height?0:this.height/t.height,r=this.angle-t.angle,i=t.center,o=this.centerX-i.x,a=this.centerY-i.y;return new l.a(e,n,o,a,r)},t.prototype.transform=function(t,e){this.rotateAt(t.angle,e),t.setAngle(0),this.setTransform(t)},t.prototype.toString=function(){return[this.centerX,this.centerY,this.width,this.height,this.angle].join(",")},t.prototype.toRectangleF=function(){return new s.a(this.centerX-this.width/2,this.centerY-this.height/2,this.width,this.height)},t.prototype.contains=function(t){var e=this.clone();e.angle=0;var n=t.clone();return n.rotateAt(-this.angle,this.center),e.bounds.contains(n)},t.prototype.getCornerByIndex=function(t){switch(t){case 0:return this.getUpperLeftCorner();case 1:return this.getUpperRightCorner();case 2:return this.getBottomRightCorner();case 3:return this.getBottomLeftCorner();default:return null}},t.prototype.transformByMatrix=function(e,n){void 0===n&&(n=null);var i=[this.center.clone(),this.getUpperLeftCorner(),this.getUpperRightCorner(),this.getBottomRightCorner(),this.getBottomLeftCorner()].map((function(t){return e.transformPoint(t)})),o=Object(r.m)(null!=n?this.angle+n:this.angle),a=i[0],s=i.slice(1,5).map((function(t){return t.rotateAt(-o,a)}));if(!Object(r.e)(s[0].x,s[3].x,.01)||!Object(r.e)(s[0].y,s[1].y,.01))throw new u.a("RotatedRectangle: Scew is not supported");var l=Math.abs(s[1].x-s[0].x),c=Math.abs(s[2].y-s[1].y);return new t(a.x,a.y,l,c,o)},t.union=function(e,n){var r=e.clone(),i=n.clone(),o=r.angle,l=r.center;r.angle=0,i.rotateAt(-o,l);var u=s.a.union(r.bounds,i.bounds),c=new a.a(u.left+u.width/2,u.top+u.height/2),h=new t;h.center=c;var p=-1===Math.sign(e.width)||-1===Math.sign(e.width)?-1:1,f=-1===Math.sign(e.height)||-1===Math.sign(n.height)?-1:1;return h.width=u.width*p,h.height=u.height*f,h.rotateAt(o,l),h},t.fromRectangleF=function(e,n){return new t(e.left+e.width/2,e.top+e.height/2,e.width,e.height,"number"==typeof n?n:0)},t.FromLTRB=function(e,n,r,i){return t.fromRectangleF(s.a.FromLTRB(e,n,r,i))},t.getRectWithOffset=function(t,e){if(null==t)throw new u.a("RotatedRectangleF.getRectWithOffset: rectangle cannot be null!");return null==e||e.isOrigin()?t.clone():t.transformByMatrix((new i.a).translate(e.x,e.y))},t}(),h=function(){function t(t,e){this.width=0,this.height=0,this.width=t,this.height=e}return t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.toString=function(){return[this.width,this.height].join(",")},t.prototype.updateByMatrix=function(t){return t.updateObjectByMatrix(this,"width","height"),this},t}()},function(t,e,n){"use strict";n.d(e,"n",(function(){return o.a})),n.d(e,"ob",(function(){return u})),n.d(e,"N",(function(){return c.a})),n.d(e,"kb",(function(){return h.a})),n.d(e,"u",(function(){return p.a})),n.d(e,"o",(function(){return f.a})),n.d(e,"p",(function(){return d.a})),n.d(e,"g",(function(){return g.a})),n.d(e,"k",(function(){return L})),n.d(e,"B",(function(){return R})),n.d(e,"j",(function(){return v.a})),n.d(e,"m",(function(){return i})),n.d(e,"i",(function(){return C})),n.d(e,"l",(function(){return m.a})),n.d(e,"q",(function(){return k.a})),n.d(e,"r",(function(){return j.a})),n.d(e,"s",(function(){return j.b})),n.d(e,"t",(function(){return j.c})),n.d(e,"O",(function(){return j.d})),n.d(e,"v",(function(){return A.a})),n.d(e,"x",(function(){return F.a})),n.d(e,"y",(function(){return U})),n.d(e,"A",(function(){return $})),n.d(e,"E",(function(){return X.a})),n.d(e,"G",(function(){return K.a})),n.d(e,"F",(function(){return Z})),n.d(e,"I",(function(){return Q.a})),n.d(e,"J",(function(){return tt.a})),n.d(e,"K",(function(){return et.a})),n.d(e,"L",(function(){return nt.a})),n.d(e,"M",(function(){return rt.a})),n.d(e,"P",(function(){return it.a})),n.d(e,"Q",(function(){return ot.a})),n.d(e,"R",(function(){return at.g})),n.d(e,"S",(function(){return at.h})),n.d(e,"b",(function(){return at.a})),n.d(e,"e",(function(){return at.d})),n.d(e,"d",(function(){return at.c})),n.d(e,"c",(function(){return at.b})),n.d(e,"z",(function(){return at.f})),n.d(e,"f",(function(){return at.e})),n.d(e,"T",(function(){return H})),n.d(e,"V",(function(){return N})),n.d(e,"W",(function(){return st.a})),n.d(e,"Y",(function(){return lt.a})),n.d(e,"Z",(function(){return ut.a})),n.d(e,"ab",(function(){return gt})),n.d(e,"bb",(function(){return ht})),n.d(e,"ub",(function(){return mt.d})),n.d(e,"H",(function(){return mt.a})),n.d(e,"ib",(function(){return mt.c})),n.d(e,"cb",(function(){return mt.b})),n.d(e,"db",(function(){return yt.a})),n.d(e,"eb",(function(){return _t.a})),n.d(e,"fb",(function(){return vt})),n.d(e,"gb",(function(){return wt.a})),n.d(e,"hb",(function(){return _.a})),n.d(e,"a",(function(){return St})),n.d(e,"jb",(function(){return It.a})),n.d(e,"lb",(function(){return Ot.a})),n.d(e,"nb",(function(){return Tt.a})),n.d(e,"U",(function(){return Et.a})),n.d(e,"pb",(function(){return Et.b})),n.d(e,"D",(function(){return pt.d})),n.d(e,"mb",(function(){return pt.f})),n.d(e,"X",(function(){return pt.e})),n.d(e,"qb",(function(){return pt.g})),n.d(e,"sb",(function(){return pt.h})),n.d(e,"C",(function(){return pt.c})),n.d(e,"h",(function(){return pt.a})),n.d(e,"w",(function(){return pt.b})),n.d(e,"rb",(function(){return Lt.a})),n.d(e,"tb",(function(){return Rt.a})),n.d(e,"vb",(function(){return kt.a})),n.d(e,"wb",(function(){return Y.a}));var r,i,o=n(498),a=n(411),s=n(410),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n}return l(e,t),e.prototype._copy=function(e,n,r,i){return t.prototype._copy.call(this,e,n,r,i),n.sourceDpi=e.sourceDpi,n.smartObjectDpi=e.smartObjectDpi,n.smartObjectRectangle=e.smartObjectRectangle,n.smartObjectSize=e.smartObjectSize,n.smartObjectStorageId=e.smartObjectStorageId,null!=e.warpControlPoints&&(n.warpControlPoints=e.warpControlPoints.map((function(t){return t}))),null!=e.projectiveTransform&&(n.projectiveTransform=e.projectiveTransform.map((function(t){return t}))),null!=e.vectorMask&&(n.vectorMask=e.vectorMask.map((function(t){return t}))),n},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this.sourceDpi,e.sourceDpi)&&Object(s.g)(this.smartObjectDpi,e.smartObjectDpi)&&a.isEqual(this.smartObjectRectangle,e.smartObjectRectangle)&&a.isEqual(this.smartObjectSize,e.smartObjectSize)&&Object(s.g)(this.smartObjectStorageId,e.smartObjectStorageId)&&Object(s.d)(this.warpControlPoints,e.warpControlPoints)&&Object(s.d)(this.projectiveTransform,e.projectiveTransform)&&Object(s.d)(this.vectorMask,e.vectorMask)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="SmartItem",e}(o.a),c=n(450),h=n(467),p=n(502),f=n(435),d=n(466),g=n(559),m=n(506),y=n(406),_=n(446),b=n(413),v=n(476);!function(t){t.None="None",t.VCard="VCard",t.Phone="Phone",t.Url="Url",t.Data="Data"}(i||(i={}));var w=n(863),C=function(){function t(t){if(this.barcodeFormat=v.a.QR_CODE,this.barcodeSubType=i.None,a.isString(t))try{t=JSON.parse(t)}catch(e){console.warn("Unable to parse BarcodeData from string ",t,e),t=null}a.isObject(t)&&a.extend(this,t)}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return a.isEmpty(this.firstName)&&a.isEmpty(this.lastName)&&a.isEmpty(this.organization)&&a.isEmpty(this.position)&&a.isEmpty(this.email)&&a.isEmpty(this.mobilePhone)&&a.isEmpty(this.url)&&a.isEmpty(this.phone)&&a.isEmpty(this.data)&&a.isEmpty(this.barcodeValue)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t){return null!=t&&this.barcodeFormat===t.barcodeFormat&&this.barcodeSubType===t.barcodeSubType&&this.firstName===t.firstName&&this.lastName===t.lastName&&this.organization===t.organization&&this.position===t.position&&this.email===t.email&&this.mobilePhone===t.mobilePhone&&this.url===t.url&&this.data===t.data&&this.phone===t.phone&&this.barcodeValue===t.barcodeValue},t.prototype._isEmpty=function(t){return a.isEmpty(null!=t?t.trim():null)},t.prototype.toVCardString=function(){var t={n:[{value:[this.lastName,this.firstName,"","",""]}],"email;internet":[{value:this.email}],org:[{value:this.organization}],"tel;cell":[{value:this.mobilePhone}],"tel;work":[{value:this.phone}],title:[{value:this.position}],url:[{value:this.url}]};return w.generate(t)},t.fromVCardString=function(e){var n=null!=e?w.parse(e):{},r=new t;return r.barcodeFormat=v.a.QR_CODE,r.barcodeSubType=i.VCard,r.email=n.email&&n.email[0]&&n.email[0].value,r.lastName=n.n&&n.n[0]&&n.n[0].value[0],r.firstName=n.n&&n.n[0]&&n.n[0].value[1],r.organization=n.org&&n.org[0]&&n.org[0].value,r.mobilePhone=n.tel&&n.tel[0]&&n.tel[0].value,r.phone=n.tel&&n.tel[1]&&n.tel[1].value,r.position=n.title&&n.title[0]&&n.title[0].value,r.url=n.url&&n.url[0]&&n.url[0].value,r},t}(),P=n(416),x=n(424),S=n(439),I=n(443),O=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},E=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},L=function(t){function e(n,r,o,a){var s=t.call(this)||this;return s._barcodeContent="",s._barcodeFormat=v.a.QR_CODE,s._barcodeOptions=new R,s._barcodeSubType=i.Url,s._color=new b.RgbColor(0,0,0,255),s.type=e.type,s._onOptionsPropertyChanged=function(t,e){s._propertyChanged.notify(s,"barcodeOptions")},s._barcodePermissions=new m.a,s._barcodeOptions.pureBarcode=!0,s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips=new _.a(!0,!1),s.itemPermissions.itemToolbarPermissions.showEditButton=!0,s.shapePermissions.allowChangeFillColor=!0,s.barcodePermissions.allowChangeBarcodeType=!1,s.barcodePermissions.allowChangeBarcodeColor=!0,s.barcodePermissions.allowChangeBarcodeContent=!0,s._ignorePermissionsChange=!1,s.fillColor=new b.RgbColor(255,255,255,255),null!=n&&(s._barcodeFormat=n),null!=r&&(s._barcodeContent=r),null!=o&&(s._barcodeOptions=o),s._subscribeOptionsPropertyChanged(),null!=a&&(s.sourceRectangle=a),s.applyPermissionsConstrain(),s}return O(e,t),Object.defineProperty(e.prototype,"barcodePermissions",{get:function(){return this._barcodePermissions},set:function(t){if(null==t)throw new y.a("barcodePermissions cannot be null");Object(s.g)(this._barcodePermissions,t)||(this._barcodePermissions.propertyChanged.remove(this._onPermissionsChanged),this._barcodePermissions=t,this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeContent",{get:function(){return this._barcodeContent},set:function(t){this._barcodeContent!==t&&(this._barcodeContent=t,this._propertyChanged.notify(this,"barcodeContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeFormat",{get:function(){return this._barcodeFormat},set:function(t){this._barcodeFormat!==t&&(this._barcodeFormat=t,this._propertyChanged.notify(this,"barcodeFormat"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeSubType",{get:function(){return this._barcodeSubType},set:function(t){this._barcodeSubType!==t&&(this._barcodeSubType=t,this._propertyChanged.notify(this,"barcodeSubType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){this._color.equals(t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeOptions",{get:function(){return this._barcodeOptions},set:function(t){JSON.stringify(this._barcodeOptions)!==JSON.stringify(t)&&(this._unsubscribeOptionsPropertyChanged(),this._barcodeOptions=t,this._subscribeOptionsPropertyChanged(),this._propertyChanged.notify(this,"barcodeOptions"))},enumerable:!0,configurable:!0}),e.prototype._subscribeOptionsPropertyChanged=function(){null!=this._barcodeOptions&&this._barcodeOptions.addPropertyChanged(this._onOptionsPropertyChanged)},e.prototype._unsubscribeOptionsPropertyChanged=function(){null!=this._barcodeOptions&&this._barcodeOptions.removePropertyChanged(this._onOptionsPropertyChanged)},Object.defineProperty(e.prototype,"isQrCode",{get:function(){return this.barcodeFormat===v.a.QR_CODE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSquareCode",{get:function(){return this.barcodeFormat===v.a.QR_CODE||this.barcodeFormat===v.a.DATA_MATRIX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLinearBarcode",{get:function(){return this.barcodeFormat===v.a.EAN_13||this.barcodeFormat===v.a.EAN_8||this.barcodeFormat==v.a.CODE_128||this.barcodeFormat===v.a.UPC_A||this.barcodeFormat===v.a.UPC_E},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.barcodePermissions=e.barcodePermissions.clone(),n.barcodeContent=e.barcodeContent,n.barcodeFormat=e.barcodeFormat,n.barcodeSubType=e.barcodeSubType,n.color=e.color.clone(),n.barcodeOptions=new R,n.barcodeOptions.width=e.barcodeOptions.width,n.barcodeOptions.height=e.barcodeOptions.height,n.barcodeOptions.margin=e.barcodeOptions.margin,n.barcodeOptions.pureBarcode=e.barcodeOptions.pureBarcode,n.barcodeOptions.errorCorrection=e.barcodeOptions.errorCorrection,n.barcodeOptions.characterSet=e.barcodeOptions.characterSet,n.barcodeOptions.pdf417Compact=e.barcodeOptions.pdf417Compact,n.barcodeOptions.pdf417Compaction=e.barcodeOptions.pdf417Compaction,n.barcodeOptions.pdf417Dimensions=e.barcodeOptions.pdf417Dimensions,n.barcodeOptions.disableEci=e.barcodeOptions.disableEci,n.barcodeOptions.code128ForceCodesetB=e.barcodeOptions.code128ForceCodesetB,n.barcodeOptions.aztecLayers=e.barcodeOptions.aztecLayers,n.barcodeOptions.qrVersion=e.barcodeOptions.qrVersion,n.barcodeOptions.xDimension=e.barcodeOptions.xDimension,n.barcodeOptions.databarExpandedSegments=e.barcodeOptions.databarExpandedSegments},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._barcodePermissions,e._barcodePermissions)&&Object(s.g)(this._barcodeContent,e._barcodeContent)&&Object(s.g)(this._barcodeFormat,e._barcodeFormat)&&Object(s.g)(this._barcodeSubType,e._barcodeSubType)&&Object(s.g)(this._color,e._color)&&Object(s.g)(this._barcodeOptions,e._barcodeOptions)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.getSimplifiedObject=function(e){a.isArray(e)||a.isString(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["barcodePermissions","isQrCode","isLinearBarcode","isSquareCode","barcodeData"].concat(e));return n.barcodePermissions=this.barcodePermissions.getSimplifiedObject(),n},e.prototype.applyPermissionsConstrain=function(){null!=this.itemPermissions&&null!=this.itemPermissions.itemToolbarPermissions&&(null==this.barcodePermissions||this.barcodePermissions.allowChangeBarcodeContent?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=this.barcodePermissions.allowChangeBarcodeContent,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1)},Object.defineProperty(e.prototype,"barcodeData",{get:function(){var t=new C;if(t.barcodeSubType=this.barcodeSubType,t.barcodeFormat=this.barcodeFormat,t.barcodeFormat===v.a.QR_CODE)switch(this.barcodeSubType){case i.Phone:t.phone=this.barcodeContent;break;case i.Url:t.url=this.barcodeContent;break;case i.Data:t.data=this.barcodeContent;break;case i.VCard:return C.fromVCardString(this.barcodeContent)}else t.barcodeValue=this.barcodeContent;return t},enumerable:!0,configurable:!0}),e.prototype.applyBarcodeData=function(t){this.barcodeFormat=t.barcodeFormat,this.barcodeSubType=null!=t.barcodeSubType?t.barcodeSubType:this.barcodeFormat===v.a.QR_CODE?i.Phone:i.None;var e="";if(this.barcodeFormat===v.a.QR_CODE)switch(this.barcodeSubType){case i.Phone:e=t.phone;break;case i.Data:e=t.data;break;case i.None:case i.Url:e=t.url;break;case i.VCard:e=t.toVCardString()}else e=t.barcodeValue;this.barcodeContent=e},e.type="BarcodeItem",T([Object(P.a)({factory:new I.d("")}),E("design:type",String),E("design:paramtypes",[String])],e.prototype,"barcodeContent",null),T([Object(P.a)({enumObject:v.a}),E("design:type",String),E("design:paramtypes",[String])],e.prototype,"barcodeFormat",null),T([Object(P.a)({enumObject:i}),E("design:type",String),E("design:paramtypes",[String])],e.prototype,"barcodeSubType",null),e}(p.a),R=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return O(e,t),e.prototype.equals=function(t){return null!=t&&Object(s.g)(this.width,t.width)&&Object(s.g)(this.height,t.height)&&Object(s.g)(this.margin,t.margin)&&Object(s.g)(this.pureBarcode,t.pureBarcode)&&Object(s.g)(this.errorCorrection,t.errorCorrection)&&Object(s.g)(this.characterSet,t.characterSet)&&Object(s.g)(this.pdf417Compact,t.pdf417Compact)&&Object(s.g)(this.pdf417Compaction,t.pdf417Compaction)&&a.isEqual(this.pdf417Dimensions,t.pdf417Dimensions)&&Object(s.g)(this.disableEci,t.disableEci)&&Object(s.g)(this.code128ForceCodesetB,t.code128ForceCodesetB)&&Object(s.g)(this.aztecLayers,t.aztecLayers)&&Object(s.g)(this.qrVersion,t.qrVersion)&&Object(s.g)(this.xDimension,t.xDimension&&Object(s.g)(this.databarExpandedSegments,t.databarExpandedSegments))},e.type="EncodingOptions",T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"width",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"height",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"margin",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(!0)}),E("design:type",Boolean)],e.prototype,"pureBarcode",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d("")}),E("design:type",String)],e.prototype,"errorCorrection",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d("")}),E("design:type",String)],e.prototype,"characterSet",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(!1)}),E("design:type",Boolean)],e.prototype,"pdf417Compact",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d("")}),E("design:type",String)],e.prototype,"pdf417Compaction",void 0),T([Object(S.a)(),Object(P.a)({ignore:!0}),E("design:type",Object)],e.prototype,"pdf417Dimensions",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(!1)}),E("design:type",Boolean)],e.prototype,"disableEci",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(!1)}),E("design:type",Boolean)],e.prototype,"code128ForceCodesetB",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"aztecLayers",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"qrVersion",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"xDimension",void 0),T([Object(S.a)(),Object(P.a)({factory:new I.d(0)}),E("design:type",Number)],e.prototype,"databarExpandedSegments",void 0),e}(x.a),k=n(560),j=n(507),A=n(561),F=n(562),B=n(434),M=n(409),N=function(){function t(t){this._allowChangeLineWidth=!0,this._allowChangeLineColor=!0,this.propertyChanged=new M.a,null==t&&(t=!0),this.allowChangeLineWidth=t,this.allowChangeLineColor=t}return Object.defineProperty(t.prototype,"allowChangeLineWidth",{get:function(){return this._allowChangeLineWidth},set:function(t){this._allowChangeLineWidth!==t&&(this._allowChangeLineWidth=t,this.propertyChanged.notify("allowChangeLineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeLineColor",{get:function(){return this._allowChangeLineColor},set:function(t){this._allowChangeLineColor!==t&&(this._allowChangeLineColor=t,this.propertyChanged.notify("allowChangeLineColor"))},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeLineWidth=this.allowChangeLineWidth,t.allowChangeLineColor=this.allowChangeLineColor,t},t.prototype.clone=function(){var e=new t;return e.allowChangeLineWidth=this.allowChangeLineWidth,e.allowChangeLineColor=this.allowChangeLineColor,e},t.prototype.equals=function(t){return this.allowChangeLineColor===t.allowChangeLineColor&&this.allowChangeLineWidth===t.allowChangeLineWidth},t}(),z=n(422),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),H=function(t){function e(n,r){var i=t.call(this)||this;return i._width=4,i._color=new b.RgbColor(0,0,0,255),i._sourcePoint0=new B.a,i._sourcePoint1=new B.a,i._fixedWidth=!1,i._overprintStroke=!1,i.lineColorForAbnormalRendering=new b.RgbColor(0,0,0,255),i.type=e.type,i._sourcePoint0=null!=n?n:new B.a,i._sourcePoint1=null!=r?r:new B.a,i._linePermissions=new N,i._linePermissions.propertyChanged.add(i._onPermissionsChanged),i._ignorePermissionsChange=!0,i.itemPermissions.itemToolbarPermissions.showEditButton=!1,i.itemPermissions.itemToolbarPermissions.showSelectButton=!1,i._ignorePermissionsChange=!1,i}return D(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){z.e(this._width,t)||(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){b.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoint0",{get:function(){return this._sourcePoint0},set:function(t){B.a.isEqual(this._sourcePoint0,t)||(this._sourcePoint0=t,this._propertyChanged.notify(this,"sourcePoint0"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoint1",{get:function(){return this._sourcePoint1},set:function(t){B.a.isEqual(this._sourcePoint1,t)||(this._sourcePoint1=t,this._propertyChanged.notify(this,"sourcePoint1"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedWidth",{get:function(){return this._fixedWidth},set:function(t){this._fixedWidth!==t&&(this._fixedWidth=t,this._propertyChanged.notify(this,"fixedWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"linePermissions",{get:function(){return this._linePermissions},set:function(t){if(null==t)throw new y.a("linePermissions cannot be null");Object(s.g)(this._linePermissions,t)||(this._linePermissions.propertyChanged.remove(this._onPermissionsChanged),this._linePermissions=t,this._linePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintStroke",{get:function(){return this._overprintStroke},set:function(t){t!=this._overprintStroke&&(this._overprintStroke=t,this._propertyChanged.notify(this,"overprintStroke"))},enumerable:!0,configurable:!0}),e.prototype._subscribeToPermissionChanged=function(){this._linePermissions.propertyChanged.add(this._onPermissionsChanged)},e.prototype._unsubscribeFromPermissionChanged=function(){this._linePermissions.propertyChanged.remove(this._onPermissionsChanged)},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButton=!1,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1,this.isRenderTypeIsNormal||(this.linePermissions.allowChangeLineColor=!1)},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["linePermissions"].concat(e));return n.linePermissions=this.linePermissions.getSimplifiedObject(),n},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.width=e.width,n.color=e.color.clone(),n.sourcePoint0=e.sourcePoint0.clone(),n.sourcePoint1=e.sourcePoint1.clone(),n.fixedWidth=e.fixedWidth,n.linePermissions=null!=e._linePermissions?e._linePermissions.clone():null,n.overprintStroke=e.overprintStroke},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._width,e._width)&&Object(s.g)(this._color,e._color)&&Object(s.g)(this._sourcePoint0,e._sourcePoint0)&&Object(s.g)(this._sourcePoint1,e._sourcePoint1)&&Object(s.g)(this._fixedWidth,e._fixedWidth)&&Object(s.g)(this._linePermissions,e._linePermissions)&&Object(s.g)(this._overprintStroke,e._overprintStroke)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="LineItem",e}(c.a),W=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U=function(t){function e(n,r){var i=t.call(this,n,r)||this;return i._dashWidth=3,i._altDashWidth=3,i._altColor=new b.RgbColor(0,0,0,0),i.type=e.type,i}return W(e,t),Object.defineProperty(e.prototype,"dashWidth",{get:function(){return this._dashWidth},set:function(t){z.e(this._dashWidth,t)||(this._dashWidth=t,this._propertyChanged.notify(this,"dashWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altDashWidth",{get:function(){return this._altDashWidth},set:function(t){z.e(this._altDashWidth,t)||(this._altDashWidth=t,this._propertyChanged.notify(this,"altDashWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altColor",{get:function(){return this._altColor},set:function(t){b.Color.equals(this._altColor,t)||(this._altColor=t,this._propertyChanged.notify(this,"altColor"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.dashWidth=e.dashWidth,n.altDashWidth=e.altDashWidth,n.altColor=e.altColor.clone()},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._dashWidth,e._dashWidth)&&Object(s.g)(this._altDashWidth,e._altDashWidth)&&Object(s.g)(this._altColor,e._altColor)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="DashedLineItem",e}(H),V=n(430),q=n(455),G=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$=function(t){function e(n){void 0===n&&(n=new V.a(0,0,10,10));var r=t.call(this,q.a.ellipse(n.left,n.top,n.width,n.height))||this;return r.type=e.type,r.sourceRectangle=n,r.manipulationPermissions.resizeGrips=new _.a(!0,!0),r}return G(e,t),e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="EllipseItem",e}(h.a),X=n(554),K=n(508),Y=n(465),J=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z=function(t){function e(n,r,i,o,a,s){var l=t.call(this)||this;return l.type=e.type,l._location=new B.a(n,r),l._cols=i,l._rows=o,l._stepX=a,l._stepY=s,l._horizontalLineColor=new b.RgbColor(0,0,0,255),l._verticalLineColor=new b.RgbColor(0,0,0,255),l._lineWidth=1,l._fixedLineWidth=!0,l.textWrappingMode=Y.a.None,l}return J(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return this._location},set:function(t){B.a.isEqual(this._location,t)||(this._location=t,this._propertyChanged.notify(this,"location"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._cols},set:function(t){z.e(this._cols,t)||(this._cols=t,this._propertyChanged.notify(this,"cols"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(t){z.e(this._rows,t)||(this._rows=t,this._propertyChanged.notify(this,"rows"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepX",{get:function(){return this._stepX},set:function(t){z.e(this._stepX,t)||(this._stepX=t,this._propertyChanged.notify(this,"stepX"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepY",{get:function(){return this._stepY},set:function(t){z.e(this._stepY,t)||(this._stepY=t,this._propertyChanged.notify(this,"stepY"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(t){z.e(this._lineWidth,t)||(this._lineWidth=t,this._propertyChanged.notify(this,"lineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedLineWidth",{get:function(){return this._fixedLineWidth},set:function(t){this._fixedLineWidth!==t&&(this._fixedLineWidth=t,this._propertyChanged.notify(this,"fixedLineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalLineColor",{get:function(){return this._verticalLineColor},set:function(t){b.Color.equals(this._verticalLineColor,t)||(this._verticalLineColor=t,this._propertyChanged.notify(this,"verticalLineColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalLineColor",{get:function(){return this._horizontalLineColor},set:function(t){b.Color.equals(this._horizontalLineColor,t)||(this._horizontalLineColor=t,this._propertyChanged.notify(this,"horizontalLineColor"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.location=e.location.clone(),n.cols=e.cols,n.rows=e.rows,n.stepX=e.stepX,n.stepY=e.stepY,n.lineWidth=e.lineWidth,n.fixedLineWidth=e.fixedLineWidth,n.verticalLineColor=e.verticalLineColor.clone(),n.horizontalLineColor=e.horizontalLineColor.clone()},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._location,e._location)&&Object(s.g)(this._rows,e._rows)&&Object(s.g)(this._cols,e._cols)&&Object(s.g)(this._stepX,e._stepX)&&Object(s.g)(this._stepY,e._stepY)&&Object(s.g)(this._lineWidth,e._lineWidth)&&Object(s.g)(this._fixedLineWidth,e._fixedLineWidth)&&Object(s.g)(this._verticalLineColor,e._verticalLineColor)&&Object(s.g)(this._horizontalLineColor,e._horizontalLineColor)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e(this.location.x,this.location.y,this.cols,this.rows,this.stepX,this.stepY);return this._copy(this,r,t,n),r},e.type="GridItem",e}(c.a),Q=n(468),tt=n(478),et=n(511),nt=n(509),rt=n(564),it=n(552),ot=n(553),at=n(565),st=n(549),lt=n(479),ut=n(477),ct=n(407),ht=function(){function t(t){this.propertyChanged=new M.a,null==t&&(t=!0),this.allowChangeColumnCount=t}return Object.defineProperty(t.prototype,"allowChangeColumnCount",{get:function(){return this._allowChangeColumnCount},set:function(t){this._allowChangeColumnCount!==t&&(this._allowChangeColumnCount=t,this.propertyChanged.notify("allowChangeColumnCount"))},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeColumnCount=this.allowChangeColumnCount,t},t.prototype.clone=function(){var e=new t;return e.allowChangeColumnCount=this.allowChangeColumnCount,e},t.prototype.equals=function(t){return this.allowChangeColumnCount===t.allowChangeColumnCount},t}(),pt=n(475),ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gt=function(t){function e(n,r,i,o){var a=t.call(this,n,i,o)||this;return a._boundingPaths=[],a._wrappingMargin=7,a._wrappingPath=null,a._paragraphSettings=new ut.a,a._isVertical=!1,a._firstBaselineOffset=pt.c.Ascent,a._firstBaselineMinOffset=0,a.type=e.type,null!=r&&(a.boundingPaths=r),a._pathBoundedTextPermissions=new ht,a._pathBoundedTextPermissions.propertyChanged.add(a._onPermissionsChanged),a}return ft(e,t),Object.defineProperty(e.prototype,"boundingPaths",{get:function(){return this._boundingPaths},set:function(t){t.length===this.boundingPaths.length&&this.boundingPaths.every((function(e,n){return e.isEqual(t[n])}))||(this._boundingPaths=t,this._propertyChanged.notify(this,"boundingPaths"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingPath",{get:function(){return this._wrappingPath},set:function(t){null==this._wrappingPath&&null==t||null!=this._wrappingPath&&this._wrappingPath.isEqual(t)||(this._wrappingPath=t,this._propertyChanged.notify(this,"wrappingPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this._wrappingMargin},set:function(t){Object(ct.EqualsOfFloatNumbers)(this._wrappingMargin,t)||(this._wrappingMargin=t,this._propertyChanged.notify(this,"wrappingMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this._paragraphSettings},set:function(t){ut.a.equals(this._paragraphSettings,t)||(this._paragraphSettings=t,this._propertyChanged.notify(this,"paragraphSettings"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathBoundedTextPermissions",{get:function(){return this._pathBoundedTextPermissions},set:function(t){if(null==t)throw new y.a("pathBoundedTextPermissions cannot be null");Object(s.g)(this._pathBoundedTextPermissions,t)||(this._pathBoundedTextPermissions.propertyChanged.remove(this._onPermissionsChanged),this._pathBoundedTextPermissions=t,this._pathBoundedTextPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineOffset",{get:function(){return this._firstBaselineOffset},set:function(t){this._firstBaselineOffset!==t&&(this._firstBaselineOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineOffset"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineMinOffset",{get:function(){return this._firstBaselineMinOffset},set:function(t){Object(ct.EqualsOfFloatNumbers)(this._firstBaselineMinOffset,t)||(this._firstBaselineMinOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineMinOffset"))},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["pathBoundedTextPermissions"].concat(e));return n.pathBoundedTextPermissions=this.pathBoundedTextPermissions.getSimplifiedObject(),n},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),"PathBoundedTextItem"!=r.type&&"BoundedTextItem"!=r.type||(r.wrappingMargin=n.wrappingMargin,r.paragraphSettings=n.paragraphSettings.clone(),r.wrappingPath=null!=n.wrappingPath?n.wrappingPath.clone():null,r.firstBaselineOffset=n.firstBaselineOffset,r.firstBaselineMinOffset=n.firstBaselineMinOffset),r instanceof e&&(r.boundingPaths=n.boundingPaths.map((function(t){return t.clone()})),r.pathBoundedTextPermissions=n.pathBoundedTextPermissions.clone())},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.c)(this._boundingPaths,e._boundingPaths)&&Object(s.g)(this._wrappingMargin,e._wrappingMargin)&&Object(s.g)(this._paragraphSettings,e._paragraphSettings)&&Object(s.g)(this._isVertical,e._isVertical)&&Object(s.g)(this._pathBoundedTextPermissions,e._pathBoundedTextPermissions)&&Object(s.g)(this._wrappingPath,e._wrappingPath)&&Object(s.g)(this.firstBaselineOffset,e.firstBaselineOffset)&&Object(s.g)(this.firstBaselineMinOffset,e.firstBaselineMinOffset)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PathBoundedTextItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(P.a)({enumObject:pt.c}),dt("design:type",Number),dt("design:paramtypes",[Number])],e.prototype,"firstBaselineOffset",null),e}(f.a),mt=n(512),yt=n(566),_t=n(567),bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vt=function(t){function e(n){var r=t.call(this)||this;if(r._width=20,r._color=new b.RgbColor(255,255,61,255),r._points=[],r.type=e.type,r._points=[],n&&n.length&&n.length>0)for(var i=0;i<n.length;i++)n[i]instanceof B.a&&r._points.push(n[i]);return r.textWrappingMode=Y.a.None,r}return bt(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){z.e(this._width,t)||(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){b.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoints",{get:function(){return this._points},set:function(t){this._points=t,this._propertyChanged.notify(this,"sourcePoints")},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.width=e.width,n.color=e.color.clone(),n.sourcePoints=e.sourcePoints.map((function(t){return t.clone()}))},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._width,e._width)&&Object(s.g)(this._color,e._color)&&Object(s.c)(this._points,e._points)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PolylineItem",e}(c.a),wt=n(503),Ct=n(568),Pt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},St=function(t){function e(n,r,i,o){var a=t.call(this,n,i,o)||this;return a._center=new ct.PointF,a.type=e.type,null!=r&&(a._center=r),a._ignorePermissionsChange=!0,a.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),a.manipulationPermissions.resizeGrips.edge=!1,a.textPermissions.allowChangeTextAlignment=!1,a.textPermissions.allowChangeLeading=!1,a._ignorePermissionsChange=!1,a}return Pt(e,t),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&null!=this.manipulationPermissions.resizeGrips&&(this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(!1),this.manipulationPermissions.resizeGrips.edgeConstraint=!1),null!=this.textPermissions&&(this.textPermissions.allowChangeLeading=!1,this.textPermissions.allowChangeTextAlignment=!1)},Object.defineProperty(e.prototype,"center",{get:function(){return this._center},set:function(t){ct.PointF.isEqual(this._center,t)||(this._center=t,this._propertyChanged.notify(this,"center"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bend",{get:function(){return this._bend},set:function(t){Object(ct.EqualsOfFloatNumbers)(this._bend,t)||(this._bend=t,this._propertyChanged.notify(this,"bend"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warp",{get:function(){return this._warp},set:function(t){this._warp!==t&&(this._warp=t,this._propertyChanged.notify(this,"warp"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return 1},set:function(t){throw console.error("ArchedText set maxLineCount",t),new y.d("Max Line Count of ArchedTextItem can not be redefined!")},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){return t.prototype.getSimplifiedObject.call(this,["maxLineCount"].concat(e))},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),r instanceof e&&(r.center=n.center,r.bend=n.bend,r.warp=n.warp)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._center,e._center)&&Object(s.g)(this._bend,e._bend)&&Object(s.g)(this._warp,e._warp)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="ArchedTextItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(Ct.b)({type:"boolean"}),xt("design:type",Boolean),xt("design:paramtypes",[Boolean])],e.prototype,"warp",null),e}(f.a),It=n(505),Ot=n(557),Tt=n(480),Et=n(504),Lt=n(558),Rt=n(555),kt=n(551)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var r,i=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},a=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t},s=function(){function t(){this._listeners=[]}return t.prototype.add=function(t){this._listeners.includes(t)||this._listeners.push(t)},t.prototype.remove=function(t){this._listeners=this._listeners.filter((function(e){return e!==t}))},t.prototype.listenersCount=function(){return this._listeners.length},t.prototype.notify=function(){for(var t,e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._listeners),o=i.next();!o.done;o=i.next())o.value.apply(void 0,a(n))}catch(s){t={error:s}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e){t.prototype.notify.call(this,e)},e.prototype.fire=function(t){this.notify(t)},e}(s),u=function(t){function e(e){var n=t.call(this)||this;return n._sender=e,n}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e){t.prototype.notify.call(this,this._sender,e)},e.prototype.fire=function(t){this.notify(t)},e}(s),c=function(t){function e(e){void 0===e&&(e=null);var n=t.call(this)||this;return n._sender=e,n}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e,n){t.prototype.notify.call(this,e,n)},e}(s)},function(t,e,n){"use strict";n.d(e,"p",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return d})),n.d(e,"l",(function(){return g})),n.d(e,"m",(function(){return m})),n.d(e,"k",(function(){return b})),n.d(e,"r",(function(){return v})),n.d(e,"h",(function(){return w})),n.d(e,"i",(function(){return C})),n.d(e,"e",(function(){return P})),n.d(e,"f",(function(){return x})),n.d(e,"n",(function(){return S})),n.d(e,"j",(function(){return I})),n.d(e,"q",(function(){return O})),n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return E})),n.d(e,"o",(function(){return L}));var r=n(406),i=(n(495),n(411)),o=n(426),a=n(537),s=n(407),l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t};function h(t,e,n){var r=!1;return null!=n&&(r="boolean"==typeof n?n:n.ignoreCase),(t=r?t.toLowerCase():t)===(r?e.toLowerCase():e)}function p(t,e){if(null==t&&null==e)return!0;if(null==t&&null!=e||null!=t&&null==e)return!1;var n,r=typeof t;if(r!==typeof e)return!1;if("string"===r||"boolean"===r)return t===e;if("number"===r)return Object(s.EqualsOfFloatNumbers)(t,e);if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&f(t,e);var i=e;return n="function"==typeof t.equals&&"function"==typeof i.equals?function(t,e){return t.equals(e)}:function(t,e){return t==e},n(t,e)}function f(t,e){return null==t&&null==e||null!=t&&null!=e&&t.length===e.length&&t.reduce((function(t,n,r){return t&&p(n,e[r])}),!0)}function d(t,e){return(null==t?void 0:t.length)===(null==e?void 0:e.length)&&t.reduce((function(t,n,r){return t&&n==e[r]}),!0)}function g(t){return null==t||""===t.trim()}function m(t,e){return void 0===e&&(e=!0),!(g(t)||!t.startsWith("<"))&&(e&&(t=y(t)),null==(new DOMParser).parseFromString("<root>"+t+"</root>","application/xml").querySelector("parsererror"))}function y(t){if(g(t)||!t.startsWith("<"))return t;for(var e=[t];;){var n=e.pop(),r=n.indexOf("&");if(-1===r){e.push(n);break}e.push(n.substring(0,r));var i=_(n,r);null!=i?(e.push(i.entity),e.push(n.substring(r+i.length))):(e.push("&"),e.push(n.substring(r+1)))}return e.join("")}function _(t,e){var n=t.substring(e,e+4).toLowerCase();if("<"==n)return{entity:"<",length:4};if(">"==n)return{entity:">",length:4};if("&"==t.substring(e,e+5).toLowerCase())return{entity:"&",length:5};var r=t.substring(e,e+6).toLowerCase();if("'"==r)return{entity:"'",length:6};if("""==r)return{entity:""",length:6};var i=t.substring(e,e+7).toLowerCase();if(i.match(/^&#[\\d]{4};$$/))return{entity:i,length:7};var o=t.substring(e,e+8);return o.toLowerCase().match(/^&#x[\\dabcdef]{4};$/)?{entity:o,length:8}:null}function b(t,e){var n,r,o,a;void 0===e&&(e=" ");var s=new DOMParser;t=y(t);var u=s.parseFromString("<root>"+t+"</root>","application/xml"),c=u.querySelector("parsererror");if(null==c){try{for(var h=l(Array.from(u.querySelectorAll("br"))),p=h.next();!p.done;p=h.next())p.value.textContent=e}catch(v){n={error:v}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var f=Array.from(u.querySelectorAll("p, li"));if(f.length>1){var d=i.without(f,f[f.length-1]);try{for(var g=l(d),m=g.next();!m.done;m=g.next()){var _=m.value,b=document.createElementNS("application/xml","span");b.textContent=e,_.appendChild(b)}}catch(w){o={error:w}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}return u.querySelector("root").textContent}return console.warn("Bad value xmlObject",u,c.innerHTML),function(t){var e=(new DOMParser).parseFromString("<span></span>","application/xml");e.querySelector("span").textContent=t;var n=(new XMLSerializer).serializeToString(e);return n.replace("<span>","").replace("</span>","").replace("<span/>","").replace("<span />","")}(t)}function v(t){var e="<span>"+t+"</span>";return m(e,!1)?(new DOMParser).parseFromString(e,"application/xml").querySelector("span").textContent:t}function w(t){var e,n,r=[];if(t instanceof Array)try{for(var i=l(t),o=i.next();!o.done;o=i.next()){var a=o.value;r.push.apply(r,c(a))}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function C(t){var e=[];if(m(t=y(t),!1))try{null!=t&&function(t,n){var r=(new DOMParser).parseFromString("<body>"+t+"</body>","application/xml"),i={acceptNode:function(t){var e=t.nodeName.toLowerCase();return n.includes(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}};o.b.IsIE()&&(i=function(t){return t.acceptNode}(i));for(var a,s,u=document.createTreeWalker(r.childNodes[0],NodeFilter.SHOW_ELEMENT,i,!1);u.nextNode();)a=u.currentNode,s=void 0,s=function(t){var e,n,r=t.attributes.getNamedItem("style");if(null==r||null==r.value)return null;var i=r.value.split(";"),o=new Map;try{for(var a=l(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(null!=(u=u.trim())&&""!==u){var c=u.split(":"),h=c[0].trim(),p=c[1].trim();o.set(h,p)}}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o}(a),null!=s&&s.has("font-name")&&e.push(s.get("font-name"))}(t,["span","ol","ul"])}catch(n){console.error("Unexpected exception while parsing item text"),console.error(n)}return i.unique(e)}function P(t,e,n){if((s=n,null==s&&(s={}),i.defaults(s,{deep:!1,ignoreNull:!0}),n=s).ignoreNull)for(var r=0;r<e.length;r++){var o=Object(a.a)(e[r]);u(o),e[r]=o}var s;return n.deep?function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=e,o=c(n),a=function(e){for(var n in e)e.hasOwnProperty(n)&&("object"==typeof e[n]&&null!=i[n]?"object"==typeof i[n]?i[n]=t(i[n],e[n]):i=e[n]:i[n]=e[n])},s=0;s<o.length;s++)a(o[s]);return i}.apply(void 0,c([t],e)):Object.assign.apply(Object,c([t],e));function u(t){var e,n;try{for(var r=l(Object.keys(t)),i=r.next();!i.done;i=r.next()){var o=i.value,a=t[o];null===a?t.hasOwnProperty(o)?delete t[o]:t[o]=void 0:"object"==typeof a&&u(a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}}function x(t,e){return P(t,[e],{deep:!0})}function S(t,e){return null==t&&(t={}),i.defaults(t,e),t}function I(t,e){var n=Object.getOwnPropertyNames(t);return n[n.map((function(e){return t[e].toString().toLowerCase()})).indexOf(e.toLowerCase())]}function O(t,e){null==e?e=[]:"string"==typeof e&&(e=[e]);var n=[];for(var r in t)n.push(r);var i=n.filter((function(n){var r,i;try{for(var o=l(["_","$$"]),a=o.next();!a.done;a=o.next()){var s=a.value;if(n.startsWith(s))return!1}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return!e.some((function(t){return t===n}))&&"function"!=typeof t[n]}));return i.reduce((function(e,n){return e[n]=t[n],e}),{})}function T(t,e){return null!=e?e:t}function E(t,e){return void 0!==e?e:t}function L(t,e){var n=null;if("number"!=typeof(n="string"==typeof t&&/%$/.test(t)?e*Number(t.split(/%/)[0])/100:Number(t))||isNaN(n))throw new r.a("'"+t+"' is not a number or percent string");return n}new Map},function(t,e,n){var r;(function(){var n=this,i=n._,o=Array.prototype,a=Object.prototype,s=Function.prototype,l=o.push,u=o.slice,c=a.toString,h=a.hasOwnProperty,p=Array.isArray,f=Object.keys,d=s.bind,g=Object.create,m=function(){},y=function(t){return t instanceof y?t:this instanceof y?void(this._wrapped=t):new y(t)};t.exports&&(e=t.exports=y),e._=y,y.VERSION="1.8.3";var _=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},b=function(t,e,n){return null==t?y.identity:y.isFunction(t)?_(t,e,n):y.isObject(t)?y.matcher(t):y.property(t)};y.iteratee=function(t,e){return b(t,e,1/0)};var v=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var u=a[l];e&&void 0!==n[u]||(n[u]=o[u])}return n}},w=function(t){if(!y.isObject(t))return{};if(g)return g(t);m.prototype=t;var e=new m;return m.prototype=null,e},C=function(t){return function(e){return null==e?void 0:e[t]}},P=Math.pow(2,53)-1,x=C("length"),S=function(t){var e=x(t);return"number"==typeof e&&e>=0&&e<=P};function I(t){return function(e,n,r,i){n=_(n,i,4);var o=!S(e)&&y.keys(e),a=(o||e).length,s=t>0?0:a-1;return arguments.length<3&&(r=e[o?o[s]:s],s+=t),function(e,n,r,i,o,a){for(;o>=0&&o<a;o+=t){var s=i?i[o]:o;r=n(r,e[s],s,e)}return r}(e,n,r,o,s,a)}}y.each=y.forEach=function(t,e,n){var r,i;if(e=_(e,n),S(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=y.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},y.map=y.collect=function(t,e,n){e=b(e,n);for(var r=!S(t)&&y.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o},y.reduce=y.foldl=y.inject=I(1),y.reduceRight=y.foldr=I(-1),y.find=y.detect=function(t,e,n){var r;if(void 0!==(r=S(t)?y.findIndex(t,e,n):y.findKey(t,e,n))&&-1!==r)return t[r]},y.filter=y.select=function(t,e,n){var r=[];return e=b(e,n),y.each(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r},y.reject=function(t,e,n){return y.filter(t,y.negate(b(e)),n)},y.every=y.all=function(t,e,n){e=b(e,n);for(var r=!S(t)&&y.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},y.some=y.any=function(t,e,n){e=b(e,n);for(var r=!S(t)&&y.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},y.contains=y.includes=y.include=function(t,e,n,r){return S(t)||(t=y.values(t)),("number"!=typeof n||r)&&(n=0),y.indexOf(t,e,n)>=0},y.invoke=function(t,e){var n=u.call(arguments,2),r=y.isFunction(e);return y.map(t,(function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)}))},y.pluck=function(t,e){return y.map(t,y.property(e))},y.where=function(t,e){return y.filter(t,y.matcher(e))},y.findWhere=function(t,e){return y.find(t,y.matcher(e))},y.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t)for(var s=0,l=(t=S(t)?t:y.values(t)).length;s<l;s++)(r=t[s])>o&&(o=r);else e=b(e,n),y.each(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o},y.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t)for(var s=0,l=(t=S(t)?t:y.values(t)).length;s<l;s++)(r=t[s])<o&&(o=r);else e=b(e,n),y.each(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o},y.shuffle=function(t){for(var e,n=S(t)?t:y.values(t),r=n.length,i=Array(r),o=0;o<r;o++)(e=y.random(0,o))!==o&&(i[o]=i[e]),i[e]=n[o];return i},y.sample=function(t,e,n){return null==e||n?(S(t)||(t=y.values(t)),t[y.random(t.length-1)]):y.shuffle(t).slice(0,Math.max(0,e))},y.sortBy=function(t,e,n){return e=b(e,n),y.pluck(y.map(t,(function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")};var O=function(t){return function(e,n,r){var i={};return n=b(n,r),y.each(e,(function(r,o){var a=n(r,o,e);t(i,r,a)})),i}};y.groupBy=O((function(t,e,n){y.has(t,n)?t[n].push(e):t[n]=[e]})),y.indexBy=O((function(t,e,n){t[n]=e})),y.countBy=O((function(t,e,n){y.has(t,n)?t[n]++:t[n]=1})),y.toArray=function(t){return t?y.isArray(t)?u.call(t):S(t)?y.map(t,y.identity):y.values(t):[]},y.size=function(t){return null==t?0:S(t)?t.length:y.keys(t).length},y.partition=function(t,e,n){e=b(e,n);var r=[],i=[];return y.each(t,(function(t,n,o){(e(t,n,o)?r:i).push(t)})),[r,i]},y.first=y.head=y.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:y.initial(t,t.length-e)},y.initial=function(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},y.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:y.rest(t,Math.max(0,t.length-e))},y.rest=y.tail=y.drop=function(t,e,n){return u.call(t,null==e||n?1:e)},y.compact=function(t){return y.filter(t,y.identity)};var T=function(t,e,n,r){for(var i=[],o=0,a=r||0,s=x(t);a<s;a++){var l=t[a];if(S(l)&&(y.isArray(l)||y.isArguments(l))){e||(l=T(l,e,n));var u=0,c=l.length;for(i.length+=c;u<c;)i[o++]=l[u++]}else n||(i[o++]=l)}return i};function E(t){return function(e,n,r){n=b(n,r);for(var i=x(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function L(t,e,n){return function(r,i,o){var a=0,s=x(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),y.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}}y.flatten=function(t,e){return T(t,e,!1)},y.without=function(t){return y.difference(t,u.call(arguments,1))},y.uniq=y.unique=function(t,e,n,r){y.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=b(n,r));for(var i=[],o=[],a=0,s=x(t);a<s;a++){var l=t[a],u=n?n(l,a,t):l;e?(a&&o===u||i.push(l),o=u):n?y.contains(o,u)||(o.push(u),i.push(l)):y.contains(i,l)||i.push(l)}return i},y.union=function(){return y.uniq(T(arguments,!0,!0))},y.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=x(t);r<i;r++){var o=t[r];if(!y.contains(e,o)){for(var a=1;a<n&&y.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},y.difference=function(t){var e=T(arguments,!0,!0,1);return y.filter(t,(function(t){return!y.contains(e,t)}))},y.zip=function(){return y.unzip(arguments)},y.unzip=function(t){for(var e=t&&y.max(t,x).length||0,n=Array(e),r=0;r<e;r++)n[r]=y.pluck(t,r);return n},y.object=function(t,e){for(var n={},r=0,i=x(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},y.findIndex=E(1),y.findLastIndex=E(-1),y.sortedIndex=function(t,e,n,r){for(var i=(n=b(n,r,1))(e),o=0,a=x(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o},y.indexOf=L(1,y.findIndex,y.sortedIndex),y.lastIndexOf=L(-1,y.findLastIndex),y.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var R=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=w(t.prototype),a=t.apply(o,i);return y.isObject(a)?a:o};y.bind=function(t,e){if(d&&t.bind===d)return d.apply(t,u.call(arguments,1));if(!y.isFunction(t))throw new TypeError("Bind must be called on a function");var n=u.call(arguments,2),r=function(){return R(t,r,e,this,n.concat(u.call(arguments)))};return r},y.partial=function(t){var e=u.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=e[a]===y?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return R(t,n,this,this,o)};return n},y.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)t[n=arguments[e]]=y.bind(t[n],t);return t},y.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return y.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},y.delay=function(t,e){var n=u.call(arguments,2);return setTimeout((function(){return t.apply(null,n)}),e)},y.defer=y.partial(y.delay,y,1),y.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var l=function(){s=!1===n.leading?0:y.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var u=y.now();s||!1!==n.leading||(s=u);var c=e-(u-s);return r=this,i=arguments,c<=0||c>e?(a&&(clearTimeout(a),a=null),s=u,o=t.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}},y.debounce=function(t,e,n){var r,i,o,a,s,l=function(){var u=y.now()-a;u<e&&u>=0?r=setTimeout(l,e-u):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=y.now();var u=n&&!r;return r||(r=setTimeout(l,e)),u&&(s=t.apply(o,i),o=i=null),s}},y.wrap=function(t,e){return y.partial(e,t)},y.negate=function(t){return function(){return!t.apply(this,arguments)}},y.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},y.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},y.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},y.once=y.partial(y.before,2);var k=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function A(t,e){var n=j.length,r=t.constructor,i=y.isFunction(r)&&r.prototype||a,o="constructor";for(y.has(t,o)&&!y.contains(e,o)&&e.push(o);n--;)(o=j[n])in t&&t[o]!==i[o]&&!y.contains(e,o)&&e.push(o)}y.keys=function(t){if(!y.isObject(t))return[];if(f)return f(t);var e=[];for(var n in t)y.has(t,n)&&e.push(n);return k&&A(t,e),e},y.allKeys=function(t){if(!y.isObject(t))return[];var e=[];for(var n in t)e.push(n);return k&&A(t,e),e},y.values=function(t){for(var e=y.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},y.mapObject=function(t,e,n){e=b(e,n);for(var r,i=y.keys(t),o=i.length,a={},s=0;s<o;s++)a[r=i[s]]=e(t[r],r,t);return a},y.pairs=function(t){for(var e=y.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},y.invert=function(t){for(var e={},n=y.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},y.functions=y.methods=function(t){var e=[];for(var n in t)y.isFunction(t[n])&&e.push(n);return e.sort()},y.extend=v(y.allKeys),y.extendOwn=y.assign=v(y.keys),y.findKey=function(t,e,n){e=b(e,n);for(var r,i=y.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r},y.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;y.isFunction(e)?(i=y.allKeys(a),r=_(e,n)):(i=T(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,l=i.length;s<l;s++){var u=i[s],c=a[u];r(c,u,a)&&(o[u]=c)}return o},y.omit=function(t,e,n){if(y.isFunction(e))e=y.negate(e);else{var r=y.map(T(arguments,!1,!1,1),String);e=function(t,e){return!y.contains(r,e)}}return y.pick(t,e,n)},y.defaults=v(y.allKeys,!0),y.create=function(t,e){var n=w(t);return e&&y.extendOwn(n,e),n},y.clone=function(t){return y.isObject(t)?y.isArray(t)?t.slice():y.extend({},t):t},y.tap=function(t,e){return e(t),t},y.isMatch=function(t,e){var n=y.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var F=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof y&&(t=t._wrapped),e instanceof y&&(e=e._wrapped);var i=c.call(t);if(i!==c.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(y.isFunction(a)&&a instanceof a&&y.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!F(t[l],e[l],n,r))return!1}else{var u,h=y.keys(t);if(l=h.length,y.keys(e).length!==l)return!1;for(;l--;)if(u=h[l],!y.has(e,u)||!F(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0};y.isEqual=function(t,e){return F(t,e)},y.isEmpty=function(t){return null==t||(S(t)&&(y.isArray(t)||y.isString(t)||y.isArguments(t))?0===t.length:0===y.keys(t).length)},y.isElement=function(t){return!(!t||1!==t.nodeType)},y.isArray=p||function(t){return"[object Array]"===c.call(t)},y.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},y.each(["Arguments","Function","String","Number","Date","RegExp","Error"],(function(t){y["is"+t]=function(e){return c.call(e)==="[object "+t+"]"}})),y.isArguments(arguments)||(y.isArguments=function(t){return y.has(t,"callee")}),"object"!=typeof Int8Array&&(y.isFunction=function(t){return"function"==typeof t||!1}),y.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},y.isNaN=function(t){return y.isNumber(t)&&t!==+t},y.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===c.call(t)},y.isNull=function(t){return null===t},y.isUndefined=function(t){return void 0===t},y.has=function(t,e){return null!=t&&h.call(t,e)},y.noConflict=function(){return n._=i,this},y.identity=function(t){return t},y.constant=function(t){return function(){return t}},y.noop=function(){},y.property=C,y.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},y.matcher=y.matches=function(t){return t=y.extendOwn({},t),function(e){return y.isMatch(e,t)}},y.times=function(t,e,n){var r=Array(Math.max(0,t));e=_(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},y.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},y.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},M=y.invert(B),N=function(t){var e=function(e){return t[e]},n="(?:"+y.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};y.escape=N(B),y.unescape=N(M),y.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),y.isFunction(r)?r.call(t):r};var z=0;y.uniqueId=function(t){var e=++z+"";return t?t+e:e},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+H[t]};y.template=function(t,e,n){!e&&n&&(e=n),e=y.defaults({},e,y.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(W,U),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var s=function(t){return a.call(this,t,y)},l=e.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},y.chain=function(t){var e=y(t);return e._chain=!0,e};var V=function(t,e){return t._chain?y(e).chain():e};y.mixin=function(t){y.each(y.functions(t),(function(e){var n=y[e]=t[e];y.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),V(this,n.apply(y,t))}}))},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=o[t];y.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],V(this,n)}})),y.each(["concat","join","slice"],(function(t){var e=o[t];y.prototype[t]=function(){return V(this,e.apply(this._wrapped,arguments))}})),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return y}.apply(e,[]))||(t.exports=r)}).call(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(441),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r){var i=t.call(this,r,n)||this;return i._items=e,i}return o(e,t),e}(i.b)},function(t,e,n){"use strict";var r;n.r(e),n.d(e,"CmykColor",(function(){return f})),n.d(e,"Color",(function(){return i.a})),n.d(e,"GrayscaleColor",(function(){return g})),n.d(e,"Ink",(function(){return m})),n.d(e,"Palette",(function(){return y.a})),n.d(e,"ProcessColor",(function(){return h})),n.d(e,"RgbColor",(function(){return b})),n.d(e,"SpotColor",(function(){return w})),n.d(e,"Swatch",(function(){return C.a})),n.d(e,"LabColor",(function(){return x})),n.d(e,"ColorSpace",(function(){return r})),n.d(e,"HsbColor",(function(){return I})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.Grayscale=2]="Grayscale",t[t.Lab=3]="Lab",t[t.Spot=4]="Spot"}(r||(r={}));var i=n(449),o=n(406),a=n(410);function s(t){if(Object(a.l)(t))throw new o.a("Value must be a non-empty string");return t}function l(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=255),"number"!=typeof t)throw new o.a("Value must be a number");if(t<e||t>n)throw new o.a("Value must be in range ["+e+", "+n+"]");return t}var u,c=(u=function(t,e){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},u(t,e)},function(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e,n){void 0===n&&(n=null);var r=t.call(this)||this;return r._alpha=l(e),r._profile=r._validateProfile(n),r}return c(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"profile",{get:function(){return this._profile},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTransparent",{get:function(){return 0===this.alpha},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){if(!t.prototype.equals.call(this,e))return!1;var n=e;return this.profile===n.profile&&this.alpha===n.alpha},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.profile=this.profile,e.alpha=this.alpha,e},e.prototype._validateProfile=function(t){return null!=t?s(t):null},e}(i.a),p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(t){function e(e,n,i,o,a,s){void 0===s&&(s=null);var u=t.call(this,a,s)||this;return u._colorSpace=r.Cmyk,u._c=l(e),u._m=l(n),u._y=l(i),u._k=l(o),u}return p(e,t),Object.defineProperty(e.prototype,"c",{get:function(){return this._c},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this._k},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.c===n.c&&this.m===n.m&&this.y===n.y&&this.k===n.k},e.prototype.clone=function(){return new e(this.c,this.m,this.y,this.k,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.c=this.c,e.m=this.m,e.y=this.y,e.k=this.k,e},e.prototype.toString=function(){return"cmyk(".concat(this._toRelative(this.c)+",",this._toRelative(this.m)+",",this._toRelative(this.y)+",",this._toRelative(this.k)+",",this._toRelative(this.alpha)+")")},e.prototype._toRelative=function(t){return(t/255).toFixed(7)},e}(h),d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e,n,i){void 0===i&&(i=null);var o=t.call(this,n,i)||this;return o._colorSpace=r.Grayscale,o._l=l(e),o}return d(e,t),Object.defineProperty(e.prototype,"l",{get:function(){return this._l},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.l===n.l},e.prototype.clone=function(){return new e(this.l,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e},e}(h),m=function(){function t(t,e,n){void 0===n&&(n=1),this._name=s(t),this._alternativeColor=e,this._solidity=l(n,0,1)}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternativeColor",{get:function(){return this._alternativeColor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"solidity",{get:function(){return this._solidity},enumerable:!0,configurable:!0}),t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.equals=function(t){return this.name===t.name&&this.solidity===t.solidity&&i.a.equals(this.alternativeColor,t.alternativeColor)},t.prototype.clone=function(){return new t(this.name,this.alternativeColor,this.solidity)},t.prototype.getData=function(){var t;return{name:this.name,alternativeColor:null===(t=this.alternativeColor)||void 0===t?void 0:t.getData(),solidity:this.solidity}},t}(),y=n(496),_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e,n,i,o,a){void 0===a&&(a=null);var s=t.call(this,o,a)||this;return s._colorSpace=r.Rgb,s._r=l(e),s._g=l(n),s._b=l(i),s}return _(e,t),Object.defineProperty(e.prototype,"r",{get:function(){return this._r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._g},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.r===n.r&&this.g===n.g&&this.b===n.b},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.r=this.r,e.g=this.g,e.b=this.b,e},e.prototype.toString=function(){if(255===this.alpha)return"rgb("+this.r+","+this.g+","+this.b+")";var t=(this.alpha/255).toFixed(7);return"rgba("+this.r+","+this.g+","+this.b+","+t+")"},e}(h),v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=function(t){function e(e,n,i){void 0===i&&(i=255);var o=t.call(this)||this;return o._colorSpace=r.Spot,o._ink=e,o._tint=l(n),o._alpha=l(i),o}return v(e,t),Object.defineProperty(e.prototype,"ink",{get:function(){return this._ink},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTransparent",{get:function(){return 0===this.alpha},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&m.equals(this.ink,n.ink)&&this.tint===n.tint&&this.alpha===n.alpha},e.prototype.clone=function(){return new e(this.ink.clone(),this.tint,this.alpha)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.ink=this.ink.getData(),e.tint=this.tint,e.alpha=this.alpha,e},e}(i.a),C=n(548),P=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x=function(t){function e(e,n,i,o,a){void 0===a&&(a=null);var s=t.call(this,o,a)||this;return s._colorSpace=r.Lab,s._l=l(e),s._a=l(n,-128,127),s._b=l(i,-128,127),s}return P(e,t),Object.defineProperty(e.prototype,"l",{get:function(){return this._l},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._a},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this.l,this.a,this.b,this.alpha,this.profile)},e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&n.l===this.l&&n.a===this.a&&n.b===this.b},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e.a=this.a,e.b=this.b,e},e}(h),S=n(407),I=function(){function t(t,e,n,r){this._h=l(t,0,1),this._s=l(e,0,1),this._b=l(n,0,1),this._alpha=l(r)}return Object.defineProperty(t.prototype,"h",{get:function(){return this._h},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"s",{get:function(){return this._s},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),t.fromRgb=function(e){var n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=o,l=o,u=o-a,c=0===o?0:u/o;if(o===a)s=0;else{switch(o){case n:s=(r-i)/u+(r<i?6:0);break;case r:s=(i-n)/u+2;break;case i:s=(n-r)/u+4}s/=6}return new t(s,c,l,e.alpha)},t.prototype.toRgb=function(){var t=6*this.h,e=Math.floor(t),n=t-e,r=this.b*(1-this.s),i=this.b*(1-n*this.s),o=this.b*(1-(1-n)*this.s),a=e%6,s=Math.round(255*[this.b,i,r,r,o,this.b][a]),l=Math.round(255*[o,this.b,this.b,i,r,r][a]),u=Math.round(255*[r,r,o,this.b,this.b,i][a]);return new b(s,l,u,this.alpha)},t.prototype.clone=function(){return new t(this.h,this.s,this.b,this.alpha)},t.prototype.decreaseHue=function(t){var e=this.clone();return e._h=Object(S.Clamp)(0,e.h-t,1),e},t.prototype.increaseHue=function(t){var e=this.clone();return e._h=Object(S.Clamp)(0,e.h+t,1),e},t.prototype.desaturate=function(t){var e=this.clone();return e._s=Object(S.Clamp)(0,e.s-t,1),e},t.prototype.saturate=function(t){var e=this.clone();return e._s=Object(S.Clamp)(0,e.s+t,1),e},t.prototype.darken=function(t){var e=this.clone();return e._b=Object(S.Clamp)(0,e.b-t,1),e},t.prototype.lighten=function(t){var e=this.clone();return e._b=Object(S.Clamp)(0,e.b+t,1),e},t.prototype.decreaseAlpha=function(t){var e=this.clone();return e._alpha=Object(S.Clamp)(0,e.alpha-t,255),e},t.prototype.increaseAlpha=function(t){var e=this.clone();return e._alpha=Object(S.Clamp)(0,e.alpha+t,255),e},t}()},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(550);function i(t){return function(e,n){var i=e.constructor.type;null==r.b.data[i]&&(r.b.data[i]={});var a=r.b.data[i];null==a[n]&&(a[n]={type:o(t,e,n),displayName:null!=t&&null!=t.displayName?t.displayName:n,propertyFactory:t.factory,values:null!=t.enumObject?Object.keys(t.enumObject).map((function(e){return t.enumObject[e]})).filter((function(t){return"string"==typeof t})):null,ignore:null==t.ignore||t.ignore})}}var o=function(t,e,n){return null!=t.type?t.type:null!=t.enumObject?"enum":null!=t.factory?t.factory.type:typeof e[n]}},function(t,e,n){"use strict";(function(t){var r=n(814);const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,a=(t=>e=>{const n=i.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),s=t=>(t=t.toLowerCase(),e=>a(e)===t),l=t=>e=>typeof e===t,{isArray:u}=Array,c=l("undefined"),h=s("ArrayBuffer"),p=l("string"),f=l("function"),d=l("number"),g=t=>null!==t&&"object"==typeof t,m=t=>{if("object"!==a(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},y=s("Date"),_=s("File"),b=s("Blob"),v=s("FileList"),w=s("URLSearchParams");function C(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),u(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function P(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,S=t=>!c(t)&&t!==x,I=(t=>e=>t&&e instanceof t)("undefined"!=typeof Uint8Array&&o(Uint8Array)),O=s("HTMLFormElement"),T=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),E=s("RegExp"),L=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};C(n,((n,i)=>{!1!==e(n,i,t)&&(r[i]=n)})),Object.defineProperties(t,r)},R="abcdefghijklmnopqrstuvwxyz",k="0123456789",j={DIGIT:k,ALPHA:R,ALPHA_DIGIT:R+R.toUpperCase()+k};e.a={isArray:u,isArrayBuffer:h,isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||i.call(t)===e||f(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&h(t.buffer),e},isString:p,isNumber:d,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:m,isUndefined:c,isDate:y,isFile:_,isBlob:b,isRegExp:E,isFunction:f,isStream:t=>g(t)&&f(t.pipe),isURLSearchParams:w,isTypedArray:I,isFileList:v,forEach:C,merge:function t(){const{caseless:e}=S(this)&&this||{},n={},r=(r,i)=>{const o=e&&P(n,i)||i;m(n[o])&&m(r)?n[o]=t(n[o],r):m(r)?n[o]=t({},r):u(r)?n[o]=r.slice():n[o]=r};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&C(arguments[i],r);return n},extend:(t,e,n,{allOwnKeys:i}={})=>(C(e,((e,i)=>{n&&f(e)?t[i]=Object(r.a)(e,n):t[i]=e}),{allOwnKeys:i}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,a,s;const l={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],r&&!r(s,t,e)||l[s]||(e[s]=t[s],l[s]=!0);t=!1!==n&&o(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:s,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(u(t))return t;let e=t.length;if(!d(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:O,hasOwnProperty:T,hasOwnProp:T,reduceDescriptors:L,freezeMethods:t=>{L(t,((e,n)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];f(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return u(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:P,global:x,isContextDefined:S,ALPHABET:j,generateString:(t=16,e=j.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=u(t)?[]:{};return C(t,((t,e)=>{const o=n(t,r+1);!c(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)}}}).call(this,n(53))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(407),i=n(406),o=function(){function t(){}return t.drawLine=function(e,n,r,i,o,a,s,l,u){if(void 0===l&&(l=1),void 0===u&&(u=null),!(t.isFullTransparentColor(s)||a<=0||null==l||l<=0)){e.save();try{l&&(e.globalAlpha=e.globalAlpha*l),e.lineWidth=a,e.strokeStyle=s,u&&e.setLineDash(u),e.beginPath(),e.moveTo(n,r),e.lineTo(i,o),e.stroke()}finally{e.restore()}}},t.drawDashedLine=function(e,n,r,i,o,a,s,l,u,c,h){if(void 0===h&&(h=1),a>0&&u>0&&c>0&&(null==h||h>0)){if(e.save(),h&&(e.globalAlpha=e.globalAlpha*h),e.lineWidth=a,i<n){var p=n;n=i,i=p,p=r,r=o,o=p}var f,d=i-n,g=o-r,m=u+c,y=Math.sqrt(d*d+g*g),_=Math.floor(y/m),b=(d/=y/m)*(u/m),v=d*(c/m),w=(g/=y/m)*(u/m),C=g*(c/m),P=n,x=r;if(!t.isFullTransparentColor(s)){for(e.strokeStyle=s,e.beginPath(),e.moveTo(P,x),f=0;f<_;f++)P+=b,x+=w,e.lineTo(P,x),P+=v,x+=C,f+1<_&&e.moveTo(P,x);P+b<=i&&x+w<=o?(e.moveTo(P,x),e.lineTo(P+b,x+w)):(e.moveTo(P,x),e.lineTo(i,o)),e.closePath(),e.stroke()}if(P=n+b,x=r+w,!t.isFullTransparentColor(l)){for(e.strokeStyle=l,e.beginPath(),e.moveTo(P,x),f=0;f<_;f++)P+=v,x+=C,e.lineTo(P,x),P+=b,x+=w,f+1<_&&e.moveTo(P,x);P<i&&x<o&&(e.moveTo(P,x),e.lineTo(i,o)),e.closePath(),e.stroke()}e.restore()}},t.drawPolyline=function(e,n,r,i,o){if(!t.isFullTransparentColor(i)&&r>0&&(null==o||o>0)&&n&&n.length>1){e.save(),o&&(e.globalAlpha=e.globalAlpha*o),e.lineWidth=r,e.strokeStyle=i,e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var a=1,s=n.length;a<s;++a){var l=n[a];e.lineTo(l.x,l.y)}e.stroke(),e.restore()}},t.drawPath=function(e,n,r,i,o,a,s){t.path(e,n,r,i,null,o,a,s,[])},t.fillPath=function(e,n,r,i,o,a){t.path(e,n,r,i,o,0,null,a,[])},t.drawStroke=function(e,n,r,i,o,a,s,l,u){if(!(o<=0)&&(t.path(e,n,r,i,null,o,a,l,u),null!=s&&null!=u&&u.length>0)){var c=u.slice(0);c.unshift(0),c.push(0),t.path(e,n,r,i,null,o,s,l,c)}},t.path=function(e,n,i,o,a,s,l,u,c){var h=null!=l&&!t.isFullTransparentColor(l)&&s>0,p=null!=a&&!t.isFullTransparentColor(a);if((h||p)&&(null==u||u>0)){e.save(),u&&(e.globalAlpha=e.globalAlpha*u);var f=o.toMatrix();if(e.translate(i.x,i.y),e.transform(f.m00,f.m10,f.m01,f.m11,f.m02,f.m12),e.translate(-i.x,-i.y),n instanceof r.Path?n.draw(e):"function"==typeof n.addToContext&&n.addToContext(e),p&&(e.fillStyle=a,e.fill()),h){if(n instanceof r.Path&&!Object(r.EqualsOfFloatNumbers)(o.scaleX,o.scaleY)){e.restore(),e.save(),u&&(e.globalAlpha=u);var d=n.clone();d.transform(o,i),d.draw(e)}else if(s/=o.scaleX,c&&c.length>0)for(var g=0;g<c.length;g++)c[g]/=o.scaleX;e.lineWidth=s,e.strokeStyle=l,e.setLineDash(c),e.stroke()}e.restore()}},t.clipPath=function(t,e){e.draw(t),t.clip()},t.drawImage=function(e,n,i,o,a,s,l,u,c,h){if(void 0===s&&(s=!1),void 0===l&&(l=null),void 0===u&&(u=1),void 0===c&&(c=null),void 0===h&&(h=0),null==u||u>0){if(e.save(),u&&(e.globalAlpha=e.globalAlpha*u),e.translate(i.centerX,i.centerY),e.rotate(Object(r.ConvertDegreeToRadian)(i.angle)),h){var p=h/o,f=h/a;i.width+=2*p,i.height+=2*f}var d=null!=c?c.width:n.naturalWidth||e.canvas.width,g=null!=c?c.height:n.naturalHeight||e.canvas.height,m=null!=o&&0!==o&&null!=a&&0!==a&&Math.abs(d-i.width*o)<1&&Math.abs(g-i.height*a)<1;s||(s=(e.imageSmoothingEnabled||!0===e.msImageSmoothingEnabled)&&Math.abs(i.angle)%90<.01&&m),s&&(e.imageSmoothingEnabled=!1,e.msImageSmoothingEnabled=!1);try{m?(e.scale(1/o,1/a),null!=c?e.drawImage(n,c.left,c.top,c.width,c.height,-i.width*o/2,-i.height*a/2,d,g):e.drawImage(n,-i.width*o/2,-i.height*a/2,d,g),e.scale(o,a)):null!=c?e.drawImage(n,c.left,c.top,c.width,c.height,-i.width/2,-i.height/2,i.width,i.height):e.drawImage(n,-i.width/2,-i.height/2,i.width,i.height),l&&!t.isFullTransparentColor(l)&&(e.fillStyle=l,e.fillRect(-i.width/2,-i.height/2,i.width,i.height))}catch(y){}s&&(e.imageSmoothingEnabled=!0,e.msImageSmoothingEnabled=!0),e.restore()}},t.drawRectangle=function(e,n,r,i,o){t.rectangle(e,n,r,i,null,o)},t.fillRectangle=function(e,n,r,i){t.rectangle(e,n,0,null,r,i)},t.rectangle=function(e,n,i,o,a,s,l){void 0===a&&(a=null),void 0===s&&(s=1),void 0===l&&(l=null);var u=o&&!t.isFullTransparentColor(o)&&i>0,c=a&&!t.isFullTransparentColor(a);(u||c)&&(null==s||s>0)&&(e.save(),s&&(e.globalAlpha=e.globalAlpha*s),e.translate(n.centerX,n.centerY),e.rotate(Object(r.ConvertDegreeToRadian)(n.angle)),c&&(e.fillStyle=a,e.fillRect(-n.width/2,-n.height/2,n.width,n.height)),u&&(null!=l&&e.setLineDash(l),e.lineWidth=i,e.strokeStyle=o,e.strokeRect(-n.width/2,-n.height/2,n.width,n.height)),e.restore())},t.measureText=function(e,n,i,o,a,s,l){void 0===a&&(a=null),void 0===s&&(s=null),void 0===l&&(l=0);var u=s&&!t.isFullTransparentColor(s),c=a&&!t.isFullTransparentColor(a);if(null==u&&null==c)return null;e.save();try{return e.font=o,e.translate(i.x,i.y),e.rotate(Object(r.ConvertDegreeToRadian)(l)),c&&(e.fillStyle=a),u&&(e.strokeStyle=s),e.measureText(n)}finally{e.restore()}},t._drawTextBackground=function(e,n,i,o,a,s,l,u,c,h,p){var f=i-n,d=a-o,g=null;if(p>0){var m=new r.SizeF(p,p);g=[m,m,m,m]}var y=r.Path.roundedRectangle(n-c,o-h,f+2*c,d+2*h,g);t.path(e,y,new r.PointF,new r.Transform,s,u,l,1,[])},t.text=function(e,n,o,a,s,l,u,c,h,p,f,d,g,m,y,_){if(void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=0),void 0===c&&(c=null),void 0===h&&(h="left"),void 0===p&&(p="alphabetic"),void 0===f&&(f=null),void 0===d&&(d=null),void 0===g&&(g=0),void 0===m&&(m=0),void 0===y&&(y=0),void 0===_&&(_=0),null!=f&&"bottom"!=p)throw new i.e("textBaseline = "+p+" is not supported yet");var b=l&&!t.isFullTransparentColor(l),v=s&&!t.isFullTransparentColor(s);if(b||v){e.save(),e.font=a,e.translate(o.x,o.y),e.rotate(Object(r.ConvertDegreeToRadian)(u)),e.textAlign=h,e.textBaseline=p,v&&(e.fillStyle=s),b&&(e.strokeStyle=l);var w=Math.floor(c/e.measureText("x").width),C=this._splitTextToLines(n,w);if(C.length>1&&"bottom"!=p)throw new i.e("textBaseline = "+p+" is not supported yet");var P=e.measureText(""),x=0,S=0;C.forEach((function(t){var n=e.measureText(t);x+=n.actualBoundingBoxAscent,S+=n.actualBoundingBoxDescent,n.width>P.width&&(P=n)}));var I=a.match(/\d+px/),O=I.length>0?+I[0].substring(0,I[0].length-2):P.actualBoundingBoxAscent+P.actualBoundingBoxDescent,T=10*O/7,E=O+T*(C.length-1),L=0;"bottom"===p&&(S=-T/40,x=E-P.actualBoundingBoxDescent,L=-T*(C.length-1)),(f||null!=d&&g>0)&&this._drawTextBackground(e,-P.actualBoundingBoxLeft,P.actualBoundingBoxRight,-x,S,f,d,g,m,y,_),C.forEach((function(t,n){v&&e.fillText(t,0,L+n*T),b&&e.strokeText(t,0,L+n*T)})),e.restore()}},t._splitTextToLines=function(t,e){void 0===e&&(e=null);var n=null;if(e){var r=new RegExp("(?![^\\n]{1,"+e+"}$)([^\\n]{1,"+e+"})\\s","g");n=t.replace(r,"$1\n").split("\n");for(var i=0;i<n.length;i++)if(n[i].length>e){var o=n[i].substring(e);n[i]=n[i].substring(0,e),n.splice(i+1,0,o)}}else n=t.split("\n");return n},t.isFullTransparentColor=function(t){if(!t)return!1;var e=t.A||t.a;return 0===e||!("string"!=typeof t||!(e=/^\s*rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\,\s*(\d{1,}(\.\d{1,})?)\s*\)\s*;{0,1}\s*$/i.exec(t)))&&0===parseFloat(e[1])},t.clearCanvas=function(t,e){void 0===e&&(e=!1),e&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.clearRect(0,0,t.canvas.width,t.canvas.height),e&&t.restore()},t.drawRoundedRectangle=function(t,e,n){t.roundedRectangle(e.left,e.top,e.width,e.height,n)},t}();CanvasRenderingContext2D.prototype.roundedRectangle=function(t,e,n,r,i){var o=2*Math.PI/2,a=2*Math.PI/4;this.beginPath(),this.arc(i+t,i+e,i,-a,o,!0),this.lineTo(t,e+r-i),this.arc(i+t,r-i+e,i,o,a,!0),this.lineTo(t+n-i,e+r),this.arc(t+n-i,e+r-i,i,a,0,!0),this.lineTo(t+n,e+i),this.arc(t+n-i,e+i,i,0,-a,!0),this.lineTo(t+i,e),this.stroke(),this.fill(),this.closePath()}},function(t,e,n){"use strict";var r=n(482);n.d(e,"BlockElement",(function(){return r.a}));var i=n(526);n.d(e,"InlineElement",(function(){return i.a}));var o=n(745);n.d(e,"Br",(function(){return o.a})),n.d(e,"InlineText",(function(){return o.b}));var a=n(746);n.d(e,"ListStyleType",(function(){return a.a})),n.d(e,"NumberFormatType",(function(){return a.b})),n.d(e,"NumberMode",(function(){return a.c})),n.d(e,"ParagraphListStyle",(function(){return a.d})),n.d(e,"ParagraphMetadata",(function(){return a.e}));var s=n(580);n.d(e,"NumericValue",(function(){return s.a})),n.d(e,"Units",(function(){return s.b}));var l=n(581);n.d(e,"Paragraph",(function(){return l.a})),n.d(e,"ParagraphAlignment",(function(){return l.b})),n.d(e,"ParagraphStyle",(function(){return l.c}));var u=n(483);n.d(e,"OpenTypeFeature",(function(){return u.a})),n.d(e,"Span",(function(){return u.b})),n.d(e,"SpanStyle",(function(){return u.c}));var c=n(747);n.d(e,"Text",(function(){return c.a})),n(748)},function(t,e,n){"use strict";n.d(e,"a",(function(){return z}));var r,i=n(410),o=n(512),a=n(478),s=n(408),l=n(435),u=n(511),c=n(406),h=n(445),p=n(457),f=n(411),d=n(426),g=n(432),m=n(465),y=n(605),_=n(413),b=n(468),v=n(428),w=n(407),C=n(489),P=n(480),x=n(471),S=n(519),I=n(456),O=function(){return O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},O.apply(this,arguments)},T=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},E=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},L=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},R=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(L(arguments[e]));return t},k=function(){function t(t,e,n){var r=this;this._productHandler=t,this._canvas=e,this._productThemeManager=n,this._applyToBarcode=function(t,e,n){return T(r,void 0,void 0,(function(){var r;return E(this,(function(i){return this._applyBarcodePermissions(e.barcodePermissions,t.barcodePermissions),this._applyBarcodeOptions(t.barcodeOptions,e.barcodeOptions),null==e.barcodeContent||!t.barcodePermissions.allowChangeBarcodeContent&&n.ignorePermissions||!t.barcodeData.isEmpty||(r=new s.i(e.barcodeContent),t.barcodePermissions.allowChangeBarcodeType&&!n.ignorePermissions&&(r.barcodeFormat=t.barcodeFormat),r.barcodeFormat===s.j.QR_CODE&&r.barcodeSubType===s.m.None&&(r.barcodeSubType=s.m.Url),t.applyBarcodeData(r)),null!=e.color&&(n.ignorePermissions||t.barcodePermissions.allowChangeBarcodeColor)&&(t.color=this._colorParser.parse(e.color)),[2,this._applyToContentItem(t,e,n)]}))}))},this._applyToImage=function(t,e,n){return T(r,void 0,void 0,(function(){var r,i,o;return E(this,(function(a){switch(a.label){case 0:return null==e?[3,3]:(this._applyImagePermissions(e.imagePermissions,t.imagePermissions),t.violationSettings.allowImageQuality=null!==(o=null===(i=e.violationSettings)||void 0===i?void 0:i.allowImageQuality)&&void 0!==o?o:t.violationSettings.allowImageQuality,null==e.imageUrl||!n.ignorePermissions&&!t.imagePermissions.allowChangeImage?[3,2]:((r=this._productHandler.getHandler(t)).canvas=this._canvas,[4,r.loadImage(e.imageUrl,{downloadToServerCache:!0,actualSize:!1,saveAspectRatio:!0})]));case 1:a.sent(),a.label=2;case 2:if(null!=e.overlayEffect&&z.applyOverlayEffect(t,e.overlayEffect),null!=e.overlayColor&&(z.setOverlayEffectColor(t,this._colorParser.parse(e.overlayColor)),console.warn("IImageItemData.overlayColor is deprecated. Use IImageItemData.overlayEffect instead.")),null!=e.effect)switch(e.effect.toLowerCase()){case"none":t.effect=s.I.None;break;case"blackandwhite":t.effect=s.I.BlackAndWhite;break;case"grayscale":t.effect=s.I.Grayscale;break;case"flipvertical":t.effect=s.I.FlipVertical;break;case"fliphorizontal":t.effect=s.I.FlipHorizontal;break;case"colorize":t.effect=s.I.Colorize;break;default:console.error("Unknown image effect:",e.effect)}a.label=3;case 3:return[2,this._applyToContentItem(t,e,n)]}}))}))},this._applyImagePermissions=function(t,e){null!=t&&(e.allowChangeImage=i.a(e.allowChangeImage,t.allowChangeImage),e.allowEditImage=i.a(e.allowEditImage,t.allowEditImage),e.allowKeepOverlayColor=i.a(e.allowKeepOverlayColor,t.allowKeepOverlayColor))},this._applyBarcodePermissions=function(t,e){null!=t&&(e.allowChangeBarcodeType=i.a(e.allowChangeBarcodeType,t.allowChangeBarcodeType),e.allowChangeBarcodeContent=i.a(e.allowChangeBarcodeContent,t.allowChangeBarcodeContent),e.allowChangeBarcodeColor=i.a(e.allowChangeBarcodeColor,t.allowChangeBarcodeColor))},this._updateThemeForItem=function(t){r._productThemeManager.applyToItem(t,r._productThemeManager.currentProductTheme)},this._colorParser=this._canvas.viewer.colorParser}return t.prototype.applyToItem=function(t,e,n){return void 0===n&&(n=null),T(this,void 0,void 0,(function(){var r,i,o;return E(this,(function(a){switch(a.label){case 0:return null==e?[2]:(r=Object.assign({ignorePermissions:!0,changePosition:!1,relativeToPrintArea:!0},n||{}),i=!1,o=function(){return i=!0},t.addPropertyChanged(o),t instanceof s.cb?[4,this._applyToPlaceholderItem(t,e,r)]:[3,2]);case 1:return a.sent(),[3,20];case 2:return t instanceof s.J?[4,this._applyToImage(t,e,r)]:[3,4];case 3:return a.sent(),[3,20];case 4:return t instanceof s.o?[4,this._applyToText(t,e,r)]:[3,6];case 5:return a.sent(),[3,20];case 6:return t instanceof s.k?[4,this._applyToBarcode(t,e,r)]:[3,8];case 7:return a.sent(),[3,20];case 8:return t instanceof s.A?[4,this._applyToEllipse(t,e,r)]:[3,10];case 9:return a.sent(),[3,20];case 10:return t instanceof s.gb?[4,this._applyToRectangle(t,e,r)]:[3,12];case 11:return a.sent(),[3,20];case 12:return t instanceof s.kb?[4,this._applyToShapeItem(t,e,r)]:[3,14];case 13:return a.sent(),[3,20];case 14:return t instanceof s.T?[4,this._applyToLineItem(t,e,r)]:[3,16];case 15:return a.sent(),[3,20];case 16:return t instanceof s.r?[4,this._applyToClipartItem(t,e,r)]:[3,18];case 17:return a.sent(),[3,20];case 18:return t instanceof s.G?[4,this._applyToGroupItem(t,e,r)]:[3,20];case 19:a.sent(),a.label=20;case 20:return t.removePropertyChanged(o),i&&null!=this._productHandler.product&&this._productHandler.product.getAllItems().includes(t)?[4,this._productHandler.getHandler(t).updateAsync()]:[3,22];case 21:a.sent(),this._canvas.redraw(),this._canvas.updateSelection(),a.label=22;case 22:return[2,i]}}))}))},t.prototype._applyToText=function(t,e,n){var r;if(null!=e){if(null!=e.textPermissions&&(t.textPermissions.allowChangeText=i.a(t.textPermissions.allowChangeText,e.textPermissions.allowChangeText),t.textPermissions.allowChangeFont=i.a(t.textPermissions.allowChangeFont,e.textPermissions.allowChangeFont),t.textPermissions.allowChangeFontSize=i.a(t.textPermissions.allowChangeFontSize,e.textPermissions.allowChangeFontSize),t.textPermissions.allowChangeFontColor=i.a(t.textPermissions.allowChangeFontColor,e.textPermissions.allowChangeFontColor),t.textPermissions.allowChangeTextAlignment=i.a(t.textPermissions.allowChangeTextAlignment,e.textPermissions.allowChangeTextAlignment),t.textPermissions.allowChangeTextBIU=i.a(t.textPermissions.allowChangeTextBIU,e.textPermissions.allowChangeTextBIU),t.textPermissions.allowChangeShadow=i.a(t.textPermissions.allowChangeShadow,e.textPermissions.allowChangeShadow),t.textPermissions.allowChangeStroke=i.a(t.textPermissions.allowChangeStroke,e.textPermissions.allowChangeStroke),t.textPermissions.allowTextFormatting=i.a(t.textPermissions.allowTextFormatting,e.textPermissions.allowTextFormatting),t.textPermissions.allowChangeStrokeColor=null!==(r=e.textPermissions.allowChangeStrokeColor)&&void 0!==r?r:t.textPermissions.allowChangeStrokeColor),(t instanceof s.eb||t instanceof s.q||t instanceof s.ab)&&(t.isVertical=i.a(t.isVertical,e.isVertical)),t instanceof s.x||t instanceof s.a||(t.maxLineCount=i.a(t.maxLineCount,e.maxLineCount)),t.maxLineLength=i.a(t.maxLineLength,e.maxLineLength),(t instanceof s.q||t instanceof s.ab)&&(t.wrappingMargin=i.a(t.wrappingMargin,e.wrappingMargin),t.characterLimit=i.a(t.characterLimit,e.characterLimit),null!=e.paragraphSettings)){var o=new s.Z(t.paragraphSettings);o.FirstLineIndent=i.a(o.FirstLineIndent,e.paragraphSettings.firstLineIndent),o.SpaceBefore=i.a(o.SpaceBefore,e.paragraphSettings.spaceBefore),o.SpaceAfter=i.a(o.SpaceAfter,e.paragraphSettings.spaceAfter),o.LeftIndent=i.a(o.LeftIndent,e.paragraphSettings.leftIndent),o.RightIndent=i.a(o.RightIndent,e.paragraphSettings.rightIndent),t.paragraphSettings=o}if(t instanceof s.q){if(null!=e.verticalAlignment)if("string"==typeof e.verticalAlignment)switch(e.verticalAlignment.toLowerCase()){case"top":t.verticalAlignment=s.sb.Top;break;case"center":t.verticalAlignment=s.sb.Center;break;case"bottom":t.verticalAlignment=s.sb.Bottom}else t.verticalAlignment=e.verticalAlignment;var a=this._convertOverflowStrategy(e.overflowStrategy);t.overflowStrategy=i.a(t.overflowStrategy,a),t.shrinkMode=i.a(t.shrinkMode,this._convertShrinkMode(e.textShrinkMode))}t instanceof s.a&&(t.bend=i.a(t.bend,e.bend),t.warp=i.a(t.warp,e.warp))}return this._applyToBaseTextItem(t,e,n)},t.prototype._convertShrinkMode=function(t){if(null==t)return null;if("number"==typeof t)return t;switch(t){case"scale":return s.mb.Scale;case"size":return s.mb.Size;default:throw new c.a("Invalid shrink mode.")}},t.prototype._convertOverflowStrategy=function(t){if(null==t)return null;if("number"==typeof t)return t;switch(t){case"clip":return s.X.Clip;case"fitToWidth":return s.X.FitToWidth;case"fitToBox":return s.X.FitToBox;case"expandBox":return s.X.ExpandBox;default:throw new c.a("Invalid overflow strategy.")}},t.prototype._applyToLineItem=function(t,e,n){null!=e.linePermissions&&(t.linePermissions.allowChangeLineColor=i.a(t.linePermissions.allowChangeLineColor,e.linePermissions.allowChangeLineColor),t.linePermissions.allowChangeLineWidth=i.a(t.linePermissions.allowChangeLineWidth,e.linePermissions.allowChangeLineWidth));var r=this._productHandler.userEditContainer,o=this._productHandler.userEditPrintArea,a=null!=o?o.bounds.center:new w.PointF(50,50),l=null!=r?.4*this._productHandler.getPrintAreaVisualSize(r).width:10;if(n.ignorePermissions||t.linePermissions.allowChangeLineWidth){var u=i.a(t.width,e.width);if(null!=r&&null!=r.region&&this._productHandler.suppressOutOfRegionManipulation){var c=this._calcNewGroupBounds(this._productHandler.selectedItems,u);Object(v.l)(w.RectangleF.intersect(r.region,c),c)&&(t.width=u)}else t.width=u;t.fixedWidth=i.a(t.fixedWidth,e.fixedWidth)}if(n.changePosition&&(null!=e.point0?(t.sourcePoint0.x=i.a(t.sourcePoint0.x,e.point0.x),t.sourcePoint0.y=i.a(t.sourcePoint0.y,e.point0.y)):t.sourcePoint0=new w.PointF(a.x-l/2,a.y),null!=e.point1?(t.sourcePoint1.x=i.a(t.sourcePoint1.x,e.point1.x),t.sourcePoint1.y=i.a(t.sourcePoint1.y,e.point1.y)):t.sourcePoint1=new w.PointF(a.x+l/2,a.y)),null!=e.color&&(n.ignorePermissions||t.linePermissions.allowChangeLineColor)){var h=this._colorParser.parse(e.color);t.color=i.a(t.color,h)}null!=e.overprintStroke&&(t.overprintStroke=e.overprintStroke);var p=this._productHandler.contentAngle;p>0&&t.transform.rotate(-p);var f=t.width+.01,d=null!=r?this._getRotatedRegion(r):null;if(null!=d){d.width-=f,d.height-=f;var g=1,m=this._productHandler.getHandler(t),y=t instanceof s.cb?m.getBoundsIncludingFrames():m.bounds;if(y.width>d.width||y.height>d.height){var _=Object(v.f)(v.a.from(y),v.a.from(d));_.width*=.9,_.height*=.9,g=_.width/y.width}var b=new w.PointF(y.left+y.width/2,y.top+y.height/2),C=b.x-d.left-d.width/2,P=b.y-d.top-d.height/2;t.transform.setScaleX(g*t.transform.scaleX),t.transform.setScaleY(g*t.transform.scaleY),t.transform.setTranslateX(t.transform.translateX-C-(m.getTransformedRectangle().centerX-b.x)*(1-g)),t.transform.setTranslateY(t.transform.translateY-P-(m.getTransformedRectangle().centerY-b.y)*(1-g))}this._applyToItem(t,e,n)},t.prototype._applyToRectangle=function(t,e,n){this._applyToShapeItem(t,e,n)},t.prototype._applyToGroupItem=function(t,e,n){this._applyToItem(t,e,n)},t.prototype._applyToEllipse=function(t,e,n){this._applyToShapeItem(t,e,n)},t.prototype._applyToClipartItem=function(t,e,n){this._applyToItem(t,e,n)},t.prototype._applyBarcodeOptions=function(t,e){var n,r,i,o,a,s,l,u,c,h,p,f;null!=e&&(t.margin=null!==(n=e.margin)&&void 0!==n?n:t.margin,t.pureBarcode=null!==(r=e.pureBarcode)&&void 0!==r?r:t.pureBarcode,t.errorCorrection=null!==(i=e.errorCorrection)&&void 0!==i?i:t.errorCorrection,t.characterSet=null!==(o=e.characterSet)&&void 0!==o?o:t.characterSet,t.pdf417Compact=null!==(a=e.pdf417Compact)&&void 0!==a?a:t.pdf417Compact,t.pdf417Compaction=null!==(s=e.pdf417Compaction)&&void 0!==s?s:t.pdf417Compaction,null!=e.pdf417Dimensions&&(t.pdf417Dimensions=O({},e.pdf417Dimensions)),t.disableEci=null!==(l=e.disableEci)&&void 0!==l?l:t.disableEci,t.code128ForceCodesetB=null!==(u=e.code128ForceCodesetB)&&void 0!==u?u:t.code128ForceCodesetB,t.aztecLayers=null!==(c=e.aztecLayers)&&void 0!==c?c:t.aztecLayers,t.qrVersion=null!==(h=e.qrVersion)&&void 0!==h?h:t.qrVersion,t.xDimension=null!==(p=e.xDimension)&&void 0!==p?p:t.xDimension,t.databarExpandedSegments=null!==(f=e.databarExpandedSegments)&&void 0!==f?f:t.databarExpandedSegments)},t.prototype._applyToPlaceholderItem=function(e,n,r){var o,a,l,u,c,h,p,d,g,m;return T(this,void 0,void 0,(function(){var y,_,b,v,C,P,x,S,I,O,T,L;return E(this,(function(E){switch(E.label){case 0:if(null!=n.placeholderPermissions&&(e.placeholderPermissions.allowEditContent=i.a(e.placeholderPermissions.allowEditContent,n.placeholderPermissions.allowEditContent),e.placeholderPermissions.showSelectButton=i.a(e.placeholderPermissions.showSelectButton,n.placeholderPermissions.showSelectButton),e.placeholderPermissions.showHandleButton=i.a(e.placeholderPermissions.showHandleButton,n.placeholderPermissions.showHandleButton)),null!=(y=n.contentPermissions)&&(null!=(_=y.barcodePermissions)&&((b=e.contentPermissions.barcodePermissions).allowChangeBarcodeColor=null!==(o=_.allowChangeBarcodeColor)&&void 0!==o?o:b.allowChangeBarcodeColor,b.allowChangeBarcodeContent=null!==(a=_.allowChangeBarcodeContent)&&void 0!==a?a:b.allowChangeBarcodeContent,b.allowChangeBarcodeType=null!==(l=_.allowChangeBarcodeType)&&void 0!==l?l:b.allowChangeBarcodeType),null!=(v=y.imagePermissions)&&((C=e.contentPermissions.imagePermissions).allowChangeImage=null!==(u=v.allowChangeImage)&&void 0!==u?u:C.allowChangeImage,C.allowEditImage=null!==(c=v.allowEditImage)&&void 0!==c?c:C.allowEditImage,C.allowKeepOverlayColor=null!==(h=v.allowKeepOverlayColor)&&void 0!==h?h:C.allowKeepOverlayColor)),e.violationSettings.allowImageQuality=null!==(d=null===(p=n.violationSettings)||void 0===p?void 0:p.allowImageQuality)&&void 0!==d?d:e.violationSettings.allowImageQuality,null!=n.contentResizeMode)switch(n.contentResizeMode.toLowerCase()){case"original":e.contentResizeMode=s.ib.Original;break;case"fill":e.contentResizeMode=s.ib.Fill;break;case"fit":e.contentResizeMode=s.ib.Fit}return e.isStubContent=i.a(e.isStubContent,n.isStubContent),e.allowedSubfolder=i.a(e.allowedSubfolder,n.allowedSubfolder),e.allowedTabs=i.a(e.allowedTabs,n.allowedTabs),e.isVariable=i.a(e.isVariable,n.isVariable),e.isCoverMode=i.a(e.isCoverMode,n.isCoverMode),e.fixedStubContentSize=i.a(e.fixedStubContentSize,n.fixedStubContentSize),P=null!==(g=n.barcodeFormat)&&void 0!==g?g:null===(m=n.barcodeContent)||void 0===m?void 0:m.barcodeFormat,e.barcodeFormat=i.a(e.barcodeFormat,P),null==e.content&&(x=void 0,null!=n.contentImageUrl?x=new s.J:e.isBarcodePlaceholder&&(S=t.getBarcodeRatio(e.barcodeFormat),x=new s.k(null,null,null,new w.RectangleF(0,0,S.width,S.height))),e.content=x),null==e.content?[3,5]:((I=f.clone(r)).changePosition=!1,null!=n.contentOverlayEffect&&z.applyOverlayEffect(e,n.contentOverlayEffect),e.content instanceof s.J?(O={imageUrl:n.contentImageUrl,imagePermissions:e.contentPermissions.imagePermissions,overlayEffect:n.contentOverlayEffect},[4,this._applyToImage(e.content,O,I)]):[3,2]);case 1:return E.sent(),[3,4];case 2:return e.content instanceof s.k?[4,this._applyToBarcode(e.content,{barcodeContent:n.barcodeContent||{barcodeFormat:e.barcodeFormat,barcodeValue:""},barcodePermissions:e.contentPermissions.barcodePermissions,barcodeOptions:n.contentBarcodeOptions,color:n.contentBarcodeColor},I)]:[3,4];case 3:E.sent(),e.barcodeFormat=e.content.barcodeFormat,e.shapePermissions.allowChangeFillColor=!0,E.label=4;case 4:null==e.barcodeFormat&&(e.imageContent.allowedSubfolder=e.allowedSubfolder,e.imageContent.allowedTabs=e.allowedTabs),E.label=5;case 5:return this._applyToShapeItem(e,n,r),null==n.contentImageUrl&&null==e.barcodeFormat?[2]:[4,(T=this._productHandler.getHandler(e.content)).waitUpdate()];case 6:return E.sent(),L=this._productHandler.getHandler(e),T.updateRectangle(!1,e.contentResizeMode,L),[2]}}))}))},t.prototype._applyToContentItem=function(t,e,n){return null!=e&&(t.isVariable=i.a(t.isVariable,e.isVariable),t.maskOpacity=i.a(t.maskOpacity,e.maskOpacity)),this._applyToShapeItem(t,e,n)},t.prototype._applyToShapeItem=function(t,e,n){var r,o;if(void 0===e&&(e=null),null!=e){if(null!=e.shapePermissions&&(t.shapePermissions.allowChangeBorderColor=i.a(t.shapePermissions.allowChangeBorderColor,e.shapePermissions.allowChangeBorderColor),t.shapePermissions.allowChangeBorderWidth=i.a(t.shapePermissions.allowChangeBorderWidth,e.shapePermissions.allowChangeBorderWidth),t.shapePermissions.allowChangeFillColor=i.a(t.shapePermissions.allowChangeFillColor,e.shapePermissions.allowChangeFillColor)),t.violationSettings.allowShape=null!==(o=null===(r=e.violationSettings)||void 0===r?void 0:r.allowShape)&&void 0!==o?o:t.violationSettings.allowShape,n.ignorePermissions||t.shapePermissions.allowChangeBorderWidth){var a=null!=t.parentContainer?t.parentContainer:this._productHandler.userEditContainer,l=i.a(t.borderWidth,e.borderWidth);if(null!=a&&null!=a.region&&this._productHandler.suppressOutOfRegionManipulation){var u=this._calcNewGroupBounds(this._productHandler.selectedItems,l);Object(v.l)(w.RectangleF.intersect(a.region,u),u)&&(t.borderWidth=l)}else t.borderWidth=l}if(null!=e.borderColor&&(n.ignorePermissions||t.shapePermissions.allowChangeBorderColor)&&(t.borderColor=this._colorParser.parse(e.borderColor)),null!=e.fillColor&&(n.ignorePermissions||t.shapePermissions.allowChangeFillColor)){var c=this._colorParser.parse(e.fillColor);t instanceof s.cb&&t.isBarcodePlaceholder?t.content.fillColor=c:t.fillColor=c}null!=e.overprintFill&&(t.overprintFill=e.overprintFill),null!=e.overprintStroke&&(t.overprintStroke=e.overprintStroke)}this._applyToItem(t,e,n)},t.prototype._applyToBaseTextItem=function(e,n,r){var o,a,l,u,c,h,p;if(null!=n){if((r.ignorePermissions||e.textPermissions.allowChangeText)&&(e.text=i.a(e.text,n.text)),(r.ignorePermissions||e.textPermissions.allowChangeTextBIU)&&(e.underline=i.a(e.underline,n.underline)),e.violationSettings.allowTextCrop=null!==(a=null===(o=n.violationSettings)||void 0===o?void 0:o.allowTextCrop)&&void 0!==a?a:e.violationSettings.allowTextCrop,e.violationSettings.allowInPlaceText=null!==(u=null===(l=n.violationSettings)||void 0===l?void 0:l.allowInPlaceText)&&void 0!==u?u:e.violationSettings.allowInPlaceText,e.tracking=i.a(e.tracking,n.tracking),null!=n.previewLeading?e.previewLeading=i.a(e.previewLeading,n.previewLeading):e.leading=i.a(e.leading,n.leading),(r.ignorePermissions||e.textPermissions.allowChangeTextAlignment)&&(e.alignment=i.a(e.alignment,n.alignment)),e.horizontalScale=i.a(e.horizontalScale,n.horizontalScale),e.verticalScale=i.a(e.verticalScale,n.verticalScale),e.previewScale=i.a(e.previewScale,n.previewScale),e.overlapLinesEnabled=i.a(e.overlapLinesEnabled,n.overlapLinesEnabled),e.checkTextCrop=i.a(e.checkTextCrop,n.checkTextCrop),e.isVariable=null!==(c=n.isVariable)&&void 0!==c?c:e.isVariable,null!=n.color&&(r.ignorePermissions||e.textPermissions.allowChangeFontColor)){var f=this._colorParser.parse(n.color);e.color=i.a(e.color,f)}if(null!=n.font){if((r.ignorePermissions||e.textPermissions.allowChangeTextBIU)&&(e.font.fauxBold=i.a(e.font.fauxBold,n.font.fauxBold),e.font.fauxItalic=i.a(e.font.fauxItalic,n.font.fauxItalic)),(r.ignorePermissions||e.textPermissions.allowChangeFont)&&(e.font.postScriptName=i.a(e.font.postScriptName,n.font.postScriptName)),r.ignorePermissions||e.textPermissions.allowChangeFontSize)if(null!=n.font.previewSize){var d=t.parseItemsDataValueRelativeToHeight(n.font.previewSize,this._productHandler,r.relativeToPrintArea),g=i.a(e.previewFontSize,d),m=e.previewFontSize;if(e.previewFontSize=g,e instanceof s.x){var y=this._productHandler.getHandler(e).getTransformedRectangle().location,_=g/m,b=new I.a(_,_,0,0,0);e.textPath.transform(b,y)}}else if(null!=(null===(h=n.font)||void 0===h?void 0:h.size)){var v=t.parseItemsDataValueRelativeToHeight(n.font.size,this._productHandler,r.relativeToPrintArea);e.font.size=i.a(e.font.size,v)}e.font.allCaps=i.a(e.font.allCaps,n.font.allCaps)}void 0!==n.stroke&&(r.ignorePermissions||e.textPermissions.allowChangeStroke)&&(null==n.stroke?e.stroke=null:(null==e.stroke&&(e.stroke=new s.pb),e.stroke.size=null!==(p=n.stroke.size)&&void 0!==p?p:e.stroke.size,(r.ignorePermissions||e.textPermissions.allowChangeStrokeColor)&&(f=this._colorParser.parse(n.stroke.color||"#00ffff"),e.stroke.color=f))),void 0!==n.shadow&&(r.ignorePermissions||e.textPermissions.allowChangeShadow)&&(null==n.shadow?e.shadow=null:(f=this._colorParser.parse(n.shadow.color||"#00ffff"),e.shadow=new s.jb({size:n.shadow.size,distance:n.shadow.distance,angle:n.shadow.angle,color:f}))),null!=n.overprintText&&(e.overprintText=n.overprintText)}this._applyToShapeItem(e,n,r)},t.prototype._applyToItem=function(t,e,n){var r,o,a,l,u,c,h,p,f,d,g,m=this;if(null!=e){if(null!=e.manipulationPermissions){var y=e.manipulationPermissions,_=t.manipulationPermissions;_.resizeGrips.corner=i.a(_.resizeGrips.corner,y.resizeGrips.corner),_.resizeGrips.edge=i.a(_.resizeGrips.edge,y.resizeGrips.edge),_.allowDelete=i.a(_.allowDelete,y.allowDelete),_.allowMoveHorizontal=i.a(_.allowMoveHorizontal,y.allowMoveHorizontal),_.allowMoveVertical=i.a(_.allowMoveVertical,y.allowMoveVertical),_.allowRotate=i.a(_.allowRotate,y.allowRotate),_.allowDragAndDrop=i.a(_.allowDragAndDrop,y.allowDragAndDrop)}null!=e.visualizationPermissions&&(t.visualizationPermissions.noPrint=i.a(t.visualizationPermissions.noPrint,e.visualizationPermissions.noPrint),t.visualizationPermissions.noShow=i.a(t.visualizationPermissions.noShow,e.visualizationPermissions.noShow));var b=e.itemPermissions;if(null!=b){t.itemPermissions.allowOpacityChange=i.a(t.itemPermissions.allowOpacityChange,b.allowOpacityChange),t.itemPermissions.allowZOrderChange=i.a(t.itemPermissions.allowZOrderChange,b.allowZOrderChange);var v=b.itemToolbarPermissions;if(null!=v){var w=t.itemPermissions.itemToolbarPermissions;w.showHandleButton=null!==(r=v.showHandleButton)&&void 0!==r?r:w.showHandleButton,w.showEditButton=null!==(o=v.showEditButton)&&void 0!==o?o:w.showEditButton,w.showSelectButton=null!==(a=v.showSelectButton)&&void 0!==a?a:w.showSelectButton,w.showDeleteButton=null!==(l=v.showDeleteButton)&&void 0!==l?l:w.showDeleteButton}t.itemPermissions.allowRemoveOnLayoutChange=i.a(t.itemPermissions.allowRemoveOnLayoutChange,b.allowRemoveOnLayoutChange)}if(t.violationSettings.allowBleedArea=null!==(c=null===(u=e.violationSettings)||void 0===u?void 0:u.allowBleedArea)&&void 0!==c?c:t.violationSettings.allowBleedArea,t.violationSettings.allowRegion=null!==(p=null===(h=e.violationSettings)||void 0===h?void 0:h.allowRegion)&&void 0!==p?p:t.violationSettings.allowRegion,t.violationSettings.allowSafetyLines=null!==(d=null===(f=e.violationSettings)||void 0===f?void 0:f.allowSafetyLines)&&void 0!==d?d:t.violationSettings.allowSafetyLines,null!=e.textWrappingMode)switch(e.textWrappingMode.toLowerCase()){case"none":t.textWrappingMode=s.wb.None;break;case"square":t.textWrappingMode=s.wb.Square;break;case"tight":t.textWrappingMode=s.wb.Tight;break;default:console.error("Unknown textWrappingMode:",e.textWrappingMode)}if((n.ignorePermissions||t.itemPermissions.allowOpacityChange)&&(t.opacity=i.a(t.opacity,e.opacity),t instanceof s.cb&&t.updateContentAndFrames((function(t){return t.opacity=i.a(t.opacity,e.opacity)}))),t.name=i.a(t.name,e.name),null!=e.blendMode){var C=null!==(g=i.j(s.p,e.blendMode))&&void 0!==g?g:s.p.Normal;t.blendMode=C}null!=e.themeBinding&&(t.themeBinding.text=i.b(t.themeBinding.text,e.themeBinding.text),t.themeBinding.stroke=i.b(t.themeBinding.stroke,e.themeBinding.stroke),t.themeBinding.shadow=i.b(t.themeBinding.shadow,e.themeBinding.shadow),t.themeBinding.img=i.b(t.themeBinding.img,e.themeBinding.img),t.themeBinding.border=i.b(t.themeBinding.border,e.themeBinding.border),t.themeBinding.fill=i.b(t.themeBinding.fill,e.themeBinding.fill),t.themeBinding.textFill=i.b(t.themeBinding.textFill,e.themeBinding.textFill),t.themeBinding.barcode=i.b(t.themeBinding.barcode,e.themeBinding.barcode),t.themeBinding.line=i.b(t.themeBinding.line,e.themeBinding.line),null!=e.themeBinding.styles&&(t.themeBinding.styles=R(t.themeBinding.styles||[],e.themeBinding.styles)),this._updateThemeForItem(t))}if(n.changePosition&&!(t instanceof s.u&&null!=t.parentPlaceholder))if(t instanceof s.o&&""!==t.text.trim()){var P=function(){t.getItemChangedEvent().remove(P),m._applyPositionAndSize(t,e,n.relativeToPrintArea)};if(t instanceof s.q){var x=e;null==x.width&&null==x.height?t.scheduledFitMode=s.D.ShrinkOrStretchToContent:null==x.height?t.scheduledFitMode=s.D.ShrinkOrStretchToContentHeight:null==x.width&&(t.scheduledFitMode=s.D.ShrinkOrStretchToContentWidth)}t instanceof s.q&&null==t.scheduledFitMode||t instanceof s.ab?this._applyPositionAndSize(t,e,n.relativeToPrintArea):t.getItemChangedEvent().add(P)}else this._applyPositionAndSize(t,e,n.relativeToPrintArea)},t.prototype._applyPositionAndSize=function(e,n,r){var o;if(!(e instanceof s.T)){var a,l,u=t._getTargetBounds(this._productHandler,r),c=t._getVisualSize(this._productHandler,u),h=this._productHandler.contentAngle,p=i.o(null!=n&&null!=n.width?n.width:"50%",c.width),f=i.o(null!=n&&null!=n.height?n.height:"50%",c.height),d=this._productHandler.getHandler(e),g=d.getTransformedRectangle(!1),m=g.angle-h+(null!==(o=n.angle)&&void 0!==o?o:0);if(e instanceof s.eb||e instanceof s.a)a=g.width,l=g.height;else if(e.type===s.kb.type)if(g.width<c.width&&g.height<c.height)a=g.width,l=g.height;else{var y=2*d.getBorderMargin(),_=window.Math.min(c.width/(g.width+y),c.height/(g.height+y));a=g.width*_,l=g.height*_}else e instanceof s.q?(a=null!=n&&null!=n.width?p:g.width,l=null!=n&&null!=n.height?f:g.height):(a=!1===n.adjustSize?c.width:p,l=!1===n.adjustSize?c.height:f);if(null!=this._productHandler.regionForCurrentContainer&&(_=window.Math.min(.9*c.width/a,.9*c.height/l))<1&&(a*=_,l*=_),e instanceof s.k&&e.barcodeFormat!==s.j.DATABAR_EXPANDED_STACKED){var b=Object(v.f)(t.getBarcodeRatio(e.barcodeFormat),new s.nb(p,f));a=b.width,l=b.height}else if(e instanceof s.J||e instanceof s.cb&&!e.isEmptyContent&&null==e.barcodeFormat){if(null==n.width&&null==n.height&&!(e instanceof s.k)){var C=(P=this._getOriginalImageSize(e)).width<c.width&&P.height<c.height;a=C?P.width:c.width,l=C?P.height:c.height}var P,x=this._getImageSource(e);_=Math.min(a/x.width,l/x.height),a=x.width*_,l=x.height*_,!1===n.adjustSize&&(x.dpiX=this._canvas.targetDpi,x.dpiY=this._canvas.targetDpi,a=(P=this._getOriginalImageSize(e)).width,l=P.height)}else if(e instanceof s.G){var I=d.rectangle;_=Math.min(a/I.width,l/I.height),a=I.width*_,l=I.height*_}var O=u.width/2,T=u.height/2,E=null!=n&&null!=n.location&&null!=n.location.x?n.location.x:O,L=null!=n&&null!=n.location&&null!=n.location.y?n.location.y:T,R=i.o(E,u.width),k=i.o(L,u.height);90!==h&&180!==h||(k=u.height-k),180!==h&&270!==h||(R=u.width-R);var j=(null!=n&&null!=n.location?n.location.originX:null)||S.a.Center,A=(null!=n&&null!=n.location?n.location.originY:null)||S.a.Center;switch(j.toLowerCase()){case S.a.Left:O=R;break;case S.a.Right:0===h?O=R-a:90===h?O=R-l:180===h?O=R+a:270===h&&(O=R+l);break;case S.a.Center:0===h?O=R-a/2:90===h?O=R-l/2:180===h?O=R+a/2:270===h&&(O=R+l/2)}switch(A.toLowerCase()){case S.a.Top:T=k;break;case S.a.Bottom:0===h?T=k-l:90===h?T=k+a:180===h?T=k+l:270===h&&(T=k-a);break;case S.a.Center:0===h?T=k-l/2:90===h?T=k+a/2:180===h?T=k+l/2:270===h&&(T=k-a/2)}O+=u.left,T+=u.top;var F=new w.RotatedRectangleF(0,0,a,l);if(F.angle=m,F.location=new w.PointF(O,T),e instanceof s.o)if(e instanceof s.q&&null!=n&&e.overflowStrategy===s.X.Clip&&(null==n.width&&null==n.height?e.scheduledFitMode=s.D.ShrinkOrStretchToContent:null==n.height?e.scheduledFitMode=s.D.ShrinkOrStretchToContentHeight:null==n.width&&(e.scheduledFitMode=s.D.ShrinkOrStretchToContentWidth)),e instanceof s.q||e instanceof s.ab){var B=F.toRectangleF(),M=w.Path.rectangle(B.left,B.top,B.width,B.height);e.sourcePath=M,e.sourceRectangle=B.clone(),e instanceof s.q?e.textRectangle=B:e.boundingPaths=[M]}else d.setTransformedRectangle(F);else{if(e instanceof s.cb||e instanceof s.u){var N=F.toRectangleF();e.sourceRectangle=N,e.sourcePath=w.Path.rectangle(N.left,N.top,N.width,N.height)}d.setTransformedRectangle(F)}this._productHandler.getHandler(e).update()}},t.prototype._getOriginalImageSize=function(t){return t instanceof s.J?t.getOriginalImageSize():null!=t.content&&t.content instanceof s.J?t.content.getOriginalImageSize():null},t._getTargetBounds=function(t,e){return e?t.getPrintAreaBounds():new w.RectangleF(0,0,t.currentSurface.width,t.currentSurface.height)},t._getVisualSize=function(t,e){return t.getVisualSize(e)},t.prototype._getImageSource=function(t){return t instanceof s.J?t.source:t.content.source},t.prototype._getRotatedRegion=function(t){if(null==t.region)return null;var e=this._productHandler.userEditPrintArea.bounds,n=w.RectangleF.FromObject(t.region),r=this._productHandler.contentAngle;if(r>0){var i=w.RotatedRectangleF.fromRectangleF(n),o=e.center;i.rotateAt(r,o),n=i.bounds}return n},t.prototype._calcNewGroupBounds=function(t,e){var n,r,i=this,o=t.map((function(t){return t.clone()})).map((function(t){return i._productHandler.getHandler(t)}));try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),s=a.next();!s.done;s=a.next()){var l=s.value;l instanceof g.n?l.item.borderWidth=e:l.width=e}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var u=o.map((function(t){return t.bounds}));return w.RectangleF.FromLTRB(Math.min.apply(Math,R(u.map((function(t){return t.left})))),Math.min.apply(Math,R(u.map((function(t){return t.top})))),Math.max.apply(Math,R(u.map((function(t){return t.right})))),Math.max.apply(Math,R(u.map((function(t){return t.bottom})))))},t.getBarcodeRatio=function(t){return t===s.j.IMB?new s.nb(744,49):t===s.j.QR_CODE||t===s.j.AZTEC||t===s.j.DATA_MATRIX?new s.nb(1,1):new s.nb(2.5,1)},t.parseItemsDataValueRelativeToHeight=function(e,n,r){if("number"==typeof e)return e;var o=t._getTargetBounds(n,r),a=t._getVisualSize(n,o);return i.o(e,a.height)},t}(),j=n(463),A=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},F=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},B=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},M=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(B(arguments[e]));return t},N=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},z=function(){function t(){}return Object.defineProperty(t,"designAtomsApiClient",{set:function(t){this._designAtomsApiClient=t},enumerable:!0,configurable:!0}),t.isBgContainerItem=function(t){if(t.parentContainer instanceof p.d)return t.parentContainer instanceof p.d&&i.p(t.parentContainer.name,h.a.BG_CONTAINER_NAME,!0)},t.isFgContainerItem=function(t){return t.parentContainer instanceof p.d&&i.p(t.parentContainer.name,h.a.FG_CONTAINER_NAME,!0)},t.isImage=function(e){return(e instanceof a.a||e instanceof o.b)&&!t.isBgContainerItem(e)},t.isEmptyPlaceholder=function(t){return t instanceof o.b&&t.isStubOrEmpty},t.isDataMatrixBarcode=function(t){return t instanceof s.k&&t.barcodeFormat===s.j.DATA_MATRIX||t instanceof o.b&&t.barcodeFormat==s.j.DATA_MATRIX},t.isQrCode=function(t){return t instanceof s.k&&t.isQrCode||t instanceof o.b&&t.barcodeFormat==s.j.QR_CODE},t.isLinearBarcode=function(t){return t instanceof s.k&&t.isLinearBarcode||t instanceof o.b&&(t.barcodeFormat==s.j.EAN_13||t.barcodeFormat==s.j.EAN_8||t.barcodeFormat==s.j.UPC_A||t.barcodeFormat==s.j.UPC_E||t.barcodeFormat==s.j.CODE_128)},t.isVariableItem=function(t){return t.canSetIsVariable()},t.isMultiValueItem=function(t){return(t instanceof a.a||t instanceof l.a)&&0!==t.values.length},t.isTextType=function(t){return t===l.a||l.a.prototype.isPrototypeOf(t.prototype)},t.getAllowTextFormatting=function(t,e){var n,r,i;return!(null!=t&&t instanceof s.q&&t.overflowStrategy!==s.X.Clip&&t.overflowStrategy!==s.X.ExpandBox)&&(null!==(i=null!==(r=null===(n=null==t?void 0:t.textPermissions)||void 0===n?void 0:n.allowTextFormatting)&&void 0!==r?r:e)&&void 0!==i?i:t instanceof s.q||t instanceof s.ab)},t.allowMoveHorizontal=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveHorizontal)},t.allowMoveVertical=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveVertical)},t.allowManipulate=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveVertical||t.manipulationPermissions.allowMoveHorizontal||t.manipulationPermissions.allowDelete||t.manipulationPermissions.allowRotate)},t.clearImageContent=function(t){if(null!=t){var e=t.content;delete e.tags.sourceData,delete e.tags.sourceType,e instanceof a.a&&(e.source.setIdWithOrigin(null,null),e.source.width=null,e.source.height=null,e.isUserImage=!1,e.fillColor=new _.RgbColor(0,0,0,0))}},t.getImageItem=function(t){if(null==t)return null;if(t instanceof a.a)return t;var e=t.content;if(e instanceof a.a)return e;if(null==e||e instanceof s.k)return null;throw new c.c("Wrong placeholder content!")},t.getImagePermissions=function(t){return null==t?null:t instanceof a.a?t.imagePermissions:t.getImagePermissions()},t.getImageSizeInPoints=function(t){var e,n,r,i;return{width:Object(j.g)(null!==(n=null===(e=null==t?void 0:t.origin)||void 0===e?void 0:e.originalSize.width)&&void 0!==n?n:t.width,t.dpiX||72),height:Object(j.g)(null!==(i=null===(r=null==t?void 0:t.origin)||void 0===r?void 0:r.originalSize.height)&&void 0!==i?i:t.height,t.dpiY||72)}},t.getContentEffect=function(t){return t.content instanceof a.a?t.content.effect:t.contentEffect},t.getAllowChangeContent=function(e){if(e instanceof s.k||e instanceof o.b&&e.isBarcodePlaceholder)return t.getBarcodePermissions(e).allowChangeBarcodeContent;var n=t.getImagePermissions(e),r=null==n||n.allowChangeImage,i=t.getImageItem(e);return r&&(null==i||0===i.values.length)},t.getImageMetaDataFromFile=function(t,e,n){return void 0===t&&(t=void 0),void 0===n&&(n=null),A(this,void 0,void 0,(function(){return F(this,(function(r){return[2,this._designAtomsApiClient.getImageMetaDataFromFile(e,n,t)]}))}))},t.getImageMetaDataFromDesignImage=function(t,e){return void 0===t&&(t=void 0),A(this,void 0,void 0,(function(){return F(this,(function(n){return[2,this._designAtomsApiClient.getImageMetaDataFromDesignImage(e,t)]}))}))},t.getImageMetadataFromRemoteFile=function(t,e){return void 0===t&&(t=void 0),A(this,void 0,void 0,(function(){return F(this,(function(n){return[2,this._designAtomsApiClient.getImageMetadataFromRemoteFile(e,t)]}))}))},t.getTextFromRichTextItem=function(t){return i.k(t.text)},t.getMaxFontSize=function(t){if(null==t||!(t instanceof l.a))return null;if(!i.m(t.text))return t.font.size;var e=[t.font.size];try{null!=t.text&&function(t,n){var r=(new DOMParser).parseFromString("<body>"+t+"</body>","application/xml"),i={acceptNode:function(t){var e=t.nodeName.toLowerCase();return n.includes(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}};d.b.IsIE()&&(i=function(t){return t.acceptNode}(i));for(var o,a,s=document.createTreeWalker(r.childNodes[0],NodeFilter.SHOW_ELEMENT,i,!1);s.nextNode();)o=s.currentNode,a=void 0,a=function(t){var e,n,r=t.attributes.getNamedItem("style");if(null==r||null==r.value)return null;var i=r.value.split(";"),o=new Map;try{for(var a=N(i),s=a.next();!s.done;s=a.next()){var l=s.value;if(null!=(l=l.trim())&&""!==l){var u=l.split(":"),c=u[0].trim(),h=u[1].trim();o.set(c,h)}}}catch(p){e={error:p}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o}(o),null!=a&&a.has("font-size")&&e.push(parseFloat(a.get("font-size")))}(t.text,["span","ol","ul"])}catch(n){console.error("Unexpected exception while parsing item text"),console.error(n)}return Math.max.apply(Math,M(e))},t.getBarcodeItem=function(t){if(null==t)return null;if(t instanceof s.k)return t;var e=t.content;if(e instanceof s.k)return e;if(null==e)return null;throw new c.c("Wrong placeholder content!")},t.getBarcodePermissions=function(t){if(null==t)return null;if(t instanceof s.k)return t.barcodePermissions;if(null!=t.contentPermissions)return t.contentPermissions.barcodePermissions;var e=t.content;return e instanceof s.k?e.barcodePermissions:null},t.getImageUrlFromImageMetadata=function(t,e,n,r,i){var o=null!=n?n:t.size.width,a=null!=r?r:t.size.height,s=null!=i&&i;return y.a.getImageUrl(e,t.storageId,o,a,null,null,s,null,t.pageIndex)},t.updateItems=function(t,e,n,o){var a,s;if(o=i.n(o,{addToHistory:!0,updatePhase:r.Final,redraw:!0}),0!==t.length){try{for(var l=N(t),u=l.next();!u.done;u=l.next()){var c=u.value;this._updateItem(e,c,o,n)}}catch(h){a={error:h}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}o.redraw&&e.redraw()}},t._updateItem=function(t,e,n,r){var i=t.getHandler(e);null!=i&&null!=i.layer&&(e instanceof a.a?this._updateImageItem(e,i,n,r):e instanceof o.b&&this._updatePlaceholderItem(e,i,n,r))},t._updateImageItem=function(t,e,n,i){e.quickUpdate(),n.updatePhase===r.Final&&(t.getItemChangedEvent().fire(),e.update(),i.updateTexts())},t._updatePlaceholderItem=function(t,e,n,r){null!=t.content&&this._updateImageItem(t.content,e.content,n,r),this._hidePlaceholderButtonWhileImageLoad(e)||e.update()},t._hidePlaceholderButtonWhileImageLoad=function(t){if(t.isEmptyContent()||!t.getPermissions().showSelectButton&&!t.getPermissions().showHandleButton)return!1;var e=function(n){n.removeReady(e),t.getPermissions().showSelectButton=!0,t.update()};return t.content.addReady(e),t.getPermissions().showSelectButton=!1,t.update(),!0},t.getItemBoundsForViolationCheck=function(t){return t instanceof g.m?t.getBoundsIncludingFrames():t.bounds},t.createCloneName=function(t,e,n){var r;"string"!=typeof(r="string"==typeof t?t:e.getRealItemName(t))&&(r="");var i=n.currentSurface.getAllItems({ignoreMockups:!1,excludeGroupItems:!0,flatGroupItems:!0}).toArray(),o=function(t){return i.some((function(n){return e.getRealItemName(n)===t}))};if(!o(r))return r;var a=0,s=r.match(/_(\d+)$/);if(null!=s&&r.length>=2){r=r.substr(0,r.length-s[0].length);var l=parseInt(s[1]);l>0&&(a=l)}var u,c=1;do{if(!o(u=r+"_"+(a+c).toString()))break;c++}while(c<=1e4);return"string"==typeof t?u:e.createNewItemName(t,u)},t.createImageContentForPlaceholder=function(e,n,r,i){var o;if(e.isBarcodePlaceholder!==n instanceof s.i)return null;var l,c=r.getHandler(e),h=c.getTransformedRectangle(!1);h.angle=0;var p=e.content,f=e.contentPermissions;if(e.isBarcodePlaceholder&&n instanceof s.i){var d=h.clone(),g=Object(v.f)(k.getBarcodeRatio(n.barcodeFormat),new P.a(h.width,h.height));d.width=g.width,d.height=g.height;var y=void 0;null!=p.barcodeOptions?y=p.barcodeOptions:(y=new s.B).pureBarcode=!1,(l=new s.k(n.barcodeFormat,null,y,d.toRectangleF())).applyBarcodeData(n),e.barcodeFormat=n.barcodeFormat}else n instanceof u.a&&(l=new a.a(n.storageId,h.location,h.width,h.height,n.size.width/n.size.height));l instanceof a.a&&n instanceof u.a&&(x.a.setDataToImage(n,l),l.effect=e.contentEffect,l.imagePermissions=f.imagePermissions.clone(),l.effect==b.a.Colorize&&null!=e.contentFillColor&&(l.fillColor=e.contentFillColor),null!=e.contentOverlayEffect&&(l.overlayEffect=e.contentOverlayEffect.clone())),l.transform.setAngle(e.transform.angle),r.getHandler(l).updateRectangle(null,e.contentResizeMode,c,i),l.textWrappingMode=m.a.Square,l.isVariable=null!=p&&p.isVariable,l instanceof s.k&&(l.barcodePermissions=f.barcodePermissions.clone());var _=e.contentPermissions.imagePermissions.allowKeepOverlayColor;return null==p?(l instanceof a.a&&(l.allowedSubfolder=e.allowedSubfolder,l.allowedTabs=e.allowedTabs),l.opacity=e.opacity):(p instanceof a.a&&l instanceof a.a&&(l.allowedSubfolder=p.allowedSubfolder,l.allowedTabs=p.allowedTabs,l.imagePermissions=p.imagePermissions.clone(),_&&(null===(o=p.overlayEffect)||void 0===o?void 0:o.color)&&t.setOverlayEffectColor(l,p.overlayEffect.color)),l.manipulationPermissions=p.manipulationPermissions.clone(),l.opacity=e.content.opacity,l.fillColor=p.fillColor.clone(),l instanceof s.k&&p instanceof s.k&&(l.barcodePermissions=p.barcodePermissions.clone())),l},t.positionItemInArea=function(e,n,r,i,a,u,c,h){if(void 0===a&&(a=!0),void 0===u&&(u=null),void 0===c&&(c=null),void 0===h&&(h=!0),n instanceof s.G)return n.getNestedItems(!0).forEach((function(n){return t.positionItemInArea(e,n,r,i,a,u,c,h)}));var p=e.userEditContainer,f=null!=u?u.toRectangleF():p.region,d=null!=f,g=p.parentComponent.printAreas.getItem(0).bounds,m=d?f:g,y=m.center,_=a?v.a.from(m):e.getVisualSize(v.a.from(m)),b=Math.min(_.width/r,_.height/i),C=null!=c?c:new w.PointF(r/2,i/2),P=function(t){var n=y;if(t instanceof s.q||t instanceof s.g)t.textRectangle.width*=b,t.textRectangle.height*=b,t.textRectangle.left=n.x+b*(t.textRectangle.left-C.x)-0,t.textRectangle.top=n.y+b*(t.textRectangle.top-C.y)-0;else if(t instanceof s.eb){var r=n.x+b*(t.baselineLocation.x-C.x),i=n.y+b*(t.baselineLocation.y-C.y);t.baselineLocation.x=r,t.baselineLocation.y=i}else{var o=e.getHandler(t).getTransformedRectangle(h),a=n.x+b*(o.centerX-C.x),l=n.y+b*(o.centerY-C.y);t.transform.setScaleX(b),t.transform.setScaleY(b),t.transform.move(a-o.centerX,l-o.centerY)}};P(n),n instanceof o.b&&n.updateContentAndFrames(P),n instanceof l.a&&(n.font.size*=b)},t.rotateItems=function(t,e,n,r){var i=function(e){if(e instanceof s.G)return e.applyToItems(i);var a=t.getHandler(e),l=a.getTransformedRectangle(!1);l.rotateAt(r,n);var u=l.getTransform(a.getTransformedRectangle(!1));e.transform.move(u.translateX,u.translateY),e.transform.rotate(u.angle),e instanceof o.b&&e.updateContentAndFrames(i)};e.forEach((function(t){return i(t)}))},t.changeItemsContent=function(t,e,n,r,i,c){var h,p,d,g,m,y,_=this,b=r.map((function(t){return t.clone()})),v=b.filter((function(t){return t instanceof s.G})),w=i.filter((function(t){return t instanceof s.G}));this._replaceContentFromOldToNewItems(v,w,(function(r,i){return _.changeItemsContent(t,e,n,i.items.toArray(),r.items.toArray(),c)}),c);var x=b.filter((function(t){return t instanceof l.a})),S=i.filter((function(t){return t instanceof l.a})),I=t.getAllItems({ignoreMockups:!1,flatGroupItems:!0}),O=I.filter((function(t){return t instanceof l.a}));O=f.without.apply(f,M([O],S));try{for(var T=N(S),E=T.next();!E.done;E=T.next()){var L=E.value;if(0!==L.placeholders.length){var R=function(t){var e=O.filter((function(e){return null!=e.placeholders.toArray().find((function(e){return e.name===t.name}))}));if(0===e.length)return"continue";t.value=e[0].placeholders.toArray().find((function(e){return e.name===t.name})).value};try{for(var k=(d=void 0,N(L.placeholders.toArray())),j=k.next();!j.done;j=k.next())R(j.value)}catch(G){d={error:G}}finally{try{j&&!j.done&&(g=k.return)&&g.call(k)}finally{if(d)throw d.error}}}}}catch($){h={error:$}}finally{try{E&&!E.done&&(p=T.return)&&p.call(T)}finally{if(h)throw h.error}}this._replaceContentFromOldToNewItems(x,S,(function(t,e){t.text=e.text,null!=e.tags&&(t.tags=e.tags)}),c);var A=function(t,e){var r=new u.a;r.size=new P.a(e.imageContent.source.width,e.imageContent.source.height),r.storageId=e.imageContent.source.id,r.name=e.imageContent.name,r.origin=e.imageContent.source.origin,r.isVector=e.imageContent.source.isVector,r.pageIndex=e.imageContent.source.pageIndex,n.execute(C.a.setImageMetadata,{dataList:[{item:t,imageData:r,tags:e.tags}]}),e.isEmptyContent||t.isEmptyContent||null==e.content.tags||(t.content.tags=e.content.tags)},F=function(t){return t instanceof o.b&&!t.isStubOrEmpty&&t.content instanceof a.a},B=b.filter(F),z=i.filter((function(t){return t instanceof o.b})),D=I.filter(F);D=f.without.apply(f,M([D],z));var H=z.filter((function(t){return null!=t.linkId}));if(0!==H.length){var W=new Set,U=function(t){var e=D.find((function(e){return e.linkId===t.linkId&&!e.isStubOrEmpty&&e.content instanceof a.a}));if(null==e)return"continue";W.add(e.linkId),A(t,e),z=f.without(z,t)};try{for(var V=N(H),q=V.next();!q.done;q=V.next())U(q.value)}catch(X){m={error:X}}finally{try{q&&!q.done&&(y=V.return)&&y.call(V)}finally{if(m)throw m.error}}B=B.filter((function(t){return!W.has(t.linkId)}))}this._replaceContentFromOldToNewItems(B,z,A,c)},t._replaceContentFromOldToNewItems=function(t,e,n,r){for(var i=t.map((function(t){return t.name})),o=[],a=function(t){i.find((function(n){return n===e[t].name}))&&(i.splice(i.indexOf(e[t].name),1),o.push(t))},s=0;s<e.length;s++)a(s);var l,u=function(a){var s=e[a],u=void 0;o.includes(a)?u=t.find((function(t){return t.name===s.name})):r&&0!==i.length&&(l=i.shift(),u=t.find((function(t){return t.name===l}))),null!=u&&(n(s,u.clone()),t.splice(t.indexOf(u),1))};for(s=0;s<e.length;s++)u(s)},t.getEmptyPlaceholdersFromProduct=function(t,e){void 0===e&&(e=!1);var n=[];return t.getAllItems({flatGroupItems:!0,ignoreMockups:!0}).filter((function(t){if(!(t instanceof o.b&&t.isStubOrEmpty&&null!=t.parentContainer&&t.parentContainer.name===h.a.MAIN_CONTAINER_NAME))return!1;if(e)return!0;if(null!=t.linkId){if(n.includes(t.linkId))return!1;n.push(t.linkId)}return!0}))},t.waitForItemsUpdated=function(t,e){return A(this,void 0,void 0,(function(){var n,r;return F(this,(function(i){switch(i.label){case 0:return n=t.filter((function(t){return t instanceof s.G})).map((function(t){return t.getNestedItems(!0)})).reduce((function(t,e){return M(t,e)}),[]),r=t.concat(n).map((function(t){return e.handlerFactory.get(t)})),[4,e.waitUpdate(r)];case 1:return i.sent(),[2]}}))}))},t.isTextItemHandlerReady=function(t,e){if(t instanceof l.a){var n=e.getHandler(t);if(n instanceof g.b&&null==n.currentTextImage.cacheFileId)return!1;if(n instanceof g.i&&!n.ready)return!1}return!0},t.alignHandlerToRect=function(t,e,n){var r=n instanceof l.a?n.alignment:s.qb.Left,i=n instanceof s.q?n.verticalAlignment:s.sb.Top,o=S.a.Center,a=S.a.Center;switch(r){case s.qb.Left:case s.qb.LastLeft:case s.qb.Justify:o=S.a.Left;break;case s.qb.Right:case s.qb.LastRight:o=S.a.Right}switch(i){case s.sb.Top:a=S.a.Top;break;case s.sb.Bottom:a=S.a.Bottom}var u=t.rectangle;t.angle=e.angle;var c=Object(v.c)(u,e,o,a);t.setRectangle(c)},t._designAtomsApiClient=null,t.setOverlayEffectColor=function(e,n){null!=e&&(t._getItemOverlayEffect(e).color=n)},t.applyOverlayEffect=function(e,n){if(null!=e&&null!=n){var r=t._getItemOverlayEffect(e);r.color=n.color,r.opacity=n.opacity}},t._getItemOverlayEffect=function(t){return t instanceof a.a?(t.overlayEffect=null!=t.overlayEffect?t.overlayEffect:new s.Y,t.overlayEffect):(t.contentOverlayEffect=null!=t.contentOverlayEffect?t.contentOverlayEffect:new s.Y,t.contentOverlayEffect)},t}();!function(t){t[t.InProgress=0]="InProgress",t[t.Final=1]="Final"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"h",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"l",(function(){return s})),n.d(e,"m",(function(){return l})),n.d(e,"i",(function(){return u})),n.d(e,"k",(function(){return c})),n.d(e,"j",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return d})),n.d(e,"a",(function(){return g})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return y}));var r=n(430),i=n(434),o=function(t,e,n){return t.x*e.y+t.y*n.x+e.x*n.y-(n.x*e.y+e.x*t.y+n.y*t.x)},a=function(t){if(0==t.length)return new r.a(0,0,0,0);for(var e=t[0],n=e.x,i=e.x,o=e.y,a=e.y,s=1,l=t.length;s<l;++s)e=t[s],n=Math.min(n,e.x),i=Math.max(i,e.x),o=Math.min(o,e.y),a=Math.max(a,e.y);return new r.a(n,o,i-n,a-o)},s=function(t,e,n){var r=Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),i=Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2),a=Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2),s=0;a*i!=0&&(s=g(-1,(-r+a+i)/(2*Math.sqrt(a)*Math.sqrt(i)),1));var l=o(t,e,n),u=Math.acos(s);return l>0&&(u=-u),d(u)},l=function(t){return(t%=360)<0&&(t+=360),t},u=function(t,e){return t.x*e.x+t.y*e.y},c=function(t,e,n){var r=new i.a(n.x-e.x,n.y-e.y),o=new i.a(t.x-e.x,t.y-e.y),a=u(o,r);if(a<=0)return h(t,e);var s=u(r,r);if(s<a)return h(t,n);var l=a/s,c=new i.a(e.x+r.x*l,e.y+r.y*l);return h(t,c)},h=function(t,e){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)},p=function(t,e,n,r,i){function o(t,e,n,r){var i=Math.pow(e-r,2),o=Math.pow(t-n,2);return Math.sqrt(i*o/(o+i))}if(t.x==e.x)return n*r;if(t.y==e.y)return n*i;var a=o(t.x,t.y,e.x,e.y);return n*o(t.x*r,t.y*i,e.x*r,e.y*i)/a},f=function(t){return Math.PI*t/180},d=function(t){return 180*t/Math.PI},g=function(t,e,n){return Math.max(t,Math.min(n,e))},m=function(t,e,n){return"number"==typeof t&&"number"==typeof e&&("number"!=typeof n&&(n=1e-4),0!=n?Math.abs(t-e)<=n:t==e)},y=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++){for(var r=t[n],i=!1,o=0;o<e.length;o++)if(r.isEqual(e[o])){i=!0;break}if(!i)return!1}return!0}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(406),i=n(738),o=n(495),a=n(409),s=n(410),l=n(411),u=function(){function t(t,e){void 0===e&&(e=""),this._name="",this._propertyChanged=new a.c,this.id=null!=t?t:(new o.a).toString(),this.name=e,null==this._tags&&(this._tags={})}return Object.defineProperty(t.prototype,"version",{get:function(){return i.a},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name!==t&&(this._name=t,this._propertyChanged.notify(this,"name"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this._tags},set:function(t){if(null==t)throw new r.a("value is null!");this._tags=t},enumerable:!0,configurable:!0}),t.prototype._copy=function(t,e,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!1),e.name=t.name,n?e.generateNewIds():e.id=t.id,null!=t.tags)for(var i in e.tags={},t.tags)e.tags[i]=l.clone(t.tags[i])},t.prototype.getSimplifiedObject=function(t){var e=s.q(this,t);return e.tags=this.tags,e.id=this.id.toString(),e},t.prototype.generateNewIds=function(){this._generateNewId()},t.prototype._generateNewId=function(){this.id=(new o.a).toString()},t.prototype.toString=function(){return this.name},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.prototype.equals=function(t){return this.name===t.name&&this.version===t.version},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r,i=n(409),o=n(497),a=n(547),s=n.n(a),l=(n(862),n(406));!function(t){t.Move="Move",t.Add="Add",t.Remove="Remove"}(r||(r={}));var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=null;!function(t){p=s.a.from;try{t.from=function(t){return t instanceof f?t:p(t)}}catch(e){console.error("unable to patch Enumerable",e)}}(s.a);var f=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;this._collection=[],this.constructor=function(t){throw new l.e},this._itemAddedEvent=new i.a,this._itemRemovedEvent=new i.a,this._itemMovedEvent=new i.a,this._enumerable=(n=this._collection)instanceof f?n:p?p(n):s.a.from(n),0!==t.length&&this.setRange(t)}return t.prototype.setRange=function(t){this.clear(),this.addRange(t)},t.prototype.addRange=function(e){var n;e instanceof t&&(e=e._collection),"getEnumerator"in(n=e)&&"toArray"in n&&(e=e.toArray());for(var r=0;r<e.length;r++)this.add(e[r])},t.prototype.add=function(){for(var t,e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=u(n),o=i.next();!o.done;o=i.next()){var a=o.value;this.insertAt(this._collection.length,a)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.push=function(t){return this.add(t),this.length},t.prototype.insertAt=function(t,e){var n,r,i;Array.isArray(e)||(e=[e]);try{for(var o=u(e),a=o.next();!a.done;a=o.next()){var s=a.value;this._checkIfItemExists(s)}}catch(p){n={error:p}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(t<0||t>this._collection.length)throw new l.f;(i=this._collection).splice.apply(i,h([t,0],e));for(var c=0;c<e.length;c++)s=e[c],this._onItemAdded(this._collection.indexOf(s),s)},t.prototype.remove=function(t){if(!this.contains(t))throw new l.a(o.c);return this.removeAt(this.indexOf(t))},t.prototype.removeAt=function(t){if(t<0||t>this._collection.length-1)throw new l.f;var e=this._collection[t];return this._collection.splice(t,1),this._onItemRemoved(t,e),e},t.prototype.removeRange=function(t,e){for(var n=this._collection.slice(),r=this._collection.splice(t,e-t+1),i=0;i<r.length;i++){var o=r[i];this._onItemRemoved(n.indexOf(o),o)}return r},t.prototype.move=function(t,e,n){"boolean"!=typeof n&&(n=!1);var r=this._collection[t];return r&&t>=0&&e>=0&&t!=e&&(this._collection.splice(t,1),this._collection.splice(e,0,r),n||this._onItemMoved(t,e)),r},t.prototype.clear=function(){for(;this.length>0;)this.removeAt(this.length-1)},t.prototype.replaceAt=function(t,e){if(e<0||e>this._collection.length-1)throw new l.f;this._onItemRemoved(e,this._collection[e]),this._collection[e]=t,this._onItemAdded(e,this._collection[e])},Object.defineProperty(t.prototype,"length",{get:function(){return this._collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return this.getItem(t)},t.prototype.set=function(t,e){throw new l.e},t.prototype.getItem=function(t){return this._collection[t]},t.prototype._checkIfItemExists=function(t){if(this.contains(t))throw new l.a(o.b)},t.prototype._onItemAdded=function(t,e){this._itemAddedEvent.notify({item:e,index:t,type:r.Add})},t.prototype.add_itemAdded=function(t){this._itemAddedEvent.add(t)},t.prototype.remove_itemAdded=function(t){this._itemAddedEvent.remove(t)},t.prototype._onItemRemoved=function(t,e){this._itemRemovedEvent.notify({item:e,index:t,type:r.Remove})},t.prototype.add_itemRemoved=function(t){this._itemRemovedEvent.add(t)},t.prototype.remove_itemRemoved=function(t){this._itemRemovedEvent.remove(t)},t.prototype._onItemMoved=function(t,e){this._itemMovedEvent.notify({oldIndex:t,newIndex:e,type:r.Move})},t.prototype.add_itemMoved=function(t){this._itemMovedEvent.add(t)},t.prototype.remove_itemMoved=function(t){this._itemMovedEvent.remove(t)},t.prototype.add_collectionChanged=function(t){this.add_itemMoved(t),this.add_itemRemoved(t),this.add_itemAdded(t)},t.prototype.remove_collectionChanged=function(t){this.remove_itemMoved(t),this.remove_itemRemoved(t),this.remove_itemAdded(t)},t.prototype[Symbol.iterator]=function(){return this._collection.values()},t.prototype.toArray=function(){return this._collection.slice()},t.prototype.getEnumerator=function(){return this._enumerable.getEnumerator()},t.prototype.traverseBreadthFirst=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).traverseBreadthFirst.apply(t,h(e))},t.prototype.traverseDepthFirst=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).traverseDepthFirst.apply(t,h(e))},t.prototype.flatten=function(){return this._enumerable.flatten()},t.prototype.pairwise=function(t){return this._enumerable.pairwise(t)},t.prototype.scan=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).scan.apply(t,h(e))},t.prototype.select=function(t){return this._enumerable.select(t)},t.prototype.selectMany=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).selectMany.apply(t,h(e))},t.prototype.where=function(t){return this._enumerable.where(t)},t.prototype.choose=function(t){return this._enumerable.choose(t)},t.prototype.ofType=function(t){return this._enumerable.ofType(t)},t.prototype.zip=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).zip.apply(t,h(e))},t.prototype.merge=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).merge.apply(t,h(e))},t.prototype.join=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).join.apply(t,h(e))},t.prototype.groupJoin=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).groupJoin.apply(t,h(e))},t.prototype.all=function(t){return this._enumerable.all(t)},t.prototype.any=function(t){return this._enumerable.any(t)},t.prototype.isEmpty=function(){return this._enumerable.isEmpty()},t.prototype.concat=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).concat.apply(t,h(e))},t.prototype.alternate=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).alternate.apply(t,h(e))},t.prototype.defaultIfEmpty=function(t){return this._enumerable.defaultIfEmpty(t)},t.prototype.distinct=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).distinct.apply(t,h(e))},t.prototype.distinctUntilChanged=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).distinctUntilChanged.apply(t,h(e))},t.prototype.except=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).except.apply(t,h(e))},t.prototype.intersect=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).intersect.apply(t,h(e))},t.prototype.union=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).union.apply(t,h(e))},t.prototype.sequenceEqual=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).sequenceEqual.apply(t,h(e))},t.prototype.orderBy=function(t){return this._enumerable.orderBy(t)},t.prototype.orderByDescending=function(t){return this._enumerable.orderByDescending(t)},t.prototype.reverse=function(){return this._enumerable.reverse()},t.prototype.shuffle=function(){return this._enumerable.shuffle()},t.prototype.weightedSample=function(t){return this._enumerable.weightedSample(t)},t.prototype.groupBy=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).groupBy.apply(t,h(e))},t.prototype.partitionBy=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).partitionBy.apply(t,h(e))},t.prototype.buffer=function(t){return this._enumerable.buffer(t)},t.prototype.aggregate=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).aggregate.apply(t,h(e))},t.prototype.average=function(t){return this._enumerable.average(t)},t.prototype.count=function(t){return this._enumerable.count(t)},t.prototype.max=function(t){return this._enumerable.max(t)},t.prototype.min=function(t){return this._enumerable.min(t)},t.prototype.maxBy=function(t){return this._enumerable.maxBy(t)},t.prototype.minBy=function(t){return this._enumerable.minBy(t)},t.prototype.sum=function(t){return this._enumerable.sum(t)},t.prototype.elementAt=function(t){return this._enumerable.elementAt(t)},t.prototype.elementAtOrDefault=function(t,e){return this._enumerable.elementAtOrDefault(t,e)},t.prototype.first=function(t){return this._enumerable.first(t)},t.prototype.firstOrDefault=function(t,e){return"function"==typeof t?this._enumerable.firstOrDefault(t,e):this._enumerable.firstOrDefault(e)},t.prototype.last=function(t){return this._enumerable.last(t)},t.prototype.lastOrDefault=function(t,e){return"function"==typeof t?this._enumerable.lastOrDefault(t,e):this._enumerable.lastOrDefault(e)},t.prototype.single=function(t){return this._enumerable.single(t)},t.prototype.singleOrDefault=function(t,e){return this._enumerable.singleOrDefault(t,e)},t.prototype.skip=function(t){return this._enumerable.skip(t)},t.prototype.skipWhile=function(t){return this._enumerable.skipWhile(t)},t.prototype.take=function(t){return this._enumerable.take(t)},t.prototype.takeWhile=function(t){return this._enumerable.takeWhile(t)},t.prototype.takeExceptLast=function(t){return this._enumerable.takeExceptLast(t)},t.prototype.takeFromLast=function(t){return this._enumerable.takeFromLast(t)},t.prototype.indexOf=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).indexOf.apply(t,h(e))},t.prototype.lastIndexOf=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).lastIndexOf.apply(t,h(e))},t.prototype.asEnumerable=function(){return this._enumerable},t.prototype.cast=function(){return this._enumerable.cast()},t.prototype.toLookup=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toLookup.apply(t,h(e))},t.prototype.toObject=function(t,e){return this._enumerable.toObject(t,e)},t.prototype.toDictionary=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toDictionary.apply(t,h(e))},t.prototype.toJSONString=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toJSONString.apply(t,h(e))},t.prototype.toJoinedString=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toJoinedString.apply(t,h(e))},t.prototype.doAction=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).doAction.apply(t,h(e))},t.prototype.forEach=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).forEach.apply(t,h(e))},t.prototype.write=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).write.apply(t,h(e))},t.prototype.writeLine=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).writeLine.apply(t,h(e))},t.prototype.force=function(){return this._enumerable.force()},t.prototype.letBind=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).letBind.apply(t,h(e))},t.prototype.share=function(){return this._enumerable.share()},t.prototype.memoize=function(){return this._enumerable.memoize()},t.prototype.catchError=function(t){return this._enumerable.catchError(t)},t.prototype.finallyAction=function(t){return this._enumerable.finallyAction(t)},t.prototype.log=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).log.apply(t,h(e))},t.prototype.trace=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).trace.apply(t,h(e))},t.prototype.insert=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).insert.apply(t,h(e))},t.prototype.contains=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).contains.apply(t,h(e))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={IsIos:function(){return(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream},GetIosVersion:function(){if(null==navigator.appVersion||!r.IsIos())return[];var t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return null==t?[]:t.slice(1).map((function(t){return parseInt(t,10)})).map((function(t){return isNaN(t)?null:t}))},IosMajorVersion:function(){var t=navigator.userAgent,e=t.indexOf("OS ");if(e>-1)return Number(t.substr(e+3,3).replace("_",".").charAt(0))},IsAndroid:function(){return!!navigator.userAgent.toLowerCase().match(/(android)/)},IsTouchDevice:function(){return r.IsIos()||r.IsAndroid()||r.IsTouchIE()},IsNativeAndroidBrowser:function(){var t=navigator.userAgent;return t.indexOf("Mozilla/5.0")>-1&&t.indexOf("Android ")>-1&&t.indexOf("AppleWebKit")>-1&&!(t.indexOf("Chrome")>-1)},IsGoogleChrome:function(){return"object"==typeof window.chrome},IsSafari:function(){return-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},IsSafariOrSafariWebView:function(){return r.IsSafari()||r.IsIos()},IsFirefox:function(){return-1!==navigator.userAgent.indexOf("Firefox")&&-1===navigator.userAgent.indexOf("Seamonkey")},IsTouchIE:function(){return-1!==navigator.userAgent.indexOf("Trident")&&-1!==navigator.userAgent.indexOf("Touch")},IsIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0},IsEdge:function(){return-1!=navigator.userAgent.indexOf("Edge")},GetEdgeHtmlVersion:function(){return r.IsEdge()?navigator.userAgent.match(/Edge\/(\d+).(\d+)/).slice(1).map((function(t){return parseInt(t,10)})).map((function(t){return isNaN(t)?null:t})):[]},get devicePixelRatio(){return null!=window.devicePixelRatio?window.devicePixelRatio:1},get screenDpi(){return 96*r.devicePixelRatio},IsSmallScreen:function(){return window.innerWidth<=500}};e.b=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));var r=n(484);function i(t){return null==t||""===t.trim()}function o(t){const e={};if(i(t))return e;const n=t.split(";");for(let i of n){const t=i.split(":");if(2!==t.length)continue;const n=t[0].trim();let o=t[1].trim();n===r.a.openType&&e.hasOwnProperty(n)&&(o=`${e[n]};${o}`),e[n]=o}return e}function a(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(n===r.a.openType?t[n].split(",").forEach((t=>{if(i(t))return;const r=t.trim().split(" "),o=`${r[0].toLowerCase()},${2===r.length?r[1]:"1"}`;e+=`${n}: ${o}; `})):e+=`${n}: ${t[n]}; `);return e.trim()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"l",(function(){return h})),n.d(e,"f",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return m})),n.d(e,"g",(function(){return y})),n.d(e,"i",(function(){return _})),n.d(e,"k",(function(){return b})),n.d(e,"h",(function(){return v})),n.d(e,"j",(function(){return w})),n.d(e,"b",(function(){return i}));var r,i,o=n(430),a=n(519),s=n(407),l=n(463),u=function(){return u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function h(t,e,n){return m(t.left,e.left,n)&&m(t.top,e.top,n)&&m(t.width,e.width,n)&&m(t.height,e.height,n)}function p(t,e,n){if(void 0===n&&(n=i.Fit),t.width===e.width&&t.height===e.height)return t;if(n===i.Original)return u({},t);if(n===i.Arbitrary)return u({},e);var r=n===i.Fit?Math.min(e.width/t.width,e.height/t.height):Math.max(e.width/t.width,e.height/t.height);return{width:t.width*r,height:t.height*r}}function f(t,e,n,r,s){if(void 0===n&&(n=i.Fit),void 0===r&&(r=a.a.Center),void 0===s&&(s=a.a.Center),o.a.isEqual(t,e))return t.clone();var l,u,c=p({width:t.width,height:t.height},{width:e.width,height:e.height},n);switch(r){case a.a.Left:l=e.left;break;case a.a.Right:l=e.right-c.width;break;default:l=e.center.x-c.width/2}switch(s){case a.a.Top:u=e.top;break;case a.a.Bottom:u=e.bottom-c.height;break;default:u=e.center.y-c.height/2}return new o.a(l,u,c.width,c.height)}function d(t,e,n,r){t.angle=e.angle;var i=g(e,n,r),o=g(t,n,r),a=t.clone();return a.centerX+=i.x-o.x,a.centerY+=i.y-o.y,a}function g(t,e,n){var r=0,i=0;switch(e){case a.a.Left:r=-t.width/2;break;case a.a.Right:r=t.width/2}switch(n){case a.a.Top:i=-t.height/2;break;case a.a.Bottom:i=t.height/2}var o=new s.PointF(r,i);return(o=o.rotate(t.angle)).translate(t.centerX,t.centerY)}function m(t,e,n){return null==n&&(n=1e-4),0!==n?Math.abs(t-e)<=n:t===e}function y(t,e,n){var r,i;switch(e){case a.a.Left:r=t.left;break;case a.a.Right:r=t.right;break;default:r=t.left+t.width/2}switch(n){case a.a.Top:i=t.top;break;case a.a.Bottom:i=t.bottom;break;default:i=t.top+t.height/2}return new s.PointF(r,i)}function _(t,e){return new s.Transform(1,1,e.x-t.x,e.y-t.y,0)}function b(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=Number.POSITIVE_INFINITY;try{for(var a=c(r),s=a.next();!s.done;s=a.next()){var l=s.value,u=Math.abs(l);u<o&&(o=u,n=l)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return n}function v(t,e,n){return Math.abs(t*e/n)}function w(t,e,n,r,i){if(e>=n)throw new l.a("oldMin must be less than oldMax");if(r>=i)throw new l.a("newMin must be less than newMax");return r+(t-e)*(i-r)/(n-e)}!function(t){t.from=function(t){return{width:t.width,height:t.height}}}(r||(r={})),function(t){t[t.Fit=0]="Fit",t[t.Fill=1]="Fill",t[t.Arbitrary=2]="Arbitrary",t[t.Original=3]="Original"}(i||(i={}))},function(t,e,n){"use strict";var r,i;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return s.a})),n.d(e,"f",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"j",(function(){return p.a})),n.d(e,"d",(function(){return l})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"a",(function(){return h})),function(t){t[t.undo=0]="undo",t[t.redo=1]="redo",t[t.setCursor=2]="setCursor",t[t.moveCursor=3]="moveCursor",t[t.moveCursorWithSelection=4]="moveCursorWithSelection",t[t.setSelection=5]="setSelection",t[t.selectCurrentWord=6]="selectCurrentWord",t[t.selectCurrentParagraph=7]="selectCurrentParagraph",t[t.selectAll=8]="selectAll",t[t.insertNewLine=9]="insertNewLine",t[t.insertLineBreak=10]="insertLineBreak",t[t.insertTab=11]="insertTab",t[t.insertChar=12]="insertChar",t[t.deleteToLeft=13]="deleteToLeft",t[t.deleteLeftWord=14]="deleteLeftWord",t[t.deleteToRight=15]="deleteToRight",t[t.deleteRightWord=16]="deleteRightWord",t[t.copyToClipboard=17]="copyToClipboard",t[t.pasteFromClipboard=18]="pasteFromClipboard",t[t.clearFormatting=19]="clearFormatting",t[t.setFontBold=20]="setFontBold",t[t.setFontItalic=21]="setFontItalic",t[t.setFontUnderline=22]="setFontUnderline",t[t.setCapitalLetters=23]="setCapitalLetters",t[t.setSubscriptLetters=24]="setSubscriptLetters",t[t.setSuperscriptLetters=25]="setSuperscriptLetters",t[t.increaseFontSize=26]="increaseFontSize",t[t.decreaseFontSize=27]="decreaseFontSize",t[t.setLeftAlignment=28]="setLeftAlignment",t[t.setRightAlignment=29]="setRightAlignment",t[t.setCenterAlignment=30]="setCenterAlignment",t[t.createBulletedListItem=31]="createBulletedListItem",t[t.createNumberedListItem=32]="createNumberedListItem",t[t.createBulletedListItemWithSpace=33]="createBulletedListItemWithSpace",t[t.createNumberedListItemWithSpace=34]="createNumberedListItemWithSpace",t[t.addListItemWithSpace=35]="addListItemWithSpace",t[t.addListItemWithNewLine=36]="addListItemWithNewLine",t[t.deleteListItem=37]="deleteListItem",t[t.increaseListItemIndent=38]="increaseListItemIndent",t[t.decreaseListItemIndent=39]="decreaseListItemIndent"}(r||(r={})),function(t){t.Left="ArrowLeft",t.Up="ArrowUp",t.Right="ArrowRight",t.Down="ArrowDown",t.Home="Home",t.End="End",t.Enter="Enter",t.Tab="Tab",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.Space="Space",t.KeyA="KeyA",t.KeyB="KeyB",t.KeyI="KeyI",t.KeyU="KeyU",t.KeyL="KeyL",t.KeyR="KeyR",t.KeyE="KeyE",t.KeyC="KeyC",t.KeyV="KeyV",t.KeyZ="KeyZ",t.KeyY="KeyY",t.KeyPeriod="Period",t.KeyComma="Comma",t.KeyEqual="Equal"}(i||(i={}));var o,a,s=n(589);!function(t){t[t.left=0]="left",t[t.right=1]="right",t[t.up=2]="up",t[t.down=3]="down",t[t.lineStart=4]="lineStart",t[t.lineEnd=5]="lineEnd",t[t.textStart=6]="textStart",t[t.textEnd=7]="textEnd",t[t.leftWord=8]="leftWord",t[t.rightWord=9]="rightWord"}(o||(o={})),function(t){t[t.toTheLeft=0]="toTheLeft",t[t.toTheRight=1]="toTheRight"}(a||(a={}));var l,u,c,h,p=n(473);!function(t){t[t.none=0]="none",t[t.bullets=1]="bullets",t[t.numbers=2]="numbers"}(l||(l={})),function(t){t[t.none=0]="none",t[t.number=1]="number",t[t.lowerLetter=2]="lowerLetter",t[t.upperLetter=3]="upperLetter",t[t.lowerRoman=4]="lowerRoman",t[t.upperRoman=5]="upperRoman"}(u||(u={})),function(t){t[t.continueFromPrevious=0]="continueFromPrevious",t[t.startAt=1]="startAt"}(c||(c={})),function(t){t[t.undo=0]="undo",t[t.redo=1]="redo",t[t.setCursor=2]="setCursor",t[t.moveCursor=3]="moveCursor",t[t.setSelection=4]="setSelection",t[t.selectWord=5]="selectWord",t[t.selectParagraph=6]="selectParagraph",t[t.selectAllText=7]="selectAllText",t[t.insertNewLine=8]="insertNewLine",t[t.insertLineBrake=9]="insertLineBrake",t[t.insertTab=10]="insertTab",t[t.insertText=11]="insertText",t[t.deleteText=12]="deleteText",t[t.copyToClipboard=13]="copyToClipboard",t[t.clearFormatting=14]="clearFormatting",t[t.setFontBold=15]="setFontBold",t[t.setFontItalic=16]="setFontItalic",t[t.setFontUnderline=17]="setFontUnderline",t[t.setCapitalLetters=18]="setCapitalLetters",t[t.setSubscriptLetters=19]="setSubscriptLetters",t[t.setSuperscriptLetters=20]="setSuperscriptLetters",t[t.setCharStyle=21]="setCharStyle",t[t.setParagraphStyle=22]="setParagraphStyle",t[t.increaseFontSize=23]="increaseFontSize",t[t.decreaseFontSize=24]="decreaseFontSize",t[t.setAlignment=25]="setAlignment",t[t.addListItem=26]="addListItem",t[t.creteBulletedListItem=27]="creteBulletedListItem",t[t.creteNumberedListItem=28]="creteNumberedListItem",t[t.deleteListItem=29]="deleteListItem",t[t.applyListItem=30]="applyListItem",t[t.increaseListItemIndent=31]="increaseListItemIndent",t[t.decreaseListItemIndent=32]="decreaseListItemIndent"}(h||(h={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(434),i=n(422),o=n(474),a=n(406),s=n(411),l=n(409),u=function(){function t(t,e,n,r){this._propertyChanged=new l.c,this._left="number"==typeof t?t:0,this._top="number"==typeof e?e:0,this._width="number"==typeof n?n:2,this._height="number"==typeof r?r:2,this._id=Math.random().toString()}return t.prototype.toJSON=function(){return{left:this.left,top:this.top,width:this.width,height:this.height,id:this._id}},Object.defineProperty(t.prototype,"left",{get:function(){return this._left},set:function(e){Object(i.e)(e,this._left,t._tolerance)||(this._left=e,this._propertyChanged.notify(this,"left"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this._top},set:function(e){Object(i.e)(e,this._top,t._tolerance)||(this._top=e,this._propertyChanged.notify(this,"top"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){Object(i.e)(e,this._width,t._tolerance)||(this._width=e,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){Object(i.e)(e,this._height,t._tolerance)||(this._height=e,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.FromLTRB=function(e,n,r,i){var o=Math.abs(r-e),a=Math.abs(i-n);return new t(Math.min(e,r),Math.min(n,i),o,a)},t.fromLtrbObject=function(e){return t.FromLTRB(e.left,e.top,e.right,e.bottom)},t.FromObject=function(e){return new t(e.left,e.top,e.width,e.height)},t.intersect=function(e,n){var r=Math.max(e.left,n.left),i=Math.min(e.right,n.right),o=Math.max(e.top,n.top),a=Math.min(e.bottom,n.bottom);return i>=r&&a>=o?new t(r,o,i-r,a-o):t.empty},t.union=function(e,n){var r=Math.min(e.left,n.left),i=Math.max(e.left+e.width,n.left+n.width),o=Math.min(e.top,n.top);return new t(r,o,i-r,Math.max(e.top+e.height,n.top+n.height)-o)},Object.defineProperty(t,"empty",{get:function(){return new t(0,0,-1,-1)},enumerable:!0,configurable:!0}),t.prototype.equals=function(e){return t.isEqual(this,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&Object(i.e)(t.left,e.left,n)&&Object(i.e)(t.top,e.top,n)&&Object(i.e)(t.width,e.width,n)&&Object(i.e)(t.height,e.height,n)},t.prototype.contains=function(t,e,n){if(null==e&&(e=!1),e){"number"!=typeof n&&(n=1e-4);var r=this.left,o=this.top,a=this.left+this.width,s=this.top+this.height;return(t.x>r||Object(i.e)(t.x,r,n))&&(t.y>o||Object(i.e)(t.y,o,n))&&(t.x<a||Object(i.e)(t.x,a,n))&&(t.y<s||Object(i.e)(t.y,s,n))}return t.x>this.left&&t.y>this.top&&t.x<this.left+this.width&&t.y<this.top+this.height},t.prototype.containsRectangle=function(t){var e=new r.a(t.left,t.top),n=new r.a(t.right,t.bottom);return this.contains(e,!0)&&this.contains(n,!0)},t.prototype.clone=function(){return new t(this.left,this.top,this.width,this.height)},t.prototype.isEmpty=function(){return this.width<=0||this.height<=0},t.prototype.inflate=function(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t},t.prototype.intersectsWith=function(t){return t.left<this.right&&this.left<t.right&&t.top<this.bottom&&this.top<t.bottom},t.prototype.updateByMatrix=function(t){var e=Math.abs(t.angle%90);if(!Object(i.e)(e,0)&&!Object(i.e)(e,90))throw new a.a("RectangleF cannot be transformed by angle ("+t.angle+"!");var n=new r.a(this.left,this.top),o=new r.a(this.right,this.bottom),s=t.transformPoint(n),l=t.transformPoint(o),u=this.clone();return this._left=s.x,this._top=s.y,this._width=l.x-this._left,this._height=l.y-this._top,u.equals(this)||this._propertyChanged.notify(this),this},t.prototype.getExpanded=function(e){return t.FromLTRB(this.left-e.left,this.top-e.top,this.right+e.right,this.bottom+e.bottom)},t.prototype.toString=function(){return[this.left,this.top,this.width,this.height].join(",")},t.fromString=function(e){var n=e.replace(", ",",").split(",");return new t(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]))},t.fromPoints=function(e,n){return t.FromLTRB(Math.min(e.x,n.x),Math.min(e.y,n.y),Math.max(e.x,n.x),Math.max(e.y,n.y))},t.getMatrix=function(t,e){var n=new o.a,r=t.center,i=e.center;return n.scaleRelativeToPoint(e.width/t.width,e.height/t.height,r),n.translate((i.x-r.x)/n.scaleX,(i.y-r.y)/n.scaleY),n},t.getOverallBounds=function(e){return s.isEmpty(e)?t.empty:e.reduce((function(e,n){return null==e?n.clone():t.union(e,n)}))},Object.defineProperty(t.prototype,"right",{get:function(){return this.left+this.width},set:function(t){this.width=t-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.top+this.height},set:function(t){this.height=t-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new r.a(this.left+this.width/2,this.top+this.height/2)},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t._tolerance=1e-6,t}()},,function(t,e,n){"use strict";n.d(e,"a",(function(){return E.a})),n.d(e,"b",(function(){return p.a})),n.d(e,"c",(function(){return B})),n.d(e,"d",(function(){return A.a})),n.d(e,"e",(function(){return D.a})),n.d(e,"f",(function(){return zt.a})),n.d(e,"g",(function(){return X})),n.d(e,"h",(function(){return Wt})),n.d(e,"i",(function(){return at.a})),n.d(e,"j",(function(){return Bt})),n.d(e,"k",(function(){return Nt})),n.d(e,"l",(function(){return qt})),n.d(e,"m",(function(){return H.a})),n.d(e,"n",(function(){return V.a}));var r,i,o,a=function(){},s=n(411),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(){},c=(l((function(t){var e=o.call(this)||this;return e.points=[],e.__type="AutoEraseEffect",e.points=s.map(t,(function(t){return s.extend(new u,t)})),e}),o=a),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),h=(function(t){c((function(e,n,r,i){var o=t.call(this)||this;return o.__type="CropEffect",o.x=e,o.y=n,o.width=r,o.height=i,o}),t)}(a),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),p=(function(t){h((function(e,n,r,i,o,a){var s=t.call(this)||this;return s.brightness=0,s.contrast=0,s.hue=0,s.saturation=0,s.grayscale=!1,s.sepia=!1,s.__type="FiltersEffect",s.brightness=e,s.contrast=n,s.hue=r,s.saturation=i,s.grayscale=o,s.sepia=a,s}),t)}(a),n(436)),f=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(t){function e(e,n,r,i){return void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,e,n,r,i)||this}return f(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"center":case"bend":case"warp":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.center=e.center,this.item.bend=e.bend,this.item.warp=e.warp},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.typeName="ArchedTextItemHandler",e}(p.a),g=n(407),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),y=function(t){function e(e,n,r,i){return void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,e,n,r,i)||this}return m(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalTextRectangle",{get:function(){return this.item.textRectangle},set:function(t){this.item.textRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalScale",{get:function(){return this.item.verticalScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScale",{get:function(){return this.item.horizontalScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this.item.isVertical},set:function(t){this.item.isVertical=t},enumerable:!0,configurable:!0}),e.prototype.getTextRectangle=function(){var t=this.getControlCenter(),e=g.RotatedRectangleF.fromRectangleF(this.item.textRectangle);return e.transform(this.item.transform.clone(),t),e.toRectangleF()},e.prototype._onItemPropertyChanged=function(e,n){"isVertical"===n&&this.update(),t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.textRectangle=e.textRectangle,this.item.isVertical=e.isVertical},e.prototype._updateEmptyTextControlPoints=function(){var t=this.item.textRectangle;this._controlPoints[0].x=t.left,this._controlPoints[0].y=t.top,this._controlPoints[1].x=t.right,this._controlPoints[1].y=t.bottom;var e=this.canvas;null!=e&&e.redraw()},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="AutoScaledTextItemHandler",e}(p.a),_=n(459),b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,e)||this;if(n.__type="BarcodeHandlerData",null==e||null==e.canvas)return n;if(e.canvas.viewer.configuration&&e.canvas.viewer.configuration.stubImages&&e.canvas.viewer.configuration.stubImages.barcode){var r=e.canvas.viewer.configuration.stubImages.barcode;n.stubText=r.text,n.errorText=r.errorText,n.stubPostScriptName=r.postScriptName}var i=(null!=e.item.parentPlaceholder?e.item.parentPlaceholder.parentContainer.parentComponent:e.item.parentContainer.parentComponent).printAreas.getItem(0);return n.dpi=e.canvas.viewer.configuration&&e.canvas.viewer.configuration.renderingConfig?e.canvas.viewer.configuration.renderingConfig.getHiResRendering(i).dpi:72,n.size=Math.round(Math.max(i.bounds.width,i.bounds.height)/2),n}return b(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),n.currentFileId=e.currentFileId,n.stubTextImageFileId=e.stubTextImageFileId,n.errorTextImageFileId=e.errorTextImageFileId,n.errorMessage=e.errorMessage),t.prototype.applyState.call(this,e,n)},e}(_.a),w=n(513),C=n(408),P=n(605),x=n(520),S=n(419),I=n(426),O=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._currentFileId=null,o._stubTextImageFileId=null,o._errorTextImageFileId=null,o._errorMessage=null,o._maxImageSize=4e6,o._fallbackFileId=null,o._stubImageContainer=new x.a(o._onStubImageLoaded.bind(o)),o}return O(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentFileId",{get:function(){return this._currentFileId},set:function(t){this._currentFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stubTextImageFileId",{get:function(){return this._stubTextImageFileId},set:function(t){this._stubTextImageFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorTextImageFileId",{get:function(){return this._errorTextImageFileId},set:function(t){this._errorTextImageFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorMessage",{get:function(){return this._errorMessage},set:function(t){this._errorMessage=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._imageContainer.isLoaded&&!(this._showStubImage&&!this._stubImageContainer.isLoaded)},enumerable:!0,configurable:!0}),e.prototype.quickUpdate=function(){this.isVisible()&&this.canvas&&!this.canvas.service.imageLoaderService.hasImageContainerFor(this._fileId)&&t.prototype.quickUpdate.call(this)},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){var e=null!=this.parentPlaceholder?this.parentPlaceholder.rectangle:this.rectangle,n=this.rectangle,r=this.isNormalRenderingType?this.item.opacity:1,i=this._getItemColorPreviews(),o=i.fillColorPreview,a=i.borderColorPreview,s=i.altBorderColorPreview;S.a.fillRectangle(t,n,null==o?void 0:o.toString(),r),this._imageContainer.isLoaded&&this._drawImage(t,this.canvas.disableSmoothing),this._stubImageContainer.isLoaded&&this._drawImage(t,this.canvas.disableSmoothing,1,this._stubImageContainer.image),(this._imageContainer.isLoading||this._stubImageContainer.isLoading)&&this.canvas.drawWaitClock(t,new g.PointF(e.centerX,e.centerY));var l=this._getActualBorderWidth();n.width+=l,n.height+=l;var u=g.Path.rotatedRectangle(n);S.a.drawStroke(t,u,n.center,new g.Transform,l,null==a?void 0:a.toString(),null==s?void 0:s.toString(),this.item.opacity,this.item.dash)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onResized=function(){return this.update(),t.prototype.onResized.call(this)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._stubImageContainer.dispose()},e.prototype._updateImpl=function(e,n){return r=this,i=void 0,a=function(){var r,i=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){return this.isVisible()?(null==this.currentFileId&&null==this.errorMessage||!this._isSquareBarcodeFormat()&&!1===this.item.barcodeOptions.pureBarcode?(r=function(){var t;"function"==typeof n&&n(),null===(t=i.canvas)||void 0===t||t.updateSelection()},t.prototype._update.call(this,null,e,r)):this.quickUpdate(),[2]):[2]}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}));var r,i,o,a},e.prototype._createDataInstance=function(t){return new v(t)},e.prototype._onItemPropertyChanged=function(e,n){var r=this;switch(this._fallbackFileId=this._fileId,n){case"barcodeFormat":case"barcodeOptions":this._fallbackFileId=null;case"barcodeContent":case"color":this.currentFileId=null,this.stubTextImageFileId=null,this.errorTextImageFileId=null,this.errorMessage=null,this.update(null,(function(){null==r.errorMessage&&(r._fallbackFileId=null)}))}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._createImageUrl=function(){var t,e,n=this.canvas;if(null==this._fileId||null==n)return null;var r=n.zoom,i=r*I.b.screenDpi/72,o=r*I.b.screenDpi/72,a=this.rectangle;t=a.width*i,e=a.height*o;var s=this._maxImageSize/t/e;return s<1&&(t*=s=Math.sqrt(s),e*=s),t=Math.round(t),e=Math.round(e),this._pixelWidth=t,this._pixelHeight=e,P.a.getImageUrl(n,this._fileId,this._pixelWidth,this._pixelHeight,!1)},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading||!(this._showStubImage&&!this._stubImageContainer.isLoading)},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t,this._showStubImage&&(this._stubImageContainer.isLoading=t)},e.prototype._updateImageUrl=function(){t.prototype._updateImageUrl.call(this),this._updateStubImageUrl()},e.prototype._updateStubImageUrl=function(){if(this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createStubImageUrl();e!==this._stubImageContainer.source&&(null==e?(this._stubImageContainer.clear(),t.redraw()):this._stubImageContainer.updateUrl(e))}}},e.prototype._onImageLoaded=function(t,e){this._imageContainer.isLoading=!1,this._stubImageContainer.isLoading||(null!=this.canvas&&(this.canvas.redraw(),this.canvas.updateSelection()),this._dispatchReadyEvent())},Object.defineProperty(e.prototype,"_fileId",{get:function(){var t;return null!==(t=this.currentFileId)&&void 0!==t?t:this._fallbackFileId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_showStubImage",{get:function(){return this.item.barcodeData.isEmpty||null!=this.errorMessage},enumerable:!0,configurable:!0}),e.prototype._createStubImageUrl=function(){var t=this.item.barcodeData.isEmpty?this.stubTextImageFileId:this.errorTextImageFileId;if(null!=t)return P.a.getImageUrl(this.canvas,t,this._pixelWidth,this._pixelHeight,!1)},e.prototype._onStubImageLoaded=function(t,e){this._stubImageContainer.isLoading=!1,this._imageContainer.isLoading||(null!=this.canvas&&(this.canvas.redraw(),this.canvas.updateSelection()),this._dispatchReadyEvent())},e.prototype._isSquareBarcodeFormat=function(){var t=this.item.barcodeFormat;return t==C.j.QR_CODE||t==C.j.AZTEC||t==C.j.DATA_MATRIX},e.typeName="BarcodeItemHandler",e}(w.a),E=n(452),L=n(522),R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="CurvedTextHandlerData",null==e||(n.firstUpdateIsComplete=e.firstUpdateIsComplete),n}return R(e,t),e.prototype.applyState=function(e,n){t.prototype.applyState.call(this,e,n),null!=n&&(n.firstUpdateIsComplete=e.firstUpdateIsComplete)},e}(L.a),j=n(523),A=n(447),F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return F(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype._onItemPropertyChanged=function(e,n){"colorGroups"===n&&null!=this.canvas&&(this.update(),this.canvas.redraw()),t.prototype._onItemPropertyChanged.call(this,e,n)},e}(A.a),M=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return M(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstUpdateIsComplete",{get:function(){return this._firstUpdateIsComplete},set:function(t){this._firstUpdateIsComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textPath",{get:function(){var t=this.getControlCenter(),e=this.item.textPath.clone(),n=this.item.transform.clone();return e.transform(n,t),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalTextPath",{get:function(){return this.item.textPath},set:function(t){this.item.textPath=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPath",{get:function(){return this.item.fitToPath},set:function(t){this.item.fitToPath=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this.item.stretch},set:function(t){this.item.stretch=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalFontSize",{get:function(){return this.item.originalFontSize},set:function(t){this.item.originalFontSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPathStep",{get:function(){return this.item.fitToPathStep},set:function(t){this.item.fitToPathStep=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.item.start},set:function(t){this.item.start=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.item.end},set:function(t){this.item.end=t},enumerable:!0,configurable:!0}),e.prototype.onResized=function(){var e=this.rectangle.height/this._height,n=parseFloat((this.item.font.size*e).toFixed(1)),r=this.canvas;if(null!=r){var i=r.minFontSize;n="number"==typeof i?Math.max(n,i):n;var o=r.maxFontSize;n="number"==typeof o?Math.min(n,o):n}return Object(g.EqualsOfFloatNumbers)(n,this.item.font.size,.01)?(null!=this._startRectangle?(this.setRectangle(this._startRectangle),r.updateSelection(),delete this._startRectangle):this.update(),!1):t.prototype.onResized.call(this)},e.prototype.drawItemHandler=function(e){t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$&&S.a.drawPath(e,this.item.textPath,this.getControlCenter(),this.item.transform,1,"red",1)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.textPath=e.textPath,this.item.fitToPath=e.fitToPath,this.item.fitToPathStep=e.fitToPathStep,this.item.stretch=e.stretch,this.item.originalFontSize=e.originalFontSize,this.item.start=e.start,this.item.end=e.end},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textPath":case"fitToPath":case"fitToPathStep":case"stretch":case"originalFontSize":case"start":case"end":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDefaultTextControlPoints=function(){this._updateEmptyTextControlPoints()},e.prototype._createDataInstance=function(t){return new k(t)},e.typeName="CurvedTextItemHandler",e}(p.a),z=(n(481),n(469)),D=n(458),H=n(440),W=n(406),U=n(524),V=n(451),q=function(){function t(){}return t.workspaceToContentPoint=function(e,n){return t.controlToContentPoint(t.workspaceToControlPoint(e,n),n)},t.controlToContentPoint=function(t,e){var n=e.getViewportLocation(),r=e.getActualScrollPosition(),i=new g.PointF(0,0),o=t.x,a=t.y;return i.x=o-n.x+r.x,i.y=a-n.y+r.y,i.round()},t.controlToPagePoint=function(t,e){var n=this.getElementPageCoord(e.element),r=t.x,i=t.y,o=r+n.left,a=i+n.top;return new g.PointF(Math.round(o),Math.round(a))},t.contentToControlPoint=function(t,e){var n=e.getViewportLocation(),r=e.getActualScrollPosition(),i=new g.PointF(0,0);return i.x=t.x+n.x-r.x,i.y=t.y+n.y-r.y,i.round()},t.controlToContentRectangle=function(e,n){var r=new g.PointF(e.left,e.top),i=new g.PointF(e.left+e.width,e.top+e.height);return r=t.controlToContentPoint(r,n),i=t.controlToContentPoint(i,n),new g.RectangleF(r.x,r.y,i.x-r.x,i.y-r.y)},t.contentToControlRectangle=function(e,n){var r=new g.PointF(e.left,e.top),i=new g.PointF(e.left+e.width,e.top+e.height);return r=t.contentToControlPoint(r,n),i=t.contentToControlPoint(i,n),new g.RectangleF(r.x,r.y,i.x-r.x,i.y-r.y)},t.workspaceToControlPoint=function(e,n){var r=n.zoom,i=e.x,o=e.y,a=new g.PointF(Math.round(i*r*n.screenXDpi/72),Math.round(o*r*n.screenYDpi/72));return t.contentToControlPoint(a,n).round()},t.productToControlPoint=function(t,e){var n=this.productToWorkspace(t,e.canvas);return this.workspaceToControlPoint(n,e)},t.workspaceToWhiteSpacePoint=function(e,n){var r=t.workspaceToContentPoint(e,n),i=n.rulerEnabled?n.rulerWidth:0,o=n.getViewportLocation();return new g.PointF(r.x-i+o.x,r.y-i+o.y)},t.workspaceToWhiteSpacePointCorrect=function(e,n){var r=this._transformByContentAngleWsToPage(e,n);return t.workspaceToWhiteSpacePoint(r,n)},t.whitespaceToWorkspacePoint=function(e,n){var r=n.rulerEnabled?n.rulerWidth:0,i=n.getViewportLocation();return t.controlToWorkspacePoint(this.contentToControlPoint(new g.PointF(e.x-i.x+r,e.y-i.y+r),n),n)},t.whitespaceToWorkspacePointCorrect=function(e,n){var r=n.rulerEnabled?n.rulerWidth:0,i=n.getViewportLocation(),o=t.controlToWorkspacePoint(this.contentToControlPoint(new g.PointF(e.x-i.x+r,e.y-i.y+r),n),n);return this._transformByContentAnglePageToWs(o,n)},t.controlToWorkspacePoint=function(e,n){var r=n.zoom,i=t.controlToContentPoint(e,n);return new g.PointF(i.x/(r*n.screenXDpi/72),i.y/(r*n.screenYDpi/72))},t.controlToWorkspacePointCorrect=function(e,n){var r=n.zoom,i=t.controlToContentPoint(e,n);return i=new g.PointF(i.x/(r*n.screenXDpi/72),i.y/(r*n.screenYDpi/72)),this._transformByContentAnglePageToWs(i,n)},t.workspaceToControlRectangle=function(e,n){var r=n.zoom,i=n.screenXDpi/72*r,o=n.screenYDpi/72*r,a=new g.RectangleF(Math.round(e.left*i),Math.round(e.top*o),Math.round(e.width*i),Math.round(e.height*o));return t.contentToControlRectangle(a,n)},t.pageToControlPoint=function(t,e){var n=this.getElementPageCoord(e.element),r=t.x-n.left,i=t.y-n.top;return new g.PointF(Math.round(r),Math.round(i))},t.pageToWorkspacePoint=function(e,n,r){void 0===r&&(r=!1);var i=t.controlToWorkspacePoint(this.pageToControlPoint(e,n),n),o=new g.PointF(i.x,i.y);return!0!==r&&(o=this._transformByContentAnglePageToWs(o,n)),o},t.pageToWhitespace=function(t,e){var n=this.pageToWorkspacePoint(t,e,!0);return this.workspaceToWhiteSpacePoint(n,e)},t.workspaceToPagePoint=function(t,e){var n=this.workspaceToControlPointCorrect(t,e);return this.controlToPagePoint(n,e)},t._transformByContentAnglePageToWs=function(t,e){var n=new g.PointF(t.x,t.y),r=e.contentAngle;return r>0&&(n.rotate(-r),90===r?n.translate(0,e.workspaceHeight):180===r?n.translate(e.workspaceWidth,e.workspaceHeight):270===r&&n.translate(e.workspaceWidth,0)),n},t._transformByContentAngleWsToPage=function(t,e){var n=new g.PointF(t.x,t.y),r=e.contentAngle;if(r>0){switch(r){case 0:break;case 90:n.translate(0,-e.workspaceHeight);break;case 180:n.translate(-e.workspaceWidth,-e.workspaceHeight);break;case 270:n.translate(-e.workspaceWidth,0);break;default:throw new Error("Unexpected content angle: "+r)}n.rotate(r)}return n},t.workspaceToControlPointCorrect=function(t,e){var n=this._transformByContentAngleWsToPage(t,e);return this.workspaceToControlPoint(n,e)},t.controlToWorkspaceRectangle=function(e,n){var r=n.zoom,i=1/(r*n.screenXDpi/72),o=1/(r*n.screenYDpi/72),a=t.controlToContentRectangle(e,n);return new g.RectangleF(a.left*i,a.top*o,a.width*i,a.height*o)},t.contentToWhitespaceRectangle=function(t,e){var n=e.rulerEnabled?e.rulerWidth:0,r=e.getViewportLocation();return new g.RectangleF(t.left+r.x-n,t.top+r.y-n,t.width,t.height)},t.workspaceToProduct=function(t,e){var n=null==e?void 0:e.offset;return null==n||n.isOrigin()?t.clone():new g.PointF(t.x-n.x,t.y-n.y)},t.productToWorkspace=function(t,e){var n=null==e?void 0:e.offset;return null==n||n.isOrigin()?t.clone():new g.PointF(t.x+n.x,t.y+n.y)},t.getElementPageCoord=function(t){var e=t.getBoundingClientRect();return{left:e.left,top:e.top}},t}(),G=n(413),$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var i=t.call(this,0,0,0,0,e,n,r)||this;return i._selectionTolerance=15,i._controlPoints=[new g.PointF(e.sourcePoint0.x?e.sourcePoint0.x:0,e.sourcePoint0.y?e.sourcePoint0.y:0),new g.PointF(e.sourcePoint1.x?e.sourcePoint1.x:0,e.sourcePoint1.y?e.sourcePoint1.y:0)],i._makeLineHorizontalWithAngle(),i}return $(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controlPoints",{set:function(t){this._controlPoints=new Array(new g.PointF(t[0].x,t[0].y),new g.PointF(t[1].x,t[1].y)),this.item.sourcePoint0=this._controlPoints[0],this.item.sourcePoint1=this._controlPoints[1],this._makeLineHorizontalWithAngle(),this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.item.width},set:function(t){this.item.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.item.color},set:function(t){this.item.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedWidth",{get:function(){return this.item.fixedWidth},set:function(t){this.item.fixedWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"point0",{get:function(){return this._getActualPoint(this._controlPoints[0])},set:function(t){var e=this.getControlBounds();if(0===e.width||0===e.height){var n=this._getActualPoint(this._controlPoints[1]);this._controlPoints=[t.clone(),n],this.item.transform=new g.Transform}else this._makeLineHorizontalWithAngle(),this._setTransformByPoints(this._controlPoints[0],t,this._controlPoints[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"point1",{get:function(){return this._getActualPoint(this._controlPoints[1])},set:function(t){var e=this.getControlBounds();if(0===e.width||0===e.height){var n=this._getActualPoint(this._controlPoints[0]);this._controlPoints=[n,t.clone()],this.item.transform=new g.Transform}else this._makeLineHorizontalWithAngle(),this._setTransformByPoints(this._controlPoints[1],t,this._controlPoints[0])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rectangle",{get:function(){var e=t.prototype._getRectangle.call(this);return e.height=this._getActualWidth(),e},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this._getActualWidth();if(!(null==t||e<=0))if(this._isReadyToDraw){var n=this._getItemColorPreviews().colorPreview,r=this.point0,i=this.point1,o=this.isNormalRenderingType?this.item.opacity:1;S.a.drawLine(t,r.x,r.y,i.x,i.y,e,null==n?void 0:n.toString(),o)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=q.workspaceToProduct(e,this.canvas),o=this.canvas.zoom*I.b.screenDpi/72,a=this.rectangle,s=!!n&&a.toRectangleF().contains(e),l=this._getActualWidth(),u=(this._selectionTolerance/o-l)/2,c=this._belongToPiece(this.point0,this.point1,i,l,u<0?0:u);return r.body=!(!s&&!c),r},e.prototype.transformByMatrix=function(t,e,n){void 0===n&&(n=null);var r=this.point0,i=this.point1;this.item.transform=new g.Transform;var o=t.transformPoint(r),a=t.transformPoint(i);this.item.sourcePoint0=o,this.item.sourcePoint1=a,this._controlPoints=[o,a],this._makeLineHorizontalWithAngle(),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging(),1===t.scaleX&&1===t.scaleY||this.onResized();var s=this.canvas;null!=s&&(this.updateViolationContainerPosition(),this.canvas.updateSelection(),s.redraw())},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews().colorPreview;return null==this.item.color||null!=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this.isNormalRenderingType?this.item.color:new G.RgbColor(0,0,0,255),e=this._colorPreviewService.getPreview(t);return null!=this.item.color&&null==e&&this._colorPreviewService.subscribeToPreviewLoaded(t,this._onColorPreviewLoaded),{colorPreview:e}},e.prototype._getActualWidth=function(){var t=this.width,e=this.canvas;return this.fixedWidth&&null!=e&&(t/=e.zoom),t},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"width":var r=this.canvas;null!=r&&r.updateSelection();break;case"color":case"fixedWidth":this.canvas.redraw()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getActualPoint=function(t){var e=new g.PointF(t.x,t.y),n=this.getControlCenter();e.translate(-n.x,-n.y);var r=this.item.transform;return e.scale(r.scaleX,r.scaleY),e.rotate(r.angle),e.translate(r.translateX,r.translateY),e.translate(n.x,n.y),e},e.prototype._setTransformByPoints=function(t,e,n){var r=this.getControlCenter(),i=this._getActualPoint(n),o=new g.PointF((i.x+e.x)/2,(i.y+e.y)/2),a=o.x-r.x,s=o.y-r.y,l=new g.PointF(t.x,t.y).translate(-r.x,-r.y),u=new g.PointF(e.x,e.y).translate(-a,-s).translate(-r.x,-r.y),c=(l.x*u.x+l.y*u.y)/Math.sqrt((l.x*l.x+l.y*l.y)*(u.x*u.x+u.y*u.y));c=g.Clamp(-1,c,1);var h=g.ConvertRadianToDegree(Math.acos(c));u=u.rotate(-h),this.item.transform=new g.Transform(u.x/l.x,u.y/l.y,a,s,h)},e.prototype._belongToPiece=function(t,e,n,r,i){var o=r/2+i;return g.getSquareDistanceToSegment(n,t,e)<=o*o},e.prototype._makeLineHorizontalWithAngle=function(){var t=this._controlPoints[0],e=this._controlPoints[1],n=g.getTriangleAngle(t,new g.PointF(t.x,e.y),e);if(0!==n){var r=(t.x+e.x)/2,i=(t.y+e.y)/2,o=t.distance(e);this._controlPoints[0]=new g.PointF(r-o/2,i),this.item.sourcePoint0=this._controlPoints[0],this._controlPoints[1]=new g.PointF(r+o/2,i),this.item.sourcePoint1=this._controlPoints[1],this.angle=n}},e}(E.a),K=n(497),Y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),J=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,0,0,0,0,e,n,r)||this}return Y(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){if(!(null==t||this.item.width<=0))if(this._isReadyToDraw){var e=this.getActualPoints(),n=this._getItemColorPreviews().colorPreview;S.a.drawPolyline(t,e,this.item.width,null==n?void 0:n.toString(),this.item.opacity)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=this.canvas.zoom*I.b.screenDpi/72,o=this._getRectangle(),a=!!n&&o.toRectangleF().contains(e),s=this._belongToLine(e,2/i);return r.body=a||s,r},e.prototype.getControlBounds=function(){var t=0,e=0,n=0,r=0,i=this.item.sourcePoints,o=i.length;o>0&&(t=i[0].x,n=i[0].x,e=i[0].y,r=i[0].y);for(var a=1;a<o;a++)t=Math.min(i[a].x,t),n=Math.max(i[a].x,n),e=Math.min(i[a].y,e),r=Math.max(i[a].y,r);var s=n-t,l=r-e;return new g.RectangleF(t,e,s,l)},e.prototype._belongToLine=function(t,e){for(var n=this.getActualPoints(),r=!1,i=this.item.width/2+e,o=i*i,a=1;a<n.length;a++)if(Object(g.getSquareDistanceToSegment)(t,n[a-1],n[a])<=o){r=!0;break}return r},e.prototype.getActualPoints=function(){for(var t=[],e=this.getControlCenter(),n=0;n<this.item.sourcePoints.length;n++)t.push(this._getActualPointFromControlPoint(this.item.sourcePoints[n],e));return t},e.prototype._getActualPointFromControlPoint=function(t,e){var n=new g.PointF(t.x,t.y);n.translate(-e.x,-e.y);var r=this.item.transform;return n.scale(r.scaleX,r.scaleY),n.rotate(r.angle),n.translate(r.translateX,r.translateY),n.translate(e.x,e.y),n},e.prototype.addPoint=function(t){this.insertPoint(t,this.item.sourcePoints.length)},e.prototype.insertPoint=function(t,e){if(e<0||e>this.item.sourcePoints.length)throw new W.f(K.a);var n=this.getActualPoints();n.splice(e,0,t),this.item.sourcePoints=n,this.item.transform=new g.Transform},e.prototype.setPoint=function(t,e){if(e<0||e>=this.item.sourcePoints.length)throw new W.f(K.e);var n=this.getActualPoints();n[e]=t,this.item.sourcePoints=n,this.item.transform=new g.Transform,this.raiseChanged()},e.prototype.getPointsCount=function(){return this.item.sourcePoints.length},e.prototype.getPoint=function(t){if(t<0||t>=this.item.sourcePoints.length)throw new W.f(K.e);return this._getActualPointFromControlPoint(this.item.sourcePoints[t],this.getControlCenter())},e.prototype.removePoint=function(t){if(t<0||t>=this.item.sourcePoints.length)throw new W.f(K.d);var e=this.item.sourcePoints;e.splice(t,1),this.item.sourcePoints=e},Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews().colorPreview;return null==this.item.color||null!=t},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this._colorPreviewService.getPreview(this.item.color);return null!=this.item.color&&null==t&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.color,this._onColorPreviewLoaded),{colorPreview:t}},e.prototype._onItemPropertyChanged=function(t,e){},e.prototype._getBoundsMargin=function(){return this.item.width},e.prototype._addPoint=function(t){var e=this.canvas,n=-1;e&&(n=I.b.screenDpi/72*e.zoom);var r=this.item.sourcePoints;if(r.length>0){var i=r[r.length-1].distance(t);(-1===n||i*n>30)&&r.push(t)}else r.push(t)},e.typeName="PolylineItemHandler",e}(E.a),Z=n(521),Q=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tt=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,e,n,r)||this}return Q(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashWidth",{get:function(){return this.item.dashWidth},set:function(t){this.item.dashWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altDashWidth",{get:function(){return this.item.altDashWidth},set:function(t){this.item.altDashWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altColor",{get:function(){return this.item.altColor},set:function(t){this.item.altColor=t},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this._getActualWidth();if(!(null==t||e<=0))if(this._isReadyToDraw){var n=this._getItemColorPreviews(),r=n.colorPreview,i=n.altColorPreview,o=this.point0,a=this.point1,s=this.dashWidth,l=this.altDashWidth;if(this.fixedWidth){var u=this.canvas.zoom;s/=u,l/=u}S.a.drawDashedLine(t,o.x,o.y,a.x,a.y,e,null==r?void 0:r.toString(),null==i?void 0:i.toString(),s,l,this.item.opacity)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype._getItemColorPreviews=function(){var e=t.prototype._getItemColorPreviews.call(this).colorPreview,n=this._colorPreviewService.getPreview(this.item.altColor);return null!=this.item.altColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.altColor,this._onColorPreviewLoaded),{colorPreview:e,altColorPreview:n}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"altColor":case"dashWidth":case"altDashWidth":this.canvas.redraw()}t.prototype._onItemPropertyChanged.call(this,e,n)},e}(X),et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nt=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,0,0,0,0,e,n,r)||this}return et(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this.item.locked},set:function(t){this.item.locked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this.item.cols},set:function(t){this.item.cols=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this.item.rows},set:function(t){this.item.rows=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepX",{get:function(){return this.item.stepX},set:function(t){this.item.stepX=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepY",{get:function(){return this.item.stepY},set:function(t){this.item.stepY=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalLineColor",{get:function(){return this.item.horizontalLineColor},set:function(t){this.item.horizontalLineColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalLineColor",{get:function(){return this.item.verticalLineColor},set:function(t){this.item.verticalLineColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this.item.lineWidth},set:function(t){this.item.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedLineWidth",{get:function(){return this.item.fixedLineWidth},set:function(t){this.item.fixedLineWidth=t},enumerable:!0,configurable:!0}),e.prototype.getControlBounds=function(){var t=this.item.cols*this.stepX,e=this.item.rows*this.stepY;return new g.RectangleF(this.item.location.x,this.item.location.y,t,e)},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){t.save();var e=this.item.location,n=this.getControlCenter(),r=this._getItemColorPreviews(),i=r.horizontalLineColorPreview,o=r.verticalLineColorPreview,a=this.lineWidth;this.fixedLineWidth&&(a/=this.canvas.zoom);for(var s=a/2/this.item.transform.scaleX,l=a/2/this.item.transform.scaleY,u=this.stepX*this.cols,c=this.stepY*this.rows,h=0;h<=this.rows;h++){var p=e.x-s,f=e.x+u+s,d=e.y+h*this.stepY,m=new g.PointF(p,d).transform(this.item.transform,n),y=new g.PointF(f,d).transform(this.item.transform,n);S.a.drawLine(t,m.x,m.y,y.x,y.y,a,null==i?void 0:i.toString(),this.item.opacity)}for(h=0;h<=this.cols;h++){var _=e.x+h*this.stepX,b=e.y-l,v=e.y+c+l;m=new g.PointF(_,b).transform(this.item.transform,n),y=new g.PointF(_,v).transform(this.item.transform,n),S.a.drawLine(t,m.x,m.y,y.x,y.y,a,null==o?void 0:o.toString(),this.item.opacity)}t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews(),e=t.horizontalLineColorPreview,n=t.verticalLineColorPreview;return!(null!=this.item.horizontalLineColor&&null==e||null!=this.item.verticalLineColor&&null==n)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this._colorPreviewService.getPreview(this.item.horizontalLineColor);null!=this.item.horizontalLineColor&&null==t&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.horizontalLineColor,this._onColorPreviewLoaded);var e=this._colorPreviewService.getPreview(this.item.verticalLineColor);return null!=this.item.verticalLineColor&&null==e&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.verticalLineColor,this._onColorPreviewLoaded),{horizontalLineColorPreview:t,verticalLineColorPreview:e}},e.prototype._onItemPropertyChanged=function(t,e){},e.prototype._getBoundsMargin=function(){var t=this.lineWidth;return this.fixedLineWidth&&(t/=this.canvas.zoom),t},e}(E.a),rt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=function(t){function e(e,n,r){void 0===n&&(n=null);var i=this;return null!=e?(i=t.call(this,g.Path.ellipse(e.sourceRectangle.left,e.sourceRectangle.top,e.sourceRectangle.width,e.sourceRectangle.height),e,n,null,r)||this)._controlPoints=[new g.PointF(e.sourceRectangle.left,e.sourceRectangle.top),new g.PointF(e.sourceRectangle.right,e.sourceRectangle.bottom)]:i=t.call(this,null,e,n,null,r)||this,i._allowNegativeResize=!1,i}return rt(e,t),e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=this._getRectangle(),o=e.clone();o.translate(-i.centerX,-i.centerY),o.rotate(-i.angle),o.scale(2/i.width,2/i.height);var a=o.x*o.x+o.y*o.y<1,s=!!n&&i.toRectangleF().contains(e);return r.body=a||s,r},e}(V.a),ot=n(444),at=n(462),st=n(428),lt=n(473);!function(t){t[t.page=0]="page",t[t.workspace=1]="workspace"}(i||(i={}));var ut=function(){function t(t,e){this._selectionHandler=t,this._hitTestManager=e}return t.prototype.hitTest=function(t){var e;if(!this._selectionHandler.enabled)return{};var n,r,o=this._selectionHandler.visibleRectangle,a=this._hitTestManager.getItemHandlersByHitTest(t,i.workspace);if(null==o)return{selection:0===a.length};var s=this._selectionHandler.selectedItemHandlers;n=s.length>1?s.toArray().reduce((function(t,e){return Math.min(t,e.getSelectionTolerance())}),s.getItem(0).getSelectionTolerance()):null!==(e=null==(r=s.getItem(0))?void 0:r.getSelectionTolerance())&&void 0!==e?e:0;var l=1===s.length&&this._selectionHandler.currentItemHandler instanceof X,u=this._hitTestManager.hitTestSelection(o,t,l,n),c=!1;if(r instanceof H.a){var h=r;if(r.editing&&a[0]==r&&(u.selection=!1),h.isContentUpdating()&&u.body&&!u.resize)return u.drag=!0,u;c=r.editing&&r.isCoverMode()}r instanceof at.a&&r.isInEdit&&(u.resize=!1,u.rotate=!1,u.body=!1);var p=this._selectionHandler.manipulationPermissions;if(u.rotate=u.rotate&&p.allowRotate&&!c&&this._selectionHandler.allowManipulation,u.resize){var f=u.resizeIndex,d=jt.isEdgeResizeGrip(f)&&this._getEdgeResize(p,r),g=jt.isCornerResizeGrip(f)&&this._getCornerResize(p,r,!1,C.hb.arbitrary),m=jt.isCornerResizeGrip(f)&&this._getCornerResize(p,r,!0,C.hb.arbitrary),y=jt.isCornerResizeGrip(f)&&this._getCornerResize(p,r,!1,C.hb.proportional),_=jt.isCornerResizeGrip(f)&&this._getCornerResize(p,r,!0,C.hb.proportional);u.arbitraryResize=d||g,u.cornerArbitraryResize=g||m,u.cornerProportionalResize=y||_,u.proportionalResize=y&&!l,u.resize=u.arbitraryResize||u.proportionalResize}return u.dragX=u.body&&p.allowMoveHorizontal&&this._selectionHandler.allowManipulation,u.dragY=u.body&&p.allowMoveVertical&&this._selectionHandler.allowManipulation,u.drag=u.dragX||u.dragY,u},t.prototype._getEdgeResize=function(t,e){return!(null!=e&&"PlainTextItemHandler"===e.getTypeName()||!this._selectionHandler.allowManipulation)&&t.resizeGrips.edge},t.prototype._getCornerResize=function(t,e,n,r){if(r===C.hb.arbitrary&&null!=e&&"PlainTextItemHandler"===e.getTypeName()||!this._selectionHandler.allowManipulation)return!1;var i=t.resizeGrips;return null!=i.corner&&0!==i.corner.length&&(n&&i.corner.length>1?i.corner[1]:i.corner[0])===r},t}(),ct=n(425),ht=n(594),pt=n(410),ft=n(409),dt=function(){function t(t){var e=this;void 0===t&&(t=null),this._selectionModifier=t,this._resizeIndex=null,this._resizeOrigin=null,this._allowNegativeResize=null,this._itemHandlerResizeStartRects=null,this._state=wt.Idle,this.startMovingByPoint=function(t,n){e._checkStartArguments("startMovingByPoint"),e._setStartParams(n,t),e._setState(wt.Drag)},this.updateMovingByPoint=function(t){var n,r,i,o,a;e._checkUpdateArguments("updateMove",wt.Drag,t.finished);var s=t.point,l=t.finished,u=null!==(n=e._lastPoint)&&void 0!==n?n:e._startPoint,c=new g.PointF(s.x-e._startPoint.x,s.y-e._startPoint.y);if(null!=(null===(r=e._selectionModifier)||void 0===r?void 0:r.beforeMovePerformed)){var h={delta:c,momentDelta:new g.PointF(s.x-u.x,s.y-u.y),startPoint:e._startPoint,startRectangle:e._startRectangle};c=null===(i=e._selectionModifier)||void 0===i?void 0:i.beforeMovePerformed(h)}var p=new g.PointF(e._startPoint.x+c.x-u.x,e._startPoint.y+c.y-u.y);null===(o=t.allowMoveHorizontal)||void 0===o||o||(p.x=0),null===(a=t.allowMoveVertical)||void 0===a||a||(p.y=0),e._lastPoint=new g.PointF(u.x+p.x,u.y+p.y);var f=e._rectangle.clone();f.centerX=e._rectangle.centerX+p.x,f.centerY=e._rectangle.centerY+p.y,e._updateRectangle(f,l),e._rectangleCenterChanged.notify({delta:p.clone(),finished:l})},this.startResizingByPoint=function(t,n,r,i,o){if(e._checkStartArguments("startResizingByPoint"),null==r||null==i)throw e._reset(),new W.a("SelectionRectangleHandler.startResize: resizeIndex and allowNegativeResize cannot be null!");e._resizeIndex=r,e._allowNegativeResize=i,e._setStartParams(n,t),e._setState(wt.Resize);var a=new g.PointF(e._startRectangle.center.x-kt.cw[e._resizeIndex]*e._startRectangle.width/2,e._startRectangle.center.y-kt.ch[e._resizeIndex]*e._startRectangle.height/2);e._resizeOrigin=a.rotateAt(e._startRectangle.angle,e._startRectangle.center),e._itemHandlerResizeStartRects=e._getItemHandlersRects(o)},this._setState=function(t){e._state!==t&&(e._state=t,e._stateChanged.notify(t))},this._reset=function(){e._lastPoint=null,e._startPoint=null,e._startRectangle=null,e._resizeIndex=null,e._resizeOrigin=null,e._setState(wt.Idle)},this._rectangleChanged=new ft.a,this._rectangleAngleChanged=new ft.a,this._rectangleResized=new ft.a,this._rectangleCenterChanged=new ft.a,this._stateChanged=new ft.a,this._checkStartArguments=function(t){try{if(e._state!==wt.Idle)throw new W.a("SelectionRectangleHandler."+t+": cannot start operation because "+wt[e._state]+" operation is in progress!")}catch(n){throw e._reset(),n}},this._checkUpdateArguments=function(t,n,r){try{if(null==e._rectangle)throw new W.a("SelectionRectangleHandler."+t+": rectangle must be defined");if(null==e._startRectangle||e._state!==n)throw new W.a("SelectionRectangleHandler."+t+": "+wt[e._state]+" operation haven't started");if(r&&e._state===wt.Idle)throw new W.a("SelectionRectangleHandler."+t+": "+wt[wt.Idle]+" cannot be finished")}catch(i){throw e._reset(),i}}}return Object.defineProperty(t.prototype,"rectangle",{get:function(){return this._rectangle},enumerable:!0,configurable:!0}),t.prototype.startRotatingByPoint=function(t,e){this._checkStartArguments("startRotatingByPoint"),this._setStartParams(e,t),this._setState(wt.Rotate)},t.prototype.updateRotatingByPoint=function(t){var e;this._checkUpdateArguments("updateRotation",wt.Rotate,t.finished);var n=t.point,r=t.tolerance,i=t.rotationStep,o=t.finished,a=n.clone(),s=this._startPoint.clone(),l=this._rectangle.clone(),u=new g.PointF(l.centerX,l.centerY),c=Object(g.getTriangleAngle)(a,s,u);if(!Object(g.EqualsOfFloatNumbers)(c,0)){var h=c=Object(g.normalizeAngle)(this._startRectangle.angle+c),p=c%i;if(p<r?h=i*Math.floor(c/i):p>i-r&&(h=i*Math.floor(c/i+1)),l.angle=Object(g.normalizeAngle)(h),null!=(null===(e=this._selectionModifier)||void 0===e?void 0:e.beforeRotatePerformed)){var f={currentRect:l,previousRectangle:this._rectangle};l=this._selectionModifier.beforeRotatePerformed(f)}var d={angle:l.angle-this._rectangle.angle,origin:l.center,finished:o};this._updateRectangle(l,o),this._rectangleAngleChanged.notify(d)}},t.prototype._getItemHandlersRects=function(t){var e=[],n=function(t){e.push({itemType:t.item.type,startRectangle:t.rectangle})};return t.forEach((function(t){t instanceof A.a?t.getNestedItemHandlers(!0).forEach(n):n(t)})),e},t.prototype.updateResizingByPoint=function(t,e){var n;void 0===e&&(e=null),this._checkUpdateArguments("updateResize",wt.Resize,t.finished);var r=t.point,i=t.arbitraryResize,o=t.finished;null==r&&(r=this._lastPoint),this._lastPoint=r;var a,s=this._startRectangle,l=this._rectangle.clone(),u=new g.PointF(r.x-s.centerX,r.y-s.centerY);u.rotate(-l.angle);var c=new g.PointF(this._startPoint.x-s.centerX,this._startPoint.y-s.centerY);c.rotate(-l.angle);var h=u.translate(-c.x,-c.y),p=1,f=1;if(i)l.width=s.width+h.x*kt.cw[this._resizeIndex],l.height=s.height+h.y*kt.ch[this._resizeIndex],6!==this._resizeIndex&&5!==this._resizeIndex||(p=-1,f=-1),1===this._resizeIndex&&(p=-1,f=-1),2===this._resizeIndex&&(p=1,f=-1),4===this._resizeIndex&&(p=-1,f=1);else{var d=h.x*kt.cw[this._resizeIndex]/s.width,m=h.y*kt.ch[this._resizeIndex]/s.height,y=d<m?d:m;h.x=s.width*y,h.y=s.height*y,l.width=s.width+h.x,l.height=s.height+h.y}if(this._allowNegativeResize||l.width>=0&&l.height>=0){if((a=new g.PointF(h.x/2*kt.cw[this._resizeIndex],h.y/2*kt.ch[this._resizeIndex])).rotate(l.angle),l.centerX=s.centerX+a.x*p,l.centerY=s.centerY+a.y*f,i){var _=a=new g.PointF(s.centerX,s.centerY);_.rotate(-l.angle),_.x=_.x+h.x/2*kt.cw[this._resizeIndex]*kt.cw[this._resizeIndex],_.y=_.y+h.y/2*kt.ch[this._resizeIndex]*kt.ch[this._resizeIndex],_.rotate(l.angle),l.centerX=_.x,l.centerY=_.y}}else{var b=new g.PointF(-kt.cw[this._resizeIndex]*this._rectangle.width/2,-kt.ch[this._resizeIndex]*this._rectangle.height/2);if(b.rotate(this._rectangle.angle),b.translate(this._rectangle.centerX,this._rectangle.centerY),l.center=b,i)l.width=Math.max(l.width,1),l.height=Math.max(l.height,1);else{var v=s.width/s.height;v>=1?(l.width=Math.max(l.width,1*v),l.height=Math.max(l.height,1)):(l.width=Math.max(l.width,1),l.height=Math.max(l.height,1/v))}var w=new g.PointF(kt.cw[this._resizeIndex]*l.width/2,kt.ch[this._resizeIndex]*l.height/2);w.rotate(l.angle),l.centerX+=w.x,l.centerY+=w.y}if(null!=(null===(n=this._selectionModifier)||void 0===n?void 0:n.beforeResizePerformed)){var C={arbitraryResize:t.arbitraryResize,currentRect:l,previousRectangle:this._rectangle,resizeIndex:t.resizeIndex,startRectangle:this._startRectangle,startItemHandlersRects:this._itemHandlerResizeStartRects,rectangleItemHandlers:e};l=this._selectionModifier.beforeResizePerformed(C)}Object(st.d)(l.width,0)&&(l.width=1),Object(st.d)(l.height,0)&&(l.height=1);var P=l.width/this._rectangle.width,x=l.height/this._rectangle.height,S={finished:o,origin:this._resizeOrigin,scaleX:P,scaleY:x,angle:l.angle};this._updateRectangle(l,o),this._rectangleResized.notify(S)},t.prototype.startMove=function(t){this._checkStartArguments("startMove"),this._setStartParams(t,null),this._setState(wt.Drag)},t.prototype.move=function(t){var e,n,r,i;this._checkUpdateArguments("move",wt.Drag,t.finished);var o=t.finished,a=t.delta;if(null!=(null===(e=this._selectionModifier)||void 0===e?void 0:e.beforeMovePerformed)){var s={delta:null,momentDelta:a,startPoint:this._startPoint,startRectangle:this._startRectangle};a=null===(n=this._selectionModifier)||void 0===n?void 0:n.beforeMovePerformed(s)}null===(r=t.allowMoveHorizontal)||void 0===r||r||(a.x=0),null===(i=t.allowMoveVertical)||void 0===i||i||(a.y=0);var l=this._rectangle.clone();l.centerX+=a.x,l.centerY+=a.y,this._updateRectangle(l,t.finished),this._rectangleCenterChanged.notify({delta:a.clone(),finished:o})},t.prototype._updateRectangle=function(t,e){this._rectangle=t;var n={rectangle:t,finished:e};this._rectangleChanged.notify(n),e&&(this._setState(wt.Idle),this._reset())},t.prototype.addRectangleChanged=function(t){this._rectangleChanged.add(t)},t.prototype.removeRectangleChanged=function(t){this._rectangleChanged.remove(t)},t.prototype.addRectangleAngleChanged=function(t){this._rectangleAngleChanged.add(t)},t.prototype.removeRectangleAngleChanged=function(t){this._rectangleAngleChanged.remove(t)},t.prototype.addRectangleResized=function(t){this._rectangleResized.add(t)},t.prototype.removeRectangleResized=function(t){this._rectangleResized.remove(t)},t.prototype.addRectangleMoved=function(t){this._rectangleCenterChanged.add(t)},t.prototype.removeRectangleMoved=function(t){this._rectangleCenterChanged.remove(t)},t.prototype.addStateChanged=function(t){this._stateChanged.add(t)},t.prototype.removeStateChanged=function(t){this._stateChanged.remove(t)},t.prototype._setStartParams=function(t,e){this._rectangle=t,this._startRectangle=t,null!=e&&(this._startPoint=e)},t}(),gt=n(489),mt=n(463);function yt(t){return t instanceof D.b&&!t.item.source.isVector}function _t(t){return t instanceof H.a?t.content:t}function bt(t){return t instanceof A.a?t.getNestedItemHandlers():[t]}function vt(t,e){var n,r,i,o;return{width:null!==(r=t.startRectangle.width/(null===(n=e.startRectangle)||void 0===n?void 0:n.width))&&void 0!==r?r:e.rectangle.width,height:null!==(o=t.startRectangle.height/(null===(i=e.startRectangle)||void 0===i?void 0:i.height))&&void 0!==o?o:e.rectangle.height}}var wt,Ct=function(){function t(t,e){this._length=t,this._center=e}return Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),t.fromAxisX=function(e){return new t(e.width,e.centerX)},t.fromAxisY=function(e){return new t(e.height,e.centerY)},t}(),Pt=function(){function t(t,e){this._start=t,this._target=e}return Object.defineProperty(t.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),t.fromAxisX=function(t,e){return{start:Ct.fromAxisX(t.startRectangle),target:Ct.fromAxisX(e)}},t.fromAxisY=function(t,e){return{start:Ct.fromAxisY(t.startRectangle),target:Ct.fromAxisY(e)}},t}(),xt=n(421),St=function(){function t(){}return t.prototype.applyTo=function(t,e,n){var r=t.clone();if(null==e.rectangleItemHandlers||!function(t,e){var n=t.height-e.previousRectangle.height,r=t.width-e.previousRectangle.width,i=Math.sign(r*t.width);return Math.sign(n*t.height)>0||i>0}(t,e))return r;var i=this._getHandlersToConstrain(e.rectangleItemHandlers);return 0==i.length?r:(r=this._applyToX(t,e,i,n),r=this._applyToY(r,e,i,n))},t.prototype._applyToX=function(t,e,n,r){return this._applyToAxis(t,e,n,r,(function(t){return t.width}),(function(t){return t.dpiX}),Pt.fromAxisX,Ct.fromAxisX,(function(t,e){t.width=e.length,t.centerX=e.center}))},t.prototype._applyToY=function(t,e,n,r){return this._applyToAxis(t,e,n,r,(function(t){return t.height}),(function(t){return t.dpiY}),Pt.fromAxisY,Ct.fromAxisY,(function(t,e){t.height=e.length,t.centerY=e.center}))},t.prototype._applyToAxis=function(t,e,n,r,i,o,a,s,l){var u=t.clone(),c=this._getMinDpiAfterResizeImageInfo(n,i(t),e,i,o),h=c.handler,p=c.dpi,f=c.sizeRatioToSelection;if(null==h.startRectangle)return u;var d=h.item.source,g=i(xt.a.getImageSizeInPoints(d)),m=Object(st.h)(g,o(d),i(e.startRectangle)/f);return p<r&&l(u,this._constrainAxis(a(e,t),s(h.startRectangle),{length:g,dpi:o(d),lengthRatioToSelection:f},m,r)),u},t.prototype._constrainAxis=function(t,e,n,r,i){var o=t.target,a=Math.abs(t.target.length)<Math.abs(t.start.length);if(r<i)return a||(o=new Ct(t.start.length*Math.sign(t.target.length),t.start.center*Math.sign(t.target.length))),o;var s=n.length*n.lengthRatioToSelection*Math.sign(t.target.length)*n.dpi/i,l=Math.sign(t.target.center-e.center);return new Ct(Object(st.k)(s,t.target.length),e.center+(s-e.length)/2*l)},t.prototype._getMinDpiAfterResizeImageInfo=function(t,e,n,r,i){var o,a,s={handler:t[0],dpi:1/0,sizeRatioToSelection:0};try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),u=l.next();!u.done;u=l.next()){var c=u.value,h=r(vt(n,c)),p=e/h,f=c.item.source,d=r(xt.a.getImageSizeInPoints(f)),g=Object(st.h)(d,i(f),p);g<s.dpi&&(s.handler=c,s.dpi=g,s.sizeRatioToSelection=h)}}catch(m){o={error:m}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return s},t.prototype._getHandlersToConstrain=function(t){return Object(mt.f)(t.map(bt)).map(_t).filter(yt).map((function(t){return t}))},t}(),It=function(){function t(t,e,n){this._selectionHandler=t,this._canvas=e,this._snapLinesHandler=n,this._minDpiResizeConstraint=new St}return Object.defineProperty(t.prototype,"ignoreSnapLines",{set:function(t){this._ignoreSnapLines=t},enumerable:!0,configurable:!0}),t.prototype.beforeMovePerformed=function(t){var e,n=this._canvas.contentEditingPlaceholderItemHandler,r=t.delta;if(this._ignoreSnapLines)this._snapLinesHandler.resetActiveLines();else if(null==this._canvas.contentEditingPlaceholderItemHandler){var i=this._selectionHandler.manipulationPermissions;r=this._snapLinesHandler.constrainMoveDataToSnapLines(t,this._canvas,i.allowMoveHorizontal,i.allowMoveVertical)}var o=this.getRectWithFrames(t.startRectangle);return null==n?r=this._constrainMoveDataToRegion(o.bounds,r):n.item.isCoverMode&&(r=this._constrainMoveDataToPlaceholderCover(t.startRectangle,n.rectangle,r)),null!==(e=null!=r?r:t.delta)&&void 0!==e?e:t.momentDelta},t.prototype.beforeResizePerformed=function(t){var e,n,r=null,i=this._canvas.contentEditingPlaceholderItemHandler;null!=i&&i.item.isCoverMode&&(r=this._constrainResizeDataToPlaceholderCover(t.currentRect,t.startRectangle,i.rectangle,t.resizeIndex));var o=this._getMinSizeConstraintConfiguration(t.startRectangle,t.startItemHandlersRects),a=o.minWidth,s=o.minHeight;r=this._constrainResizeDataToMinSize(t.startRectangle,null!=r?r:t.currentRect,t.arbitraryResize,t.resizeIndex,a,s),null==this._canvas.contentEditingPlaceholderItemHandler&&(r=this._constrainResizeDataToSnapLines(t,null!=r?r:t.currentRect));var l=null===(n=null===(e=this._canvas.viewer.configuration)||void 0===e?void 0:e.handlers)||void 0===n?void 0:n.imageMinDpi;return null!=l&&(r=this._minDpiResizeConstraint.applyTo(null!=r?r:t.currentRect,t,l)),r=null!=r?r:t.currentRect,this._validateRectRelativeToRegion(r)?r:t.previousRectangle},t.prototype.beforeRotatePerformed=function(t){return this._validateRectRelativeToRegion(t.currentRect)?t.currentRect:t.previousRectangle},t.prototype.getRectWithFrames=function(t){for(var e=this._selectionHandler.selectedItemHandlers,n=this.getRectangleWithBorder(t),r=0;r<e.length;r++){var i=e.getItem(r);if(null!=i&&i instanceof H.a){var o=i.getRectangleIncludingFrames(),a=E.a.transformRectangleByTwoRectanglesDiff(o,this._selectionHandler.rectangle,t);n=g.RotatedRectangleF.union(a,n)}}return n},t.prototype.getRectangleWithBorder=function(t){var e=this._selectionHandler.border;if(null==t||null==e)return null;var n=t.center,r=t.angle;t.angle=0;var i=t.bounds,o=g.RotatedRectangleF.FromLTRB(i.left-e.left,i.top-e.top,i.right+e.right,i.bottom+e.bottom);return o.width*=Math.sign(t.width),o.height*=Math.sign(t.height),o.rotateAt(r,n),t.angle=r,o},Object.defineProperty(t.prototype,"_region",{get:function(){return this._selectionHandler.region},enumerable:!0,configurable:!0}),t.prototype._validateRectRelativeToRegion=function(t){if(!this._canvas.suppressOutOfRegionManipulation||null!=this._canvas.contentEditingPlaceholderItemHandler||null==this._region)return!0;var e=this.getRectWithFrames(t).bounds;return this._region.containsRectangle(e)},t.prototype._constrainMoveDataToRegion=function(t,e){return this._canvas.suppressOutOfRegionManipulation&&null!=this._region?(t.left+e.x<this._region.left&&(e.x=this._region.left-t.left),t.top+e.y<this._region.top&&(e.y=this._region.top-t.top),t.right+e.x>this._region.left+this._region.width&&(e.x=this._region.left+this._region.width-t.right),t.bottom+e.y>this._region.top+this._region.height&&(e.y=this._region.top+this._region.height-t.bottom),e):e},t.prototype._constrainMoveDataToPlaceholderCover=function(t,e,n){var r=e.angle;e.angle=0;var i=e.bounds,o=t.clone();o.rotateAt(-r,e.center);var a=o.bounds;return n.rotate(-r),a.left+n.x>i.left&&(n.x=i.left-a.left),a.top+n.y>i.top&&(n.y=i.top-a.top),a.right+n.x<i.left+i.width&&(n.x=i.left+i.width-a.right),a.bottom+n.y<i.top+i.height&&(n.y=i.top+i.height-a.bottom),n.rotate(r),n},t.prototype._constrainResizeDataToPlaceholderCover=function(t,e,n,r){var i=t.angle,o=n.angle,a=Object(g.EqualsOfFloatNumbers)(90,Object(g.normalizeAngle)(i-o)%180);n.angle=0;var s=n.bounds;t.rotateAt(-o,n.center);var l=t.bounds,u=Math.min(l.left,s.left),c=Math.min(l.top,s.top),h=Math.max(l.right,s.right),p=Math.max(l.bottom,s.bottom),f=h-u,d=p-c,m=a?e.height/e.width:e.width/e.height,y=f/d,_=(r-1+Math.round(Object(g.normalizeAngle)(i-o)/90))%4+1;if(y>m){var b=Math.abs(f/m-f/y);1===_||2===_?c-=b:p+=b}if(y<m){var v=Math.abs(d*m-d*y);2===_||3===_?h+=v:u-=v}var w=new g.RectangleF(u,c,h-u,p-c);if(!Object(g.EqualsOfFloatNumbers)(0,i-o%360)){var C=g.RotatedRectangleF.fromRectangleF(w);C.rotateAt(o-i,n.center),w=C.bounds}var P=g.RotatedRectangleF.fromRectangleF(w);return P.rotateAt(i,n.center),P},t.prototype._getMinSizeConstraintConfiguration=function(t,e){var n=this,r=null,i=null;return e.forEach((function(e){var o=function(t){var e,r,i=null===(r=null===(e=n._canvas.viewer.configuration)||void 0===e?void 0:e.handlers)||void 0===r?void 0:r.resizeLimits;if(i)for(var o in i)if((o+"Item").toLowerCase()==t.itemType.toLowerCase())return i[o];return null!=(null==i?void 0:i.common)?i.common:new g.SizeF(null,null)}(e),a=(e.startRectangle.angle-t.angle)%180,s=Object(g.ConvertDegreeToRadian)(a),l=function(t,e){var n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e));return{projectedWidth:n*t.width,projectedHeight:r*t.width,cos:n,sin:r}}(e.startRectangle,s);if(!Object(st.d)(l.cos,0)&&null!==o.width){var u=l.cos*o.width*t.width/l.projectedWidth;(null==r||r<u)&&(r=u)}if(!Object(st.d)(l.sin,0)&&null!==o.width){var c=o.width*l.sin*t.height/l.projectedHeight;(null==r||r<c)&&(i=c)}var h=function(t,e){var n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),i=n*t.height;return{projectedWidth:r*t.height,projectedHeight:i,cos:n,sin:r}}(e.startRectangle,s);Object(st.d)(h.cos,0)||null===o.height||(c=o.height*h.cos*t.height/h.projectedHeight,(null==i||i<c)&&(i=c)),Object(st.d)(h.sin,0)||null===o.height||(u=o.height*h.sin*t.width/h.projectedWidth,(null==i||i<u)&&(i=u))})),{minWidth:r,minHeight:i}},t.prototype._constrainResizeDataToMinSize=function(t,e,n,r,i,o){i=Math.min(i,t.width),o=Math.min(o,t.height);var a=e.clone(),s=!1,l=!1;a.width<0&&(s=!0),a.height<0&&(l=!0);var u=t.width/t.height,c=this._calculateMinWidthAndHeight(Math.abs(e.width),Math.abs(e.height),i,o,u,n),h=c.resultWidth,p=c.resultHeight;return c.isChanged&&(a.width=s?-h:h,a.height=l?-p:p,this._alignRectangleWithStartRectangle(t,a,r)),a},t.prototype._calculateMinWidthAndHeight=function(t,e,n,r,i,o){var a=t,s=e,l=!1,u=!1;a<n&&(a=n,l=!0),s<r&&(s=r,u=!0);var c=u||l;if(c&&!o){var h=function(t){return t*i},p=function(t){return t*(1/i)};l?(s=p(a))<r&&(a=h(s=r)):u&&(a=h(s))<n&&(s=p(a=n))}return{resultWidth:a,resultHeight:s,isChanged:c}},t.prototype._alignRectangleWithStartRectangle=function(t,e,n){var r,i;switch(n){case 1:r=t.getBottomRightCorner(),i=e.getBottomRightCorner();break;case 2:r=t.getBottomLeftCorner(),i=e.getBottomLeftCorner();break;case 3:r=t.getUpperLeftCorner(),i=e.getUpperLeftCorner();break;case 4:r=t.getUpperRightCorner(),i=e.getUpperRightCorner();break;case 5:r=t.getRightCenterPoint(),i=e.getRightCenterPoint();break;case 6:r=t.getBottomCenterPoint(),i=e.getBottomCenterPoint();break;case 7:r=t.getLeftCenterPoint(),i=e.getLeftCenterPoint();break;case 8:r=t.getUpperCenterPoint(),i=e.getUpperCenterPoint()}var o=new g.PointF(r.x-i.x,r.y-i.y);e.translate(o.x,o.y)},t.prototype._constrainResizeDataToSnapLines=function(t,e){return this._snapLinesHandler.constrainRectangleToSnapLines(e,this.getRectangleWithBorder(t.previousRectangle),t.arbitraryResize,t.resizeIndex,this.getRectWithFrames(e),this.getRectangleWithBorder(e),this._canvas)},t}(),Ot=n(813),Tt=n(441),Et=function(){return Et=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Et.apply(this,arguments)},Lt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Rt=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Lt(arguments[e]));return t},kt=function(){function t(t,e,n){var r=this;this._canvas=e,this._snapLinesHandler=n,this._itemHandlers=new ct.a,this._parentSelectionRectangle=null,this._multipleSelectionEnabled=!0,this._enabled=!0,this._skipUpdate=!1,this._locked=!1,this._state=wt.Idle,this._ignoreSimpleMode=!1,this._manipulationPermissions=new C.W,this._setRectangle=function(t){r._rectangle=t},this._updatePermissions=function(){var t=new C.W;null!=r._canvas.contentEditingPlaceholderItemHandler?r._manipulationPermissions=r._canvas.contentEditingPlaceholderItemHandler.content.item.manipulationPermissions:r._ignoreSimpleMode||!r._canvas.simpleMode?(r._itemHandlers.selectMany((function(t){return t instanceof A.a?t.getNestedItemHandlers(!1,!1,!0):[t]})).ofType(E.a).forEach((function(e){var n,i,o,a,l=e.item.manipulationPermissions;t.allowDelete=t.allowDelete&&l.allowDelete,t.allowDragAndDrop=t.allowDragAndDrop&&l.allowDragAndDrop,t.allowMoveHorizontal=t.allowMoveHorizontal&&l.allowMoveHorizontal,t.allowMoveVertical=t.allowMoveVertical&&l.allowMoveVertical,t.allowRotate=t.allowRotate&&l.allowRotate,t.resizeGrips.edge=t.resizeGrips.edge&&l.resizeGrips.edge,t.resizeGrips.corner=s.intersection(l.resizeGrips.corner,t.resizeGrips.corner),((null!==(a=null!==(i=null===(n=r._rectangle)||void 0===n?void 0:n.angle)&&void 0!==i?i:null===(o=r._parentSelectionRectangle)||void 0===o?void 0:o.angle)&&void 0!==a?a:0)-e.angle)%90!=0&&(t.resizeGrips.edge=!1,t.resizeGrips.setCornerArbitrary(!1))})),r._manipulationPermissions=t):r._manipulationPermissions=new C.W(!1)},this._selectionChanged=new ft.a,this._onSelectionItemHandlersChanged=function(){r._itemHandlers.contains(r._currentItemHandler)||(r._currentItemHandler instanceof H.a&&r._currentItemHandler.removeIsEditingChanged(r._updatePermissions),r._currentItemHandler=r._itemHandlers.lastOrDefault(),r._currentItemHandler instanceof H.a&&r._currentItemHandler.addIsEditingChanged(r._updatePermissions),r._currentItemChangedEvent.notify(r._currentItemHandler)),r._update(),r._updatePermissions(),r._selectionChanged.notify()},this._selectionRectangleChanged=function(t){Ot.a.debugLog("Selection changed: "+t.rectangle.toString()+" is"+(t.finished?"":" not")+" finished.",Ot.b.SelectionHandler),r._rectangle=t.rectangle,t.finished&&(r._rectangle.width=Math.abs(r._rectangle.width),r._rectangle.height=Math.abs(r._rectangle.height),r._canvas.updateTexts()),r._updateParentSelectionRectangle(),r._selectionChanged.notify()},this._selectionStateChanged=function(t){r._state=t},this._selectionAngleChanged=function(t){var e=Et(Et({},t),{items:r._items,finished:t.finished});r._canvas.viewer.commandManager.execute(gt.a.rotateItems,e,r._getHistoryUpdateMode(t.finished))},this._selectionMoved=function(t){var e={delta:t.delta,items:r._items,finished:t.finished};r._canvas.viewer.commandManager.execute(gt.a.newTranslateItems,e,r._getHistoryUpdateMode(t.finished))},this._selectionResized=function(t){var e=Et({items:r._items,finished:t.finished},t);r._canvas.viewer.commandManager.execute(gt.a.resizeItems,e,r._getHistoryUpdateMode(t.finished))},this._onItemHandlersItemAdded=function(t){t.item.addChanged(r._onSelectedItemHandlerChanged)},this._onItemHandlersItemRemoved=function(t){t.item.removeChanged(r._onSelectedItemHandlerChanged)},this._onSelectedItemHandlerChanged=function(t){r._updatePermissions(),r._update()},this.addSelectedItemHandlersChanged=function(t){r._itemHandlers.add_collectionChanged(t)},this.removeSelectedItemHandlersChanged=function(t){r._itemHandlers.remove_collectionChanged(t)},this._currentItemChangedEvent=new ft.a,this._selectionHitTestManager=new ut(this,t),this._selectionProcessModifier=new It(this,e,n),this._selectionRectangleHandler=new dt(this._selectionProcessModifier),this._itemHandlers.add_collectionChanged(this._onSelectionItemHandlersChanged),this._itemHandlers.add_itemAdded(this._onItemHandlersItemAdded),this._itemHandlers.add_itemRemoved(this._onItemHandlersItemRemoved),this._selectionRectangleHandler.addRectangleChanged(this._selectionRectangleChanged),this._selectionRectangleHandler.addRectangleAngleChanged(this._selectionAngleChanged),this._selectionRectangleHandler.addRectangleMoved(this._selectionMoved),this._selectionRectangleHandler.addRectangleResized(this._selectionResized),this._selectionRectangleHandler.addStateChanged(this._selectionStateChanged)}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedItemHandlers",{get:function(){return this._itemHandlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentItemHandler",{get:function(){return this._currentItemHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionHitTestManager",{get:function(){return this._selectionHitTestManager},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locked",{get:function(){return this._locked},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"border",{get:function(){return this._border},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rectangle",{get:function(){return this._rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentRectangle",{get:function(){return this._parentSelectionRectangle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"region",{get:function(){return this._region},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ignoreSimpleMode",{set:function(t){this._ignoreSimpleMode!==t&&(this._ignoreSimpleMode=t,this._updatePermissions())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"multipleSelectionEnabled",{get:function(){return this._multipleSelectionEnabled&&!this.selectedItemHandlers.any((function(t){return t.item.parentGroupItem instanceof C.R}))},set:function(t){this._multipleSelectionEnabled=t},enumerable:!0,configurable:!0}),t.prototype.lock=function(t){void 0===t&&(t=!1),this._locked=!0,t||this._itemHandlers.clear(),this._canvas.onSelectionLocked(),this._canvas.redraw()},t.prototype.unlock=function(){this._locked=!1,this._canvas.redraw()},t.prototype.enable=function(){this._update(),this._enabled=!0},t.prototype.disable=function(){this._enabled=!1},t.prototype.rotateByPoint=function(t,e,n){if(void 0===n&&(n=null),this.manipulationPermissions.allowRotate){if(e===ht.a.Started){if(null==n)throw new W.a("SelectionHandler.updateRotation: startPoint cannot be null!");this._selectionProcessModifier.ignoreSnapLines=!1,this._selectionRectangleHandler.startRotatingByPoint(n,this.rectangle)}try{this._selectionRectangleHandler.updateRotatingByPoint(t)}finally{e===ht.a.Finished&&this._notifyItemHandlersChanged()}}},t.prototype.moveByPoint=function(t,e,n,r){var i;void 0===r&&(r=null);var o=this.manipulationPermissions;if(o.allowMove){if(null==t.allowMoveHorizontal&&(t.allowMoveHorizontal=o.allowMoveHorizontal),null==t.allowMoveVertical&&(t.allowMoveVertical=o.allowMoveVertical),e===ht.a.Started){if(null==r)throw new W.a("SelectionHandler.updateMoving: startPoint cannot be null!");this._selectionProcessModifier.ignoreSnapLines=n,this._selectionRectangleHandler.startMovingByPoint(r,this.rectangle),n||this._fillSnapData()}try{this._selectionRectangleHandler.updateMovingByPoint(t)}finally{e===ht.a.Finished&&(this._notifyItemHandlersChanged(),this._snapLinesHandler.clearSnapData(),null===(i=this._canvas)||void 0===i||i.redraw())}}},t.prototype.resizeByPoint=function(t,e,n){var r;if(void 0===n&&(n=null),this.manipulationPermissions.allowResize){if(e===ht.a.Started){if(null==n)throw new W.a("SelectionHandler.updateResizing: startPoint cannot be null!");this._selectionProcessModifier.ignoreSnapLines=!1,this._selectionRectangleHandler.startResizingByPoint(n,this.rectangle,t.resizeIndex,this._allowNegativeResize,this.selectedItemHandlers.toArray()),this._fillSnapData()}try{this._selectionRectangleHandler.updateResizingByPoint(t,this._itemHandlers.toArray())}finally{e===ht.a.Finished&&(this._notifyItemHandlersChanged(),this._snapLinesHandler.clearSnapData(),null===(r=this._canvas)||void 0===r||r.redraw())}}},t.prototype._notifyItemHandlersChanged=function(){this._itemHandlers.forEach((function(t){return t.item.getItemChangedEvent().fire()}))},t.prototype.move=function(t,e){var n=this.manipulationPermissions;n.allowMove&&(null==t.allowMoveHorizontal&&(t.allowMoveHorizontal=n.allowMoveHorizontal),null==t.allowMoveVertical&&(t.allowMoveVertical=n.allowMoveVertical),e===ht.a.Started&&this._state===wt.Idle&&(this._selectionProcessModifier.ignoreSnapLines=!0,this._selectionRectangleHandler.startMove(this.rectangle)),this._selectionRectangleHandler.move(t))},t.prototype.isItemHandlerSelected=function(t){return this._itemHandlers.contains(t)},t.prototype.isOnlyThisItemHandlerSelected=function(t){return this.isItemHandlerSelected(t)&&1===this._itemHandlers.length},t.prototype.setSelectedItemHandlers=function(t,e){void 0===e&&(e=!1),!s.isArray(t)||this._locked||Object(pt.d)(t,this._itemHandlers.toArray())||(e||this.clearSelectedItemHandlers(),this._cancelEditMode(),this.multipleSelectionEnabled||(t=[t[0]]),this._itemHandlers.addRange(t))},t.prototype._cancelEditMode=function(){var t;null===(t=this._itemHandlers)||void 0===t||t.ofType(H.a).forEach((function(t){return t.editing=!1}))},t.prototype.clearSelectedItemHandlers=function(){this._cancelEditMode(),this._itemHandlers.clear(),this._updateParentSelectionRectangle()},t.prototype.addSelectedItemHandler=function(t){!this.multipleSelectionEnabled&&this._itemHandlers.length>0&&this._itemHandlers.clear(),this.setSelectedItemHandlers([t],!0)},t.prototype.removeSelectedItemHandler=function(t){this._itemHandlers.contains(t)&&this._itemHandlers.remove(t)},t.prototype.update=function(t){void 0===t&&(t=!1),(t||this._state===wt.Idle)&&this._update()},t.prototype._update=function(){if(!this._skipUpdate){if(0===this._itemHandlers.length)return this._setRectangle(null),this._border=null,void(this._region=null);var t=this._itemHandlers.getItem(0),e=t.getBorderMargin();if(1===this._itemHandlers.length)this._setRectangle(this._itemHandlers.get(0).getSelectionRectangle()),this._border={left:e,top:e,right:e,bottom:e};else{for(var n=t.getSelectionRectangle().bounds,r=n.left,i=n.top,o=n.right,a=n.bottom,s={left:e,top:e,right:e,bottom:e},l=1;l<this._itemHandlers.length;l++)e=(t=this._itemHandlers.getItem(l)).getBorderMargin(),(n=t.getSelectionRectangle().bounds).left-e<r-s.left&&(r=n.left,s.left=e),n.top-e<i-s.top&&(i=n.top,s.top=e),n.right+e>o+s.right&&(o=n.right,s.right=e),n.bottom+e>a+s.bottom&&(a=n.bottom,s.bottom=e);this._setRectangle(g.RotatedRectangleF.FromLTRB(r,i,o,a)),this._border=s}this._updateParentSelectionRectangle(),this._region=this._getRegion(),this._canvas.redraw(!0)}},t.prototype._updateParentSelectionRectangle=function(){var t,e,n=null;if((null===(t=this._itemHandlers)||void 0===t?void 0:t.any())&&(e=(n=this._itemHandlers.getItem(0).item.parentGroupItem)&&this._canvas.handlerFactory.get(n)),null==n||null==e||e.isEmpty())this._parentSelectionRectangle=null;else{var r=e.getSelectionRectangle();this._parentSelectionRectangle=r}},t.prototype._getRegion=function(){var t=null;if(this._canvas.constrainedMarginEnabled&&this._canvas.margin>0){var e=this._canvas.margin;t=new g.RectangleF(e,e,this._canvas.workspaceWidth-e,this._canvas.workspaceHeight-e)}return this._itemHandlers.where((function(t){var e;return null!=(null===(e=t.layer)||void 0===e?void 0:e.region)})).select((function(t){return t.layer.region})).distinct().forEach((function(e){t=null!=t?g.RectangleF.intersect(t,e):e})),t},t.prototype.getSelectionDrawingParams=function(){var t,e,n=!1,r=!1,i=!1,o=null;1===this._itemHandlers.length?(n=(o=this._itemHandlers.getItem(0))instanceof X,i=o instanceof H.a&&o.editing):r=this._itemHandlers.any((function(t){return t instanceof X}));var a=i&&o.item.isCoverMode,s=o instanceof at.a&&o.isInEdit,l=this.manipulationPermissions;return{rotate:this.allowManipulation&&l.allowRotate&&!a&&!s,resize:this.allowManipulation&&null!==(e=null===(t=l.resizeGrips.corner)||void 0===t?void 0:t[0])&&void 0!==e&&e&&!n&&!s,arbitraryWidthResize:this.allowManipulation&&l.resizeGrips.edge&&!r&&!a&&!s,arbitraryHeightResize:this.allowManipulation&&l.resizeGrips.edge&&!n&&!r&&!a&&!s}},t.prototype.getHighlightRectangles=function(){var t,e=[];if(null==this._itemHandlers||0==this._itemHandlers.length)return e;var n={includeChildren:!0,includeParent:!1};if(this._itemHandlers.length>1)this._itemHandlers.forEach((function(t){return e.push.apply(e,Rt(t.getHighlightRectangles(n)))}));else{var r=this._itemHandlers.get(0);(r instanceof at.a?r.isHighlightNeeded()&&(null===(t=this._canvas.textEditor)||void 0===t?void 0:t.highlightInEditingModeEnabled):r.isHighlightNeeded())&&(n.includeParent=!1,e.push.apply(e,Rt(r.getHighlightRectangles(n))))}return e},Object.defineProperty(t.prototype,"visibleRectangle",{get:function(){return this._getVisibleSelectionRectangle(this._rectangle)},enumerable:!0,configurable:!0}),t.prototype._getVisibleSelectionRectangle=function(t){if(null==t)return null;var e=t.clone();if(e.width=Math.abs(e.width),e.height=Math.abs(e.height),null!=this._border){var n=e.angle;(e=g.RotatedRectangleF.fromRectangleF(e.toRectangleF().getExpanded(this._border))).angle=n}return e},Object.defineProperty(t.prototype,"manipulationPermissions",{get:function(){return this._manipulationPermissions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowManipulation",{get:function(){return null!=this._canvas&&(!this._canvas.simpleMode||null!=this._canvas.contentEditingPlaceholderItemHandler)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.manipulationPermissions.allowMove&&this.allowManipulation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_allowNegativeResize",{get:function(){return!this._itemHandlers.any((function(t){return!t.allowNegativeResize}))},enumerable:!0,configurable:!0}),t.prototype.addOnSelectionChanged=function(t){this._selectionChanged.add(t)},t.prototype.removeOnSelectionChanged=function(t){this._selectionChanged.remove(t)},t.prototype._getHistoryUpdateMode=function(t){return t?Tt.a.ForceUpdate:Tt.a.NotUpdate},Object.defineProperty(t.prototype,"_items",{get:function(){return null!=this._canvas.contentEditingPlaceholderItemHandler?[this._canvas.contentEditingPlaceholderItemHandler.item.content]:this._itemHandlers.select((function(t){return t.item})).toArray()},enumerable:!0,configurable:!0}),t.prototype._fillSnapData=function(){this._snapLinesHandler.fillSnapData(this.rectangle,this._selectionProcessModifier.getRectWithFrames(this.rectangle),null!=this.rectangle&&null!=this._border?this._selectionProcessModifier.getRectangleWithBorder(this.rectangle).bounds:null,this._region,this._canvas,this._state===wt.Drag)},t.prototype.dispose=function(){this._itemHandlers.remove_collectionChanged(this._onSelectionItemHandlersChanged),this._currentItemHandler instanceof H.a&&this._currentItemHandler.removeIsEditingChanged(this._updatePermissions)},t.prototype.addCurrentItemChanged=function(t){this._currentItemChangedEvent.add(t)},t.prototype.removeCurrentItemChanged=function(t){this._currentItemChangedEvent.remove(t)},Object.defineProperty(t.prototype,"isIdle",{get:function(){return this._state===wt.Idle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isResizing",{get:function(){return this._state===wt.Resize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRotating",{get:function(){return this._state===wt.Rotate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDraging",{get:function(){return this._state===wt.Drag},enumerable:!0,configurable:!0}),t.cw=[0,-1,1,1,-1,-1,0,1,0],t.ch=[0,-1,-1,1,1,0,-1,0,1],t}();!function(t){t[t.Idle=0]="Idle",t[t.Select=1]="Select",t[t.Drag=2]="Drag",t[t.Resize=3]="Resize",t[t.Rotate=4]="Rotate"}(wt||(wt={}));var jt=function(){function t(){}return t.isLeftResizeGrip=function(t){return 1===t||4===t||5===t},t.isTopResizeGrip=function(t){return 1===t||2===t||6===t},t.isRightResizeGrip=function(t){return 2===t||3===t||7===t},t.isBottomResizeGrip=function(t){return 3===t||4===t||8===t},t.isCornerResizeGrip=function(t){return 1===t||2===t||3===t||4===t},t.isEdgeResizeGrip=function(t){return 5===t||6===t||7===t||8===t},t}(),At=n(470),Ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o.lastRectangle=null,o}return Ft(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){var t=this.canvas.isItemHandlerSelected(this)&&this.canvas.isResizing();if(null==this._staticTextRect)return t&&null!=this.startRectangle?this.startRectangle:this.rectangle;var e=g.RotatedRectangleF.fromRectangleF(this._staticTextRect),n=t&&null!=this.startRectangle?this.startRectangle.getTransform(g.RotatedRectangleF.fromRectangleF(this.getControlBounds())):this.item.transform.clone();return e.transform(n,this.getControlCenter()),e},enumerable:!0,configurable:!0}),e.prototype.setTextWhizzWrappingPath=function(t){var e=this.item,n=null;if(null!=e.wrappingPath){if(Object(g.EqualsOfFloatNumbers)(0,this.item.transform.angle))n=Object(At.b)(this._textWhizz,e.wrappingPath);else{var r=e.wrappingPath.clone();r.rotateAt(-this.item.transform.angle,this.getControlCenter()),n=Object(At.b)(this._textWhizz,r)}n.offsetContour(e.wrappingMargin)}else n=new this._textWhizz.Path;t.setWrappingPath(n)},e.prototype.getWrappingPathData=function(){if(null!=this.item.wrappingPath){var t=null;if(Object(g.EqualsOfFloatNumbers)(0,this.item.transform.angle))t=this.item.wrappingPath;else{var e=this.item.wrappingPath.clone();e.rotateAt(-this.item.transform.angle,this.getControlCenter()),t=e}return{path:t,wrappingMargin:this.item.wrappingMargin}}return{isEmptyPath:!0}},e.prototype.getFramesData=function(){return{type:lt.a.shapeTextFrame,frames:this._getFrames()}},e.prototype.getTextWrappingPath=function(){var e=this;if(this.item instanceof C.ab&&this.item.textWrappingMode===C.wb.Tight){var n=this._getFrames(),r=function(t){var n=t.clone();return n.transform(e.item.transform,e.getControlCenter()),n};if(1==n.length)return r(n[0]);for(var i=r(n[0]),o=Object(At.b)(this._textWhizz,i),a=1;a<n.length;a++){var s=r(n[a]),l=Object(At.b)(this._textWhizz,s);o=this._textWhizz.Path.union(o,l)}return Object(At.a)(o)}return t.prototype.getTextWrappingPath.call(this)},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),this.setRectangleValidated()},e.prototype.setRectangleValidated=function(t){void 0===t&&(t=null),null==t&&(t=this.rectangle),this._validateRectAndSet(t,!0)},e.prototype.getTextRectangle=function(){var t,e=this.getControlCenter();return(t=this._textEditorController.ready?g.RotatedRectangleF.fromRectangleF(this._textEditorController.measureText()):g.RotatedRectangleF.fromRectangleF(this.item.sourceRectangle)).transform(this.item.transform.clone(),e),t},e.prototype._onFrontEndRenderingInitialized=function(){t.prototype._onFrontEndRenderingInitialized.call(this),this.setRectangleValidated()},e.prototype._onTransformRectangle=function(t,e,n){var r;if(null!=t&&null!=e&&null!=this._startRectangle){var i=this._calculateTransformedRectangle(t,e);this.setRectangle(i,!0),null===(r=this.canvas)||void 0===r||r.redraw()}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textRectangle":case"boundingPaths":case"firstBaselineOffset":case"firstBaselineMinOffset":this.update(null,null,"frame");break;case"wrappingPath":case"wrappingMargin":this.update(null,null,this.item.transform.isEmpty?"wrappingPath":null);break;case"verticalAlignment":case"isVertical":case"shrinkMode":case"scheduledFitMode":case"paragraphSettings":case"overflowStrategy":case"characterLimit":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._transformText=function(e){this.canvas.isResizing()||null!=this.item.wrappingPath?this.update(null,null,"frame"):t.prototype._transformText.call(this,e)},e.prototype.renderFill=function(t){var e=this.item,n=this.getControlCenter(),r=this.item.transform,i=this._getItemColorPreviews().fillColorPreview;this._getFrames().forEach((function(o){S.a.fillPath(t,o,n,r,null==i?void 0:i.toString(),e.opacity)}))},e.prototype.renderStroke=function(t){var e=this,n=this._getActualBorderWidth();if(!(n<=0)){var r=this.item,i=this.getControlCenter(),o=this.item.transform,a=this._getItemColorPreviews(),s=a.borderColorPreview,l=a.altBorderColorPreview;this._getFrames().forEach((function(a){var u=Object(At.b)(e._textWhizz,a);u.offsetContour(n/2),S.a.drawStroke(t,u,i,o,n,null==s?void 0:s.toString(),null==l?void 0:l.toString(),r.opacity,r.dash)}))}},e.prototype._onTextManagerExitedEditMode=function(){t.prototype._onTextManagerExitedEditMode.call(this),this.setRectangleValidated()},e.prototype._applyTransform=function(t,e,n){var r,i;if(t instanceof C.q){var o=g.RotatedRectangleF.fromRectangleF(t.textRectangle);o.setTransform(e);var a=o.toRectangleF();t.textRectangle=a,this.controlPoints=[new g.PointF(a.left,a.top),new g.PointF(a.right,a.bottom)]}if(t instanceof C.ab)try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.boundingPaths),l=s.next();!l.done;l=s.next())l.value.transform(e,n)}catch(u){r={error:u}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype._validateRect=function(t){var e,n,r,i,o;return n=this,r=void 0,o=function(){var n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return null===this._textEditorController?[2,null]:this.item instanceof C.q&&this.item.overflowStrategy==C.X.ExpandBox?[4,this._textEditorController.measureTextFrame()]:[3,2];case 1:if((n=o.sent()).height>t.height)return r=n.height-t.height,Object(st.d)(r,0)?[2,null]:(i=t.clone(),(null===(e=this._transformOperation)||void 0===e?void 0:e.resize)&&jt.isTopResizeGrip(this._transformOperation.resizeIndex)&&(r*=-1),i.centerY+=r/2,i.height=n.height,[2,i]);o.label=2;case 2:return[2,null]}}))},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{l(o.next(t))}catch(n){e(n)}}function s(t){try{l(o.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}))},e.prototype._validateRectAndSet=function(e,n){var r=this;this._validateRect(e).then((function(i){null!=i?(t.prototype.setRectangle.call(r,i,n),r.update()):t.prototype.setRectangle.call(r,e,n)}))},e.prototype._getFrames=function(){var t;if(this.item instanceof C.q){var e;return e=(null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit)?this.rectangle.toRectangleF():this.item.textRectangle,[g.Path.rectangle(e.left,e.top,e.width,e.height)]}return this.item.boundingPaths},e.prototype._firstBaselineOffsetToTextWhizz=function(t){switch(t){case C.C.Ascent:return this._textWhizz.FirstBaselineOffset.ascent;case C.C.CapHeight:return this._textWhizz.FirstBaselineOffset.capHeight;case C.C.Leading:return this._textWhizz.FirstBaselineOffset.leading;case C.C.XHeight:return this._textWhizz.FirstBaselineOffset.xHeight;case C.C.Fixed:return this._textWhizz.FirstBaselineOffset.fixed;case C.C.EmboxHeight:return this._textWhizz.FirstBaselineOffset.emBox}},e.typeName="NewBoundedTextItemHandler",e}(at.a),Mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nt=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return Mt(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.getFramesData=function(){var t=[];return t.push(this.item.textPath),{type:lt.a.pathTextFrame,frames:t}},e.prototype.updateTextWhizzFrames=function(t){t.replaceFrame(this._createTextWhizzFrame(),0)},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype.getWrappingPathData=function(){return{}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textPath":case"start":case"end":this.update(null,null,"frame");break;case"fitToPath":case"fitToPathStep":case"stretch":case"originalFontSize":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._addTextWhizzFrames=function(t){t.addFrame(this._createTextWhizzFrame())},e.prototype._getEndTransformTrigger=function(t){return t?null:"frame"},e.prototype._applyTransform=function(t,e,n){var r,i;if(t instanceof C.x){var o=t.textPath.clone();o.transform(e,n),t.textPath=o;var a=this._getPreviewScaleLimits(),s=this.item.previewScale*e.scaleY;s=Math.min(null!==(r=a.max)&&void 0!==r?r:Number.MAX_VALUE,s),s=Math.max(null!==(i=a.min)&&void 0!==i?i:Number.MIN_VALUE,s),t.previewScale=s}},e.prototype._createTextWhizzFrame=function(){var t=Object(At.b)(this._textWhizz,this.item.textPath),e=this.item.previewScale;Object(g.EqualsOfFloatNumbers)(e,1)||t.scale(1/e,1/e);var n=new this._textWhizz.PathTextFrame;return n.baseline=t,n.start=this.item.start,n.end=this.item.end,this.item.fitToPath&&(n.copyFittingMode=this._textWhizz.CopyFittingMode.fitToWidth),n},e.typeName="NewCurvedTextItemHandler",e}(at.a),zt=n(538),Dt=n(812),Ht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wt=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return Ht(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.isHighlightNeeded=function(){return!0},e.prototype.getFramesData=function(){var t={point:this.item.center.clone(),bend:this.isInEdit?0:this.item.bend};return{type:lt.a.archedTextFrame,frames:[t]}},e.prototype.getWrappingPathData=function(){return{}},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"center":case"bend":case"warp":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.center=e.center,this.item.bend=e.bend,this.item.warp=e.warp},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._applyTransform=function(t,e,n){var r,i;if(t instanceof C.a){t.center.clone();var o=t.center.clone();o.transform(e,n),t.center=o;var a=this._getPreviewScaleLimits(),s=this.item.previewScale*e.scaleX;s=Math.min(null!==(r=a.max)&&void 0!==r?r:Number.MAX_VALUE,s),s=Math.max(null!==(i=a.min)&&void 0!==i?i:Number.MIN_VALUE,s),t.previewScale=s}},e.typeName="NewArchedTextItemHandler",e}(at.a),Ut=(function(){function t(t){var e=this;this._canvas=t,this._handlers=new Map,this._beforeReplaceItemHandlerEvent=new ft.a,this._afterReplaceItemHandlerEvent=new ft.a,this.get=function(t){if(!e._handlers.has(t)){var n=e._createItemHandler(t);e._handlers.set(t,n),e._initItemHandler(n)}var r=e._handlers.get(t);return e._isItemOnCanvas(t)&&r.canvas!=e._canvas&&(r.canvas=e._canvas),r}}Object.defineProperty(t.prototype,"beforeReplaceItemHandlerEvent",{get:function(){return this._beforeReplaceItemHandlerEvent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"afterReplaceItemHandlerEvent",{get:function(){return this._afterReplaceItemHandlerEvent},enumerable:!0,configurable:!0}),t.prototype.delete=function(t){var e=this;t instanceof A.a&&t.itemHandlers.forEach((function(t){return e.delete(t)})),t instanceof H.a&&(t.content&&this.delete(t.content),t.topFrames&&t.topFrames.forEach((function(t){return e.delete(t)})),t.bottomFrames&&t.bottomFrames.forEach((function(t){return e.delete(t)}))),this._handlers.delete(t.item),t.dispose()},t.prototype.replaceItemHandler=function(t,e){var n=this.get(t),r=this._canvas.isItemHandlerSelected(n);this._beforeReplaceItemHandlerEvent.notify(n),this._handlers.delete(t);var i=this.get(null!=e?e:t),o=n.parentGroupItemHandler;if(null!=o)o.replaceItemHandler(n,i);else{var a=n.layer.itemHandlers,s=a.indexOf(n);a.remove(n),a.insertAt(s,i)}n.dispose(),n.item=null,this._afterReplaceItemHandlerEvent.notify(i),r&&this._canvas.addSelectedItemHandler(i)},t.prototype.replaceTextItemHandler=function(t){if(t instanceof C.o){var e=this._useOldItemHandler(t,!1),n=this.get(t);(e&&n instanceof at.a||!e&&n instanceof p.a)&&this.replaceItemHandler(t)}},Object.defineProperty(t.prototype,"_viewer",{get:function(){return this._canvas.viewer},enumerable:!0,configurable:!0}),t.prototype._initItemHandler=function(t){var e=this;if(t instanceof zt.a){this._canvas.pauseUpdateTexts();var n=t.item.items.select((function(t){return e.get(t)}));t.setItemHandlers(n.toArray()),this._canvas.resumeUpdateTexts()}},t.prototype._createItemHandler=function(t){var e,n,r,i,o,a,s,l,u,c,h,p,f,g,m,_,b,v,w,P,x,S,I,O,E,L,R,k,F,M,q,G=this,$=null===(n=null===(e=this._canvas)||void 0===e?void 0:e.viewer)||void 0===n?void 0:n.designAtomsApiClient,K=null===(i=null===(r=this._canvas)||void 0===r?void 0:r.viewer)||void 0===i?void 0:i.colorPreviewService;if(t.type===C.gb.type)return new z.a(t,null===(o=this._canvas)||void 0===o?void 0:o.textWhizz,$,K);if((null==(q=t)?void 0:q.type)===C.J.type)return new D.b(t,null===(a=this._canvas)||void 0===a?void 0:a.textWhizz,$,K);if(function(t){return t.type===C.k.type}(t))return new T(t,null===(s=this._canvas)||void 0===s?void 0:s.textWhizz,$,K);if(function(t){return t.type===C.cb.type}(t)){var Y=new H.a(t,null===(l=this._canvas)||void 0===l?void 0:l.textWhizz,$,K);return null!=t.content&&(Y.content=this.get(t.content)),Y.bottomFrames=t.bottomFrames.map((function(t){return G.get(t)})),Y.topFrames=t.topFrames.map((function(t){return G.get(t)})),Y}if(t instanceof C.o)if(this._useOldItemHandler(t,!(null===(c=null===(u=this._canvas)||void 0===u?void 0:u.viewer)||void 0===c?void 0:c.frontEndTextRenderingEnabled))){if(Q(t))return new j.a(t,null===(h=this._canvas)||void 0===h?void 0:h.textWhizz,$,K);if(ot(t))return new U.a(t,null===(p=this._canvas)||void 0===p?void 0:p.textWhizz,$,K);if(et(t))return new N(t,null===(f=this._canvas)||void 0===f?void 0:f.textWhizz,$,K);if(rt(t))return new Z.a(t,null===(g=this._canvas)||void 0===g?void 0:g.textWhizz,$,K);if(function(t){return t.type===C.g.type}(t))return new y(t,null===(m=this._canvas)||void 0===m?void 0:m.textWhizz,$,K);if(at(t))return new d(t,null===(_=this._canvas)||void 0===_?void 0:_.textWhizz,$,K)}else{if(Q(t)||ot(t))return new Bt(t,null===(b=this._canvas)||void 0===b?void 0:b.textWhizz,$,K);if(et(t))return new Nt(t,null===(v=this._canvas)||void 0===v?void 0:v.textWhizz,$,K);if(rt(t))return new qt(t,null===(w=this._canvas)||void 0===w?void 0:w.textWhizz,$,K);if(at(t))return new Wt(t,null===(P=this._canvas)||void 0===P?void 0:P.textWhizz,$,K)}if(function(t){return t.type===C.T.type}(t))return new X(t,null===(x=this._canvas)||void 0===x?void 0:x.textWhizz,K);if(function(t){return t.type===C.y.type}(t))return new tt(t,null===(S=this._canvas)||void 0===S?void 0:S.textWhizz,K);if(function(t){return t.type===C.kb.type}(t))return new V.a(t.sourcePath,t,null===(I=this._canvas)||void 0===I?void 0:I.textWhizz,$,K);if(function(t){return t.type===C.fb.type}(t))return new J(t,null===(O=this._canvas)||void 0===O?void 0:O.textWhizz,K);if(function(t){return t.type===C.F.type}(t))return new nt(t,null===(E=this._canvas)||void 0===E?void 0:E.textWhizz,K);if(function(t){return t.type===C.A.type}(t))return new it(t,null===(L=this._canvas)||void 0===L?void 0:L.textWhizz,K);if(function(t){return t.type===C.G.type}(t))return new A.a(t,t.items.toArray().map((function(t){return G.get(t)})),null===(R=this._canvas)||void 0===R?void 0:R.textWhizz);if(function(t){return t.type===C.r.type}(t))return new B(t,t.items.toArray().map((function(t){return G.get(t)})),null===(k=this._canvas)||void 0===k?void 0:k.textWhizz);if(function(t){return t.type===C.R.type}(t))return new zt.a(t,null,null===(F=this._canvas)||void 0===F?void 0:F.history,null===(M=this._canvas)||void 0===M?void 0:M.textWhizz);throw new W.e("Item of type "+t.type+" not supported");function Q(t){return t.type===C.q.type}function et(t){return t.type===C.x.type}function rt(t){return t.type===C.eb.type}function ot(t){return t.type===C.ab.type}function at(t){return t.type===C.a.type}},t.prototype._isItemOnCanvas=function(t){if(null==t.parentContainer||!(t.parentContainer.parentComponent instanceof ot.Surface))return!1;var e=t.parentContainer.parentComponent;return this._viewer.surface==e},Object.defineProperty(t.prototype,"_debugWarnEnabled",{get:function(){return void 0===window.$DesignAtoms$WarnOnLegacyItemHandlers&&(window.$DesignAtoms$WarnOnLegacyItemHandlers=!1),window.$DesignAtoms$WarnOnLegacyItemHandlers},enumerable:!0,configurable:!0}),t.prototype._logUseOldItemHandler=function(t,e){this._debugWarnEnabled&&console.warn("Legacy text item handler created for item ["+t.type+"#"+t.name+"] reason: "+e+".")},t.getUseLegacyTextReasons=function(t){var e=[];return Dt.a.containsRtlChars(t.text)&&e.push("RTL text"),t instanceof C.g&&e.push("auto-scaled text"),null!=t.shadow&&e.push("shadow"),t.overlapLinesEnabled&&e.push("overlap lines enabled"),t instanceof C.q&&null!=t.scheduledFitMode&&e.push("scheduledFitMode = "+t.scheduledFitMode),e},t.prototype._useOldItemHandler=function(e,n){if(!0===n)return!0;var r=t.getUseLegacyTextReasons(e);return r.length>0&&(this._logUseOldItemHandler(e,r.join(", ")),!0)}}(),n(607),n(578),n(569),n(517),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Vt=(function(t){function e(e){var n=this;if(!e)throw new W.b("layer");return(n=t.call(this)||this)._layer=e,n}Ut(e,t),e.prototype.insertAt=function(e,n){t.prototype.insertAt.call(this,e,n),this._onHandlerAdded(n,e,this._layer.index)},e.prototype.move=function(e,n){return t.prototype.move.call(this,e,n)},e.prototype.removeAt=function(e){var n=t.prototype.removeAt.call(this,e);return n&&this._onHandlerRemoved(n,e),n},e.prototype.clear=function(){for(var e=0;e<this.length;e++)this.getItem(e).layer=null;t.prototype.clear.call(this)},e.prototype._onHandlerAdded=function(t,e,n){var r=this,i=function(t){t.layer=r._layer;var e=r._layer.canvas;e&&(t.canvas=e),t instanceof A.a&&t.applyToItems(i)};i(t)},e.prototype._onHandlerRemoved=function(t,e){var n=this._layer.canvas;n&&n.isItemHandlerSelected(t)&&n.removeSelectedItemHandler(t),t.layer=null,n&&(t.canvas=null)}}(ct.a),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),qt=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return Vt(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.getFramesData=function(){var t=[];return t.push(this.item.baselineLocation.clone()),{type:lt.a.pointTextFrame,frames:t}},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype.getWrappingPathData=function(){return{}},e.prototype.updateTextWhizzFrames=function(t){t.replaceFrame(this._createTextWhizzFrame(),0)},e.prototype._addTextWhizzFrames=function(t){t.addFrame(this._createTextWhizzFrame())},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"baselineLocation":this.update(null,null,"frame");break;case"isVertical":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._getEndTransformTrigger=function(t){return t?null:"frame"},e.prototype._applyTransform=function(t,e,n){var r,i;if(t instanceof C.eb){var o=t.baselineLocation.clone();o.transform(e,n),t.baselineLocation=o;var a=this._getPreviewScaleLimits(),s=this.item.previewScale*e.scaleY;s=Math.min(null!==(r=a.max)&&void 0!==r?r:Number.MAX_VALUE,s),s=Math.max(null!==(i=a.min)&&void 0!==i?i:Number.MIN_VALUE,s),t.previewScale=s}},e.prototype._getPreviewScaleLimits=function(){var e,n,r=t.prototype._getPreviewScaleLimits.call(this);return this.item.leading>0&&(null==this.canvas.maxLeading||isNaN(this.canvas.maxLeading)||(r.max=Math.min(null!==(e=r.max)&&void 0!==e?e:Number.MAX_VALUE,this.canvas.maxLeading/this.item.leading)),null==this.canvas.minLeading||isNaN(this.canvas.minLeading)||(r.min=Math.max(null!==(n=r.min)&&void 0!==n?n:Number.MIN_VALUE,this.canvas.minLeading/this.item.leading))),r},e.prototype._createTextWhizzFrame=function(){var t=this.item.baselineLocation.clone(),e=this.item.previewScale;Object(g.EqualsOfFloatNumbers)(e,1)||t.scale(1/e,1/e);var n=new this._textWhizz.PointTextFrame;return n.point=t,n.textOrientation=this.item.isVertical?this._textWhizz.TextOrientation.vertical:this._textWhizz.TextOrientation.horizontal,n},e.typeName="NewPlainTextItemHandler",e}(at.a);n(579),n(576)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i.a}));class r extends Error{constructor(t){super(t)}}var i=n(527)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(422),i=function(){function t(t,e){this.x=0,this.y=0,this.x=t||0,this.y=e||0}return t.prototype.rotate=function(e){return this.rotateAt(e,new t(0,0))},t.prototype.rotateAt=function(e,n){n||(n=new t(0,0));var i=Object(r.c)(e),o=Math.cos(i)*(this.x-n.x)-Math.sin(i)*(this.y-n.y)+n.x,a=Math.sin(i)*(this.x-n.x)+Math.cos(i)*(this.y-n.y)+n.y;return this.x=o,this.y=a,this},t.prototype.translate=function(t,e){return this.x=this.x+t,this.y=this.y+e,this},t.prototype.scale=function(t,e){return this.x=this.x*t,this.y=this.y*e,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.equals=function(t,e){return null!=t&&Object(r.e)(this.x,t.x,e)&&Object(r.e)(this.y,t.y,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.distance=function(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))},t.prototype.transform=function(e,n){return null==n&&(n=new t),this.translate(-n.x,-n.y),this.scale(e.scaleX,e.scaleY),this.rotate(e.angle),this.translate(e.translateX,e.translateY),this.translate(n.x,n.y),this},t.prototype.toString=function(){return[this.x.toFixed(2),this.y.toFixed(2)].join(",")},t.prototype.toIPoint=function(){return{x:this.x,y:this.y}},t.fromIPoint=function(e){return new t(e.x,e.y)},t.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},t.prototype.isOrigin=function(){return 0===this.x&&0===this.y},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r,i=n(503),o=n(413),a=n(504),s=n(505),l=n(558),u=n(406),c=n(410),h=n(411),p=n(407),f=n(475),d=n(409),g=n(425),m=n(416),y=n(443),_=n(424),b=n(739),v=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},C=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},P=function(t){function e(n,r,i){var a=t.call(this)||this;a._text="",a._originalText="",a._underline=!1,a._color=new o.RgbColor(0,0,0,255),a._alignment=f.g.Left,a._tracking=0,a._leading=0,a._checkTextCrop=!0,a._overlapLinesEnabled=!1,a._verticalScale=1,a._horizontalScale=1,a._stroke=null,a._shadow=null,a._previewScale=1,a._placeholders=new g.a,a._displayText=null,a._colorPalette=new g.a,a._baselineShift=0,a._overprintText=!1,a.values=[],a._characterLimit=null,a._maxLineLength=null,a._maxLineCount=null,a.isTextPlaceholder=!1,a.textColorForAbnormalRendering=new o.RgbColor(0,0,0,255),a.type=e.type,a._onFontPropertyChanged=function(t,e){a._propertyChanged.notify(a,"font")},a._onShadowPropertyChanged=function(t,e){a._propertyChanged.notify(a,"shadow")},a._onStrokePropertyChanged=function(t,e){a._propertyChanged.notify(a,"stroke")},a.borderWidth=0,a.fillColor=new o.RgbColor(0,0,0,0),a.text=null!=n?n:"",a._font=new e.FontSettings(r,null!=i?i:10),a._subscribeFontPropertyChanged(),a.textPermissions=new l.a,a._setViolationSettings(new b.a,!0);var s=function(){a._displayText=null,a._propertyChanged.notify(a,"text")};return a._placeholders.add_itemAdded((function(t){return t.item.addPropertyChanged(s)})),a._placeholders.add_itemRemoved((function(t){return t.item.removePropertyChanged(s)})),a._ignorePermissionsChange=!0,a.itemPermissions.allowRemoveOnLayoutChange=!0,a.itemPermissions.itemToolbarPermissions.showEditButton=!0,a._ignorePermissionsChange=!1,a}return v(e,t),Object.defineProperty(e.prototype,"characterLimit",{get:function(){return this._characterLimit},set:function(t){p.EqualsOfFloatNumbers(this._characterLimit,t)||(this._characterLimit=t,null!=t&&this._propertyChanged.notify(this,"characterLimit"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return this._maxLineCount},set:function(t){this._maxLineCount!==t&&(this._maxLineCount=t,this._displayText=null,this._propertyChanged.notify(this,"maxLineCount"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineLength",{get:function(){return this._maxLineLength},set:function(t){this._maxLineLength!==t&&(this._maxLineLength=t,this._displayText=null,this._propertyChanged.notify(this,"maxLineLength"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewScale",{get:function(){return this._previewScale},set:function(t){p.EqualsOfFloatNumbers(this._previewScale,t)||(this._previewScale=t,this._propertyChanged.notify(this,"previewScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stroke",{get:function(){return this._stroke},set:function(t){a.b.equals(this._stroke,t)||(this._unsubscribeStrokePropertyChanged(),this._stroke=t,this._subscribeStrokePropertyChanged(),this._propertyChanged.notify(this,"stroke"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadow",{get:function(){return this._shadow},set:function(t){null==this._shadow&&null==t||null!=t&&t.equals(this._shadow)||(this._unsubscribeShadowPropertyChanged(),this._shadow=t,this._subscribeShadowPropertyChanged(),this._propertyChanged.notify(this,"shadow"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScale",{get:function(){return this._horizontalScale},set:function(t){p.EqualsOfFloatNumbers(this._horizontalScale,t)||(this._horizontalScale=t,this._propertyChanged.notify(this,"horizontalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalScale",{get:function(){return this._verticalScale},set:function(t){p.EqualsOfFloatNumbers(this._verticalScale,t)||(this._verticalScale=t,this._propertyChanged.notify(this,"verticalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkTextCrop",{get:function(){return this._checkTextCrop},set:function(t){this._checkTextCrop!==t&&(this._checkTextCrop=t,this._propertyChanged.notify(this,"checkTextCrop"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overlapLinesEnabled",{get:function(){return this._overlapLinesEnabled},set:function(t){this._overlapLinesEnabled!==t&&(this._overlapLinesEnabled=t,this._propertyChanged.notify(this,"overlapLinesEnabled"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this._propertyChanged.notify(this,"alignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tracking",{get:function(){return this._tracking},set:function(t){p.EqualsOfFloatNumbers(this._tracking,t)||(this._tracking=t,this._propertyChanged.notify(this,"tracking"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leading",{get:function(){return this._leading},set:function(t){p.EqualsOfFloatNumbers(this._leading,t)||(this._leading=t,this._propertyChanged.notify(this,"leading"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalText",{get:function(){return null!=this._originalText?this._originalText:""},set:function(t){this._originalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this._underline},set:function(t){this._underline!==t&&(this._underline=t,this._propertyChanged.notify(this,"underline"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this._font},set:function(t){e.FontSettings.equals(this._font,t)||(this._unsubscribeFontPropertyChanged(),this._font=t,this._subscribeFontPropertyChanged(),this._propertyChanged.notify(this,"font"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return null==this._displayText&&(this._displayText=this.getUpdatedText(this._text)),this._text=this._displayText,this._text},set:function(t){this._text!==t&&(this._text=t,this._displayText=null,this._propertyChanged.notify(this,"text"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){o.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineShift",{get:function(){return this._baselineShift},set:function(t){p.EqualsOfFloatNumbers(this._baselineShift,t)||(this._baselineShift=t,this._propertyChanged.notify(this,"baselineShift"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintText",{get:function(){return this._overprintText},set:function(t){t!=this._overprintText&&(this._overprintText=t,this._propertyChanged.notify(this,"overprintText"))},enumerable:!0,configurable:!0}),e.prototype.getUpdatedText=function(t){var e=t;return this.placeholders.length>0&&(e=this._replaceInStringPlaceholders()),e},Object.defineProperty(e.prototype,"placeholders",{get:function(){return this._placeholders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorPalette",{get:function(){return this._colorPalette},enumerable:!0,configurable:!0}),e.prototype._canSetIsVariable=function(){return!0},Object.defineProperty(e.prototype,"previewFontSize",{get:function(){return this.font.size*this.previewScale},set:function(t){this.font.size=t/this.previewScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewLeading",{get:function(){return this.leading*this.previewScale},set:function(t){this.leading=t/this.previewScale},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showSelectButton=!1,null==this.textPermissions||this.textPermissions.allowChangeText?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,this.isRenderTypeIsNormal||(this.textPermissions.allowChangeFontColor=!1,this.textPermissions.allowChangeShadow=!1,this.textPermissions.allowChangeStroke=!1)},Object.defineProperty(e.prototype,"textPermissions",{get:function(){return this._textPermissions},set:function(t){if(null==t)throw new u.a("textPermissions cannot be null");Object(c.g)(this._textPermissions,t)||(null!=this._textPermissions&&this._textPermissions.propertyChanged.remove(this._onPermissionsChanged),this._textPermissions=t,this.applyPermissionsConstrain(),this._textPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"textPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof b.a))throw new u.a("Shape ViolationSettings property must has TextViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype._subscribeFontPropertyChanged=function(){null!=this._font&&this._font.addPropertyChanged(this._onFontPropertyChanged)},e.prototype._unsubscribeFontPropertyChanged=function(){null!=this._font&&this._font.removePropertyChanged(this._onFontPropertyChanged)},e.prototype._subscribeShadowPropertyChanged=function(){null!=this._shadow&&this._shadow.addPropertyChanged(this._onShadowPropertyChanged)},e.prototype._unsubscribeShadowPropertyChanged=function(){null!=this._shadow&&this._shadow.removePropertyChanged(this._onShadowPropertyChanged)},e.prototype._subscribeStrokePropertyChanged=function(){null!=this._stroke&&this._stroke.addPropertyChanged(this._onStrokePropertyChanged)},e.prototype._unsubscribeStrokePropertyChanged=function(){null!=this._stroke&&this._stroke.removePropertyChanged(this._onStrokePropertyChanged)},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["_placeholders","currentTextImage","textPermissions","textForTextWhizz","shadow","stroke"].concat(e));return n.placeholders=this.placeholders.toArray(),n.textPermissions=this.textPermissions.getSimplifiedObject(),n.font=this.font.getSimplifiedObject(),n.shadow=null!=this.shadow?this.shadow.getSimplifiedObject():null,n.stroke=null!=this.stroke?this.stroke.getSimplifiedObject():null,n},e.prototype._replaceInStringPlaceholders=function(){return c.m(this.originalText)?this._replaceInStringPlaceholdersValueInRichText():this._replaceInStringPlaceholdersValueInPlainText()},e.prototype._replaceInStringPlaceholdersValueInPlainText=function(){var t=this.originalText;return this.placeholders.forEach((function(e){t=t.replace(e.id,e.value)})),t},e.prototype._replaceInStringPlaceholdersValueInRichText=function(){if(null==this._originalTextDom){var t=new DOMParser;this._originalTextDom=t.parseFromString("<xml>"+this.originalText+"</xml>","text/xml")}var e=this._originalTextDom.cloneNode(!0),n=e.getElementsByTagName("span");this.placeholders.forEach((function(t){if(null!=n&&n.length)for(var e=0;e<n.length;e++){var r=n[e];null!=r.textContent&&(r.textContent=r.textContent.replace(t.id,t.value))}}));var r=(new XMLSerializer).serializeToString(e);return r.substr(0,r.length-6).substr(5)},e.prototype._copy=function(e,n,r,i){var o,a;if(t.prototype._copy.call(this,e,n,r,i),n.textPermissions=e._textPermissions.clone(),n.placeholders.setRange(e.placeholders.toArray().map((function(t){return t.clone()}))),n.color=e._color.clone(),n.text=e._text,n.font=e._font.clone(),n.underline=e._underline,n.originalText=e._originalText,n.leading=e._leading,n.tracking=e._tracking,n.alignment=e._alignment,n.checkTextCrop=e._checkTextCrop,n.verticalScale=e._verticalScale,n.horizontalScale=e._horizontalScale,n.shadow=null!=e._shadow?e._shadow.clone():null,n.stroke=null!=e._stroke?e._stroke.clone():null,n.previewScale=e._previewScale,n._maxLineCount=e._maxLineCount,n.isTextPlaceholder=e.isTextPlaceholder,n.maxLineLength=e.maxLineLength,n.overlapLinesEnabled=e.overlapLinesEnabled,n.colorPalette.setRange(e.colorPalette.toArray().map((function(t){return t.clone()}))),n.baselineShift=e.baselineShift,n.overprintText=e.overprintText,n.listStyles=e.listStyles,n.characterLimit=e.characterLimit,null!=e.values){n.values=[];try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.values),l=s.next();!l.done;l=s.next()){var u=l.value;n.values.push(u.clone())}}catch(c){o={error:c}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}}},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(c.g)(this._textPermissions,e._textPermissions),i=Object(c.c)(this._placeholders.toArray(),e._placeholders.toArray()),o=Object(c.g)(this._color,e._color),a=Object(c.g)(this._text,e._text),s=Object(c.g)(this._font,e._font),l=Object(c.g)(this._underline,e._underline),u=Object(c.g)(this._originalText,e._originalText),h=Object(c.g)(this._leading,e._leading),p=Object(c.g)(this._tracking,e._tracking),f=Object(c.g)(this._alignment,e._alignment),d=Object(c.g)(this._checkTextCrop,e._checkTextCrop),g=Object(c.g)(this._verticalScale,e._verticalScale),m=Object(c.g)(this._previewScale,e._previewScale),y=Object(c.g)(this._maxLineCount,e._maxLineCount),_=Object(c.g)(this.isTextPlaceholder,e.isTextPlaceholder),b=Object(c.g)(this._maxLineLength,e._maxLineLength),v=Object(c.g)(this._overlapLinesEnabled,e._overlapLinesEnabled),w=Object(c.g)(this._stroke,e._stroke),C=Object(c.c)(this.values,e.values),P=Object(c.c)(this._colorPalette.toArray(),e._colorPalette.toArray()),x=Object(c.g)(this._baselineShift,e._baselineShift),S=Object(c.g)(this._overprintText,e._overprintText),I=Object(c.g)(this.listStyles,e.listStyles),O=Object(c.g)(this.characterLimit,e.characterLimit);return n&&r&&i&&o&&a&&s&&l&&u&&h&&p&&f&&d&&g&&m&&y&&_&&b&&v&&w&&C&&P&&x&&S&&I&&O},e.prototype.isEmptyText=function(){return""===this.text},e.prototype.isEmptyXmlText=function(){return"<p></p>"===this.text||"<p><span></span></p>"===this.text},e.prototype.isEmpty=function(){return!this.isTextPlaceholder&&(this.isEmptyText()||this.isEmptyXmlText())},e.type="baseText",w([Object(m.a)({factory:new y.d(50),displayName:"Character Limit"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"characterLimit",null),w([Object(m.a)({factory:new y.d(1),displayName:"Max line count"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"maxLineCount",null),w([Object(m.a)({factory:new y.d(50),displayName:"Max line length"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"maxLineLength",null),w([Object(m.a)({factory:new y.c(a.b),displayName:"Stroke"}),C("design:type",a.b),C("design:paramtypes",[a.b])],e.prototype,"stroke",null),w([Object(m.a)({factory:new y.c(s.a),displayName:"Shadow"}),C("design:type",s.a),C("design:paramtypes",[s.a])],e.prototype,"shadow",null),w([Object(m.a)({enumObject:f.g}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"alignment",null),w([Object(m.a)({type:"string"}),C("design:type",String)],e.prototype,"listStyles",void 0),e}(i.a);!function(t){var e=function(t){function e(e,n){void 0===n&&(n=10);var r=t.call(this)||this;return r._fauxBold=!1,r._fauxItalic=!1,r._allCaps=!1,r._openTypeFeatures=[],r.$_propertyChanged=new d.c,r._postScriptName=e,r._size=n,r}return v(e,t),e.prototype.clone=function(){var t=new e(this._postScriptName,this._size);return t._openTypeFeatures=h.clone(this._openTypeFeatures),t.allCaps=this._allCaps,t.fauxItalic=this._fauxItalic,t.fauxBold=this._fauxBold,t},Object.defineProperty(e.prototype,"fauxBold",{get:function(){return this._fauxBold},set:function(t){this._fauxBold!==t&&(this._fauxBold=t,this.$_propertyChanged.notify(this,"fauxBold"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fauxItalic",{get:function(){return this._fauxItalic},set:function(t){this._fauxItalic!==t&&(this._fauxItalic=t,this.$_propertyChanged.notify(this,"fauxItalic"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCaps",{get:function(){return this._allCaps},set:function(t){this._allCaps!==t&&(this._allCaps=t,this.$_propertyChanged.notify(this,"allCaps"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"openTypeFeatures",{get:function(){return this._openTypeFeatures},set:function(t){this._openTypeFeatures!==t&&(this._openTypeFeatures=t,this.$_propertyChanged.notify(this,"openTypeFeatures"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"postScriptName",{get:function(){return this._postScriptName},set:function(t){this._postScriptName!==t&&(this._postScriptName=t,this.$_propertyChanged.notify(this,"postScriptName"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(t){p.EqualsOfFloatNumbers(this._size,t)||(this._size=t,this.$_propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),e.prototype.addPropertyChanged=function(t){this.$_propertyChanged.add(t)},e.prototype.removePropertyChanged=function(t){this.$_propertyChanged.remove(t)},e.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},e.prototype.equals=function(t){return this.postScriptName===t.postScriptName&&this.size===t.size&&this.fauxBold===t.fauxBold&&this.fauxItalic===t.fauxItalic&&this.allCaps===t.allCaps&&h.isEqual(this.openTypeFeatures,t.openTypeFeatures)},e.prototype.getSimplifiedObject=function(){return{allCaps:this.allCaps,fauxBold:this.fauxBold,fauxItalic:this.fauxItalic,openTypeFeatures:this.openTypeFeatures,postScriptName:this.postScriptName,size:this.size}},e}(_.a);t.FontSettings=e;var n=function(){function t(t,e){this.name=t,this.text=e}return t.prototype.equals=function(t){return null!=t&&Object(c.g)(this.name,t.name)&&Object(c.g)(this.text,t.text)},t.prototype.clone=function(){return new t(this.name,this.text)},t}();t.BaseTextValue=n}(P||(P={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return d}));var r,i=n(408),o=n(469),a=n(522),s=n(520),l=n(419),u=n(744),c=n(410),h=n(463),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._defaultWidth=10,o._currentTextImage=null,o._onCanvasChangedDelegate=null,o._updatedFromServer=!1,o._isLegacyTextEditor=!1,o._isUpdatingAfterResize=!1,o._height=0,o._updateTextsFunc=function(){null!=o.canvas&&o.canvas.updateTexts()},o._imageContainer=new s.a(o._onImageLoaded.bind(o)),o._allowNegativeResize=!1,o}return p(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLegacyTextEditor",{get:function(){return this._isLegacyTextEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTextImage",{get:function(){return null!=this._currentTextImage?this._currentTextImage:this._currentTextImage=new d},set:function(t){var e,n,r,i=null===(e=this._currentTextImage)||void 0===e?void 0:e.cacheFileId,o=null==t?void 0:t.cacheFileId;i&&i!=o&&(null===(n=this.imageLoaderService)||void 0===n||n.releaseImageContainerFor(i,this.uniqueId)),this._currentTextImage=t,o&&i!=o&&(null===(r=this.imageLoaderService)||void 0===r||r.lockImageContainerFor(o,this.uniqueId)),this._height=this.rectangle.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textCropped",{get:function(){return this.item.checkTextCrop?null!=this.currentTextImage&&this.currentTextImage.textCropped:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._imageContainer.isLoaded},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isUpdatingAfterResize",{get:function(){return this._isUpdatingAfterResize},set:function(t){this._isUpdatingAfterResize=t},enumerable:!0,configurable:!0}),e.prototype.isEmptyTextPlaceholder=function(){return this.item.isTextPlaceholder&&""===this.item.text},e.prototype._cropTextLimits=function(){var t,e,n=this._getText(),r=n,i=null!==(t=this.item.maxLineCount)&&void 0!==t?t:0,o=null!==(e=this.item.maxLineLength)&&void 0!==e?e:0;if(i>0||o>0){c.m(r)&&(r=c.k(n,"\n"));var a=r.split("\n");if(i>0&&a.length>i&&(a=a.splice(0,i)),o>0)for(var s=0;s<a.length;s++)a[s].length>o&&(a[s]=a[s].substr(0,o));this.item.text=a.join("\n")}},e.prototype.drawItemHandler=function(t){if(null!=t&&null!=this.canvas)if(this._isReadyToDraw){this._hasVectorMask()&&(t.save(),this._clip(t));var e=this.item,n=this.rectangle,r=this.isEmptyTextPlaceholder()?.5:1,i=this._getItemColorPreviews(),o=i.fillColorPreview,a=i.borderColorPreview,s=i.altBorderColorPreview;if(l.a.fillRectangle(t,n,null==o?void 0:o.toString(),e.opacity*r),""!==this._getText()||!0===this._updatedFromServer)try{var c=this.canvas.service.imageLoaderService.getImageContainerFor(this.currentTextImage.cacheFileId);if(null!=c){var p=this.canvas.service.imageLoaderService.getImageContainerRectangleFor(this.currentTextImage.cacheFileId);u.a.renderTextImage(this,c,p,t,r,0)}else u.a.renderTextImage(this,this._imageContainer,null,t,r,0)}catch(g){console.error(g),this.update()}var f=this._getActualBorderWidth();if(f>0){n.width+=f,n.height+=f;var d=h.c.rotatedRectangle(n);l.a.drawStroke(t,d,n.center,new h.e,f,null==a?void 0:a.toString(),null==s?void 0:s.toString(),e.opacity*r,e.dash)}this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onResized=function(){return null!=this.canvas&&(this.isUpdatingAfterResize=!0),t.prototype.onResized.call(this)},e.prototype.isEmpty=function(){return this.item.isEmpty()},e.prototype.isVisible=function(){var e=null==this.item.parentGroupItem||this.item.parentGroupItem.isChildVisible(this.item);return t.prototype.isVisible.call(this)&&e},e.prototype.quickUpdate=function(){this._updateImageUrl(),this.isVisible()&&!this._imageContainer.source&&this.canvas&&!this.canvas.service.imageLoaderService.hasImageContainerFor(this.currentTextImage.cacheFileId)&&this.update()},e.prototype.transformChanged=function(){var e=this;if(t.prototype.transformChanged.call(this),this.isUpdating&&this._callbacks){var n=this.item.transform.clone();this._callbacks.push((function(){e.item.setTransform(n,!0)}))}},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),e&&n&&this.update()},e.prototype.dispose=function(){this._imageContainer.dispose(),null!=this._onCanvasChangedDelegate&&(null!=this.canvas&&this.canvas.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate),this.currentTextImage=null,t.prototype.dispose.call(this)},e.prototype._updateImpl=function(t,e){return n=this,r=void 0,o=function(){var n,r=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){return this.isVisible()?(n=function(){r._afterUpdate(e)},this._update(null,t,n)):"function"==typeof t&&t(),[2]}))},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{l(o.next(t))}catch(n){e(n)}}function s(t){try{l(o.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},e.prototype._validateBeforeCallService=function(){return""!==this._getText()},e.prototype._onValidateBeforeCallServiceFailed=function(){this._getSrc()?this._setDefaultTextControlPoints():this._updateEmptyTextControlPoints()},e.prototype._updateEmptyTextControlPoints=function(){var e,n=this,r=this._createDataInstance(this),i=JSON.parse(this._getDataItem());e=i.text,i.text="a";var o=[JSON.stringify(r),i];t.prototype._callService.call(this,"Update"+this.getTypeName(),o,(function(t){var r=null;"object"==typeof t&&(r=t.item,t=t.itemHandlerData),null!=r&&(r.text=e,n._applyDataItem(r,t)),n.setData(t);var i=n.canvas;null!=i&&(i.updateSelection(),i.redraw()),n.onSuccessResponse()}),(function(t){n.onErrorResponse(t)}),null)},e.prototype._setDefaultTextControlPoints=function(){var t=this.item.alignment;t===i.qb.Center?this._controlPoints[0].x+=(this._controlPoints[1].x-this._controlPoints[0].x)/2-this._defaultWidth/2:t===i.qb.Right&&(this._controlPoints[0].x=this._controlPoints[1].x-this._defaultWidth),this._controlPoints[1].x=this._controlPoints[0].x+this._defaultWidth,this.raiseChanged();var e=this.canvas;null!=e&&(e.updateSelection(),e.redraw()),this.onSuccessResponse()},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype._createDataInstance=function(t){return new a.a(t)},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"text":this._isLegacyTextEditor&&this._cropTextLimits(),this.update(null,this._updateTextsFunc);break;case"font":this.update(null,this._updateTextsFunc);break;case"underline":case"color":case"alignment":case"leading":case"tracking":case"verticalScale":case"horizontalScale":case"previewScale":case"stroke":case"shadow":case"baselineShift":case"overlapLinesEnabled":case"characterLimit":case"maxLineCount":case"maxLineLength":this.update();break;case"checkTextCrop":e.checkTextCrop&&this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.text=e.text,this.item.font=e.font,this.item.leading=e.leading,this.item.color=e.color,this.item.stroke=e.stroke,this.item.shadow=e.shadow,this.item.verticalScale=e.verticalScale,this.item.horizontalScale=e.horizontalScale,this.item.previewScale=e.previewScale,this.item.mask=e.mask,this.item.baselineShift=e.baselineShift,this._updateVectorMaskCenter()},e.prototype._getSrc=function(){var t=this._imageContainer.source;return c.l(t)?this._createImageUrl():t},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),null==e.textEditor&&(this._isLegacyTextEditor=!0,this._cropTextLimits()),null==this.canvas||this._onCanvasChangedDelegate||(this._onCanvasChangedDelegate=this._onCanvasChanged.bind(this),this.canvas.add_zoomChanged(this._onCanvasChangedDelegate))},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),e&&null!=this._onCanvasChangedDelegate&&(e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate)},e.prototype._getText=function(){var t=this.isEmptyTextPlaceholder()?this.item.originalText:this.item.text;return c.m(t)?this._xmlToHtml(t).textContent.trim():t.trim()},e.prototype._createImageUrl=function(){return null==this.canvas||this.canvas.service.imageLoaderService.hasImageContainerFor(this.currentTextImage.cacheFileId)?null:null!=this.currentTextImage.cacheFileId&&0!==this.currentTextImage.cacheFileId.length||null!=this.currentTextImage.base64Image&&0!==this.currentTextImage.base64Image.length?this.currentTextImage&&this.currentTextImage.base64Image?"data:image/png;base64,"+this.currentTextImage.base64Image:this._apiClient.serviceEndpoint+"/txt?f="+encodeURIComponent(this.currentTextImage.cacheFileId):null},e.prototype._updateImageUrl=function(){if(""!==this._getText()&&this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createImageUrl();null==this._imageContainer.source||e!==this._imageContainer.source?null===e?(this._imageContainer.clear(),t.redraw()):this._imageContainer.updateUrl(e):!0===this.isUpdatingAfterResize&&(this.isUpdatingAfterResize=!1,t.redraw())}}},e.prototype._afterUpdate=function(t){var e;"function"==typeof t&&t(),this._updatedFromServer||null===(e=this.canvas)||void 0===e||e.updateViolationContainerPosition(this),this._updatedFromServer=!0,null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redrawDesign())},e.prototype._xmlToHtml=function(t){return(new DOMParser).parseFromString("<body>"+t+"</body>","text/html").getElementsByTagName("body")[0]},e.prototype._onImageLoaded=function(){this.isUpdatingAfterResize=!1,this._height=this.rectangle.height,null!=this.canvas&&this.canvas.redraw(),this._dispatchReadyEvent()},e.prototype._onCanvasChanged=function(t){t.fullUpdate&&this.update()},Object.defineProperty(e.prototype,"imageLoaderService",{get:function(){var t,e;return null===(e=null===(t=this.canvas)||void 0===t?void 0:t.service)||void 0===e?void 0:e.imageLoaderService},enumerable:!0,configurable:!0}),e.typeName="BaseTextItemHandler",e}(o.a),d=function(){this.cacheFileId=null,this.base64Image=null,this.textCropped=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(406),i=function(){function t(t){this._args=t}return t.prototype.execute=function(){throw new r.e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return p})),n.d(e,"f",(function(){return f})),n.d(e,"g",(function(){return d.a})),n.d(e,"h",(function(){return g.a})),n.d(e,"i",(function(){return m.a})),n.d(e,"j",(function(){return y.a})),n.d(e,"e",(function(){return b}));var r=n(413),i=n(420);class o{constructor(t,e,n){this._textWhizz=t,this._colorPalette=e,n&&(this.font=n.font,this.color=n.color,this.underline=n.underline,this.leading=n.leading,this.tracking=n.tracking,this.stroke=n.stroke,this.openType=n.openType,this.subscript=n.subscript,this.subscriptSize=n.subscriptSize,this.superscript=n.superscript,this.superscriptSize=n.superscriptSize,this.baselineShift=n.baselineShift,this.verticalScale=n.verticalScale,this.horizontalScale=n.horizontalScale)}setEntry(t){t&&(this.font={postScriptName:t.fontName,size:t.fontSize,fauxBold:t.fauxBold,fauxItalic:t.fauxItalic,allCaps:t.allCaps,smallCaps:t.smallCaps},this.color=this._colorPalette.getPaletteColorAt(t.fillColor.index),this.underline=t.underline,this.leading=t.leading,this.tracking=t.tracking,this.superscript=t.superscript,this.superscriptSize=t.superscriptSize,this.subscript=t.subscript,this.subscriptSize=t.subscriptSize,this.baselineShift=t.baselineShift,this.verticalScale=t.vertScale,this.horizontalScale=t.horzScale,this.openType=Object.keys(this._textWhizz.OpenTypeFeature).filter((e=>1===t.openType.get(this._textWhizz.OpenTypeFeature[e]))).map((t=>new i.OpenTypeFeature(t,1))),this.stroke={color:this._colorPalette.getPaletteColorAt(t.strokeColor.index),size:t.strokeWidth,enabled:this._isStrokeEnabled(t)})}patchToEntry(t){const e=this;if(this._isSet(e.font)){const n=e.font;this._isSet(n.postScriptName)&&(t.fontName=n.postScriptName),this._isSet(n.size)&&(t.fontSize=n.size),this._isSet(n.fauxBold)&&(t.fauxBold=n.fauxBold),this._isSet(n.fauxItalic)&&(t.fauxItalic=n.fauxItalic),this._isSet(n.allCaps)&&(t.allCaps=n.allCaps),this._isSet(n.smallCaps)&&(t.smallCaps=n.smallCaps)}return this._isSet(e.color)&&(t.fillColor=this._colorPalette.addColorToPalette(e.color)),this._isSet(e.underline)&&(t.underline=e.underline),this._isSet(e.leading)&&(t.leading=e.leading),this._isSet(e.tracking)&&(t.tracking=e.tracking),Array.isArray(e.openType)&&e.openType.length&&e.openType.forEach((e=>t.openType.set(this._textWhizz.OpenTypeFeature[e.tag],e.value))),this._isSet(e.subscript)&&(t.subscript=e.subscript),this._isSet(e.subscriptSize)&&(t.subscriptSize=e.subscriptSize),this._isSet(e.superscript)&&(t.superscript=e.superscript),this._isSet(e.superscriptSize)&&(t.superscriptSize=e.superscriptSize),this._isSet(e.baselineShift)&&(t.baselineShift=e.baselineShift),this._isSet(e.verticalScale)&&(t.vertScale=e.verticalScale),this._isSet(e.horizontalScale)&&(t.horzScale=e.horizontalScale),this._isSet(e.stroke)&&(e.stroke.enabled?(this._isSet(e.stroke.color)&&(t.strokeColor=this._colorPalette.addColorToPalette(e.stroke.color)),this._isSet(e.stroke.size)&&(t.strokeWidth=e.stroke.size)):(t.strokeColor=this._colorPalette.addColorToPalette({color:new r.RgbColor(0,0,0,0),preview:new r.RgbColor(0,0,0,0)}),t.strokeWidth=0)),t}_isSet(t){return!(null==t)}_isStrokeEnabled(t){const e=t.strokeColor;return t.strokeWidth>0||e.getType()===this._textWhizz.ColorType.rgb&&e.A>0||e.getType()===this._textWhizz.ColorType.indexed&&!this._colorPalette.getPaletteColorAt(e.index).color.isTransparent}}class a{constructor(t,e){this._tw=t,this._colorPalette=e,this._initializeTextWhizz(this._colorPalette.select((t=>t.preview)))}getPaletteColors(){return[...this._colorPalette]}getPaletteColorAt(t){return this._colorPalette.get(t)}addColorToPalette(t){const e=this.addColorToPaletteReturnIndex(t);return this._getColorFromTextWhizz(e)}addColorToPaletteReturnIndex(t){let e=this._colorPalette.indexOf((e=>e.color.equals(t.color)));return-1!==e?e:(this._colorPalette.add(t),this._addColorToTextWhizz(t.preview))}_initializeTextWhizz(t){for(let e of t)this._addColorToTextWhizz(e)}_getColorFromTextWhizz(t){const e=this._tw.engine.ColorType.indexed,n=[t];return new this._tw.engine.Color(e,n)}_addColorToTextWhizz(t){const e=this._tw.engine.ColorType.rgb,n=[t.b,t.g,t.r,t.alpha],r=new this._tw.engine.Color(e,n),i=this._tw.engineHandler.getColorPalette();return i.add(r),i.getSize()-1}}var s=n(408),l=n(429);class u{constructor(t){this._textWhizz=t}convertAlignmentFromTextWhizz(t){return t===this._textWhizz.TextAlignment.center?s.qb.Center:t===this._textWhizz.TextAlignment.right?s.qb.Right:t===this._textWhizz.TextAlignment.justification?s.qb.Justify:t===this._textWhizz.TextAlignment.justificationLastLeft?s.qb.LastLeft:t===this._textWhizz.TextAlignment.justificationLastCenter?s.qb.LastCenter:t===this._textWhizz.TextAlignment.justificationLastRight?s.qb.LastRight:s.qb.Left}convertListStyleTypeFromTextWhizz(t){return t===this._textWhizz.ListStyleType.none?l.d.none:t===this._textWhizz.ListStyleType.bullets?l.d.bullets:t===this._textWhizz.ListStyleType.numbers?l.d.numbers:void 0}convertListStyleTypeToTextWhizz(t){switch(t){case l.d.none:return this._textWhizz.ListStyleType.none;case l.d.bullets:return this._textWhizz.ListStyleType.bullets;case l.d.numbers:return this._textWhizz.ListStyleType.numbers}}convertListNumberFormatTypeFromTextWhizz(t){return t===this._textWhizz.NumberFormatType.none?l.h.none:t===this._textWhizz.NumberFormatType.number?l.h.number:t===this._textWhizz.NumberFormatType.lowerLetter?l.h.lowerLetter:t===this._textWhizz.NumberFormatType.upperLetter?l.h.upperLetter:t===this._textWhizz.NumberFormatType.lowerRoman?l.h.lowerRoman:t===this._textWhizz.NumberFormatType.upperRoman?l.h.upperRoman:void 0}convertListNumberFormatTypeToTextWhizz(t){switch(t){case l.h.none:return this._textWhizz.NumberFormatType.none;case l.h.number:return this._textWhizz.NumberFormatType.number;case l.h.lowerLetter:return this._textWhizz.NumberFormatType.lowerLetter;case l.h.upperLetter:return this._textWhizz.NumberFormatType.upperLetter;case l.h.lowerRoman:return this._textWhizz.NumberFormatType.lowerRoman;case l.h.upperRoman:return this._textWhizz.NumberFormatType.upperRoman}}convertListNumberModeFromTextWhizz(t){return t===this._textWhizz.NumberMode.continueFromPrevious?l.i.continueFromPrevious:t===this._textWhizz.NumberMode.startAt?l.i.startAt:void 0}convertListNumberModeToTextWhizz(t){switch(t){case l.i.continueFromPrevious:return this._textWhizz.NumberMode.continueFromPrevious;case l.i.startAt:return this._textWhizz.NumberMode.startAt}}convertAlignmentToTextWhizz(t){switch(t){case s.qb.Center:return this._textWhizz.TextAlignment.center;case s.qb.Right:return this._textWhizz.TextAlignment.right;case s.qb.Justify:return this._textWhizz.TextAlignment.justification;case s.qb.LastLeft:return this._textWhizz.TextAlignment.justificationLastLeft;case s.qb.LastCenter:return this._textWhizz.TextAlignment.justificationLastCenter;case s.qb.LastRight:return this._textWhizz.TextAlignment.justificationLastRight;case s.qb.Left:default:return this._textWhizz.TextAlignment.left}}convertMoveDirectionToTextWhizz(t){switch(t){case l.f.up:return this._textWhizz.MoveDirection.up;case l.f.down:return this._textWhizz.MoveDirection.down;case l.f.lineStart:return this._textWhizz.MoveDirection.lineStart;case l.f.lineEnd:return this._textWhizz.MoveDirection.lineEnd;case l.f.textStart:return this._textWhizz.MoveDirection.textStart;case l.f.textEnd:return this._textWhizz.MoveDirection.textEnd;case l.f.leftWord:return this._textWhizz.MoveDirection.leftWord;case l.f.rightWord:return this._textWhizz.MoveDirection.rightWord;case l.f.left:return this._textWhizz.MoveDirection.left;case l.f.right:return this._textWhizz.MoveDirection.right;default:return null}}convertFirstBaselineOffsetToTextWhizz(t){switch(t){case s.C.Ascent:return this._textWhizz.FirstBaselineOffset.ascent;case s.C.CapHeight:return this._textWhizz.FirstBaselineOffset.capHeight;case s.C.Leading:return this._textWhizz.FirstBaselineOffset.leading;case s.C.XHeight:return this._textWhizz.FirstBaselineOffset.xHeight;case s.C.Fixed:return this._textWhizz.FirstBaselineOffset.fixed;case s.C.EmboxHeight:return this._textWhizz.FirstBaselineOffset.emBox}}convertAutoSizeModeToTextWhizz(t){switch(t){case s.h.Off:return this._textWhizz.AutoSizeMode.off;case s.h.WidthOnly:return this._textWhizz.AutoSizeMode.widthOnly;case s.h.HeightOnly:return this._textWhizz.AutoSizeMode.heightOnly;case s.h.WidthHeight:return this._textWhizz.AutoSizeMode.widthHeight}}convertVerticalAlignmentToTextWhizz(t){switch(t){case s.sb.Top:return this._textWhizz.VerticalAlignment.top;case s.sb.Center:return this._textWhizz.VerticalAlignment.center;case s.sb.Bottom:return this._textWhizz.VerticalAlignment.bottom;default:return this._textWhizz.VerticalAlignment.top}}}var c=n(407),h=n(470);class p{constructor(t,e,n,r,i){switch(this._tw=t,this._textMeasurerHolder=e,this._converter=new u(t.engine),n){case l.j.pointTextFrame:this._textFrame=this._getPointTextFrame(r);break;case l.j.pathTextFrame:this._textFrame=this._getPathTextFrame(r);break;case l.j.shapeTextFrame:this._textFrame=this._getShapeTextFrame(r,i);break;case l.j.archedTextFrame:this._textFrame=this._getArchedTextFrame(r)}}get(){return this._textFrame}_getArchedTextFrame(t){const e=new this._tw.engine.ArchedTextFrame,n=this._tw.initData.previewScale;return Object(c.EqualsOfFloatNumbers)(n,1)||t.point.scale(1/n,1/n),e.center=t.point,e.bend=t.bend,e}_getPointTextFrame(t){const e=new this._tw.engine.PointTextFrame,n=this._tw.initData.previewScale;return Object(c.EqualsOfFloatNumbers)(n,1)||t.scale(1/n,1/n),e.point=t,e.textOrientation=this._tw.initData.isTextVertical?this._tw.engine.TextOrientation.vertical:this._tw.engine.TextOrientation.horizontal,e}_getPathTextFrame(t){const e=new this._tw.engine.PathTextFrame,n=this._tw.initData.previewScale,r=Object(h.b)(this._tw.engine,t);return Object(c.EqualsOfFloatNumbers)(n,1)||r.scale(1/n,1/n),e.baseline=r,e.start=this._tw.initData.start,e.end=this._tw.initData.end,this._tw.initData.isFitToPath&&(e.copyFittingMode=this._tw.engine.CopyFittingMode.fitToWidth),e}_getShapeTextFrame(t,e){const n=this._tw.initData.firstBaselineOffset,r=this._tw.initData.firstBaselineMinOffset,i=this._tw.initData.isTextBounded,o=this._tw.initData.overflowStrategy,a=this._tw.initData.verticalAlignment,l=this._tw.initData.previewScale,u=new this._tw.engine.ShapeTextFrame;return u.shape=Object(h.b)(this._tw.engine,t),null!=n&&(u.firstBaselineOffset=this._converter.convertFirstBaselineOffsetToTextWhizz(n)),null!=r&&(u.firstBaselineMinOffset=r),i&&(o===s.X.ExpandBox?!e&&this._isLargeRect()||!e?u.verticalAlignment=this._converter.convertVerticalAlignmentToTextWhizz(a):u.autoSizeMode=this._tw.engine.AutoSizeMode.heightOnly:u.verticalAlignment=this._converter.convertVerticalAlignmentToTextWhizz(a),o===s.X.FitToBox&&(u.copyFittingMode=this._tw.engine.CopyFittingMode.fitToBox),o===s.X.FitToWidth&&(u.copyFittingMode=this._tw.engine.CopyFittingMode.fitToWidth)),Object(c.EqualsOfFloatNumbers)(l,1)||u.shape.scale(1/l,1/l),u.textOrientation=this._tw.initData.isTextVertical?this._tw.engine.TextOrientation.vertical:this._tw.engine.TextOrientation.horizontal,u}_isLargeRect(){const t=this._tw.initData.rectangle;return this._textMeasurerHolder.textMeasurer.measureTextFrame(!1).height<t.height}}n(529);class f{constructor(t,e){this._textWhizz=t,this._converter=new u(t),e&&(this.alignment=e.alignment,this.firstLineIndent=e.firstLineIndent,this.leftIndent=e.leftIndent,this.rightIndent=e.rightIndent,this.spaceAfter=e.spaceAfter,this.spaceBefore=e.spaceBefore,this.listType=e.listType,this.level=e.level,this.tabOffset=e.tabOffset,this.numberingFormat=e.numberingFormat,this.numberingMode=e.numberingMode,this.startNumber=e.startNumber,this.bulletCharCode=e.bulletCharCode)}setEntry(t){t&&(this.alignment=this._converter.convertAlignmentFromTextWhizz(t.alignment),this.firstLineIndent=t.firstLineIndent,this.spaceBefore=t.spaceBefore,this.spaceAfter=t.spaceAfter,this.leftIndent=t.leftIndent,this.rightIndent=t.rightIndent,this.listType=this._converter.convertListStyleTypeFromTextWhizz(t.type),this.level=t.level,this.numberingFormat=this._converter.convertListNumberFormatTypeFromTextWhizz(t.formatType),this.numberingMode=this._converter.convertListNumberModeFromTextWhizz(t.mode),this.startNumber=t.startAt,this.bulletCharCode=t.bulletChar,this.tabOffset=t.tabPosition)}patchToEntry(t){const e=this;return this._isSet(e.alignment)&&(t.alignment=this._converter.convertAlignmentToTextWhizz(e.alignment)),this._isSet(e.firstLineIndent)&&(t.firstLineIndent=e.firstLineIndent),this._isSet(e.leftIndent)&&(t.leftIndent=e.leftIndent),this._isSet(e.rightIndent)&&(t.rightIndent=e.rightIndent),this._isSet(e.spaceAfter)&&(t.spaceAfter=e.spaceAfter),this._isSet(e.spaceBefore)&&(t.spaceBefore=e.spaceBefore),this._isSet(e.listType)&&(t.type=this._converter.convertListStyleTypeToTextWhizz(e.listType)),this._isSet(e.level)&&(t.level=e.level),this._isSet(e.numberingFormat)&&(t.formatType=this._converter.convertListNumberFormatTypeToTextWhizz(e.numberingFormat)),this._isSet(e.numberingMode)&&(t.mode=this._converter.convertListNumberModeToTextWhizz(e.numberingMode)),this._isSet(e.startNumber)&&(t.startAt=e.startNumber),this._isSet(e.bulletCharCode)&&(t.bulletChar=e.bulletCharCode),this._isSet(e.tabOffset)&&(t.tabPosition=e.tabOffset),t}_isSet(t){return!(null==t)}}var d=n(530),g=n(608),m=n(487),y=n(531);class _{constructor(t,e){this._name=t,this.value=e}get name(){return this._name}getEntry(){return{key:this.name,value:this.value}}}class b{constructor(t,e){this._tw=t,this._properties=[],e&&e.forEach((t=>this.setProperty(t.name,t.value)))}isPropertyExists(t){return null!=this.getProperty(t)}getProperty(t){const e=this._properties.filter((e=>e.name===t));return(null==e?void 0:e.length)>0?e[0]:null}getPropertiesCount(){return this._properties.length}getProperties(){return this._properties}setProperty(t,e){const n=this.getProperty(t);if(n)return void(n.value=e);const r=new _(t,e);this._properties.push(r)}deleteProperty(t){const e=this.getProperty(t);if(e){const t=this._properties.indexOf(e,0);return t>-1&&this._properties.splice(t,1),!0}return!1}getEntry(){const t=new this._tw.StringMap;return this._properties.forEach((e=>t.set(e.name,e.value))),t}setEntry(t){const e=t.keys(),n=e.size();if(0!==n)for(let r=0;r<n;r++){const n=e.get(r),i=t.get(n);this.setProperty(n,i)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(406),i=n(410);function o(){return function(t,e){var n="_"+e;Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){var o,a=typeof t;if(null!=t&&"boolean"!==a&&"number"!==a&&"string"!==a&&("object"!==a||"function"!=typeof t.equals))throw new r.a("PropertyChanged decorator works only for simple types or objects with equals method");Object(i.g)(this[n],t)||(this[n]=t,(null!==(o=this._propertyChanged)&&void 0!==o?o:this.propertyChanged).notify(this,e))},configurable:!0,enumerable:!0})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(451),o=n(407),a=n(481),s=n(742),l=n(419),u=n(413),c=n(409),h=n(579),p=n(408),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(n,r,i,o){void 0===r&&(r=null);var a=t.call(this,e._getItemPath(n),n,r,i,o)||this;return a._previousRectangle=null,a._isEditingChangedEvent=new c.a,a._selectButtonClickEvent=new c.c,a._content=null,a._topFrames=[],a._bottomFrames=[],a._editing=!1,a._showMaskedContent=!0,a._isContentUpdating=!1,a._placeholderButtonGroup=null,a._editButtonGroup=null,a._doneButtonGroup=null,a._selectButton=null,a._doneButton=null,a._handleButton=null,a._qualityChangeContainer=null,a._qualityChangeScaleBar=null,a._qualityChangeInfoBar=null,a._forceQualityChangeInfoBar=!1,a._emptyPlaceholderBorderColor=new u.RgbColor(204,204,204,255),a._emptyPlaceholderBorderWidth=1,a._imageIsLoading=!1,a.onHandleButtonClick=function(){var t;a.editing=!0,null===(t=a.canvas)||void 0===t||t.updatePlaceholderButtonGroup(a)},a.onDoneButtonClick=function(){var t;a.editing=!1,null===(t=a.canvas)||void 0===t||t.setSelectedItemHandlers([a])},a._selectButtonClickHandler=a._onSelectButtonClick.bind(a),a}return f(e,t),e.prototype.isHighlightNeeded=function(){return this.editing},Object.defineProperty(e.prototype,"imageIsLoading",{get:function(){return this._imageIsLoading},set:function(t){this._imageIsLoading=t,this._onImageIsLoadingChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousRectangle",{get:function(){return this._previousRectangle},set:function(t){this._previousRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){var e=this.canvas;null==e||this.isStubOrEmpty()||e.removeViolationContainer(this._content);var n=this._content;if(this._content=t,null!=this._content&&(this._content.layer=this.layer,this._content.parentPlaceholder=this,this._content.contentType=a.a.PlaceholderContent),null!=e){if(this._reloadPlaceholderButtons(),null==this._content)return;this._content.canvas=e,n&&n!=this._content&&this.canvas.handlerFactory.delete(n)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topFrames",{get:function(){return this._topFrames},set:function(t){var e=this;this._topFrames=t,this._updateTopFrames((function(t){t.contentType=a.a.TopFrame,t.layer=e.layer,t.parentPlaceholder=e,t.canvas=e.canvas}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomFrames",{get:function(){return this._bottomFrames},set:function(t){var e=this;this._bottomFrames=t,this._updateBottomFrames((function(t){t.contentType=a.a.BottomFrame,t.layer=e.layer,t.parentPlaceholder=e,t.canvas=e.canvas}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editing",{get:function(){return!this.isStubOrEmpty()&&this._editing},set:function(t){this._editing!==t&&(t&&!this.getPermissions().allowEditContent&&this.isStubOrEmpty()||(this._editing=t,this.raiseChanged(),this._isEditingChangedEvent.notify(this),null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.updatePlaceholderButtonGroup(this),this.canvas.redraw())))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMaskedContent",{get:function(){return this._showMaskedContent},set:function(t){this._showMaskedContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isQualityChangeBarEmpty",{get:function(){var t=this.canvas;return null==this._qualityChangeScaleBar||null==t||this._qualityChangeScaleBar.className===this.canvas.qualityChangeScaleBarCssClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeScaleBar",{get:function(){return this._qualityChangeScaleBar},set:function(t){this._qualityChangeScaleBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeInfoBar",{get:function(){return this._qualityChangeInfoBar},set:function(t){this._qualityChangeInfoBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeContainer",{get:function(){return this._qualityChangeContainer},set:function(t){this._qualityChangeContainer=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"forceQualityChangeInfoBar",{get:function(){return this._forceQualityChangeInfoBar},set:function(t){this._forceQualityChangeInfoBar=t;var e=this.canvas;null!=e&&e.updateViolationContainer(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholderButtonGroup",{get:function(){return this._placeholderButtonGroup},set:function(t){this._placeholderButtonGroup=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doneButtonGroup",{get:function(){return this._doneButtonGroup},set:function(t){this._doneButtonGroup=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButton",{get:function(){return this._selectButton},set:function(t){this._selectButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doneButton",{get:function(){return this._doneButton},set:function(t){this._doneButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleButton",{get:function(){return this._handleButton},set:function(t){this._handleButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButtonClickHandler",{get:function(){return this._selectButtonClickHandler},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editButtonGroup",{get:function(){return this._editButtonGroup},set:function(t){this._editButtonGroup=t},enumerable:!0,configurable:!0}),e.prototype.addIsEditingChanged=function(t){this._isEditingChangedEvent.add(t)},e.prototype.removeIsEditingChanged=function(t){this._isEditingChangedEvent.remove(t)},e.prototype.quickUpdate=function(){this.isVisible()&&this.update(),null!=this.canvas&&this.canvas.updatePlaceholderButtonGroup(this)},e.prototype.getContentScale=function(){if(this.isStubOrEmpty())return null;var t=this.getTransformedRectangle(!1),e=this.content.getTransformedRectangle(!1),n=90===Object(o.normalizeAngle)(t.angle-e.angle)||270===Object(o.normalizeAngle)(t.angle-e.angle),r=n?e.height/t.width:e.width/t.width,i=n?e.width/t.height:e.height/t.height;return this.item.contentResizeMode===p.ib.Fit?100*Math.max(r,i):100*Math.min(r,i)},e.prototype.setContentScale=function(t){if(!this.isStubOrEmpty()){var e=this.content.getTransformedRectangle(!1),n=t/this.getContentScale();this.content.setTransformedRectangle(new o.RotatedRectangleF(e.centerX,e.centerY,e.width*n,e.height*n,e.angle)),this.raiseChanging(this.item),this.canvas.redraw()}},e.prototype.resetContent=function(){if(!this.isStubOrEmpty()){var t=this.getTransformedRectangle(!1),e=this.content.getTransformedRectangle(!1),n=100/this.getContentScale(),r=90===Object(o.normalizeAngle)(t.angle-e.angle)||270===Object(o.normalizeAngle)(t.angle-e.angle),i=this.content.item,a=r?e.height/e.width:e.width/e.height,s=i.ratioWidthToHeight||i.sourceRectangle.width/i.sourceRectangle.height,l=a<s?n*(s/a):n,u=a>s?n*(a/s):n,c=r?e.height*l:e.width*l,h=r?e.width*u:e.height*u,f=this.item.contentResizeMode===p.ib.Fit?Math.min(t.width/c,t.height/h):Math.max(t.width/c,t.height/h);this.content.setTransformedRectangle(new o.RotatedRectangleF(t.centerX,t.centerY,c*f,h*f,t.angle)),this.content.item.getItemChangedEvent().notify(),this.canvas.redraw()}},e.prototype.getSelectToolbarButtonClickEvent=function(){return this._selectButtonClickEvent},e.prototype.getTopFrame=function(t){return null!=this._topFrames?this._topFrames[t]:null},e.prototype.setTopFrame=function(t,e){e._contentType=a.a.TopFrame,e._layer=this.layer,e._parentPlaceholder=this,e.canvas=this.canvas,this._topFrames[t]=e},e.prototype.getBottomFrame=function(t){return null!=this._bottomFrames?this._bottomFrames[t]:null},e.prototype.setBottomFrame=function(t,e){e._contentType=a.a.BottomFrame,e._layer=this.layer,e._parentPlaceholder=this,e.canvas=this.canvas,this._bottomFrames[t]=e},e.prototype.isEmptyContent=function(){return null==this._content},e.prototype.isStubOrEmpty=function(){return this.item.isStubContent||this.isEmptyContent()},e.prototype.isCoverMode=function(){return this.item.isCoverMode},e.prototype.showEditButton=function(){var e=t.prototype.showEditToolbarButton,n=!!this.isStubOrEmpty()||!this.item.imageContent.source.isVector;return e&&n},e.prototype.showHandleToolbarButton=function(){var t=this.getPermissions();return t.allowEditContent&&t.showHandleToolbarButton&&!this.isStubOrEmpty()},e.prototype.getPermissions=function(e){if(!this.editing||null!=e&&e)return t.prototype.getPermissions.call(this);if(!this.isEmptyContent()){var n=this._content.getPermissions().clone();return n.allowDelete=!1,n}return new s.a({},!1)},e.prototype.setBadToWarningChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToWarningChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityWarningToGoodChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setWarningToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityWarningToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setBadToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityWarningToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.rotateContentLeft=function(){this._rotateContent(-90)},e.prototype.rotateContentRight=function(){this._rotateContent(90)},e.prototype.setRectangle=function(e,n,r){this._previousRectangle=n?this.rectangle.clone():null,!this.editing||r?t.prototype.setRectangle.call(this,e,n):this._content.setRectangle(e,n)},e.prototype.drawItemHandler=function(e){if(null!=e){var n=function(t){t.drawItemHandler(e)},r=this.editing&&this.showMaskedContent;r||this._updateBottomFrames(n);var i=l.a,a=this.originalPath,s=this.getControlCenter(),c=this.item.transform;if(this.isEmptyContent())this.imageIsLoading?this.canvas.drawWaitClock(e,this.bounds.center):t.prototype.drawItemHandler.call(this,e),Object(o.EqualsOfFloatNumbers)(0,this.item.borderWidth)&&i.drawPath(e,a,s,c,this._emptyPlaceholderBorderWidth,this._emptyPlaceholderBorderColor.toString(),1);else if(this._areColorPreviewsReady){r&&this._content.drawMaskedContent(e);var h=this.isNormalRenderingType?this.item.opacity:1;e.save();var p=this._getTransformedPath();if(i.clipPath(e,p),null!=this.item.mask&&null!=this.item.mask.vectorMask){var f=this._getTransformedClippingPath();i.clipPath(e,f)}if(null!=a){var d=this._getItemColorPreviews().fillColorPreview;i.fillPath(e,a,s,c,null==d?void 0:d.toString(),h)}this.imageIsLoading?this.canvas.drawWaitClock(e,this.bounds.center):this._content.drawItemHandler(e),this.canvas.dndHandler.isDragSource(this)&&(e.globalCompositeOperation="destination-out",i.fillRectangle(e,this.rectangle,new u.RgbColor(0,0,0,255),.3),e.globalCompositeOperation="source-over"),e.restore();var g=this._getItemColorPreviews(),m=g.borderColorPreview,y=g.altBorderColorPreview;i.drawStroke(e,a,s,c,this._getActualBorderWidth(),null==m?void 0:m.toString(),null==y?void 0:y.toString(),h,this.item.dash)}else this.canvas.drawWaitClock(e,this.rectangle.center);if(r){if(e.globalCompositeOperation="destination-over",null!=this._bottomFrames)for(var _=this._bottomFrames.length-1;_>=0;_--)n(this._bottomFrames[_]);e.globalCompositeOperation="source-over"}this.canvas.dndHandler.isDragTarget(this)&&this.isNormalRenderingType&&i.fillRectangle(e,this.rectangle,new u.RgbColor(0,0,0,255),.5),this._updateTopFrames(n)}},e.prototype.getSelectionRectangle=function(){return this.editing?this._content.getSelectionRectangle():t.prototype.getSelectionRectangle.call(this)},e.prototype.getBorderMargin=function(){return this.editing?this._content.getBorderMargin():t.prototype.getBorderMargin.call(this)},e.prototype.addSelectButtonClick=function(t){this._selectButtonClickEvent.add(t)},e.prototype.removeSelectButtonClick=function(t){this._selectButtonClickEvent.remove(t)},e.prototype.getChangeContentButtonClickEvent=function(){return this._selectButtonClickEvent},e.prototype.startTransform=function(e){t.prototype.startTransform.call(this,e),this.editing&&(this._startRectangle=this._content.rectangle),this.updateContentAndFrames((function(t){t._startRectangle=t.rectangle}))},e.prototype.endTransform=function(t,e){this._endTransform(t,e)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this);var e=this.canvas;null!=e&&e.updatePlaceholderButtonGroupPosition(this)},e.prototype.onResized=function(){return this.updateContentAndFrames((function(t){t.onResized()})),t.prototype.onResized.call(this)},e.prototype.showSelectButton=function(){return this.isStubOrEmpty()&&this.getPermissions().showSelectButton},e.prototype.showSelectToolbarButton=function(){return this.getPermissions().showSelectToolbarButton&&!this.isStubOrEmpty()},e.prototype.showHandleButton=function(){return!this.isStubOrEmpty()&&this.getPermissions().allowEditContent&&this.getPermissions().showHandleButton&&!this._editing},e.prototype.setContentUpdating=function(t){this._isContentUpdating=t},e.prototype.isContentUpdating=function(){return this._isContentUpdating},e.prototype.updateContentAndFrames=function(t){this._updateContent(t),this._updateFrames(t)},e.prototype.getBoundsIncludingFrames=function(){var t=this.bounds;return this._updateFrames((function(e){t=o.RectangleF.union(t,e.bounds)})),t},e.prototype.getRectangleIncludingFrames=function(){var t=this.rectangle;return this._updateFrames((function(e){t=o.RotatedRectangleF.union(e.rectangle,t)})),t},e.prototype.setQualityChangeScaleBarWidth=function(t){null!=this._qualityChangeScaleBar&&(t=Math.max(0,t),t=Math.min(100,t),this._qualityChangeScaleBar.style.width=t+"%")},e.prototype.setQualityChangeInfoBarText=function(t){null!=this._qualityChangeInfoBar&&(this._qualityChangeInfoBar.innerText=t)},e.prototype._updateImpl=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return this.updateContentAndFrames((function(t){t.update()})),null!=this.canvas&&this.canvas.updatePlaceholderButtonGroup(this),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._onAddedOnCanvas=function(e){var n=this;t.prototype._onAddedOnCanvas.call(this,e),this.updateContentAndFrames((function(t){t.layer=n.layer,t.parentPlaceholder=n,t.canvas=e})),null!=e&&null==this.placeholderButtonGroup&&e.addPlaceholderButtonGroup(this),null!=this.content&&(this.content.canvas=e)},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),this.editing=!1,this.updateContentAndFrames((function(t){t._onRemovedFromCanvas(e)})),null!=e&&e.removePlaceholderButtonGroup(this)},e.prototype._onTransformRectangle=function(e,n,r){if(this._previousRectangle=this.rectangle,t.prototype._onTransformRectangle.call(this,e,n,r),!this.isEmptyContent()&&null!=this.content.startRectangle)if(this.item.isStubContent&&this.item.fixedStubContentSize&&!this.editing){var i=n.clone();i.Width=e.Width,i.Height=e.Height,this.content.transformRectangle(e,i)}else this.content.transformRectangle(e,n);this.editing||this._updateFrames((function(t){null!=t.startRectangle&&t.transformRectangle(e,n)})),this._previousRectangle=null;var o=this.canvas;null!=o&&o.updatePlaceholderButtonGroupPosition(this)},e.prototype._endTransform=function(t,e,n){void 0===n&&(n=!1),t&&(e||null!=this._startRectangle)&&(this.updateContentAndFrames((function(n){return n._endTransform(t,e,!0)})),n||this._itemPropertyChangedEvent.notify(this,"transform")),t&&e||(delete this._startRectangle,this.updateContentAndFrames((function(t){delete t._startRectangle}))),null!=this.canvas&&this.canvas.updateViolationContainer(this,!0)},e.prototype._getHighlightRectangle=function(){return this.editing?this.rectangle:t.prototype._getHighlightRectangle.call(this)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips=new p.hb(!0,!0,!1),e},e.prototype._getItemPermissions=function(){var e=t.prototype._getItemPermissions.call(this);return e.placeholder=this.item.placeholderPermissions,e},e.prototype._onItemPropertyChanged=function(e,n){var r,i=this;switch(n){case"content":this.content=null!=e.content&&null!=this.canvas?this.canvas.handlerFactory.get(e.content):null,this.update();break;case"topFrames":null!=this.canvas&&(this.topFrames=e.topFrames.map((function(t){return i.canvas.handlerFactory.get(t)}))),this.update();break;case"bottomFrames":null!=this.canvas&&(this.bottomFrames=e.bottomFrames.map((function(t){return i.canvas.handlerFactory.get(t)}))),this.update();break;case"locked":null===(r=this.canvas)||void 0===r||r.updatePlaceholderButtonGroup(this);break;case"isStubContent":this._reloadPlaceholderButtons();break;case"isCoverMode":null!=this._content&&this.item.isCoverMode&&this._content.setRectangle(this._content.rectangle);break;case"contentOverlayEffect":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){var e;t.prototype._onItemVisibilityChanged.call(this),null===(e=this.canvas)||void 0===e||e.updatePlaceholderButtonGroup(this)},e.prototype._refreshState=function(){var e;t.prototype._refreshState.call(this),this._isIgnorePermissionsMode()&&(null===(e=this.canvas)||void 0===e||e.updatePlaceholderButtonGroup(this))},e.prototype._createDataInstance=function(t){return new h.a(t)},e.prototype._updateFrames=function(t){this._updateTopFrames(t),this._updateBottomFrames(t)},e.prototype._updateTopFrames=function(t,e){if(null!=this._topFrames)for(var n=0;n<this._topFrames.length;n++)t(this._topFrames[n],null!=e?e[n]:null)},e.prototype._updateBottomFrames=function(t,e){if(null!=this._bottomFrames)for(var n=0;n<this._bottomFrames.length;n++)t(this._bottomFrames[n],null!=e?e[n]:null)},e.prototype._updateContent=function(t){this.isEmptyContent()||t(this._content)},e.prototype._onSelectButtonClick=function(){this._selectButtonClickEvent.notify(this)},e.prototype._onImageIsLoadingChanged=function(){var t,e,n;this.imageIsLoading?null===(t=this.canvas)||void 0===t||t.removePlaceholderButtonGroup(this):null===(e=this.canvas)||void 0===e||e.addPlaceholderButtonGroup(this),null===(n=this.canvas)||void 0===n||n.redraw(!0)},e.prototype._rotateContent=function(t){if(!this.isStubOrEmpty()){var e=this.content.getTransformedRectangle(!1);e.angle=Object(o.normalizeAngle)((e.angle+t)%360),this.content.setTransformedRectangle(e),this.canvas.redraw()}},e.prototype._reloadPlaceholderButtons=function(){var t=this.canvas;null!=t&&(t.removePlaceholderButtonGroup(this),t.addPlaceholderButtonGroup(this),this.isStubOrEmpty()?t.removeViolationContainer(this._content):t.addViolationContainer(this._content))},e._getItemPath=function(t){return null==t?null:null!=t.sourcePath?t.sourcePath:null!=t.sourceRectangle?o.Path.rectangle(t.sourceRectangle.left,t.sourceRectangle.top,t.sourceRectangle.width,t.sourceRectangle.height):null},e.typeName="PlaceholderItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return i}));var r,i,o=n(406),a=n(437),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r._historyArgs=n,null==r._historyArgs&&(r._historyArgs={}),r._historyUpdateMode=null!=r._historyArgs.historyUpdateMode?r._historyArgs.historyUpdateMode:i.Update,r}return s(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){switch(e.label){case 0:return null!=this._historyArgs.history&&this._historyArgs.history.pause(),[4,this._executeCommandBody()];case 1:return t=e.sent(),null!=this._historyArgs.history&&this._historyArgs.history.resume(this._historyUpdateMode!==i.NotUpdate,this._historyArgs.historyUpdateMode===i.ForceUpdate),[2,t]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._executeCommandBody=function(){throw new o.e},e.prototype.redo=function(){throw new o.e},e.prototype.undo=function(){throw new o.e},e}(a.a);!function(t){t[t.NotUpdate=0]="NotUpdate",t[t.Update=1]="Update",t[t.ForceUpdate=2]="ForceUpdate"}(i||(i={}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return f}));var r,i=n(406),o=function(){function t(t,e){this._abstractObjectClass=t,this._derivedClassesData=e}return Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._abstractObjectClass},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"derivedTypes",{get:function(){return this._derivedClassesData.map((function(t){return t.type}))},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(t){var e=this._derivedClassesData.find((function(e){return e.type===t}));if(null==e)throw new i.c("Type "+t+" is not defined! Try on of these values: "+this.derivedTypes.join(", ")+".");return e.getDefaultValue()},t}(),a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._collectionConstructor=t,this._args=e}return Object.defineProperty(t.prototype,"type",{get:function(){return"collection"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._collectionConstructor},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){var t;return new((t=this._collectionConstructor).bind.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}([void 0],this._args)))},t}(),l=n(413),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return t.call(this,l.Color,[{type:"cmyk",getDefaultValue:function(){return new l.CmykColor(0,0,0,100,255)}},{type:"rgb",getDefaultValue:function(){return new l.RgbColor(0,0,0,255)}},{type:"spot",getDefaultValue:function(){return new l.SpotColor(new l.Ink("inkName",new l.CmykColor(0,0,0,100,255),1),255,255)}},{type:"grayscale",getDefaultValue:function(){return new l.GrayscaleColor(0,255)}},{type:"lab",getDefaultValue:function(){return new l.LabColor(0,0,0,255)}}])||this}return u(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"color"},enumerable:!0,configurable:!0}),e}(o),h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},p=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._objectConstructor=t,this._args=e}return Object.defineProperty(t.prototype,"type",{get:function(){return"object"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._objectConstructor},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){var t;return new((t=this._objectConstructor).bind.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}([void 0],this._args)))},t}(),f=function(){function t(t){this._defaultValue=t}return Object.defineProperty(t.prototype,"factoryClass",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return typeof this._defaultValue},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){return this._defaultValue},t}()},function(t,e,n){"use strict";n.r(e),n.d(e,"CornerRadiusConverter",(function(){return r.a})),n.d(e,"ItemsMetadata",(function(){return i.a})),n.d(e,"itemsMetadata",(function(){return i.e})),n.d(e,"Property",(function(){return i.b})),n.d(e,"checkType",(function(){return i.d})),n.d(e,"PropertyChanged",(function(){return i.c})),n.d(e,"BaseItem",(function(){return o.n})),n.d(e,"SmartItem",(function(){return o.ob})),n.d(e,"Item",(function(){return o.N})),n.d(e,"ShapeItem",(function(){return o.kb})),n.d(e,"ContentItem",(function(){return o.u})),n.d(e,"BaseTextItem",(function(){return o.o})),n.d(e,"BlendMode",(function(){return o.p})),n.d(e,"AutoScaledTextItem",(function(){return o.g})),n.d(e,"BarcodeItem",(function(){return o.k})),n.d(e,"EncodingOptions",(function(){return o.B})),n.d(e,"BarcodeFormat",(function(){return o.j})),n.d(e,"BarcodeSubType",(function(){return o.m})),n.d(e,"BarcodeData",(function(){return o.i})),n.d(e,"BarcodePermissions",(function(){return o.l})),n.d(e,"BoundedTextItem",(function(){return o.q})),n.d(e,"ClipartItem",(function(){return o.r})),n.d(e,"ColorGroup",(function(){return o.s})),n.d(e,"ColorGroupTarget",(function(){return o.t})),n.d(e,"ItemColorProperty",(function(){return o.O})),n.d(e,"ContentPermissions",(function(){return o.v})),n.d(e,"CurvedTextItem",(function(){return o.x})),n.d(e,"DashedLineItem",(function(){return o.y})),n.d(e,"EllipseItem",(function(){return o.A})),n.d(e,"FrontendPermissions",(function(){return o.E})),n.d(e,"GroupItem",(function(){return o.G})),n.d(e,"GridItem",(function(){return o.F})),n.d(e,"ImageEffect",(function(){return o.I})),n.d(e,"ImageItem",(function(){return o.J})),n.d(e,"ImageMetaData",(function(){return o.K})),n.d(e,"ImagePermissions",(function(){return o.L})),n.d(e,"InStringPlaceholder",(function(){return o.M})),n.d(e,"ItemPermissions",(function(){return o.P})),n.d(e,"ItemToolbarPermissions",(function(){return o.Q})),n.d(e,"LayoutItem",(function(){return o.R})),n.d(e,"LayoutType",(function(){return o.S})),n.d(e,"AutoLayoutAlignItems",(function(){return o.b})),n.d(e,"AutoLayoutOrientation",(function(){return o.e})),n.d(e,"AutoLayoutJustifyContent",(function(){return o.d})),n.d(e,"AutoLayoutAnchorPoint",(function(){return o.c})),n.d(e,"DefaultLayoutSettings",(function(){return o.z})),n.d(e,"AutoLayoutSettings",(function(){return o.f})),n.d(e,"LineItem",(function(){return o.T})),n.d(e,"LinePermissions",(function(){return o.V})),n.d(e,"ManipulationPermissions",(function(){return o.W})),n.d(e,"OverlayEffect",(function(){return o.Y})),n.d(e,"ParagraphSettings",(function(){return o.Z})),n.d(e,"PathBoundedTextItem",(function(){return o.ab})),n.d(e,"PathBoundedTextPermissions",(function(){return o.bb})),n.d(e,"VerticalContentAlignment",(function(){return o.ub})),n.d(e,"HorizontalContentAlignment",(function(){return o.H})),n.d(e,"ResizeMode",(function(){return o.ib})),n.d(e,"PlaceholderItem",(function(){return o.cb})),n.d(e,"PlaceholderPermissions",(function(){return o.db})),n.d(e,"PlainTextItem",(function(){return o.eb})),n.d(e,"PolylineItem",(function(){return o.fb})),n.d(e,"RectangleItem",(function(){return o.gb})),n.d(e,"ResizeGripsPermissions",(function(){return o.hb})),n.d(e,"ArchedTextItem",(function(){return o.a})),n.d(e,"ShadowSettings",(function(){return o.jb})),n.d(e,"ShapePermissions",(function(){return o.lb})),n.d(e,"Size",(function(){return o.nb})),n.d(e,"LineJoin",(function(){return o.U})),n.d(e,"StrokeSettings",(function(){return o.pb})),n.d(e,"FitMode",(function(){return o.D})),n.d(e,"ShrinkMode",(function(){return o.mb})),n.d(e,"OverflowStrategy",(function(){return o.X})),n.d(e,"TextAlignment",(function(){return o.qb})),n.d(e,"TextVerticalAlignment",(function(){return o.sb})),n.d(e,"FirstBaselineOffset",(function(){return o.C})),n.d(e,"AutoSizeMode",(function(){return o.h})),n.d(e,"CopyFittingMode",(function(){return o.w})),n.d(e,"TextPermissions",(function(){return o.rb})),n.d(e,"ThemeBinding",(function(){return o.tb})),n.d(e,"VisualizationPermissions",(function(){return o.vb})),n.d(e,"WrappingMode",(function(){return o.wb})),n.d(e,"FontSettingsData",(function(){return a.a})),n.d(e,"ShadowSettingsData",(function(){return a.c})),n.d(e,"StrokeSettingsData",(function(){return a.d})),n.d(e,"ItemData",(function(){return a.b})),n.d(e,"Container",(function(){return s.a})),n.d(e,"MockupContainer",(function(){return s.b})),n.d(e,"SurfaceContainer",(function(){return s.d})),n.d(e,"SpotColorContainer",(function(){return s.c})),n.d(e,"TextureContainer",(function(){return s.e})),n.d(e,"CropMark",(function(){return l.a})),n.d(e,"CropMarkTextAlignment",(function(){return l.c})),n.d(e,"CropMarkText",(function(){return l.b})),n.d(e,"ItemMask",(function(){return u.a})),n.d(e,"ModelComponent",(function(){return c.a})),n.d(e,"PrintArea",(function(){return h.a})),n.d(e,"PrintAreaBoundsType",(function(){return p.a})),n.d(e,"Product",(function(){return f.a})),n.d(e,"RenderingType",(function(){return d.a})),n.d(e,"PdfBox",(function(){return g.a})),n.d(e,"SafetyLine",(function(){return g.b})),n.d(e,"Surface",(function(){return m.a})),n.d(e,"SurfaceMockup",(function(){return y.a})),n.d(e,"Uuid",(function(){return _.a})),n.d(e,"Watermark",(function(){return b}));var r=n(570),i=n(568),o=n(408),a=n(492),s=n(457),l=n(571),u=n(500),c=n(424),h=n(572),p=n(464),f=n(574),d=n(499),g=n(516),m=n(514),y=n(515),_=n(495),b=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.storageId=this.storageId,e.width=this.width,e.height=this.height,e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return t.MAIN_CONTAINER_NAME="Main",t.BG_CONTAINER_NAME="Background",t.FG_CONTAINER_NAME="Foreground",t.BG_SOLIDCOLOR="solidColor",t.SPINE_AND_FOLDING_CONTAINER_NAME="Spine&Folding",t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(406),i=n(409),o=n(411),a=n(416),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(){function t(e,n,r){void 0===r&&(r=!0),this._edgeConstraint=null,this._cornerArbitraryConstraint=null,this.propertyChanged=new i.a,this.type=t.type,this.edge=n,this._setCornerValues(e,n,r)}return Object.defineProperty(t.prototype,"edgeConstraint",{set:function(t){var e=this.edge;this._edgeConstraint=t,this.edge!==e&&this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return null!=this._edgeConstraint?this._edgeConstraint:this._edge},set:function(t){this._edge!==t&&(this._edge=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"corner",{get:function(){return this._corner},set:function(t){if(null==t)throw new r.b("corner cannot be null");this._corner!==t&&(this._corner=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype._setCornerValues=function(e,n,r){this.corner=e&&n?r?[t.arbitrary,t.proportional]:[t.proportional,t.arbitrary]:e?[t.proportional]:n?[t.arbitrary]:[]},t.prototype.getCornerProportional=function(){return this.corner.includes(t.proportional)},t.prototype.getCornerArbitrary=function(){return null!=this._cornerArbitraryConstraint?this._cornerArbitraryConstraint:this.corner.includes(t.arbitrary)},t.prototype.setCornerProportional=function(t){var e=this.getCornerArbitrary();this._setCornerValues(t,e,!0)},t.prototype.setCornerArbitrary=function(t){var e=this.getCornerProportional();this._setCornerValues(e,t,!0)},t.prototype.setCornerArbitraryConstraint=function(t){var e=this.getCornerArbitrary();this._cornerArbitraryConstraint=t,this.getCornerArbitrary()!==e&&this.propertyChanged.notify()},t.prototype.clone=function(){var e=new t(!0,!0);return e.edge=this.edge,e.corner=this.corner.slice(),e},t.prototype.equals=function(t){return this.edge===t.edge&&o.isEqual(this.corner,t.corner)},Object.defineProperty(t.prototype,"data",{get:function(){return{Edge:this.edge,Corner:this.corner}},enumerable:!0,configurable:!0}),t._fromData=function(e){if(null==e)return new t(!1,!1);var n=new t(!0,!0);return n.corner=e.Corner,n.edge=e.Edge,n},t.prototype.getSimplifiedObject=function(){var t={};return t.edge=this.edge,t.corner=this.corner,t},t.arbitrary="Arbitrary",t.proportional="Proportional",t.type="ResizeGripsPermissions",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(a.a)({ignore:!0}),s("design:type",Boolean),s("design:paramtypes",[Boolean])],t.prototype,"edgeConstraint",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r,i,o,a,s=n(428),l=n(452),u=n(407),c=n(440),h=n(408),p=n(425),f=n(406);!function(t){t.Overlay="Overlay",t.Normal="Normal"}(r||(r={})),function(t){t.Mm="Mm",t.Inch="Inch",t.Cm="Cm",t.Point="Point",t.Custom="Custom"}(i||(i={})),function(t){t[t.Default=0]="Default",t[t.Html=1]="Html",t[t.None=2]="None"}(o||(o={})),function(t){t.InsideAll="InsideAll",t.PartiallyInsideAny="PartiallyInsideAny",t.InsideAny="InsideAny"}(a||(a={}));var d,g=(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},d(t,e)},function(t,e){function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},y=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t},_=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},b=function(t){function e(e,n,r){void 0===r&&(r=null);var i=t.call(this,null,null,null,null,e,r)||this;return i._itemHandlers=new p.a,i._onChildItemHandlerChanging=function(t){return i.raiseChanging(i.item)},Array.isArray(n)&&(i.itemHandlers=new p.a(n)),i.item.items.add_itemAdded(i._onItemAdded.bind(i)),i.item.items.add_itemRemoved(i._onItemRemoved.bind(i)),i._subscribeItemHandlers(),i}return g(e,t),e.prototype.isHighlightNeeded=function(){return!0},e.prototype._unsubscribeItemHandlers=function(){var t=this;null!=this.itemHandlers&&(this.itemHandlers.remove_itemAdded(this._onItemHandlerAdded.bind(this)),this.itemHandlers.remove_itemRemoved(this._onItemHandlerRemoved.bind(this)),this.itemHandlers.forEach((function(e){return e.getChangingEvent().remove(t._onChildItemHandlerChanging)})))},e.prototype._subscribeItemHandlers=function(){var t=this;null!=this.itemHandlers&&(this.itemHandlers.add_itemAdded(this._onItemHandlerAdded.bind(this)),this.itemHandlers.add_itemRemoved(this._onItemHandlerRemoved.bind(this)),this.itemHandlers.forEach((function(e){return e.getChangingEvent().add(t._onChildItemHandlerChanging)})))},e.prototype.setItemHandlers=function(t){this._unsubscribeItemHandlers(),Array.isArray(t)&&(this.itemHandlers=new p.a(t)),this._subscribeItemEvents()},Object.defineProperty(e.prototype,"itemHandlers",{get:function(){return this._itemHandlers},set:function(t){if(null==t)throw new Error("ItemHandlers can't be null");this._itemHandlers.clear(),this._itemHandlers.addRange(t)},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this;this.getNestedItemHandlers(!0,!1,!0).forEach((function(n){var i,o,a,s=(null===(a=null===(o=null===(i=e.canvas.viewer)||void 0===i?void 0:i.configuration)||void 0===o?void 0:o.handlers)||void 0===a?void 0:a.placeholderEditingViewMode)===r.Normal;null==n.canvas||!s&&n instanceof c.a&&n.editing||n.drawItemHandler(t)}))},e.prototype._getChildrenHighlights=function(){var t=[];return this.itemHandlers.where((function(t){return t.isVisible()})).forEach((function(e){var n=e.getHighlightRectangles();t.push.apply(t,y(n))})),t},e.prototype.getHighlightRectangles=function(e){void 0===e&&(e={includeChildren:!0,includeParent:!1});var n=[];return e.includeChildren&&(n=y(this._getChildrenHighlights())),e.includeParent&&this.item.groupItemPermissions&&n.push.apply(n,y(t.prototype.getHighlightRectangles.call(this,e))),n},e.prototype.getOrderedItems=function(){return this.item.items.toArray()},e.prototype._onItemPropertyChanged=function(e,n){if("opacity"===n){var r=e.opacity;this.item.applyToItems((function(t){s.d(t.opacity,r)||(t.opacity=r),t instanceof h.cb&&!s.d(t.content.opacity,r)&&t.updateContentAndFrames((function(t){return t.opacity=r}))}))}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemAdded=function(t){var e=t.item,n=t.index;null!=this.canvas&&(null!=n?this.itemHandlers.insertAt(n,this.canvas.handlerFactory.get(e)):this.itemHandlers.add(this.canvas.handlerFactory.get(e)))},e.prototype._onItemRemoved=function(t){if(null!=this.canvas){var e=this.itemHandlers.firstOrDefault((function(e){return e.item==t.item}));this.canvas.isItemHandlerSelected(e)&&this.canvas.removeSelectedItemHandler(e),this.itemHandlers.remove(e)}},e.prototype._onItemHandlerAdded=function(t){var n=this,r=t.item;r.getChangingEvent().add(this._onChildItemHandlerChanging);var i=function(t){t.layer=n.layer,t.canvas=n.canvas,t instanceof e&&t.applyToItems((function(t){return i(t)}))};i(r)},e.prototype._onItemHandlerRemoved=function(t){var e=t.item;e.getChangingEvent().remove(this._onChildItemHandlerChanging),this.canvas.isItemHandlerSelected(t.item)&&this.canvas.removeSelectedItemHandler(t.item),e.canvas=null,e.layer=null,e.item.parentContainer=null},e.prototype.replaceItemHandler=function(t,e){var n=this.itemHandlers.indexOf(t);if(-1==n)throw new f.c("ItemHandler not found");this.itemHandlers.replaceAt(e,n),e.layer=this.layer,this._onItemHandlerRemoved({item:t,index:n}),this._onItemHandlerAdded({item:e,index:n})},e.prototype.getNestedItemHandlers=function(t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===r&&(r=!1);for(var i=[],o=n?this.itemHandlers.toArray().slice().reverse():this.itemHandlers.toArray().slice();o.length>0;){var a=o.shift();if(!r||a.isVisible()&&!a.getPermissions().noShow){if(a instanceof e){var s=n?a.itemHandlers.toArray().slice().reverse():a.itemHandlers.toArray();if(o.unshift.apply(o,y(s)),t)continue}i.push(a)}}return i},e.prototype.updateNestedItemHandlers=function(t){var e,n,r=!1;try{for(var i=_(this.itemHandlers),o=i.next();!o.done;o=i.next()){var a=o.value,s=t(a);r=r||s,"updateNestedItemHandlers"in a&&(s=a.updateNestedItemHandlers(t),r=r||s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},e.prototype._onTransformRectangle=function(e,n,r){t.prototype._onTransformRectangle.call(this,e,n,r),this.itemHandlers.forEach((function(t){return t.transformRectangle(e,n,r)}))},e.prototype._updateImpl=function(){return e=this,n=void 0,i=function(){var e,n,r,i,o;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(a){switch(a.label){case 0:if(null==this.itemHandlers)return[3,8];a.label=1;case 1:a.trys.push([1,6,7,8]),e=_(this.itemHandlers),n=e.next(),a.label=2;case 2:return n.done?[3,5]:[4,n.value.updateAsync()];case 3:a.sent(),a.label=4;case 4:return n=e.next(),[3,2];case 5:return[3,8];case 6:return r=a.sent(),i={error:r},[3,8];case 7:try{n&&!n.done&&(o=e.return)&&o.call(e)}finally{if(i)throw i.error}return[7];case 8:return[4,t.prototype._updateImpl.call(this)];case 9:return a.sent(),[2]}}))},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}));var e,n,r,i},e.prototype.quickUpdate=function(){this.applyToItems((function(t){return t.quickUpdate()})),t.prototype.quickUpdate.call(this)},e.prototype.onResized=function(){return this.applyToItems((function(t){return t.onResized()})),t.prototype.onResized.call(this)},e.prototype.startTransform=function(e){this.applyToItems((function(t){return t.startTransform(e)})),t.prototype.startTransform.call(this,e)},e.prototype._endTransform=function(e,n,r){void 0===r&&(r=!1),this.applyToItems((function(t){return t.endTransform(e,n,!0)})),t.prototype._endTransform.call(this,e,n,r)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this),this.applyToItems((function(t){return t.transformChanged()}))},e.prototype.setRectangle=function(e,n){var r=e.getTransform(this.rectangle),i=r.translateX,o=r.translateY,a=r.scaleX,s=r.scaleY,l=r.angle,h=function(t){var n=t.rectangle;n.translate(i,o),n.rotateAt(l,e.center),t.setRectangle(n,!0),t instanceof c.a&&t.updateContentAndFrames(h)};this.itemHandlers.forEach(h);var p=this.rectangle,f=function(t){var e=t.rectangle,n=e.centerX-p.centerX,r=e.centerY-p.centerY;e.setTransform(new u.Transform(a,s,n*(a-1),r*(s-1))),t.setRectangle(e,!0),t instanceof c.a&&t.updateContentAndFrames(f)};this.itemHandlers.forEach(f),t.prototype.setRectangle.call(this,e,n)},Object.defineProperty(e.prototype,"_calculateRectangleFromChild",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype._getRectangle=function(){if(!this._calculateRectangleFromChild)return t.prototype._getRectangle.call(this);var e=this.itemHandlers.where((function(t){return t.isVisible()})).toArray().map((function(t){return t.getTransformedRectangle(!1,!0)}));if(e.length<1)return null!=e[0]?e[0]:new u.RotatedRectangleF;var n=this.item.transform.angle,r=e.reduce((function(t,e){return u.RotatedRectangleF.union(t,e)})).center,i=e.map((function(t){return t.rotateAt(-n,r).bounds})).reduce((function(t,e){return{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top),right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)}})),o=i.left,a=i.top,s=i.bottom,l=i.right;return u.RotatedRectangleF.FromLTRB(o,a,l,s).rotateAt(n,r)},e.prototype._onAddedOnCanvas=function(e){t.prototype._onAddedOnCanvas.call(this,e),this.applyToItems((function(t){return t.canvas=e}))},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),this.applyToItems((function(t){return t.canvas=null}))},e.prototype.applyToItems=function(t){if(null!=this.itemHandlers)for(var e=0;e<this.itemHandlers.length;e++)t(this.itemHandlers.getItem([e]))},e.prototype.getPermissions=function(){var e,n,r=t.prototype.getPermissions.call(this).clone();try{for(var i=_(this.itemHandlers),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.getPermissions();s.allowMoveHorizontal||(r.allowMoveHorizontal=!1),s.allowMoveVertical||(r.allowMoveVertical=!1),s.allowRotate||(r.allowRotate=!1),s.resizeGrips.edge||(r.resizeGrips.edge=!1),s.resizeGrips.getCornerProportional()||r.resizeGrips.setCornerProportional(!1),s.resizeGrips.getCornerArbitrary()||r.resizeGrips.setCornerArbitrary(!1),(this.item.transform.angle-a.angle)%90!=0&&(r.resizeGrips.edge=!1,r.resizeGrips.setCornerArbitrary(!1))}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.showSelectToolbarButton=this.item.groupItemPermissions.allowReplaceContent,r},e.prototype.resetPermissions=function(){var e,n;t.prototype.resetPermissions.call(this);try{for(var r=_(this.itemHandlers),i=r.next();!i.done;i=r.next())i.value.resetPermissions()}catch(o){e={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.isChildVisible=function(t){return!0},Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.typeName="GroupItemHandler",e}(l.a)},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return Object.defineProperty(t.prototype,"colorSpace",{get:function(){return this._colorSpace},enumerable:!0,configurable:!0}),t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.equals=function(t){return t.colorSpace===this.colorSpace},t.prototype.getData=function(){return{colorSpace:this.colorSpace}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r,i=n(498),o=n(457),a=n(549),s=n(551),l=n(552),u=n(554),c=n(406),h=n(409),p=n(407),f=n(456),d=n(465),g=n(555),m=n(411),y=n(499),_=n(466),b=n(500),v=n(410),w=n(416),C=n(556),P=n(443),x=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},I=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},O=function(t){function e(){var n=t.call(this)||this;n._visible=!0,n._locked=!1,n._opacity=1,n._fromLayout=!1,n._textWrappingMode=d.a.None,n._isVariable=!1,n._blendMode=_.a.Normal,n._ignorePermissionsChange=!1,n._mask=null,n._onPermissionsChanged=function(){n._ignorePermissionsChange||(n._ignorePermissionsChange=!0,n.applyPermissionsConstrain(),n._ignorePermissionsChange=!1,n._propertyChanged.notify(n,"permissions"))},n._parentGroupItem=null,n.themeBinding=new g.a,n._onTransformChanged=function(t){n._propertyChanged.notify(n,"transform")},n._onMaskChanged=function(t){n._propertyChanged.notify(n,"mask")},n._changedEvent=new h.b(n),n._changingEvent=new h.a,n.type=e.type;var r=new l.a;return r.allowRemoveOnLayoutChange=!1,n.itemPermissions=r,n.setManipulationPermissions(new a.a),n.visualizationPermissions=new s.a,n.frontendPermissions=new u.a,n._setViolationSettings(new C.a,!0),n.setTransform(new f.a),n}return x(e,t),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.itemPermissions=e._itemPermissions.clone(),n.visible=e._visible,n.locked=e._locked,n.opacity=e._opacity,n.isVariable=e._isVariable,n.textWrappingMode=e._textWrappingMode,n.setManipulationPermissions(e._manipulationPermissions.clone()),n.visualizationPermissions=e._visualizationPermissions.clone(),n.frontendPermissions=e._frontendPermissions.clone(),n.violationSettings=e._violationSettings.clone(),n.transform=e._transform.clone(),n.containerName=e.containerName,n.themeBinding=e.themeBinding.clone(),n.mask=null!=e.mask?e.mask.clone():null,n.blendMode=e.blendMode},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(v.g)(this._itemPermissions,e._itemPermissions),i=Object(v.g)(this._visible,e._visible),o=Object(v.g)(this._locked,e._locked),a=Object(v.g)(this._opacity,e._opacity),s=Object(v.g)(this._isVariable,e._isVariable),l=Object(v.g)(this._textWrappingMode,e._textWrappingMode),u=Object(v.g)(this._manipulationPermissions,e._manipulationPermissions),c=Object(v.g)(this._visualizationPermissions,e._visualizationPermissions),h=Object(v.g)(this._frontendPermissions,e._frontendPermissions),p=Object(v.g)(this._transform,e._transform),f=Object(v.g)(this._violationSettings,e._violationSettings),d=Object(v.g)(this.containerName,e.containerName),g=Object(v.g)(this.themeBinding,e.themeBinding),m=Object(v.g)(this._mask,e._mask),y=Object(v.g)(this.blendMode,e.blendMode);return n&&r&&i&&o&&a&&s&&l&&u&&c&&h&&p&&f&&d&&g&&m&&y},Object.defineProperty(e.prototype,"manipulationPermissions",{get:function(){return this.getManipulationPermissions()},set:function(t){this.setManipulationPermissions(t)},enumerable:!0,configurable:!0}),e.prototype.getManipulationPermissions=function(){return this._manipulationPermissions},e.prototype.setManipulationPermissions=function(t){if(null==t)throw new c.a("manipulationPermissions cannot be null");Object(v.g)(this._manipulationPermissions,t)||(null!=this._manipulationPermissions&&this._manipulationPermissions.propertyChanged.remove(this._onPermissionsChanged),this._manipulationPermissions=t,this.applyPermissionsConstrain(),this._manipulationPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"manipulationPermissions"))},Object.defineProperty(e.prototype,"visualizationPermissions",{get:function(){return this._visualizationPermissions},set:function(t){if(null==t)throw new c.a("visualizationPermissions cannot be null");Object(v.g)(this._visualizationPermissions,t)||(null!=this._visualizationPermissions&&this._visualizationPermissions.propertyChanged.remove(this._onPermissionsChanged),this._visualizationPermissions=t,this.applyPermissionsConstrain(),this._visualizationPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"visualizationPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemPermissions",{get:function(){return this._itemPermissions},set:function(t){if(null==t)throw new c.a("itemPermissions cannot be null");Object(v.g)(this._itemPermissions,t)||(null!=this._itemPermissions&&this._itemPermissions.propertyChanged.remove(this._onPermissionsChanged),this._itemPermissions=t,this.applyPermissionsConstrain(),this._itemPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"itemPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frontendPermissions",{get:function(){return this._frontendPermissions},set:function(t){if(null==t)throw new c.a("frontendPermissions cannot be null");Object(v.g)(this._frontendPermissions,t)||(null!=this._frontendPermissions&&this._frontendPermissions.propertyChanged.remove(this._onPermissionsChanged),this._frontendPermissions=t,this.applyPermissionsConstrain(),this._frontendPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"frontendPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(t,e){if(void 0===e&&(e=!1),null==t)throw new c.a("violationSettings cannot be null");Object(v.g)(this._violationSettings,t)||(null!=this._violationSettings&&this._violationSettings.removePropertyChanged(this._onPermissionsChanged),this._violationSettings=t,this.applyPermissionsConstrain(),this._violationSettings.addPropertyChanged(this._onPermissionsChanged),this._propertyChanged.notify(this,"violationSettings"))},e.prototype.applyPermissionsConstrain=function(){this.isRenderTypeIsNormal||(this.itemPermissions.allowOpacityChange=!1)},e.prototype._onContainerChanged=function(){t.prototype._onContainerChanged.call(this),this.applyPermissionsConstrain()},Object.defineProperty(e.prototype,"parentGroupItem",{get:function(){return this._parentGroupItem},set:function(t){this._parentGroupItem=t,null!=t&&(this.parentContainer=this._parentGroupItem.parentContainer)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this._blendMode!==t&&(this._blendMode=t,this._propertyChanged.notify(this,"blendMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transform",{get:function(){return this._transform},set:function(t){this.setTransform(t)},enumerable:!0,configurable:!0}),e.prototype.setTransform=function(t,e){void 0===e&&(e=!1),this._transform&&this._transform.removeTransformChanged(this._onTransformChanged);var n=!1;f.a.isEqual(this._transform,t)||(this._transform=t,n=!0),this._transform&&this._transform.addTransformChanged(this._onTransformChanged),!e&&n&&this._propertyChanged.notify(this,"transform")},Object.defineProperty(e.prototype,"textWrappingMode",{get:function(){return this._textWrappingMode},set:function(t){this._textWrappingMode!==t&&(this._textWrappingMode=t,this._propertyChanged.notify(this,"textWrappingMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this._locked},set:function(t){this._locked!==t&&(this._locked=t,this._propertyChanged.notify(this,"locked"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){Object(v.g)(this.mask,t)||(null!=this._mask&&this._mask.removeMaskChanged(this._onMaskChanged),this._mask=t,null!=this._mask&&this._mask.addMaskChanged(this._onMaskChanged),this._propertyChanged.notify(this,"mask"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._propertyChanged.notify(this,"visible"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"opacity",{get:function(){return this._opacity},set:function(t){p.EqualsOfFloatNumbers(this._opacity,t)||(this._opacity=t,this._propertyChanged.notify(this,"opacity"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVariable",{get:function(){return this._isVariable},set:function(t){if(this._isVariable!==t){if(!this._canSetIsVariable())throw new c.d("Unable to set isVariable on item of type '"+this.type+"'");this._isVariable=t,this._propertyChanged.notify(this,"isVariable")}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fromLayout",{get:function(){return this._fromLayout},set:function(t){this._fromLayout!==t&&(this._fromLayout=t,this._propertyChanged.notify(this,"fromLayout"))},enumerable:!0,configurable:!0}),e.prototype.canSetIsVariable=function(){return this._canSetIsVariable()},e.prototype._canSetIsVariable=function(){return!1},e.prototype._getParentContainer=function(){return null!=this.parentContainer?this.parentContainer:null},e.prototype.getSimplifiedObject=function(e){m.isArray(e)||m.isString(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["_changedEvent","_changingEvent","manipulationPermissions","itemPermissions","visualizationPermissions","frontendPermissions","renderingType","isRenderTypeIsNormal","parentGroupItem"].concat(e));return n.manipulationPermissions=this.manipulationPermissions.getSimplifiedObject(),n.itemPermissions=this.itemPermissions.getSimplifiedObject(),n.visualizationPermissions=this.visualizationPermissions.getSimplifiedObject(),n.frontendPermissions=this.frontendPermissions.getSimplifiedObject(),n.mask=null!=this.mask?this.mask.getSimplifiedObject():null,n},e.prototype.getItemChangedEvent=function(){return this._changedEvent},e.prototype.getItemChangingEvent=function(){return this._changingEvent},e.prototype._getThemeBinding=function(t){return null!=t?t:this.themeBinding},e.prototype._applyThemeColor=function(t,e,n){throw new c.e},Object.defineProperty(e.prototype,"isRenderTypeIsNormal",{get:function(){return this.renderingType===y.a.Normal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderingType",{get:function(){return this.parentContainer instanceof o.d?this.parentContainer.renderingType:y.a.Normal},enumerable:!0,configurable:!0}),e.type="item",S([Object(w.a)({enumObject:_.a,displayName:"Blend mode"}),I("design:type",String),I("design:paramtypes",[String])],e.prototype,"blendMode",null),S([Object(w.a)({enumObject:d.a}),I("design:type",Number),I("design:paramtypes",[Number])],e.prototype,"textWrappingMode",null),S([Object(w.a)({displayName:"Locked"}),I("design:type",Boolean),I("design:paramtypes",[Boolean])],e.prototype,"locked",null),S([Object(w.a)({factory:new P.c(b.a)}),I("design:type",b.a),I("design:paramtypes",[b.a])],e.prototype,"mask",null),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(409),o=n(452),a=n(407),s=n(419),l=n(459),u=n(408),c=n(577),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},d=function(t){function e(e,n,r,o,s){void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null);var l=t.call(this,null,null,null,null,n,r,s)||this;return l._apiClient=o,l._originalPathId=null,l._isLoadingPath=!1,l._isLoadedPath=!1,l.originalPath=null!=e?e:new a.Path(""),l._addedOnCanvasEvent=new i.a,null!=n&&null!=n.sourcePathId&&l.setOriginalPathId(n.sourcePathId),l._allowNegativeResize=!1,l._updateControlPointsSync(),l}return h(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return t.prototype._getItem.call(this)},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalPath",{get:function(){return this.item.sourcePath},set:function(t){this.item.sourcePath=t,this._isLoadedPath=!0},enumerable:!0,configurable:!0}),e.prototype.getOriginalPathId=function(){return this._originalPathId},e.prototype.setOriginalPathId=function(t){return p(this,void 0,void 0,(function(){var e,n,r,i;return f(this,(function(o){switch(o.label){case 0:return this._originalPathId=t,null==this._originalPathId?[2]:(this._isLoadingPath=!0,this._isLoadedPath=!1,[4,this._waitAddOnCanvas()]);case 1:if(o.sent(),null==this.canvas)return[2];o.label=2;case 2:return o.trys.push([2,4,5,6]),e=this._apiClient.getContentPath(this._originalPathId),r=a.Path.bind,[4,e];case 3:return n=new(r.apply(a.Path,[void 0,o.sent()])),this.item.sourcePathLoaded=!0,this.originalPath=n,this._updateControlPoints(),this._isLoadedPath=!0,[3,6];case 4:return i=o.sent(),console.error("Unable to load content path. Reason: "+i),this._isLoadedPath=!1,[3,6];case 5:return this._isLoadingPath=!1,this.item.sourcePathLoaded=!1,this.item.getPathLoadedEvent().notify(),[7];case 6:return this.canvas.redraw(),[2]}}))}))},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){this._hasVectorMask()&&(t.save(),this._clip(t));var e=this._getItemColorPreviews(),n=e.fillColorPreview,r=e.borderColorPreview,i=e.altBorderColorPreview;s.a.path(t,this.item.sourcePath,this.getControlCenter(),this.item.transform,null==n?void 0:n.toString(),0,null,this.item.opacity,null);var o=this._getActualDash();s.a.drawStroke(t,this.item.sourcePath,this.getControlCenter(),this.item.transform,this._getActualBorderWidth(),null==r?void 0:r.toString(),null==i?void 0:i.toString(),this.item.opacity,o),this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onTextWhizzInit=function(){t.prototype.onTextWhizzInit.call(this),this._updateControlPoints()},e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode===u.wb.Tight?this._getTransformedPath():t.prototype.getTextWrappingPath.call(this)},e.prototype._updateImpl=function(e,n){return p(this,void 0,void 0,(function(){return f(this,(function(r){return"function"!=typeof e||(this.isVisible()?t.prototype._update.call(this,null,e,n):e()),[2]}))}))},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews(),e=t.fillColorPreview,n=t.borderColorPreview,r=t.altBorderColorPreview;return!(null!=this.item.fillColor&&null==e||null!=this.item.borderColor&&null==n||null!=this.item.altBorderColor&&null==r)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return!this._isLoadingPath&&this._isLoadedPath&&this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.fillColor=e.fillColor,this.item.borderColor=e.borderColor,this.item.sourcePath=e.sourcePath,this.item.altBorderColor=e.altBorderColor,this.item.borderWidth=e.borderWidth,this.item.dash=e.dash,this.item.fixedBorderWidth=e.fixedBorderWidth},e.prototype._onItemPropertyChanged=function(e,n){var r=this.canvas;switch(n){case"fillColor":case"borderColor":case"altBorderColor":this.item.parentGroupItem instanceof u.r||(this.update(),null!=this.canvas&&this.canvas.redraw());case"dash":break;case"fixedBorderWidth":case"borderWidth":null!=r&&(r.updateSelection(),r.redraw());break;case"sourceRectangle":this.originalPath=a.Path.rectangle(this.item.sourceRectangle.left,this.item.sourceRectangle.top,this.item.sourceRectangle.width,this.item.sourceRectangle.height),this._controlPoints=[new a.PointF(this.item.sourceRectangle.left,this.item.sourceRectangle.top),new a.PointF(this.item.sourceRectangle.right,this.item.sourceRectangle.bottom)]}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getActualBorderWidth=function(){var t=this.item.borderWidth,e=this.canvas;return this.item.fixedBorderWidth&&null!=e&&(t/=e.zoom),t},e.prototype._getBoundsMargin=function(){return this._getActualBorderWidth()},e.prototype._getTransformedPath=function(){var t=this.getControlCenter(),e=this.item.sourcePath.clone();return e.transform(this.item.transform,t),e},e.prototype._createDataInstance=function(t){return new l.a(t)},e.prototype._getItemColorPreviews=function(){var t=this._colorPreviewService.getPreview(this.item.fillColor);null!=this.item.fillColor&&null==t&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.fillColor,this._onColorPreviewLoaded);var e=this._colorPreviewService.getPreview(this.item.borderColor);null!=this.item.borderColor&&null==e&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.borderColor,this._onColorPreviewLoaded);var n=this._colorPreviewService.getPreview(this.item.altBorderColor);return null!=this.item.altBorderColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.altBorderColor,this._onColorPreviewLoaded),{fillColorPreview:t,borderColorPreview:e,altBorderColorPreview:n}},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),this._apiClient=e.viewer.designAtomsApiClient,this._addedOnCanvasEvent.notify(),this._updateControlPoints()},e.prototype._updateControlPoints=function(){return p(this,void 0,void 0,(function(){var t;return f(this,(function(e){switch(e.label){case 0:return null==this.item.sourcePath?[2]:[4,c.a.getBounds(this.item.sourcePath)];case 1:return t=e.sent(),this.controlPoints=[new a.PointF(t.left,t.top),new a.PointF(t.right,t.bottom)],[2]}}))}))},e.prototype._updateControlPointsSync=function(){if(null!=this.item.sourcePath){var t=c.a.getBoundsSync(this.item.sourcePath);null!=t&&(this.controlPoints=[new a.PointF(t.left,t.top),new a.PointF(t.right,t.bottom)])}},e.prototype._waitAddOnCanvas=function(){return p(this,void 0,void 0,(function(){var t=this;return f(this,(function(e){switch(e.label){case 0:return null!=this.canvas?[2]:[4,new Promise((function(e){var n=function(){e(),t._addedOnCanvasEvent.remove(n)};t._addedOnCanvasEvent.add(n)}))];case 1:return e.sent(),[2]}}))}))},e.prototype._getActualDash=function(){var t=this.item.dash;if(null==t)return t;var e=this.canvas,n=t.slice(0);if(n.length>0&&this.item.fixedBorderWidth&&null!=e)for(var r=0;r<n.length;r++)n[r]/=e.zoom;return n},e.typeName="ShapeItemHandler",e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r,i=n(409),o=n(569),a=n(481),s=n(419),l=n(408),u=n(407),c=n(577),h=n(428),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},g=function(t){function e(e,n,r,o,a,s,l){void 0===s&&(s=null);var c=t.call(this,a)||this;c._textWhizz=s,c._transformChanging=new i.b(c),c._violationWarningButtonClickEvent=new i.c,c._violationWarningButtonClick=new i.c,c._doubleClickEvent=new i.c,c._clickEvent=new i.c,c._onColorPreviewLoaded=function(t){c._colorPreviewService.unsubscribeFromPreviewLoaded(t.color,c._onColorPreviewLoaded),c.canvas.redraw()},c._applyMatrix=function(t,e,n){void 0===n&&(n=null),c.setRectangle(c.rectangle.transformByMatrix(t,n),!e)};var h=e||0,p=n||0,f=r||0,d=o||0;return c._controlPoints=[new u.PointF(h,p),new u.PointF(h+f,p+d)],c._allowNegativeResize=!1,c._selectionTolerance=0,c._violationWarningButton=null,c._violationWarningButtonClickHandler=c._onViolationWarningButtonClick.bind(c),c._colorPreviewService=l,c._violationContainer=null,c._updateVectorMaskCenterSync(),c}return p(e,t),Object.defineProperty(e.prototype,"allowNegativeResize",{get:function(){return this._allowNegativeResize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transformChanging",{get:function(){return this._transformChanging},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rectangle",{get:function(){return this._getRectangle()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){var t=this.rectangle,e=this._getBoundsMargin();return t.width+=t.width>0?e:-e,t.height+=t.height>0?e:-e,t.bounds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.item.transform.angle},set:function(t){this.item.transform.setAngle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.rectangle.height},set:function(t){var e=this.rectangle;e.height=t,this.setRectangle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.rectangle.width},set:function(t){var e=this.rectangle;e.width=t,this.setRectangle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startRectangle",{get:function(){return null!=this._startRectangle?this._startRectangle:null},enumerable:!0,configurable:!0}),e.transformRectangleByTwoRectanglesDiff=function(t,e,n){var r=n.getTransform(e),i=r.angle,o=r.scaleX,a=r.scaleY;if(Object(u.EqualsOfFloatNumbers)(n.angle,0)||t.rotateAt(-n.angle,e.center),Object(u.EqualsOfFloatNumbers)(o,1)&&Object(u.EqualsOfFloatNumbers)(a,1)?(t.centerX+=r.translateX,t.centerY+=r.translateY):(t.width=t.width*o,t.height=t.height*a,t.centerX=n.centerX+(t.centerX-e.centerX)*o,t.centerY=n.centerY+(t.centerY-e.centerY)*a),Object(u.EqualsOfFloatNumbers)(n.angle,0)||t.rotateAt(n.angle,n.center),!Object(u.EqualsOfFloatNumbers)(i,0)){var s=t.center;s.rotateAt(i,e.center),t.angle=t.angle+i,t.center=s}return t},e.prototype.setRectangle=function(t,e){var n=u.RotatedRectangleF.fromRectangleF(this.getControlBounds()),r=t.getTransform(n);this.item.setTransform(r,e)},e.prototype.getControlBounds=function(){var t=Math.max(this._controlPoints[0].x,this._controlPoints[1].x),e=Math.max(this._controlPoints[0].y,this._controlPoints[1].y),n=Math.min(this._controlPoints[0].x,this._controlPoints[1].x),r=Math.min(this._controlPoints[0].y,this._controlPoints[1].y),i=t-n,o=e-r;return new u.RectangleF(n,r,i,o)},e.prototype.getControlCenter=function(){var t=this.getControlBounds(),e=t.left+t.width/2,n=t.top+t.height/2;return new u.PointF(e,n)},e.prototype.transformByMatrix=function(t,e,n){if(void 0===n&&(n=null),e||null!=this._startRectangle||this.startTransform(),this._applyMatrix(t,e,n),this.transformChanged(),e&&null!=this._startRectangle){var r=this.rectangle,i=!r.equals(this._startRectangle),o=!Object(h.d)(r.width,this._startRectangle.width)||!Object(h.d)(r.height,this._startRectangle.height);o&&this.onResized(),this._endTransform(i,o,!0),this._startRectangle=null}var a=this.canvas;null!=a&&(this.updateViolationContainerPosition(),a.redraw(!0)),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging()},e.prototype.getTransformedRectangle=function(t,e){void 0===t&&(t=!0);var n=this.rectangle,r=this._getPrintAreaBounds();if(null!=r&&t&&(n.location=n.location.translate(-r.left,-r.top)),e){var i=this.getBorderMargin();n.width+=2*i,n.height+=2*i}return n},e.prototype.setTransformedRectangle=function(t,e){this.setRectangle(t,e)},e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode!==l.wb.None?u.Path.rotatedRectangle(this.rectangle):null},e.prototype.setLocation=function(t){var e=this.rectangle;e.location=t,this.setRectangle(e)},e.prototype.onTextWhizzInit=function(){this._updateVectorMaskCenter()},e.prototype.hitTest=function(t){return this.canvas.hitTestManager.hitTestSelection(this._getHighlightRectangle(),t)},e.prototype.addViolationWarningButtonClick=function(t){this._violationWarningButtonClick.add(t)},e.prototype.removeViolationWarningButtonClick=function(t){this._violationWarningButtonClick.remove(t)},e.prototype.getViolationWarningButton=function(){return this._violationWarningButton},e.prototype.setViolationWarningButton=function(t){this._violationWarningButton=t},e.prototype.getViolationWarningButtonClickHandler=function(){return this._violationWarningButtonClickHandler},e.prototype.getViolationContainer=function(){return this._violationContainer},e.prototype.setViolationContainer=function(t){this._violationContainer=t},e.prototype.getViolationWarningButtonElement=function(){return this._violationWarningButton},e.prototype.transformRectangle=function(t,e,n){void 0===n&&(n=!1),this._onTransformRectangle(t,e,n),this.canvas,this.updateViolationContainerPosition(),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging()},e.prototype.startTransform=function(e){t.prototype.startTransform.call(this,e),this._startRectangle=this.rectangle;var n=this.canvas;null!=n&&n.updateViolationContainer(this,!1)},e.prototype.endTransform=function(e,n,r){void 0===r&&(r=!1),t.prototype.endTransform.call(this,e,n,r),this._endTransform(e,n,r)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this),this.updateViolationContainerPosition()},e.prototype.onResized=function(){return delete this._startRectangle,!0},e.prototype.dispatchDoubleClickEvent=function(t){this._doubleClickEvent.notify(this,t)},e.prototype.addDoubleClick=function(t){this._doubleClickEvent.add(t)},e.prototype.removeDoubleClick=function(t){this._doubleClickEvent.remove(t)},e.prototype.dispatchClickEvent=function(t){this._clickEvent.notify(t)},e.prototype.addClick=function(t){this._clickEvent.add(t)},e.prototype.removeClick=function(t){this._clickEvent.remove(t)},e.prototype.getHighlightRectangles=function(t){void 0===t&&(t={includeChildren:!0,includeParent:!0});var e=this.rectangle;return e.width=Math.abs(e.width)+this._getBoundsMargin(),e.height=Math.abs(e.height)+this._getBoundsMargin(),[e]},e.prototype.getSelectionRectangle=function(){return this.isVisible()?this.rectangle:null},e.prototype.getBorderMargin=function(){return this._getBoundsMargin()/2},e.prototype.getSelectionTolerance=function(){return this._selectionTolerance},e.prototype.showDeleteToolbarButton=function(){return this.getPermissions().allowDelete&&this.getPermissions().showDeleteToolbarButton},e.prototype.showHandleToolbarButton=function(){return!1},e.prototype.showEditToolbarButton=function(){return this.getPermissions().showEditToolbarButton},e.prototype.showSelectToolbarButton=function(){return this.getPermissions().showSelectToolbarButton},e.prototype.updateViolationContainerPosition=function(){var t;null===(t=this.canvas)||void 0===t||t.updateViolationContainerPosition(this)},e.prototype.isGoodViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.goodViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setGoodViolationIcon=function(t){if(null==this._violationWarningButton)return!1;if(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isGoodViolationIcon()){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(r),this._violationWarningButton.classList.remove(i),this._violationWarningButton.classList.add(n),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isWarningViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.warningViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setWarningViolationIcon=function(t){if(null!=this._violationWarningButton&&(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isWarningViolationIcon())){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(i),this._violationWarningButton.classList.add(r),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isBadViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.badViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setBadViolationIcon=function(t){if(null!=this._violationWarningButton&&(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isBadViolationIcon())){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(r),this._violationWarningButton.classList.add(i),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isNoneViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas,e=t.goodViolationIconCssClass,n=t.warningViolationIconCssClass,r=t.badViolationIconCssClass,i=this._violationWarningButton.classList.contains(e)||this._violationWarningButton.classList.contains(n)||this._violationWarningButton.classList.contains(r);return"hidden"===this._violationWarningButton.style.visibility||!i},e.prototype.setNoneViolationIcon=function(){if(null!=this._violationWarningButton){var t=this.canvas,e=t.goodViolationIconCssClass,n=t.warningViolationIconCssClass,r=t.badViolationIconCssClass;this._violationWarningButton.classList.remove(e),this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(r),this._violationWarningButton.style.visibility="hidden"}},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype._updateImpl=function(t,e){return f(this,void 0,void 0,(function(){return d(this,(function(t){return this._updateViolationContainersVisibility(),[2]}))}))},e.prototype._getItemColorPreviews=function(){return{}},e.prototype._getHighlightRectangle=function(){var t=this.rectangle,e=parseInt(this._getBoundsMargin().toString());return t.width+=t.width>=0?e:-e,t.height+=t.height>=0?e:-e,t},e.prototype._updateVisibility=function(){this._updateViolationContainersVisibility()},e.prototype._onViolationWarningButtonClick=function(t){this._violationWarningButtonClick.notify(this,t),t.preventDefault()},e.prototype._updateViolationContainersVisibility=function(){var t;null===(t=this.canvas)||void 0===t||t.updateViolationContainer(this)},e.prototype._endTransform=function(t,e,n){void 0===n&&(n=!1),n||!t||!e&&null==this._startRectangle||this._itemPropertyChangedEvent.notify(this,"transform"),t&&e||delete this._startRectangle;var r=this.canvas;null!=r&&r.updateViolationContainer(this,!0)},e.prototype._calculateTransformedRectangle=function(t,n){var r;if(this._startRectangle.equals(t))r=n.clone();else{var i=this._startRectangle.clone();r=e.transformRectangleByTwoRectanglesDiff(i,t,n)}return r},e.prototype._onTransformRectangle=function(t,e,n){if(null!=t&&null!=e&&null!=this._startRectangle){var r=this._calculateTransformedRectangle(t,e);this.setRectangle(r,!0)}},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),null!=e&&(null!=this._contentType&&this._contentType!==a.a.NotContent||e.addViolationContainer(this),this._updateVectorMaskCenter())},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),null!=e&&e.removeViolationContainer(this)},e.prototype._getRectangle=function(){var t=u.RotatedRectangleF.fromRectangleF(this.getControlBounds());return t.setTransform(this.item.transform),t},e.prototype._getBoundsMargin=function(){return 0},e.prototype._clip=function(t){if(this._hasVectorMask()){var e=this._getTransformedClippingPath();null!=e&&s.a.clipPath(t,e)}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"opacity":case"transform":break;case"locked":this._updateVisibility();break;case"textWrappingMode":null!=this.canvas&&this.canvas.updateTexts();break;case"mask":this._updateVectorMaskCenter();break;case"violationSettings":this.canvas.updateViolationContainer(this)}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){t.prototype._onItemVisibilityChanged.call(this),this._updateVisibility()},e.prototype._updateVectorMaskCenter=function(){return f(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return this._hasVectorMask()?[4,c.a.getBounds(this.item.mask.vectorMask)]:[3,2];case 1:return t=e.sent(),this._vectorMaskCenter=u.RotatedRectangleF.fromRectangleF(t).center,[3,3];case 2:this._vectorMaskCenter=null,e.label=3;case 3:return[2]}}))}))},e.prototype._updateVectorMaskCenterSync=function(){if(this._hasVectorMask()){var t=c.a.getBoundsSync(this.item.mask.vectorMask);if(null==t)return;this._vectorMaskCenter=u.RotatedRectangleF.fromRectangleF(t).center}else this._vectorMaskCenter=null},e.prototype._getTransformedClippingPath=function(t){if(!this._hasVectorMask()||null==this._vectorMaskCenter)return null;null==t&&(t=this.item.transform.clone());var e=this.item.mask.vectorMask.clone(),n=this._vectorMaskCenter,r=this.getControlCenter();if(0!==t.angle&&(e.rotateAt(t.angle,r),t.setAngle(0,!0)),!Object(u.EqualsOfFloatNumbers)(t.scaleX,1)||!Object(u.EqualsOfFloatNumbers)(t.scaleY,1)){var i=n.x-r.x,o=n.y-r.y;r.translate(t.translateX,t.translateY),t.setTranslateX(r.x+i*t.scaleX-n.x),t.setTranslateY(r.y+o*t.scaleY-n.y)}return e.transform(t,n),e},e.prototype._hasVectorMask=function(){return null!=this.item.mask&&null!=this.item.mask.vectorMask},e.prototype._refreshState=function(){t.prototype._refreshState.call(this),this._isIgnorePermissionsMode()&&null!=this.canvas&&(this.visible&&!this.locked||this.canvas.removeSelectedItemHandler(this),this.canvas.updateViolationContainer(this,!0),this.canvas.redraw())},e.prototype._showViolationButton=function(){var t,e=this.isVisible()&&1!=(null===(t=this.canvas)||void 0===t?void 0:t.previewMode);this._violationWarningButton.style.visibility=e?"visible":"hidden"},e.prototype._getPrintAreaBounds=function(){if(null==this.layer||null==this.layer.container.parentComponent)return null;var t=this.layer.container.parentComponent;return null==t.printAreas||t.printAreas.length<1?null:t.printAreas.get(0).bounds},e.typeName="BaseRectangleItemHandler",e}(o.a)},function(t,e,n){"use strict";var r=n(417);function i(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.a.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{a[t]={value:t}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=(t,e,n,a,s,l)=>{const u=Object.create(o);return r.a.toFlatObject(t,u,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),i.call(u,t.message,e,n,a,s),u.cause=t,u.name=t.name,l&&Object.assign(u,l),u},e.a=i},,function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(434),i=n(409),o=n(422),a=function(){function t(t,e){this._name="",this._points=[],this._name=t?t.toUpperCase():"",this._points=e||[]}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.getPoint=function(t){return this._points[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this._points.length},enumerable:!0,configurable:!0}),t.prototype.transform=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).transform(t,e)},t.prototype.rotateAt=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).rotateAt(t,e)},t.prototype.translate=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).translate(t,e)},t.prototype.scale=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).scale(t,e)},t.prototype.draw=function(t){switch(this.name){case"Z":t.closePath();break;case"M":t.moveTo(this.getPoint(0).x,this.getPoint(0).y);break;case"L":t.lineTo(this.getPoint(0).x,this.getPoint(0).y);break;case"Q":t.quadraticCurveTo(this.getPoint(0).x,this.getPoint(0).y,this.getPoint(1).x,this.getPoint(1).y);break;case"C":t.bezierCurveTo(this.getPoint(0).x,this.getPoint(0).y,this.getPoint(1).x,this.getPoint(1).y,this.getPoint(2).x,this.getPoint(2).y)}},t.prototype.toString=function(){for(var t=this.name,e=0;e<this.length;e++)t+=" "+this.getPoint(e).x+" "+this.getPoint(e).y;return t},t.prototype.clone=function(){return new t(this.name,this._points.map((function(t){return t.clone()})))},t}(),s=function(){function t(t){this._pathChangedEvent=new i.a,this._segments=[],null!=t&&this._fromString(t)}return Object.defineProperty(t.prototype,"length",{get:function(){return this._segments.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){return this._segments},enumerable:!0,configurable:!0}),t.prototype.addPathChanged=function(t){this._pathChangedEvent.add(t)},t.prototype.removePathChanged=function(t){this._pathChangedEvent.remove(t)},t.prototype.moveTo=function(t,e){this._segments.push(new a("M",[new r.a(t,e)])),this._onPathChanged()},t.prototype.lineTo=function(t,e){this._segments.push(new a("L",[new r.a(t,e)])),this._onPathChanged()},t.prototype.quadraticTo=function(t,e,n,i){this._segments.push(new a("Q",[new r.a(t,e),new r.a(n,i)])),this._onPathChanged()},t.prototype.cubicTo=function(t,e,n,i,o,s){this._segments.push(new a("C",[new r.a(t,e),new r.a(n,i),new r.a(o,s)])),this._onPathChanged()},t.prototype.close=function(){this._segments.push(new a("Z")),this._onPathChanged()},t.prototype._onPathChanged=function(){this._pathChangedEvent.notify()},t.prototype.transform=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].transform(t,e)},t.prototype.rotateAt=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].rotateAt(t,e)},t.prototype.translate=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].translate(t,e)},t.prototype.scale=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].scale(t,e)},t.prototype.draw=function(t){if(t){t.beginPath();for(var e=0;e<this.length;e++)this._segments[e].draw(t)}},t.prototype.toString=function(){for(var t="",e=0;e<this.length;e++)t+=this._segments[e].toString(),e<this._segments.length-1&&(t+=" ");return t},t.prototype.clone=function(){return new t(this.toString())},t.prototype.equals=function(t){return this.isEqual(t)},t.prototype.isEqual=function(t){return null!=t&&this.toString()===t.toString()},t.prototype.addPath=function(t){var e,n;try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t._segments),i=r.next();!i.done;i=r.next()){var o=i.value;this._segments.push(o.clone())}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype._fromString=function(t){for(var e=t.split(" "),n=0;n<e.length;){for(var i=e[n],o=n+1,s=[];o<e.length;){var l=parseFloat(e[o]);if(isNaN(l)||!isFinite(l))break;s.push(l),o++}for(var u=0,c=[];u<s.length;)c.push(new r.a(s[u],s[u+1])),u+=2;var h=new a(i,c);this._segments.push(h),n=o}},t.rectangle=function(e,n,r,i){var o=new t;return o.moveTo(e,n),o.lineTo(e+r,n),o.lineTo(e+r,n+i),o.lineTo(e,n+i),o.lineTo(e,n),o.close(),o},t.ellipse=function(e,n,r,i){var o=.5517,a=r/2,s=i/2,l=new t;return l.moveTo(e,n+s),l.cubicTo(e,n+s-s*o,e+a-a*o,n,e+a,n),l.cubicTo(e+a+a*o,n,e+r,n+s-s*o,e+r,n+s),l.cubicTo(e+r,n+s+s*o,e+a+a*o,n+i,e+a,n+i),l.cubicTo(e+a-a*o,n+i,e,n+s+s*o,e,n+s),l.close(),l},t.roundedRectangle=function(e,n,r,i,a){if(null==a)return t.rectangle(e,n,r,i);var s=.5517,l=new t,u=e,c=n,h=a[0].width,p=a[0].height,f=a[1].width,d=a[1].height,g=a[2].width,m=a[2].height,y=a[3].width,_=a[3].height;return(Object(o.e)(h,0)||Object(o.e)(p,0))&&(h=p=0),(Object(o.e)(f,0)||Object(o.e)(d,0))&&(f=d=0),(Object(o.e)(g,0)||Object(o.e)(m,0))&&(g=m=0),(Object(o.e)(y,0)||Object(o.e)(_,0))&&(y=_=0),l.moveTo(u+h,c),Object(o.e)(h+f,r)||l.lineTo(u+r-f,c),Object(o.e)(f,0)||Object(o.e)(d,0)||l.cubicTo(u+r-f*(1-s),c,u+r,c+d*(1-s),u+r,c+d),Object(o.e)(d+m,i)||l.lineTo(u+r,c+i-m),Object(o.e)(g,0)||Object(o.e)(m,0)||l.cubicTo(u+r,c+i-m*(1-s),u+r-g*(1-s),c+i,u+r-g,c+i),Object(o.e)(g+y,r)||l.lineTo(u+y,c+i),Object(o.e)(y,0)||Object(o.e)(_,0)||l.cubicTo(u+y*(1-s),c+i,u,c+i-_*(1-s),u,c+i-_),Object(o.e)(_+p,i)||l.lineTo(u,c+p),Object(o.e)(h,0)||Object(o.e)(p,0)||l.cubicTo(u,c+p*(1-s),u+h*(1-s),c,u+h,c),l.close(),l},t.rotatedRectangle=function(e){var n=e.getUpperLeftCorner(),r=e.getUpperRightCorner(),i=e.getBottomRightCorner(),o=e.getBottomLeftCorner(),a=new t;return a.moveTo(n.x,n.y),a.lineTo(r.x,r.y),a.lineTo(i.x,i.y),a.lineTo(o.x,o.y),a.lineTo(n.x,n.y),a.close(),a},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(409),i=n(422),o=n(474),a=function(){function t(t,e,n,i,o){this._angle=0,this._scaleX=0,this._scaleY=0,this._translateX=0,this._translateY=0,this._transformChangedEvent=new r.a,this._angle=o||0,this._scaleX=t||0===t?t:1,this._scaleY=e||0===t?e:1,this._translateX=n||0,this._translateY=i||0}return t.prototype.addTransformChanged=function(t){this._transformChangedEvent.add(t)},t.prototype.removeTransformChanged=function(t){this._transformChangedEvent.remove(t)},t.prototype._setProperty=function(t,e,n){void 0===n&&(n=!1);var r="_"+t;this[r]!==e&&(this[r]=e,n||this._transformChangedEvent.notify())},Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},enumerable:!0,configurable:!0}),t.prototype.setAngle=function(t,e){this._setProperty("angle",t,e)},Object.defineProperty(t.prototype,"scaleX",{get:function(){return this._scaleX},enumerable:!0,configurable:!0}),t.prototype.setScaleX=function(t,e){this._setProperty("scaleX",t,e)},Object.defineProperty(t.prototype,"scaleY",{get:function(){return this._scaleY},enumerable:!0,configurable:!0}),t.prototype.setScaleY=function(t,e){this._setProperty("scaleY",t,e)},Object.defineProperty(t.prototype,"translateX",{get:function(){return this._translateX},enumerable:!0,configurable:!0}),t.prototype.setTranslateX=function(t,e){this._setProperty("translateX",t,e)},Object.defineProperty(t.prototype,"translateY",{get:function(){return this._translateY},enumerable:!0,configurable:!0}),t.prototype.setTranslateY=function(t,e){this._setProperty("translateY",t,e)},t.prototype.move=function(t,e){var n=this.clone();null!=t&&this.setTranslateX(this._translateX+t,!0),null!=e&&this.setTranslateY(this._translateY+e,!0),n.equals(this)||this._transformChangedEvent.notify()},t.prototype.rotate=function(t){null==t||Object(i.e)(t,0)||(this._angle+=t,this._transformChangedEvent.notify())},t.prototype.clone=function(){return new t(this._scaleX,this._scaleY,this._translateX,this._translateY,this._angle)},t.prototype.equals=function(t,e){return null!=t&&Object(i.e)(this._scaleX,t._scaleX,e)&&Object(i.e)(this._scaleY,t._scaleY,e)&&Object(i.e)(this._translateX,t._translateX,e)&&Object(i.e)(this._translateY,t._translateY,e)&&Object(i.e)(this._angle,t._angle,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&t.equals(e,n)},t.prototype.toMatrix=function(){var t=this._angle,e=Math.sin(Object(i.c)(t)),n=Math.cos(Object(i.c)(t));return new o.a(n*this._scaleX,e*this._scaleX,-e*this._scaleY,n*this._scaleY,this._translateX,this._translateY)},t.prototype.clear=function(t){var e=void 0===t?{}:t,n=e.keepAngle,r=void 0!==n&&n,i=e.supressOnChanged,o=void 0!==i&&i;this._scaleX=1,this._scaleY=1,this._translateX=0,this._translateY=0,r||(this._angle=0),o||this._transformChangedEvent.notify()},t.prototype.applyMatrix=function(t,e){if(void 0===e&&(e=!1),!t.isIdentity){var n=this.toMatrix().concatenate(t);this._angle=n.angle,this._scaleX=n.scaleX,this._scaleY=n.scaleY,this._translateX=n.translateX,this._translateY=n.translateY,e||this._transformChangedEvent.notify()}},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return Object(i.e)(this._scaleX,1)&&Object(i.e)(this._scaleY,1)&&Object(i.e)(this._translateX,0)&&Object(i.e)(this._translateY,0)&&Object(i.e)(this._angle,0)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=[this.translateX,this.translateY,this.scaleX,this.scaleY,this.angle].map((function(t){return t.toFixed(2)}));return"{ tx: "+t[0]+", ty: "+t[1]+", sx: "+t[2]+", sy: "+t[3]+", a: "+t[4]+"}"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"d",(function(){return h})),n.d(e,"c",(function(){return p})),n.d(e,"e",(function(){return f}));var r,i=n(424),o=n(411),a=n(425),s=n(499),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e,n){var r=t.call(this)||this;return r._items=new a.a,r._visible=!0,r._locked=!1,r._region=null,r.parentComponent=null,r.renderingType=s.a.Normal,r.type="Container",r._onItemAdded=function(t){t.item.parentContainer=r},r._onItemRemoved=function(t){var e=t.item;e.parentContainer==r&&(e.parentContainer=null)},r._onRegionChanged=function(t,e){"left"!==e&&"top"!==e&&"width"!==e&&"height"!==e||r._propertyChanged.notify(r,"region")},r._items=new a.a,r._items.add_itemAdded(r._onItemAdded),r._items.add_itemRemoved(r._onItemRemoved),null!=e&&r.items.setRange(e),null!=n&&(r.name=n),r}return l(e,t),Object.defineProperty(e.prototype,"region",{get:function(){return this._region},set:function(t){this._region!==t&&(null!=this._region&&this._region.removePropertyChanged(this._onRegionChanged),this._region=t,this._propertyChanged.notify(this,"region"),null!=this._region&&this._region.addPropertyChanged(this._onRegionChanged))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._propertyChanged.notify(this,"visible"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this._locked},set:function(t){this._locked!==t&&(this._locked=t,this._propertyChanged.notify(this,"locked"))},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this,["parentComponent","version"]);return e.version=this.version,e},e.prototype.generateNewIds=function(){this._generateNewId(),this._items.forEach((function(t){return t.generateNewIds()}))},e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.items.addRange(e.items.toArray().map((function(t){return t.clone(r)}))),n.locked=e.locked,n.visible=e.visible,n.renderingType=e.renderingType,n.translationKey=e.translationKey,n.region=null!=e.region?e.region.clone():null},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e}(i.a),c=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.noPrint=!1,r.noShow=!1,r.size=null,r._locked=!0,r}return l(e,t),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.noPrint=e.noPrint,n.noShow=e.noShow,n.size=null!=e.size?e.size.clone():null},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e}(u),h=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.type="SurfaceContainer",r._locked=!1,r}return l(e,t),e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e}(u),p=function(t){function e(){var e=t.call(this)||this;return e.type="SpotColorContainer",e.renderingType=s.a.Grayscale,e}return l(e,t),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.previewColor=e.previewColor},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e}(h),f=function(t){function e(){var e=t.call(this)||this;return e.type="TextureContainer",e.renderingType=s.a.Solid,e}return l(e,t),Object.defineProperty(e.prototype,"previewTextureSource",{get:function(){return this._previewTextureSource},set:function(t){t!==this._previewTextureSource&&(this._previewTextureSource=t,this._propertyChanged.notify(this,"previewTextureSource"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){return t.prototype._copy.call(this,e,n,r),n.previewTextureSource=null!=e.previewTextureSource?e.previewTextureSource.clone():null,n.previewTextureName=e.previewTextureName,n},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.getSimplifiedObject=function(e){o.isArray(e)||o.isString(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this);return n.previewTextureSource={id:this.previewTextureSource.id,width:this.previewTextureSource.width,height:this.previewTextureSource.height,isVector:this.previewTextureSource.isVector,pageIndex:this.previewTextureSource.pageIndex,url:this.previewTextureSource.url,actualSize:this.previewTextureSource.actualSize,saveAspectRatio:this.previewTextureSource.saveAspectRatio,origin:this.previewTextureSource.origin},n},e}(h)},function(t,e,n){"use strict";n.d(e,"b",(function(){return d}));var r=n(409),i=n(513),o=n(578),a=n(408);n.d(e,"a",(function(){return a.I}));var s,l=n(605),u=n(426),c=n(463),h=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},s(t,e)},function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},d=function(t){function e(e,n,i,o){void 0===n&&(n=null);var s=t.call(this,e,n,i,o)||this;return s._maxImageSize=4e6,s._imageResizedEvent=new r.c,s._qualityChangeContainer=null,s._qualityChangeScaleBar=null,s._qualityChangeInfoBar=null,s.item.source.type===a.J.ImageSourceType.Url&&s.loadImage(null,{downloadToServerCache:!0,actualSize:s.item.source.actualSize,saveAspectRatio:s.item.source.saveAspectRatio}),s}return h(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needToDownloadImage",{get:function(){return this._needToDownloadImage},set:function(t){this._needToDownloadImage=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"takeIntoAccountImageDpi",{get:function(){return this._takeIntoAccountImageDpi},set:function(t){this._takeIntoAccountImageDpi=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceImageHorizontalResolution",{get:function(){return this._sourceImageHorizontalResolution},set:function(t){this._sourceImageHorizontalResolution=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceImageVerticalResolution",{get:function(){return this._sourceImageVerticalResolution},set:function(t){this._sourceImageVerticalResolution=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeScaleBar",{get:function(){return this._qualityChangeScaleBar},set:function(t){this._qualityChangeScaleBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeInfoBar",{get:function(){return this._qualityChangeInfoBar},set:function(t){this._qualityChangeInfoBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeContainer",{get:function(){return this._qualityChangeContainer},set:function(t){this._qualityChangeContainer=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isQualityChangeBarEmpty",{get:function(){var t=this.canvas;return null==this._qualityChangeScaleBar||null==t||this._qualityChangeScaleBar.className===this.canvas.qualityChangeScaleBarCssClass},enumerable:!0,configurable:!0}),e.prototype.loadImage=function(t,e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var n=this;return f(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&this.item.source.type!==a.J.ImageSourceType.Url&&console.error("Invalid sourceUrl: "+t),e.downloadToServerCache?(this._needToDownloadImage=!0,this._actualSize=null!=e.actualSize&&e.actualSize,this._saveAspectRatio=null==e.saveAspectRatio||e.saveAspectRatio,this._sourceUrl=t,null==t&&(this._sourceUrl=this.item.source.url),[4,new Promise((function(t){return n.update(null,t)}))]):[3,2];case 1:return r.sent(),[3,3];case 2:this._needToDownloadImage=!1,this._setSrc(t),r.label=3;case 3:return[2,this.item.source.id]}}))}))},e.prototype.loadImageFromRemoteUrl=function(t,e){return void 0===e&&(e=void 0),p(this,void 0,void 0,(function(){var n;return f(this,(function(r){switch(r.label){case 0:return[4,this._apiClient.getImageMetaDataFromRemoteUrl(t,e)];case 1:return n=r.sent(),this.item.source.id=n.storageId,this.item.source.width=n.size.width,this.item.source.height=n.size.height,this.item.source.isVector=n.isVector,this.item.name=n.name,this.item.sourceRectangle.width=this.item.source.width,this.item.sourceRectangle.height=this.item.source.height,[2]}}))}))},e.prototype.showEditButton=function(){return t.prototype.showEditToolbarButton.call(this)&&!this.item.source.isVector},e.prototype.addImageResized=function(t){this._imageResizedEvent.add(t)},e.prototype.removeImageResized=function(t){this._imageResizedEvent.remove(t)},e.prototype.onResized=function(){var e=this.rectangle;return this._imageResizedEvent.notify(this,{Width:e.width,Height:e.height}),this.update(),t.prototype.onResized.call(this)},e.prototype.setQualityChangeScaleBarWidth=function(t){null!=this._qualityChangeScaleBar&&(t=Math.max(0,t),t=Math.min(100,t),this._qualityChangeScaleBar.style.width=t+"%")},e.prototype.setQualityChangeInfoBarText=function(t){null!=this._qualityChangeInfoBar&&(this._qualityChangeInfoBar.innerText=t)},e.prototype.setBadToWarningChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToWarningChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityWarningToGoodChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setWarningToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityWarningToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setBadToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityWarningToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.updateRectangle=function(e,n,r,i){t.prototype.updateRectangle.call(this,e,n,r,this.item.source.width,this.item.source.height,i)},e.prototype._updateImpl=function(t,e){return p(this,void 0,void 0,(function(){var n,r=this;return f(this,(function(i){return null!=this._sourceUrl&&null!=this._sourceUrl?(this._update([this._actualSize,this._saveAspectRatio,this._sourceUrl],t,e),null==this.item.source.id&&null!=this.item.source.url&&this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder)):this.item.source.type===a.J.ImageSourceType.Url?this.loadImage(null,{downloadToServerCache:!0,actualSize:this.item.source.actualSize,saveAspectRatio:this.item.source.saveAspectRatio}).then((function(){null!=r.canvas&&r.canvas.updateSelection()})):(this.quickUpdate(),null!=(n=this.canvas)&&n.updateSelection()),[2]}))}))},e.prototype._getDrawingFillColor=function(){return this.item.effect===a.I.Colorize?new c.d(0,0,0,0):this.item.fillColor},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n);var r=null==this.item.source.id&&null!=this.item.source.url;this.item.source.id=e.source.id,this.item.source.width=e.source.width,this.item.source.height=e.source.height,this.item.source.isVector=e.source.isVector,this.item.source.pageIndex=e.source.pageIndex,this.item.source.url=e.source.url,r&&(this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder),this.update())},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"source":this._sourceUrl=null,this.update(),null==this.item.source.id&&null!=this.item.source.url&&this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder);break;case"fillColor":this.item.effect===a.I.Colorize&&this.update();break;case"effect":case"overlayEffect":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips=new a.hb(!0,!1),e},e.prototype._createDataInstance=function(t){return new o.a(t)},e.prototype._updateImageUrl=function(){var e=this,n=this.canvas;if(null!=n&&this.isVisible()){if(null==this.item.source.id||null!=this.item.source.width&&null!=this.item.source.height)return void t.prototype._updateImageUrl.call(this);n.service.GetImageSize(this.item.source.id,this.item.source.pageIndex,(function(n){if(e.item.source.width=n.width,e.item.source.height=n.height,e._saveAspectRatio){var r=e.item.source.width/e.item.source.height;e.width<e.height?e.height=e.width/r:e.width=e.height*r}t.prototype._updateImageUrl.call(e)}),(function(t){window.console&&(console.error("Unable GetimageSize of image with id "+e.item.source.id),console.error(t))}))}},e.prototype._createImageUrl=function(){var t=this.item.source.id;if(null==t)return null;var e,n,r=this.canvas;if(null==r)return null;var i=r.zoom,o=i*u.b.screenDpi/72,a=i*u.b.screenDpi/72,s=this.rectangle;e=s.width*o,n=s.height*a,this.item.source.isVector||(e=Math.min(e,this.item.source.width),n=Math.min(n,this.item.source.height));var c=this._maxImageSize/e/n;return c<1&&(e*=c=Math.sqrt(c),n*=c),e=Math.max(1,Math.round(e)),n=Math.max(1,Math.round(n)),this._pixelWidth=e,this._pixelHeight=n,l.a.getImageUrl(r,t,e,n,!1,this.item.effect,!1,this.item.overlayEffect,this.item.source.pageIndex,!this.isNormalRenderingType,this.item.fillColor)},e.typeName="ImageItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(517),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="ShapeHandlerData",n}return o(e,t),e.prototype.applyState=function(e,n){t.prototype.applyState.call(this,e,n)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r,i=n(482),o=n(582);!function(t){t[t.numbers=0]="numbers",t[t.lowerLetter=1]="lowerLetter",t[t.upperLetter=2]="upperLetter",t[t.lowerRoman=3]="lowerRoman",t[t.upperRoman=4]="upperRoman"}(r||(r={}));class a extends o.a{isMatch(t){return t instanceof a&&!!super.isMatch(t)&&this.type===t.type}}class s extends i.a{constructor(){super(...arguments),this.items=[]}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return Rt}));var r=n(407),i=n(408),o=n(410),a=n(413),s=n(409),l=n(525),u=n(528),c=n(420),h=n(427),p=n(527);class f{}f.fontFeatureSettings="font-feature-settings",f.fontFamily="font-family",f.fontSize="font-size",f.color="color",f.colorIndex="color-index",f.fontWeight="font-weight",f.fontStyle="font-style",f.textDecoration="text-decoration",f.webkitTextStroke="-webkit-text-stroke",f.penColor="-webkit-text-stroke-color",f.penColorIndex="pen-color-index",f.penWidth="-webkit-text-stroke-width",f.letterSpacing="letter-spacing",f.lineHeight="line-height",f.sub="sub",f.verticalAlign="vertical-align",f.textTransform="text-transform",f.fontVariantCaps="font-variant-caps",f.verticalScale="transform",f.paddingLeft="padding-left";class d{}d.textAlign="text-align",d.textIndent="text-indent",d.paddingBottom="padding-bottom",d.paddingTop="padding-top",d.marginLeft="margin-left",d.marginRight="margin-right",d.listStyleType="list-style-type";class g{}g.listStyleType="list-style-type",g.value="value",g.level="level",g.bulletNumberTabPosition="bullet-number-tab-position";var m=n(749);class y{}y.levelIndent="level-indent",y.textIndent="text-indent",y.textIndentCroppedPart="text-indent-cropped-part",y.leftIndent="left-indent",y.firstLineIndent="first-line-indent",y.marginLeft="margin-left",y.fontSize="font-size",y.listStyleType="list-style-type",y.bulletNumberTabPosition="bullet-number-tab-position";class _ extends y{}_.textAlign="text-align";class b extends y{}b.start="start",b.type="type";class v extends y{}v.type="type";var w=n(750),C=n.n(w),P=n(460),x=n(472),S=n(411),I=n(600),O=n(486);class T{}T.fontName="font-name",T.fontSize="font-size",T.color="color",T.bold="bold",T.italic="italic",T.underline="underline",T.penColor="pen-color",T.penWidth="pen-width",T.tracking="tracking",T.leading="leading",T.sub="sub",T.sup="sup",T.allCaps="all-caps",T.smallCaps="small-caps",T.fontFamily="font-family",T.fontStyle="font-style",T.wordSpacingScale="word-spacing-scale",T.supSize="sup-size",T.supPosition="sup-position",T.subSize="sub-size",T.subPosition="sub-position",T.digitType="digit-type",T.openType="ot",T.baselineShift="baseline-shift",T.inkName="ink-name",T.inkSolidity="ink-solidity",T.inkColor="ink-color",T.penInkName="pen-ink-name",T.penInkSolidity="pen-ink-solidity",T.penInkColor="pen-ink-color";var E=n(483);class L{constructor(t,e,n,r,i){this._colorPaletteManager=t,this._fontService=e,this._useSimpleFontList=n,this._colorParser=r,this._colorPreviewService=i,this._colorConverter=null}static getTrackingValue(t){const e=t["letter-spacing"];return null==e?null:L.letterSpacingToTracking(e)}static letterSpacingToTracking(t){const e=1e3*+t.replace("em;","").replace("em","");return isNaN(e)?0:e}static getLeadingValue(t,e=1){const n=t["line-height"];return null==n?null:"normal"===n?0:L.stringToNumber(n,"pt")/e}static getAllCapsValue(t){const e=t["text-transform"];return null==e?null:"uppercase"===e}static getSmallCapsValue(t){const e=t["font-variant-caps"];return null==e?null:"all-small-caps"===e}static getSupValue(t){const e=t["vertical-align"];return null==e?null:"super"===e}static getSubValue(t){const e=t["vertical-align"];return null==e?null:"sub"===e}static getOpenTypeValue(t){const e=t["font-feature-settings"];return this.parseOpenTypeFromStyle(e)}static getOpenTypeStringValue(t){const e=t["font-feature-settings"];return null!=e?e.replace(/("|')/g,""):null}static parseOpenTypeFromStyle(t){return null!=t?t.split(",").map((t=>{var e;const n=t.trim().split(" ");return new E.a(n[0].replace(/"/g,""),L.stringToNumber(null!==(e=n[1])&&void 0!==e?e:"1"))})):null}static stringToNumber(t,e="",n=0){if(null==t)return null;const r=o.l(e)?+t:+t.replace(e,"");return isNaN(r)?n:r}static getElementFontValue(t,e,n){const r=null!=n?S.clone(n):{},i=t=>{var n,a,s;if(null!=t.parentElement&&t!=e&&i(t.parentElement),t.style){const e=null===(n=t.style)||void 0===n?void 0:n.fontFamily,i=null===(a=t.style)||void 0===a?void 0:a.fontWeight,l=null===(s=t.style)||void 0===s?void 0:s.fontStyle;o.l(e)||(r.family=e),o.l(i)||(r.bold="bold"===i),o.l(l)||(r.italic="italic"===l)}};return i(t),r.family===(null==n?void 0:n.family)&&delete r.family,r.bold===(null==n?void 0:n.bold)&&delete r.bold,r.italic===(null==n?void 0:n.italic)&&delete r.italic,r}static getAlignmentValue(t){const e=t["text-align"];return null==e?null:L.stringToTextAlignment(e)}static stringToTextAlignment(t){switch(t.toLocaleLowerCase()){case"left":default:return i.qb.Left;case"center":return i.qb.Center;case"right":return i.qb.Right;case"justify":case"justify-all":case"justification":return i.qb.Justify;case"justification-last-left":return i.qb.LastLeft;case"justification-last-center":return i.qb.LastCenter;case"justification-last-right":return i.qb.LastRight}}static getFirstLineIndentValue(t,e=1){const n=t["text-indent"];return null==n?null:L.stringToNumber(n,"pt")/e}static getSpaceAfterValue(t,e=1){const n=t["padding-bottom"];return null==n?null:L.stringToNumber(n,"pt")/e}static getSpaceBeforeValue(t,e=1){const n=t["padding-top"];return null==n?null:L.stringToNumber(n,"pt")/e}static getLeftIndentValue(t,e=1){const n=t["margin-left"];return null==n?null:L.stringToNumber(n,"pt")/e}static getRightIndentValue(t,e=1){const n=t["margin-right"];return null==n?null:L.stringToNumber(n,"pt")/e}static getFontValue(t){const e=t["font-weight"],n=t["font-style"],r=t["font-family"];if(null==r&&null==e&&null==n)return null;const i={};return o.l(r)||(i.family=r),null!=e&&(i.bold="bold"===e),null!=n&&(i.italic="italic"===n),i}static getFontSettings(t,e,n){if(n){if(null==t.family)return{};const n=this._deserializeCssEscapedString(t.family).replace(/"/g,"").replace(/'/g,"");return e.findSuitableFontParams(e.findOriginalFamilyName(n.replace("_cc_family_","")),t.bold,t.italic)}{const n={};if(null!=t.family){const r=e.findOriginalPsName(t.family.replace("_cc_psname_",""));n.postScriptName=r}return null!=t.bold&&(n.fauxBold=t.bold),null!=t.italic&&(n.fauxItalic=t.italic),n}}static setFontValue(t,e,n,r){const i=L.getFontSettings(e,n,r);null!=i.postScriptName&&(t[T.fontName]=i.postScriptName),null!=i.fauxBold&&(t[T.bold]=`${i.fauxBold}`),null!=i.fauxItalic&&(t[T.italic]=`${i.fauxItalic}`)}static getBoldValue(t){const e=t["font-weight"];return null==e?null:"bold"===e}static getItalicValue(t){const e=t["font-style"];return null==e?null:"italic"===e}static getUnderlineValue(t){const e=t["text-decoration"]||t["text-decoration-line"];return null==e?null:"underline"===e}static getFontSizeValue(t,e=1){const n=t["font-size"];if(null==n||"super"===t["vertical-align"]||"sub"===t["vertical-align"])return null;let r=12;return n.endsWith("pt")?r=L.stringToNumber(n,"pt"):n.endsWith("px")?r=.75*L.stringToNumber(n,"px"):"x-small"==n?r=7.5:"small"==n?r=.8*12:"medium"==n?r=12:"large"==n?r=13.5:"x-large"==n?r=18:"xx-large"==n?r=24:"xxx-large"==n&&(r=36),+(r/e).toFixed(2)}async parse(t,e,n){const r=this._parse(t);return this._colorConverter=new O.a(e,this._colorParser),await this._convert(r,n)}async getColorValue(t,e,n){const r=t.color;if(null==r)return null;const i=await this._convertColor(r,e["color-index"],n);return null!=i?i:void 0}async getStrokeValue(t,e,n,r=1){let i=null,o=null,a=t["-webkit-text-stroke"];if(null!=a?(i=a.substring(0,a.indexOf(" ")),o=a.substring(a.indexOf(" ")+1)):(i=t["-webkit-text-stroke-width"],o=t["-webkit-text-stroke-color"]),null==o&&null==i)return null;const s={};if(null!=i&&(s.size=L.stringToNumber(i,"pt")/r),null!=o){const t=await this._convertColor(o,e["pen-color-index"],n);null!=t&&(s.colorIndex=t)}return s}processEmptyLines(t){return t.replace(/<p><span><br\s*\/?><\/span><\/p>/g,"<p></p>").replace(/<p><br\s*\/?><\/p>/g,"<p></p>").replace(/<\/span><br\s*\/?><\/p>/g,"</span></p>").replace(/<\/span><br\s*\/?><\/li>/g,"</span></li>").replace(/<li><span><br\s*\/?><\/span><\/li>/g,"<li></li>").replace(/<span(| style=('|")padding-left: \d*pt(|; )('|"))><br\s*\/?><\/span>/g,(function(t,e){return"<span"+e+"></span>"})).replace(/<li><br\s*\/?><\/li>/g,"<li></li>").replace(/<\/span><br\s*\/?><\/li>/g,"</span></li>")}_parse(t){var e=`<body>${t.replace(/ /g," ")}</body>`;e=this.processEmptyLines(e);const n=new C.a.DOMParser;try{return n.parseFromString(e,"text/html").getElementsByTagName("body")[0]}catch(r){throw console.error("_parse error",r),console.error(`html: \n\r${e}`),r}}_isAccepted(t){const e=this.getNodeName(t);return"body"==e||"p"===e||"ol"===e||"li"===e||"ul"===e||"br"===e||"span"===e||"#text"===e}getNodeName(t){return t.nodeName.toLowerCase()}_dbgGetNodeContent(t){return"#text"==t.nodeName.toLowerCase()?t.textContent:""}async _convertNode(t,e,n){const r=this.getNodeName(t);switch(r){case"body":return this._convertBody(t,e);case"p":return this._convertParagraph(t,e,n);case"span":return await this._convertSpan(t,e,n);case"u":case"b":case"i":return this._convertUbi(t,e);case"ol":return this._convertOrderedList(t,e);case"ul":return this._convertUnorderedList(t,e);case"li":return this._convertListItem(t,e,n);case"br":return this._convertBr();case"#text":return this._convertText(t);default:throw this._notImplemented(`_convertNode for ${r}`)}}_convertCommonListStyleToParagraphStyle(t,e,n){var r,i,o,a,s,l,u,h,p;const f=.75;t.listStyle=new c.ParagraphListStyle,t.style=null!==(r=t.style)&&void 0!==r?r:new c.ParagraphStyle;const d=null==e?void 0:e.alignment;d&&(t.style.alignment=d);const g=new c.NumericValue;g.value=null!==(o=null===(i=null==e?void 0:e.leftIndent)||void 0===i?void 0:i.value)&&void 0!==o?o:0,g.unit=null!==(s=null===(a=null==e?void 0:e.leftIndent)||void 0===a?void 0:a.unit)&&void 0!==s?s:c.Units.point,(null==e?void 0:e.leftIndent)?("pt"==g.unit?g.value+=30:"px"==g.unit&&(g.value+=40),t.style.leftIndent=g):t.style.leftIndent=I.h.parse("30pt");let m=null==n?void 0:n.leftIndent;if(null==n?void 0:n.leftIndent)if(m.unit==t.style.leftIndent.unit)t.style.leftIndent.value+=m.value;else if("px"==m.unit)t.style.leftIndent.value+=m.value*f;else{if("pt"!=m.unit)throw this._notImplemented(`NumericValue.unit ${m.unit} is not supported`);t.style.leftIndent.value+=m.value/f}const y=new c.NumericValue;y.value=null!==(u=null===(l=null==n?void 0:n.firstLineIndent)||void 0===l?void 0:l.value)&&void 0!==u?u:0,y.unit=null!==(p=null===(h=null==n?void 0:n.firstLineIndent)||void 0===h?void 0:h.unit)&&void 0!==p?p:c.Units.point,(null==n?void 0:n.firstLineIndent)?t.style.firstLineIndent=y:t.style.firstLineIndent=I.h.parse("0pt");const _=null==e?void 0:e.firstLineIndent;if(_)if(_.unit==t.style.firstLineIndent.unit)t.style.firstLineIndent.value+=_.value;else if("px"==_.unit)t.style.firstLineIndent.value+=_.value*f;else{if("pt"!=_.unit)throw this._notImplemented(`NumericValue.unit ${_.unit} is not supported`);t.style.firstLineIndent.value+=_.value/f}0===t.style.firstLineIndent.value&&(t.style.firstLineIndent=null);const b=null==e?void 0:e.tabPosition;b&&(t.listStyle.tabPosition=b);const v=null==n?void 0:n.tabPosition;v&&(t.listStyle.tabPosition+=v)}_convertOListItemToParagraph(t,e,n){var r,i;const o=new c.Paragraph;o.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(o,t.style,e.style),o.listStyle.type=c.ListStyleType.numbers;const a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.type;return o.listStyle.formatType=I.f.fromListType(a||P.c.numbers),"number"==typeof(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.start)?(o.listStyle.startAt=t.style.start,o.listStyle.mode=c.NumberMode.startAt):null!==n?(o.listStyle.startAt=n,o.listStyle.mode=c.NumberMode.startAt):o.listStyle.mode=c.NumberMode.continueFromPrevious,o}_convertUListItemToParagraph(t,e){var n,r;const i=new c.Paragraph;return i.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(i,t.style,e.style),i.listStyle.type=c.ListStyleType.bullets,i.listStyle.bulletChar=null===(r=this._convertUnorderedListBullet(null===(n=null==e?void 0:e.style)||void 0===n?void 0:n.type))||void 0===r?void 0:r.charCodeAt(0),i}_convertUnorderedListLevelIndent(t){return t?t.value:null}_convertUnorderedListBullet(t){if(t instanceof x.d)return String.fromCharCode(t.value.charCodeAt(0));switch(t){case x.c.minus:return"-";case x.c.bullet:default:return"•"}}static _getSupSubSize(t){const e=t["font-size"];if(null==e)return null;const n=L.stringToNumber(e.replace("%",""));if(null==n)return null;const i=n/100;return Object(r.EqualsOfFloatNumbers)(L._defaultSupSubSize,i)?null:(+i.toFixed(3)).toString()}static _deserializeCssEscapedString(t){let e=t;return"'"===e[0]&&(e=e.slice(1)),"'"===e[e.length-1]&&(e=e.slice(0,e.length-1)),e}async _convert(t,e){var n,r;let i=[],o=[];if(t.childNodes)for(let s=0;s<t.childNodes.length;++s){const a=t.childNodes[s];if(this._isAccepted(a)){const s=this.getNodeName(a),l=this.getNodeName(a.parentNode);if("ol"!=s&&"ul"!==s&&"p"!==s||"p"!==l&&"span"!==l){if("br"!=s||"p"!==l&&"li"!==l&&("span"!==l||"p"!==this.getNodeName(null===(n=a.parentNode)||void 0===n?void 0:n.parentNode)&&"li"!==this.getNodeName(null===(r=a.parentNode)||void 0===r?void 0:r.parentNode))||1!=t.childNodes.length){let t=await this._convert(a,e);if(Array.isArray(t))for(let e=0;e<t.length;++e)i.push(t[e]);else i.push(t)}}else{if(1==t.childNodes.length)return await this._convert(a,e);{const t=await this._convert(a,e);o.push(t)}}}}const a=await this._convertNode(t,i,e);return 0==o.length?a:(0!==i.length&&o.push(a),o)}_convertBr(){return new c.Br}_convertText(t){const e=new c.InlineText;return e.value=t.textContent.replace(/</g,"<").replace(/>/g,">"),e}_convertBody(t,e){const n=new c.Text;let r=null;for(var i of e)if(i instanceof x.a)n.blocks.push(...i.items),r=n.blocks[n.blocks.length-1];else if(i instanceof P.a)n.blocks.push(...i.items),r=n.blocks[n.blocks.length-1];else if(i instanceof c.BlockElement)n.blocks.push(i),r=i;else if(i instanceof m.a)n.blocks.push(i),r=i;else if(i instanceof c.InlineElement){if(r||(r=new c.Paragraph,n.blocks.push(r)),!(r instanceof c.Paragraph))throw this._notImplemented("Inserting inline element into block element that is not paragraph");r.inlineElements.push(i)}return n}_convertParagraph(t,e,n){const r=new c.Paragraph;null!=e&&e.length>0&&r.inlineElements.push(...e);let i=t.getAttributeNode("style");const o=t.getAttributeNode("value");o&&i&&(i.value+=`; value: ${o.value}; `),"li"==this.getNodeName(t)&&(i?i.value.includes(g.listStyleType)||(i.value+="; list-style-type: disc;"):i={value:"list-style-type: disc;",name:"style"});let a=this._convertParagraphStyles(null==i?void 0:i.value,n);r.style=a.style,r.listStyle=a.listStyle;const s=t.getAttributeNode("metadata");return r.metadata=this._convertParagraphMetadata(null==s?void 0:s.value),r}_convertParagraphMetadata(t){if(Object(h.a)(t))return null;const e=Object(h.b)(t),n=new c.ParagraphMetadata;for(let r in e)n.set(r,e[r]);return n}_convertParagraphStyles(t,e){if(Object(h.a)(t))return{style:new c.ParagraphStyle,listStyle:null};const n=Object(h.b)(t);return{style:this._convertParagraphStyle(n,e),listStyle:this._convertParagraphListStyles(n)}}_convertParagraphListStyles(t){let e=new c.ParagraphListStyle;const n=t[g.listStyleType];let r;null!=n&&(r=I.c.parseComplex(n),e.type=r.listStyleType,null!==r.numberFormatType&&void 0!==r.numberFormatType&&(e.formatType=r.numberFormatType),null!==r.bulletChar&&void 0!==r.bulletChar&&(e.bulletChar=r.bulletChar));const i=parseInt(t[g.value]);let o;e.type==c.ListStyleType.numbers&&(o=I.c.parseNumberModeStartAt(i),e.mode=o.numberMode,null!==o.startAt&&void 0!==o.startAt&&(e.startAt=o.startAt));const a=t[g.bulletNumberTabPosition];return null!=a&&(e.tabPosition=I.h.parseNumber(a)),e}_convertParagraphStyle(t,e=1){let n=new c.ParagraphStyle;const r=t[d.textAlign];null!=r&&(n.alignment=I.d.parse(r));const i=t[d.textIndent];null!=i&&(n.firstLineIndent=I.h.parse(i),n.firstLineIndent.value=n.firstLineIndent.value/e);const o=t[d.paddingTop];null!=o&&(n.spaceBefore=I.h.parse(o),n.spaceBefore.value=n.spaceBefore.value/e);const a=t[d.paddingBottom];null!=a&&(n.spaceAfter=I.h.parse(a),n.spaceAfter.value=n.spaceAfter.value/e);const s=t[d.marginLeft];null!=s&&(n.leftIndent=I.h.parse(s),n.leftIndent.value=n.leftIndent.value/e);const l=t[d.marginRight];return null!=l&&(n.rightIndent=I.h.parse(l),n.rightIndent.value=n.rightIndent.value/e),this._checkUnsupportedStyles([d,g],t,"paragraph"),n}_convertOrderedList(t,e){let n=new P.a;const r=t.getAttributeNode("style");null!=r&&(n.style=this._convertOrderedListStyles(r.value));let i=n.style.start;return n.items=[],null!=e&&e.length>0&&e.forEach((t=>{var e;if(t instanceof m.a){i=(null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.start)?t.style.start:null;let r=this._convertOListItemToParagraph(t,n,i);n.items.push(r),null!=i&&i++}})),n}_convertUnorderedList(t,e){let n=new x.a;const r=t.getAttributeNode("style");return null!=r&&(n.style=this._convertUnorderedListStyles(null==r?void 0:r.value)),n.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof m.a){let e=this._convertUListItemToParagraph(t,n);n.items.push(e)}})),n}_convertListItem(t,e,n){const r=this.getNodeName(t.parentNode);if("ol"==r||"ul"==r){const n=new m.a,r=t.getAttributeNode("style");if(null!=r){n.style=this._convertListItemStyles(r.value);const t=Object(h.b)(r.value);this._convertBaseListStyles(n.style,t)}const i=t.getAttributeNode("value");return null!=i&&(n.style||(n.style=new m.b),n.style.start=parseInt(i.value)),null!=e&&e.length>0&&(1==e.length&&e[0]instanceof c.Span?function(t){const n=e[0];n.style&&0===Object.keys(n.style).length&&Object.getPrototypeOf(n.style)===Object.prototype?t.content.push(...n.content):t.content.push(...e)}(n):n.content.push(...e)),n}return this._convertParagraph(t,e,n)}_convertUbi(t,e){const n=new c.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t))),n.style=new c.SpanStyle;const r=this.getNodeName(t);switch(r){case"u":n.style.underline=!0;break;case"b":n.style.bold=!0;break;case"i":n.style.italic=!0;break;default:throw new p.a(`Unexpected node name ${r} while parsing UBI.`)}return n}async _convertSpan(t,e,n){const r=new c.Span;return null!=e&&e.length>0&&e.forEach((t=>r.content.push(t))),r.style=await this._convertSpanStyles(t,n),r}_convertBaseListStyles(t,e){const n=e[y.marginLeft];null!=n&&(t.leftIndent=I.h.parse(n));const r=e[y.textIndent];if(null!=r){let n=I.h.parse(r);const i=e[y.textIndentCroppedPart];if(i){const t=I.h.parse(i);n.value+=t.value}t.firstLineIndent=n}const i=e[y.levelIndent];null!=i&&(t.levelIndent=I.h.parse(i));const o=e[y.bulletNumberTabPosition];null!=o&&(t.tabPosition=parseInt(o))}_convertListItemStyles(t){let e=new m.b;const n=Object(h.b)(t),r=n[_.textAlign];null!=r&&(e.alignment=I.d.parse(r));const i=n[_.fontSize];return null!=i&&(e.fontSize=I.h.parse(i)),e}_convertOrderedListStyles(t){let e=new P.b;const n=Object(h.b)(t);this._convertBaseListStyles(e,n);const r=n[b.listStyleType];null!=r&&(e.type=I.c.parseOltype(r));const i=n[b.start];return null!=i&&(e.start=I.h.parseNumber(i)),e}_convertUnorderedListStyles(t){let e=new x.b;const n=Object(h.b)(t);this._convertBaseListStyles(e,n);const r=n[v.listStyleType];return null!=r&&(e.type=I.c.parseUltype(r)),e}async _convertSpanStyles(t,e){var n,r;const i=null===(n=t.getAttributeNode("style"))||void 0===n?void 0:n.value,o=null===(r=t.getAttributeNode("colordata"))||void 0===r?void 0:r.value,a=Object(h.b)(i),s=Object(h.b)(o),l=new c.SpanStyle,u=L.getFontValue(a);if(null!=u){const t=L.getFontSettings(u,this._fontService,this._useSimpleFontList),e=t.postScriptName;e&&(l.fontName=e);const n=t.fauxBold;null!=n&&(l.bold=this._parseBool(`${n}`));const r=t.fauxItalic;null!=r&&(l.italic=this._parseBool(`${r}`))}const p=L.getUnderlineValue(a);null!=p&&(l.underline=this._parseBool(`${p}`));const d=L.getFontSizeValue(a,e);null!=d&&(l.fontSize=I.h.parse(`${d}pt`));const g=await this.getColorValue(a,s,this._colorPaletteManager);if(null!=g){const t=g.toString();null!=t&&(l.color=this._colorConverter.parse(t))}const m=await this.getStrokeValue(a,s,this._colorPaletteManager,e);if(null!=m){if(null!=m.size){const t=`${m.size}pt`;null!=t&&(l.penWidth=I.h.parse(t))}if(null!=m.colorIndex){const t=m.colorIndex.toString();null!=t&&(l.penColor=this._colorConverter.parse(t))}}const y=L.getTrackingValue(a);null!=y&&(l.tracking=I.h.parseNumber(y.toString()));const _=L.getLeadingValue(a,e);null!=_&&(l.leading=I.h.parse(`${_}pt`));const b=L.getAllCapsValue(a);null!=b&&(l.allCaps=this._parseBool(`${b}`));const v=L.getSmallCapsValue(a);if(null!=v&&(l.smallCaps=this._parseBool(`${v}`)),!0===L.getSupValue(a)){l.sup=!0;const t=L._getSupSubSize(a);t&&(l.supSize=I.h.parseNumber(t))}if(!0===L.getSubValue(a)){l.sub=!0;const t=L._getSupSubSize(a);t&&(l.subSize=I.h.parseNumber(t))}const w=L.getOpenTypeStringValue(a);null!=w&&(l.openTypeFeatures=I.i.parseHtml(w));const C=a.transform;if(null!=C){let t=C.replace(/[^0-9,.]/g,"").split(",");t&&2===t.length&&(l.horizontalScale=I.h.parseNumber(t[0]),l.verticalScale=I.h.parseNumber(t[1]))}return this._checkUnsupportedStyles([f],a,"span"),l}async _convertColor(t,e,n){let r;if(null!=e){if(r=+e,isNaN(r))return console.warn(`HtmlToXml: invalid color index: ${e}`),null}else{const e=this._colorParser.parse(t),i=await this._colorPreviewService.getPreviewAsync(e);r=n.addColorToPaletteReturnIndex({color:e,preview:i})}return r}_checkUnsupportedStyles(t,e,n){const r={};for(let a of t)for(let t in a)r[a[t]]=1;const i=[];for(let a in e)r[a]||i.push(a);const o=i.join(", ");i.length>0&&console.warn(`HtmlParser: unsupported ${n} styles: ${o}`)}_parseBool(t){return Object(h.a)(t)?null:"true"==t.toLowerCase()}_notImplemented(t=null){return new Error(`not implemented: ${t}`)}}L._defaultSupSubSize=.583;var R,k=n(433);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.BoldItalic=3]="BoldItalic",t[t.Other=4]="Other"}(R||(R={}));class j{constructor(t,e,n,r){this._fontService=t,this._colorPreviewSrvice=e,this._colorParser=n,this._useSimpleFontList=r}async serialize(t,e,n){if(null==t)throw new k.b("Text must be not null");this._colorConverter=new I.b(e,this._colorParser);let r=await this._serializeBlocks(t.blocks,n);return r=r.replace(/<p><\/p>/g,"<p><span><br /></span></p>").replace(/<p><span> <\/span><\/p>/g,"<p><span><br /></span></p>").replace(/<li><span> <\/span><\/li>/g,"<li><span><br /></span></li>").replace(/<li><\/li>/g,"<li><span><br /></span></li>").replace(/<span(| style=('|")padding-left: \d*pt('|"))><\/span>/g,(function(t,e){return"<span"+e+"><br /></span>"})),r}async _serializeBlocks(t,e){var n,r;if(null==t)return"";let i="",o="",a=null,s=null;for(let[l,u]of t.entries())if(u instanceof c.Paragraph&&((null===(n=null==u?void 0:u.listStyle)||void 0===n?void 0:n.type)===c.ListStyleType.bullets||(null===(r=null==u?void 0:u.listStyle)||void 0===r?void 0:r.type)===c.ListStyleType.numbers)){const n=this._serializeListStyle(u.listStyle);n!==a?(""!==o&&(s==c.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o)),s=u.listStyle.type,a=n,o="",o+=await this._serializeParagraph(u,e)):s==c.ListStyleType.numbers&&l>0&&this._changeStartAtToContinuefromPreviousIfRequared(u,t[l-1])?o+=await this._serializeParagraph(u,e,!0):o+=await this._serializeParagraph(u,e)}else""!==o&&(s==c.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o),o=""),i+=await this._serializeBlock(u,e);return""!==o&&(s==c.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o)),i}_changeStartAtToContinuefromPreviousIfRequared(t,e){var n,r;return(null===(n=null==t?void 0:t.listStyle)||void 0===n?void 0:n.startAt)==(null===(r=null==e?void 0:e.listStyle)||void 0===r?void 0:r.startAt)+1}async _serializeBlock(t,e){if(t instanceof c.Paragraph)return await this._serializeParagraph(t,e);if(t instanceof P.a)return await this._serializeOrderedList(t,e);if(t instanceof x.a)return await this._serializeUnorderedList(t,e);throw console.error("Unknown block type, serialization not implemented",t),new k.a("Unknown block type ")}async _serializeParagraph(t,e,n=!1){var r,i,o;let a=this._serializeParagraphStyle(t.style,t.listStyle,e),s=this._serializeParagraphMetadata(t.metadata),l=[];s&&l.push(s),a&&l.push(a),(null===(r=null==t?void 0:t.listStyle)||void 0===r?void 0:r.startAt)&&!n&&l.push(this._buildAttribute("value",[`${t.listStyle.startAt}`]));let u,h="";if(this._isEmpty(null===(i=null==t?void 0:t.listStyle)||void 0===i?void 0:i.type)||(null===(o=null==t?void 0:t.listStyle)||void 0===o?void 0:o.type)===c.ListStyleType.none){if(t.inlineElements)for(let n of t.inlineElements)h+=await this._serializeInlineElement(n,e);u=this._buildTag("p",l,h)}else{let n=this._getLiInnerSpanPadding(t.style,t.listStyle,e);if(t.inlineElements[0]instanceof c.Span){if(h+=await this._serializeSpan(t.inlineElements[0],e,n),t.inlineElements.shift(),t.inlineElements)for(let r of t.inlineElements)h+=await this._serializeInlineElement(r,e)}else{if(n&&(h+=`<span style="${n}">`),t.inlineElements)for(let n of t.inlineElements)h+=await this._serializeInlineElement(n,e);n&&(h+="</span>")}u=this._buildTag("li",l,h)}return u}_serializeParagraphMetadata(t){const e=[];if(t)for(let[n,r]of t)this._isEmpty(r)||e.push(`${n}: ${r}`);return e.length>0?this._buildAttribute("metadata",e):null}_serializeListStyle(t){let e=[];return e.push("margin-bottom: 0pt"),this._isEmpty(t.type)||e.push(`list-style-type: ${I.c.serializeComplex(t.type,t.formatType,t.bulletChar)}`),e.length>0?this._buildAttribute("style",e):null}_getLiInnerSpanPadding(t,e,n){let r=null;const i=this._isEmpty(null==t?void 0:t.firstLineIndent)?0:t.firstLineIndent.value,o=this._isEmpty(null==t?void 0:t.leftIndent)?j._listsLeftIndentEqualsToModelZero:t.leftIndent.value,a=this._isEmpty(null==e?void 0:e.tabPosition)?0:e.tabPosition,s=e&&e.type&&(e.formatType||e.bulletChar)?I.c.serializeComplex(e.type,e.formatType,e.bulletChar):"";let l=j.getCorrectpaddingLeftValue(i,o,a,s);return 0!=l&&(r=`padding-left: ${j.setValueInPoints(l,n)}`),r}static getCorrectTextIndentValue(t,e){let n=t;return t<-e&&(n=-e),n}static getCorrectpaddingLeftValue(t=0,e=j._listsLeftIndentEqualsToModelZero,n=0,r){let i=0;if(t<0)i-=j.getCorrectTextIndentValue(t,e)+17;else{let e=n-t+i,r=0;r=n-t>12?-17:n-t>-32?-17+n:62,e+=r,e>i&&(i=e)}return r.match(/('|").('|")/)?i+=5:r.match(/(disc|circle|square)/)&&(i-=3),i}_serializeParagraphStyle(t,e,n){let r=[];if(t){if(this._isEmpty(t.alignment)||r.push(`text-align: ${j.setAlignment(t.alignment)}`),!this._isEmpty(t.firstLineIndent))if((null==e?void 0:e.type)==c.ListStyleType.bullets||(null==e?void 0:e.type)==c.ListStyleType.numbers){const e=t.firstLineIndent.value,i=j.getCorrectTextIndentValue(e,this._isEmpty(t.leftIndent)?j._listsLeftIndentEqualsToModelZero:t.leftIndent.value);r.push(`text-indent: ${j.setValueInPoints(i,n)}`),i!=e&&r.push(`text-indent-cropped-part: ${j.setValueInPoints(-i+e,n)}`)}else r.push(`text-indent: ${j.setValueInPoints(t.firstLineIndent.value,n)}`);this._isEmpty(t.spaceBefore)||r.push(`padding-top: ${j.setValueInPoints(t.spaceBefore.value,n)}`),this._isEmpty(t.spaceAfter)||r.push(`padding-bottom: ${j.setValueInPoints(t.spaceAfter.value,n)}`),this._isEmpty(t.leftIndent)||(this._isEmpty(null==e?void 0:e.type)?r.push(`margin-left: ${j.setValueInPoints(t.leftIndent.value,n)}`):r.push(`margin-left: ${j.setCorrectedForListsLeftIndentValue(t.leftIndent.value,n)}`)),this._isEmpty(t.rightIndent)||r.push(`margin-right: ${j.setValueInPoints(t.rightIndent.value,n)}`)}return e&&(this._isEmpty(e.tabPosition)||r.push(`bullet-number-tab-position: ${j.setBulletTabPosition(e.tabPosition,n)}`),this._isEmpty(e.level)||r.push(`level: ${e.level}`),this._isEmpty(e.type)||r.push("list-style-position: inside")),r.length>0?this._buildAttribute("style",r):null}static setAlignment(t){const e="string"==typeof t?j.stringToTextAlignmentForHtml(t):t;return j.textAlignmentToHtmlString(e)}static stringToTextAlignmentForHtml(t){switch(t.toLocaleLowerCase()){case"left":default:return i.qb.Left;case"center":return i.qb.Center;case"right":return i.qb.Right;case"justify":case"justify-all":case"justification":case"justification-last-left":case"justification-last-center":case"justification-last-right":return i.qb.Justify}}static textAlignmentToHtmlString(t){switch(t){case i.qb.Left:return"left";case i.qb.Center:return"center";case i.qb.Right:return"right";case i.qb.Justify:return"justify"}}static setValueInPoints(t,e=1){return("number"==typeof t?t:j.stringToNumber(t,"pt"))*e+"pt"}static setBulletTabPosition(t,e=1){return""+("number"==typeof t?t:j.stringToNumber(t,"pt"))*e}static setCorrectedForListsLeftIndentValue(t,e=1){let n="number"==typeof t?t:j.stringToNumber(t,"pt");return n-=j._listsLeftIndentEqualsToModelZero,n*e+"pt"}static stringToNumber(t,e="",n=0){if(null==t)return null;const r=j.isNullOrEmptyOrWhiteSpace(e)?+t:+t.replace(e,"");return isNaN(r)?n:r}static isNullOrEmptyOrWhiteSpace(t){return null==t||""===t.trim()}_serializeInlineText(t){return t.value.replace(/\n\r/gm,"<br />").replace(/\n/gm,"<br />")}async _serializeInlineElement(t,e){return t instanceof c.Span?await this._serializeSpan(t,e):t instanceof c.InlineText?this._serializeInlineText(t):t instanceof c.Br?this._serializeBr(t):void 0}_serializeBr(t){return"<br />"}async _serializeSpan(t,e,n=null){let r=t.style||n?await this._serializeSpanStyle(t,e,n):null,i=r?`<span ${r}>`:"<span>",o="";if(null!=t.content)for(let a of t.content)o+=await this._serializeInlineElement(a,e);else o+="<br>";return`${i}${o}</span>`}async _serializeSpanStyle(t,e,n=null){const r=t.style;let i=[],o=[];if(n&&i.push(n),r){this._isEmpty(r.underline)||i.push("text-decoration: "+(r.underline?"underline":"none"));const t=j.getFontValue(r,this._fontService,this._useSimpleFontList);if(null!=t&&(this._isEmpty(t.family)||i.push(`font-family: ${t.family}`)),this._isEmpty(r.bold)&&!(null==t?void 0:t.bold)||i.push("font-weight: "+(r.bold||(null==t?void 0:t.bold)?"bold":"normal")),this._isEmpty(r.italic)&&!(null==t?void 0:t.italic)||i.push("font-style: "+(r.italic||(null==t?void 0:t.italic)?"italic":"normal")),this._isEmpty(r.fontSize)||i.push(`font-size: ${j.setValueInPoints(r.fontSize.value,e)}`),this._isEmpty(r.leading)||i.push("line-height: "+(0===r.leading.value?"normal":`${j.setValueInPoints(r.leading.value,e)}`)),this._isEmpty(r.tracking)||i.push(`letter-spacing: ${j.trackingToLetterSpacing(r.tracking)}`),!this._isEmpty(r.color)){const t=await this._colorPreviewSrvice.getPreviewAsync(r.color.color);i.push(`color: ${t.toString()}`),o.push(`color-index: ${this._colorConverter.serialize(r.color)}`)}if(!this._isEmpty(r.penColor)&&!this._isEmpty(r.penWidth)){const t=await this._colorPreviewSrvice.getPreviewAsync(r.penColor.color);i.push(`-webkit-text-stroke: ${j.setValueInPoints(r.penWidth.value,e)} ${t}`),o.push(`pen-color-index: ${this._colorConverter.serialize(r.penColor)}`)}if(!this._isEmpty(r.sub)){i.push("vertical-align: sub");let t=r.subSize;this._isEmpty(t)&&(t=j._defaultSupSubSize),i.push(`font-size: ${100*t}%`)}if(!this._isEmpty(r.sup)){i.push("vertical-align: super");let t=r.supSize;this._isEmpty(t)&&(t=j._defaultSupSubSize),i.push(`font-size: ${100*t}%`)}if(this._isEmpty(r.allCaps)||i.push("text-transform: "+(r.allCaps?"uppercase":"none")),this._isEmpty(r.smallCaps)||i.push("font-variant-caps: "+(r.smallCaps?"all-small-caps":"none")),(!this._isEmpty(r.horizontalScale)&&1!==r.horizontalScale||!this._isEmpty(r.verticalScale)&&1!==r.verticalScale)&&(this._isEmpty(r.horizontalScale)&&(r.horizontalScale=1),this._isEmpty(r.verticalScale)&&(r.verticalScale=1),i.push(`transform:scale(${r.horizontalScale},${r.verticalScale})`)),!this._isEmpty(r.openTypeFeatures)){let t="";for(let e of r.openTypeFeatures)null!=e.tag&&null!=e.tag&&(t+=`'${e.tag}' ${null!=e.value&&null!=e.value?e.value:""},`);t=t.slice(0,-1),i.push(`font-feature-settings: ${t}`)}}let a="";return o.length>0&&(a+=this._buildAttribute("colordata",o),a+=" "),i.length>0&&(a+=this._buildAttribute("style",i)),""!==a?a:null}static setStrokeValue(t,e,n,r=1){var i,o;const a=t.attributes.colordata,s=null!=a?Object(h.b)(a.value):{};e.enabled?(t.style.webkitTextStrokeWidth=e.size*r+"pt",e.color&&(t.style.webkitTextStrokeColor=null===(o=null===(i=e.color)||void 0===i?void 0:i.preview)||void 0===o?void 0:o.toString(),s["pen-color-index"]=n.addColorToPaletteReturnIndex(e.color).toString())):(j.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStrokeWidth)&&j.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStrokeColor)&&j.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStroke)?(t.style.webkitTextStrokeWidth="0pt",t.style.webkitTextStrokeColor="rgba(0,0,0,0)"):(t.style.webkitTextStrokeWidth=null,t.style.webkitTextStrokeColor=null,t.style.webkitTextStroke=null),delete s["pen-color-index"]),S.isEmpty(s)?t.removeAttribute("colordata"):t.setAttribute("colordata",Object(h.c)(s))}static getFontValue(t,e,n){const r=t.fontName,i=t.bold,o=t.italic;if(null==r&&null==i&&null==o)return null;const a={postScriptName:j.isNullOrEmptyOrWhiteSpace(r)?null:r,fauxBold:i||null,fauxItalic:o||null};return j.fontSettingsToHtmlValue(a,e,n)}static fontSettingsToHtmlValue(t,e,n){if(null==t)return null;const r=t.postScriptName,i=t.fauxBold,o=t.fauxItalic;if(null==r&&null==i&&null==o)return null;const a={};if(n){if(!j.isNullOrEmptyOrWhiteSpace(r)){a.family=e.getCssFontFamily(e.availableFontsByPsName[r.toLowerCase()].family);const t=e.recognizeStyleByPsName(r);a.bold=t===R.Bold||t===R.BoldItalic,a.italic=t===R.Italic||t===R.BoldItalic}}else a.family=null!=r?e.getCssPsName(r):null,a.bold=i,a.italic=o;return a}static setAlignmentValue(t,e){const n="string"==typeof e?j.stringToTextAlignmentForHtml(e):e;t.style.textAlign=j.textAlignmentToHtmlString(n)}static setFirstLineIndentValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.textIndent=r*n+"pt"}static setSpaceAfterValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.paddingBottom=r*n+"pt"}static setSpaceBeforeValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.paddingTop=r*n+"pt"}static setRightIndentValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.marginRight=r*n+"pt"}static setLeftIndentValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.marginLeft=r*n+"pt"}static setFontValue(t,e){null!=e.family&&(t.style.fontFamily=e.family),null!=e.bold&&(t.style.fontWeight=!0===e.bold?"bold":"normal"),null!=e.italic&&(t.style.fontStyle=!0===e.italic?"italic":"normal")}static setBoldValue(t,e){t.style.fontWeight=!0===e||"true"===e?"bold":"normal"}static setItalicValue(t,e){t.style.fontStyle=!0===e||"true"===e?"italic":"normal"}static setUnderlineValue(t,e){t.style.textDecoration=!0===e||"true"===e?"underline":"none"}static setFontSizeValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.fontSize=r*n+"pt"}static setFontNameValue(t,e){t.style.fontFamily=e}static setLeadingValue(t,e,n=1){const r="number"==typeof e?e:j.stringToNumber(e,"pt");t.style.lineHeight=0===r?"normal":r*n+"pt"}static setTrackingValue(t,e){t.style.letterSpacing=j.trackingToLetterSpacing(e)}static trackingToLetterSpacing(t){return(isNaN(t)?0:t/1e3)+"em"}static setColorValue(t,e,n,r){t.style.color=n.toString();const i=r.addColorToPaletteReturnIndex({color:e,preview:n});j.setColorIndex(t,i)}static setColorIndex(t,e){const n=t.attributes.colordata,r=null!=n?Object(h.b)(n.value):{};r["color-index"]=e.toString(),t.setAttribute("colordata",Object(h.c)(r))}static setSupValue(t,e,n){!0!==e&&"true"!==e||(t.style.verticalAlign="super",null==n&&(n=j._defaultSupSubSize),t.style.fontSize=100*n+"%")}static setSubValue(t,e,n){!0!==e&&"true"!==e||(t.style.verticalAlign="sub",null==n&&(n=j._defaultSupSubSize),t.style.fontSize=100*n+"%")}static setAllCapsValue(t,e){t.style.textTransform=!0===e||"true"===e?"uppercase":"none"}static setSmallCapsValue(t,e){t.style.fontVariantCaps=!0===e||"true"===e?"all-small-caps":"none"}static setOpenTypeValue(t,e){null!=e&&0!=e.length&&(t.style.fontFeatureSettings=e.map((t=>`"${t.tag.toLowerCase()}" ${t.value}`)).join(", "))}static setOpenTypeStringValue(t,e){let n=null;e.split(";").forEach((t=>{if(j.isNullOrEmptyOrWhiteSpace(t))return;const e=t.split(","),r=e[0],i=2===e.length?e[1]:null;null==n?n="":n+=", ",n+=`"${r.toLowerCase()}"`,null!=i&&(n+=` ${i}`)})),null!=n&&(t.style.fontFeatureSettings=n)}static parseOpenTypeFeaturesFromGmXml(t){if(j.isNullOrEmptyOrWhiteSpace(t))return null;const e=[];return t.split(";").forEach((t=>{if(j.isNullOrEmptyOrWhiteSpace(t))return;const n=t.split(","),r=n[0].toLowerCase(),i=2===n.length?n[1]:null,o=new E.a(r,j.stringToNumber(null!=i?i:"1"));e.push(o)})),e}async _serializeOrderedList(t,e){let n=t.style?this._serializeOrderedListStyle(t.style):null,r=n?`<ol ${n}>`:"<ol>";if(0==t.items.length)return`${r}</ol>`;let i="";for(let o of t.items)i+=await this._serializeListItem(o,e);return`${r}${i}</ol>`}_serializeOrderedListStyle(t){let e=[];return this._isEmpty(t.start)||e.push(`start: ${t.start}`),this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||e.push(`type: ${P.c[t.type]}`),e.length>0?this._buildAttribute("style",e):null}async _serializeUnorderedList(t,e){let n=t.style?this._serializeUnorderedListStyle(t.style):null,r=n?`<ul ${n}>`:"<ul>";if(0==t.items.length)return`${r}</ul>`;let i="";for(let o of t.items)i+=await this._serializeListItem(o,e);return`${r}${i}</ul>`}_serializeUnorderedListStyle(t){let e=[];return this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||(t.type instanceof x.d?e.push(`type: ${t.type.value}`):e.push(`type: ${x.c[t.type]}`)),e.length>0?this._buildAttribute("style",e):null}async _serializeListItem(t,e){if(t instanceof c.Paragraph)return await this._serializeParagraph(t,e);throw new Error("not implemented")}_buildTag(t,e,n){let r=`<${t}`;return e.forEach((t=>{r+=` ${t}`})),r+=">",n&&(r+=n),r+=`</${t}>`,r}_buildAttribute(t,e){return`${t}="${e.join("; ")}"`}_isEmpty(t){return null==t}}j._defaultSupSubSize=.583,j._listsLeftIndentEqualsToModelZero=30;var A=n(752),F=n(753),B=n(588);class M{}M.fontName="fontName",M.bold="bold",M.italic="italic",M.underline="underline",M.subscript="subscript",M.superscript="superscript",M.color="color",M.justifyCenter="justifyCenter",M.justifyFull="justifyFull",M.justifyLeft="justifyLeft",M.justifyRight="justifyRight",M.documentCommands=S.values([M.fontName,M.bold,M.italic,M.underline,M.color,M.justifyCenter,M.justifyFull,M.justifyLeft,M.justifyRight,M.subscript,M.superscript]),M.verticalAlignmentTop="verticalAlignmentTop",M.verticalAlignmentCenter="verticalAlignmentCenter",M.verticalAlignmentBottom="verticalAlignmentBottom",M.alignment="alignment",M.firstLineIndent="first-line-indent",M.spaceAfter="space-after",M.spaceBefore="space-before",M.leftIndent="left-indent",M.rightIndent="right-indent",M.verticalAlignment="vertical-alignment",M.fontSize="fontSize",M.stroke="stroke",M.tracking="tracking",M.leading="leading",M.allCaps="all-caps",M.smallCaps="small-caps",M.openType="open-type";class N{constructor(){}static setInitData(t){this._initData=t}static setPreviewScale(t){this._previewScale=t}static _getListStyle(t){let e="";return e+="margin-bottom: 0pt; ",e+=`list-style-type: ${B.a.serializeComplex(t,this._initData.listSettings.numberingFormat,this._initData.listSettings.bulletChar)}`,e}static _getListItemStyle(){let t="",e=this._initData.listSettings.firstLineIndent,n=j.getCorrectTextIndentValue(e,this._initData.listSettings.listIndent);return t+=`text-indent: ${j.setValueInPoints(n,this._previewScale)}; `,n!=e&&(t+=`text-indent-cropped-part: ${j.setValueInPoints(-n+e,this._previewScale)}; `),t+=`margin-left: ${j.setCorrectedForListsLeftIndentValue(this._initData.listSettings.listIndent,this._previewScale)}; `,t+=`bullet-number-tab-position: ${this._initData.listSettings.tabOffset}; `,t+="list-style-position: inside",t}static _getInnerSpanStyle(t){let e="";const n=B.a.serializeComplex(t,this._initData.listSettings.numberingFormat,this._initData.listSettings.bulletChar);return e+=`padding-left: ${j.getCorrectpaddingLeftValue(this._initData.listSettings.firstLineIndent,this._initData.listSettings.listIndent,this._initData.listSettings.tabOffset,n)}pt; `,e}static _nextNode(t){if(t.hasChildNodes())return t.firstChild;for(;t&&!t.nextSibling;)t=t.parentNode;return t?t.nextSibling:null}static _getRangeSelectedNodes(t){let e=t.startContainer,n=t.endContainer;if(e==n)return[e];let r=[];for(;e&&e!=n;)r.push(e=this._nextNode(e));for(e=t.startContainer;e&&e!=t.commonAncestorContainer;)r.unshift(e),e=e.parentNode;return r}static _getSelectedNodes(){if(document.getSelection){let t=document.getSelection();return this._getRangeSelectedNodes(t.getRangeAt(0))}return[]}static _findLi(t=null){let e;for(e=t||document.getSelection().anchorNode;e;){if(N.isListItem(e))return e;e=e.parentNode}return null}static _findParagraph(t=null){let e;for(e=t||document.getSelection().anchorNode;e;){if(N.isParagraph(e))return e;e=e.parentNode}return null}static findAllSelectedLis(){let t=[];return N._getSelectedNodes().forEach((e=>{const n=N._findLi(e);n&&t.push(n)})),t}static isBr(t){return"br"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isListItem(t){return"li"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isBulletedList(t){return"ul"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isNumberedList(t){return"ol"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isAnyList(t){return N.isBulletedList(t)||N.isNumberedList(t)}static getDefaultFontValue(t){const e={};return e.family=null==t?void 0:t.postScriptName,e.bold=null==t?void 0:t.fauxBold,e.italic=null==t?void 0:t.fauxItalic,e}static paragraphStyleToCommands(t,e=!0){const n=[];if(null!=t.alignment)if(e&&S.isEmpty(S.omit(t,M.alignment)))switch(t.alignment){case i.qb.Left:n.push({key:M.justifyLeft});break;case i.qb.Center:n.push({key:M.justifyCenter});break;case i.qb.Right:n.push({key:M.justifyRight});break;case i.qb.Justify:case i.qb.LastLeft:n.push({key:M.justifyFull})}else t.alignment==i.qb.LastLeft&&(t.alignment=i.qb.Justify),n.push({key:M.alignment,value:t.alignment});return null!=t.firstLineIndent&&n.push({key:M.firstLineIndent,value:t.firstLineIndent}),null!=t.leftIndent&&n.push({key:M.leftIndent,value:t.leftIndent}),null!=t.rightIndent&&n.push({key:M.rightIndent,value:t.rightIndent}),null!=t.spaceAfter&&n.push({key:M.spaceAfter,value:t.spaceAfter}),null!=t.spaceBefore&&n.push({key:M.spaceBefore,value:t.spaceBefore}),n}static isSpan(t){return"span"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isParagraph(t){return"p"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isText(t){return"#text"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static _findEmptyNodeInside(t=null){let e=t;for(;e;){if(N.isBr(e))return e.parentNode;if(1!=e.childNodes.length)return null;e=e.childNodes[0]}return null}static saveSelection(t,e=0){let n=window.getSelection(),r=n.getRangeAt(0),i=r.toString().length,o=N._findEmptyNodeInside(r.startContainer),a=N._findEmptyNodeInside(r.endContainer),s=o||0!=r.startOffset?null:r.startContainer,l=a||0!=r.endOffset||n.isCollapsed?null:r.endContainer;(a&&a!==o||l&&l!==s)&&(i+=1),r.setStart(t,0);let u=r.toString().length;u=u-i+e,(o||s)&&(u+=1),(a&&a!==o||l&&l!==s)&&(u+=1);const c=u;return function(){const e=NodeFilter.SHOW_TEXT;o&&(o.innerHTML="​"),a&&(a.innerHTML="​"),s&&(s.textContent=""+s.textContent),l&&(l.textContent=""+l.textContent);let r=document.createTreeWalker(t,e,(function(t){return u>t.textContent.length?(u-=t.textContent.length,NodeFilter.FILTER_REJECT):NodeFilter.FILTER_ACCEPT}));const h=r.currentNode;let p=r.nextNode();const f=u;u=c+i,r.currentNode=h;let d=r.nextNode(),g={startNode:p||t,startPosition:f,endNode:d||t,endPosition:u};u=c,s&&(s.textContent=s.textContent.substring(1),g.startPosition-=1,g.endPosition-=1),n.removeAllRanges();let m=new Range;m.setStart(g.startNode,g.startPosition),m.setEnd(g.endNode,g.endPosition),n.addRange(m)}}static getCorrectLinesCount(t){let e=0;const n=NodeFilter.SHOW_ALL;return document.createTreeWalker(t,n,(function(t){return"p"!==t.nodeName.toLowerCase()&&"li"!==t.nodeName.toLowerCase()||e++,NodeFilter.FILTER_REJECT})).nextNode(),e}static getDefaultInlineStyle(t){var e,n,r,i,o,a;return{font:{postScriptName:t.font.postScriptName,fauxBold:t.font.fauxBold,fauxItalic:t.font.fauxItalic,size:t.font.size},underline:t.underline,leading:t.leading,tracking:t.tracking,color:{color:null===(e=t.color)||void 0===e?void 0:e.color.clone(),preview:null===(r=null===(n=t.color)||void 0===n?void 0:n.preview)||void 0===r?void 0:r.clone()},stroke:{enabled:t.stroke.enabled,size:t.stroke.size,color:{color:null===(i=t.stroke.color)||void 0===i?void 0:i.color.clone(),preview:null===(a=null===(o=t.stroke.color)||void 0===o?void 0:o.preview)||void 0===a?void 0:a.clone()}},openType:t.openType}}static insertTextAtCaret(t){let e,n;window.getSelection&&(e=window.getSelection(),e.getRangeAt&&e.rangeCount&&(n=e.getRangeAt(0),n.deleteContents(),n.insertNode(document.createTextNode(t))))}static setListStyle(t,e){t[0].parentElement.setAttribute("style",N._getListStyle(e));const n=N._getInnerSpanStyle(e);t.forEach((t=>{let e;t.setAttribute("style",N._getListItemStyle());let r=t.childNodes[0];if(N.isSpan(r)){const t=r.getAttribute("style");e=t?t.includes("padding-left")?t.replace(/padding-left:(| )\d*(pt|px)(;|)( |)/,n):n+t:n,r.setAttribute("style",e)}else t.innerHTML="<span style='"+e+"'>"+t.innerHTML+"</span>"}))}static getAdjacentLi(t){const e=t[0].previousElementSibling;if(N.isListItem(e))return e;const n=t[t.length-1].nextElementSibling;return N.isListItem(n)?n:null}static setAdjacentLiStyle(t,e){const n=e.getAttribute("style"),r=e.childNodes[0],i=null==r?void 0:r.getAttribute("style");t.forEach((t=>{let e;if(t.setAttribute("style",null!=n?n:""),i){let n=t.childNodes[0];if(N.isSpan(n)){const t=n.getAttribute("style");e=t?t.includes("padding-left")?t.replace(/(;|; |)padding-left:(| )\d*(pt|px)(;|)( |)/,`;${i};`):i+"; "+t:i,n.setAttribute("style",e)}else t.innerHTML="<span style='"+e+"'>"+t.innerHTML+"</span>"}}))}static wrapSpansWithP(){const t=N._getSelectedNodes();0!==t.length&&(1==t.length&&t.push(t[0].parentNode),t.forEach((t=>{if(N.isSpan(t)&&!N.isParagraph(t.parentNode)){let e=t.nextSibling;N.isBr(e)&&e.remove(),t.outerHTML="<p>"+t.outerHTML+"</p>"}})))}static processEnterOnEmptyListItem(t,e){const n=N._findLi();if(n&&n.innerHTML.match(/<span(| style=('|").*('|"))>(|<span(| style=('|").*('|"))>)<br>(|<\/span>)<\/span>/)){t.preventDefault();const r=N.saveSelection(e);n.setAttribute("replace","here");const i=n.parentElement,o=i.nodeName.toLowerCase(),a=i.getAttribute("style");i.outerHTML=i.outerHTML.replace(n.outerHTML,`</${o}><p><span>​</span></p><${o} style="${a}">`),r()}}static getParagraphIndex(t){let e=t;for(;e&&!N.isListItem(e)&&!N.isParagraph(e);)e=e.parentNode;const n=e,r=e.parentNode;for(var i=0;i<r.childNodes.length;i++)if(r.childNodes[i]==n)return i;return console.error("unable to get paragraph index"),-1}static getParagraphByIndex(t){if(t<0)return null;const e=window.getSelection().getRangeAt(0).startContainer.parentElement;return t>=e.children.length?null:e.children[t]}static getParagraphLengthByIndex(t){const e=this.getParagraphByIndex(t);return null==e?0:this.getParagraphLength(e)}static getParagraphLength(t){return null==t?0:t.textContent.length}static getCurrentParagraphLength(t=0){let e=window.getSelection().getRangeAt(0).startContainer;for(;e&&!N.isListItem(e)&&!N.isParagraph(e);)e=e.parentNode;if(t<0)for(let n=t;n<0;n++)e=e.previousSibling;if(t>0)for(let n=t;n>0;n--)e=e.nextSibling;return e&&e.textContent?e.textContent.length:0}static getEveryLineLength(t){let e=[];const n=NodeFilter.SHOW_ELEMENT;return document.createTreeWalker(t,n,(function(t){return t.textContent&&e.push(t.textContent.length),NodeFilter.FILTER_REJECT})).nextNode(),e}static isCaretOnTheBeginingOfListItem(){const t=window.getSelection();if(t.isCollapsed&&0==t.anchorOffset&&N._findLi())return!0}static isCaretOnTheBeginingOfParagraph(){const t=window.getSelection();if(t.isCollapsed&&0==t.anchorOffset&&N._findParagraph())return!0}static isCaretOnEndOfParagraph(t){const e=window.getSelection();if(e.isCollapsed&&e.anchorOffset==t&&N._findParagraph())return!0}static async applyCommands(t,e,n,r){for(let i of e){const e=i.key,o=i.value;switch(e){case M.fontName:j.setFontNameValue(t,o);break;case M.fontSize:j.setFontSizeValue(t,o,this._previewScale);break;case M.bold:j.setBoldValue(t,o);break;case M.italic:j.setItalicValue(t,o);break;case M.allCaps:j.setAllCapsValue(t,o);break;case M.underline:j.setUnderlineValue(t,o);break;case M.leading:j.setLeadingValue(t,o,this._previewScale);break;case M.tracking:j.setTrackingValue(t,o);break;case M.color:{const e=await r.getPreviewAsync(o.color);j.setColorValue(t,o.color,e,n)}break;case M.stroke:{const e=o;e.color.preview=await r.getPreviewAsync(e.color.color),j.setStrokeValue(t,e,n,this._previewScale)}break;case M.openType:j.setOpenTypeValue(t,o);break;case M.subscript:j.setSubValue(t,o);break;case M.superscript:j.setSupValue(t,o);break;case M.alignment:j.setAlignmentValue(t,o);break;case M.firstLineIndent:j.setFirstLineIndentValue(t,o,this._previewScale);break;case M.spaceAfter:j.setSpaceAfterValue(t,o,this._previewScale);break;case M.spaceBefore:j.setSpaceBeforeValue(t,o,this._previewScale);break;case M.leftIndent:j.setLeftIndentValue(t,o,this._previewScale);break;case M.rightIndent:j.setRightIndentValue(t,o,this._previewScale)}}}static async customInlineCommand(t,e,n,r,i){if(null==e||e.collapsed)return;const o=document.getSelection(),a=n.cloneNode(),s=t=>{if(o.containsNode(t,!1)||!t.hasChildNodes())return!0;let n=!0,r=!0;return N.isSpan(t.firstChild)?n=s(t.firstChild):N.isText(t.firstChild)&&(n=t.firstChild.isSameNode(e.startContainer)&&0==e.startOffset),N.isSpan(t.lastChild)?r=s(t.lastChild):N.isText(t.lastChild)&&(r=t.lastChild.isSameNode(e.endContainer)&&e.endOffset==t.lastChild.length),e.startContainer.isSameNode(e.endContainer)?n&&r:n||r},l=async(n,a)=>{for(let u=0;u<n.childNodes.length;u++){const c=n.childNodes.item(u);if(o.containsNode(c,!0))if(N.isText(c)){let n=c.cloneNode(!1),o=null,s=0;c.isSameNode(e.startContainer)&&(s=e.startOffset,o=n.splitText(s),a.appendChild(n),n=o,o=null),c.isSameNode(e.endContainer)&&(o=n.splitText(e.endOffset-s));const l=document.createElement("span");await N.applyCommands(l,t,r,i),l.textContent=n.textContent,a.appendChild(l),null!=o&&a.appendChild(o)}else if(N.isSpan(c)&&s(c)){const e=c.cloneNode(!0);await N.applyCommands(e,t,r,i),a.appendChild(e)}else{const t=c.cloneNode(!1);await l(c,t),a.appendChild(t)}else a.appendChild(c.cloneNode(!0))}};for(let u=0;u<n.childNodes.length;u++){const t=n.childNodes.item(u);if(o.containsNode(t,!0)){const e=t.cloneNode(!1);await l(t,e),a.appendChild(e)}else a.appendChild(t.cloneNode(!0))}n.focus(),document.execCommand("selectAll"),document.execCommand("insertHTML",!1,a.innerHTML)}}N._previewScale=1;var z=n(490);class D{constructor(t){this._rootElement=t}updateTextMetrics(t){this._textMetrics=t}updateSelection(t){this._range=t.getRangeAt(0),this._isSelectionCollapsed=t.isCollapsed}getTextMetrics(){return this._textMetrics}getSelectionRightParagraphLength(){return N.getParagraphLength(this._range.endContainer)}getSelectionRightParagraphIndex(){return N.getParagraphIndex(this._range.endContainer)}getSelectionLeftParagraphIndex(){return N.getParagraphIndex(this._range.startContainer)}getSelectionLeftParagraphLength(){return N.getParagraphLength(this._range.startContainer)}getSelectionRightParagraphOffset(){return this._range.endOffset}getSelectionLeftParagraphOffset(){return this._range.startOffset}get isSelectionCollapsed(){return this._isSelectionCollapsed}get isSelectionMultiline(){return this._range.startContainer!=this._range.endContainer}get isCursorAtTheBeginningOfParagraph(){return N.isCaretOnTheBeginingOfParagraph()}get isCaretAtTheEndOfParagraph(){return N.isCaretOnEndOfParagraph(this._textMetrics.currentLineLength)}getNextParagraphLength(){return N.getCurrentParagraphLength(1)}getPreviousParagraphLength(){return N.getCurrentParagraphLength(-1)}getParagraphIndex(){throw new Error("Method not implemented.")}getParagraphText(){throw new Error("Method not implemented.")}getTextFromStartOfParagraph(){throw new Error("Method not implemented.")}getCursorPosition(){throw new Error("Method not implemented.")}getSelection(){throw new Error("Method not implemented.")}getParagraphLength(t){throw new Error("Method not implemented.")}getListItemLevel(){throw new Error("Method not implemented.")}findItemToContinueBulletedList(t){throw new Error("Method not implemented.")}findItemToContinueNumberedList(t,e){throw new Error("Method not implemented.")}}class H{constructor(){this.textLength=null,this.currentLineLength=null,this.linesCount=null}update(t,e,n){return(t!==this.textLength||e!==this.currentLineLength||n!==this.linesCount)&&(this.textLength=t,this.currentLineLength=e,this.linesCount=n,!0)}}class W{constructor(t,e,n,r,i,o,a,c){this._inputTextValidator=r,this._listStyleSheetManager=null,this._colorPalette=null,this._fontService=null,this._useSimpleFontList=!1,this._range=null,this._inlineStyle=null,this._defaultInlineStyle=null,this._paragraphStyle=null,this._defaultParagraphStyle=null,this._usedColors=[],this._previewScale=1,this.styleChanged=new s.a,this.editorInitialized=new s.a,this._ready=!1,this._textMetrics=null,this._textLimits=null,this._limitsInputValidator=null,this._currentTextInfo=null,this._elementHandler=t,this._invalidCharEntered=new s.a,this._isActive=!1,this._frameChangedEvent=new s.a,this._textLimitsViolationEvent=new s.a,this._textMetricsChangedEvent=new s.a,this._designAtomsApiClient=i,this._colorPreviewService=o,this._rgbColorParser=c,this._colorParser=a,document.onselectionchange=async t=>{await this._onSelectionChange()},this._fontService=e,this._useSimpleFontList=n,this._designAtomsApiClient.getFontsCSS(Object.keys(e.availableFontsByPsName),!this._useSimpleFontList).then((t=>{this._elementHandler.addTextEditorStyles(t),this._ready=!0,this.editorInitialized.fire()})).catch((t=>{console.error(`Unable to get FontsCss. Reason: ${t}`)})),this._htmlSerializer=new j(this._fontService,this._colorPreviewService,this._colorParser,this._useSimpleFontList),this._gmXmlParser=new l.a(this._colorParser),this._htmlParser=new L(this._colorPalette,this._fontService,this._useSimpleFontList,this._colorParser,this._colorPreviewService),this._GmXmlSerializer=new u.a(this._colorParser)}get highlightInEditingModeEnabled(){return!1}get redrawActiveTextInEditMode(){return!1}get frameChanged(){return this._frameChangedEvent}get invalidCharEntered(){return this._invalidCharEntered}get textMetrics(){return this._textMetrics}get textLimits(){return this._textLimits}get canUndo(){return document.queryCommandEnabled("undo")}get canRedo(){return document.queryCommandEnabled("redo")}get isActive(){return this._isActive}get isReady(){return this._ready}get textMetricsChangedEvent(){return this._textMetricsChangedEvent}get textLimitsViolationEvent(){return this._textLimitsViolationEvent}get _div(){return this._elementHandler.textEditorDiv}get _innerDiv(){return this._elementHandler.textEditorInnerDiv}isApplyingListsEnabled(){return!0}executeCommand(t,e){if(29!==t)throw new Error("Method not implemented.");{const t=N.saveSelection(this._innerDiv);t(),1===(null==e?void 0:e.listType)&&document.execCommand("insertUnorderedList"),2===(null==e?void 0:e.listType)&&document.execCommand("insertOrderedList");let n=N.findAllSelectedLis();if(0!==n.length&&N.isAnyList(n[0].parentElement)){const t=N.getAdjacentLi(n);t?N.setAdjacentLiStyle(n,t):N.setListStyle(n,null==e?void 0:e.listType)}else N.wrapSpansWithP();t()}}getTextModel(){throw new Error("Method not implemented.")}initialize(t,e,n){this._initData=t,N.setInitData(t),this._colorPalette=e,this._listStyleSheetManager=n}isBulletedList(){let t=document.getSelection().anchorNode;for(;t;){if(N.isBulletedList(t))return!0;t=t.parentNode}return!1}isNumberedList(){let t=document.getSelection().anchorNode;for(;t;){if(N.isNumberedList(t))return!0;t=t.parentNode}return!1}getTextMetrics(){return this._textMetrics}getParagraphLength(t){return N.getParagraphLengthByIndex(t)}isIndentationEnabled(){return!1}isIndentationHidden(){return!0}async enterEditMode(t){var e,n,r,i,o,a;this._isActive=!0,this._initData.point=t;const s=this._initData;this._previewScale=null!==(e=s.previewScale)&&void 0!==e?e:1,N.setPreviewScale(this._previewScale);const l=null===(n=s.textFormattingEnabled)||void 0===n||n,u=this._gmXmlParser.parse(s.text,this._colorPalette,null,this._listStyleSheetManager),c=await this._htmlSerializer.serialize(u,this._colorPalette,this._previewScale);this._elementHandler.showTextEditor(s.rectangle,s.textAlignment,c,s.borderWidth,s.borderColor,s.fillColor,s.opacity,s.textVerticalAlignment,s.isVertical),await this._setDefaultStyles(s.defaultInlineStyle,s.defaultParagraphStyle),this._currentTextInfo=new D(this._elementHandler.textEditorInnerDiv),this._limitsInputValidator=new z.b(this._currentTextInfo),this._limitsInputValidator.setLimits(this._initData.limits),this._textLimits={characterLimit:null===(r=this._initData.limits)||void 0===r?void 0:r.characterLimit,maxLineCount:null===(i=this._initData.limits)||void 0===i?void 0:i.maxLineCount,maxLineLength:null===(o=this._initData.limits)||void 0===o?void 0:o.maxLineLength,isSingleLineText:null===(a=this._initData.limits)||void 0===a?void 0:a.isSingleLineText},null===this._textMetrics&&(this._textMetrics=new H),this._innerDiv.addEventListener("mousedown",(()=>{this._updateTextMetrics()})),this._innerDiv.addEventListener("keydown",(t=>{const e=this._convertInputEventToKeyboardCommand(t),n=this._limitsInputValidator.validateInput(e);if(n.isViolated&&(t.preventDefault(),this._updateLimitsEvent(n.limitsViolated,n.pastedLimitsViolated)),"Enter"===t.key&&N.processEnterOnEmptyListItem(t,this._innerDiv),"Backspace"===t.key&&N.isCaretOnTheBeginingOfListItem()){t.preventDefault();const e={listType:this.isBulletedList()?1:2};this.executeCommand(29,e)}if(A.a.containsRtlChars(t.key)){t.preventDefault();const e=t.key;this._validateInputText(e,(()=>{N.insertTextAtCaret(e)}))}})),this._innerDiv.addEventListener("input",(t=>{this._updateTextMetrics(),/^<(p|ul|ol)/.test(this._innerDiv.innerHTML)||(document.execCommand("selectAll"),document.execCommand("formatblock",!1,"p")),"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||document.getSelection().collapseToEnd()})),this._innerDiv.addEventListener("keyup",(()=>{this._updateTextMetrics()})),this._innerDiv.addEventListener("mouseup",(()=>{this._updateTextMetrics()})),l||this._div.addEventListener("beforeinput",(t=>{["formatBold","formatItalic","formatUnderline","formatSuperscript","formatSubscript","formatJustifyFull","formatJustifyCenter","formatJustifyRight","formatJustifyLeft","formatFontColor","formatFontName"].includes(t.inputType)&&t.preventDefault()})),this._innerDiv.addEventListener("paste",(t=>{t.preventDefault();const e=t.clipboardData.getData("text/plain").replace(/\r\n/g,"\n");this._limitsInputValidator.validatePastedText(e).pastedLimitsViolated?this._updateLimitsEvent(!0,!0):this._validateInputText(e,(()=>{document.execCommand("insertText",!1,e)}))})),this._innerDiv.addEventListener("copy",(t=>{const e=document.getSelection().toString().replace(/\n\n/g,"\n");t.clipboardData.setData("text/plain",e),t.preventDefault()})),this._usedColors=[]}exitEditMode(){this._isActive=!1,this._colorPalette=null,this._elementHandler.hideTextEditor()}ensureFocus(){this._innerDiv.focus()}async getFormattedText(){this._updateColors();const t=this._elementHandler.getTextEditorFormattedText(),e=await this._htmlParser.parse(t,this._colorPalette,this._previewScale);return this._GmXmlSerializer.serialize(e,this._colorPalette)}undo(){document.execCommand("undo")}redo(){document.execCommand("redo")}processMouseEvent(t){}async processKeyEvent(t){return!0}async processZoomChangedEvent(){return!1}redraw(){}dispose(){}getInlineStyle(){return this.isActive?this._inlineStyle:null}async setInlineStyle(t){if(!this.isActive)return;if(this._removeCurrentStyles(t,this._inlineStyle),S.isEmpty(t))return;const e=this._inlineStyleToCommands(t);if(0==e.length)return;this._focusOnDiv();const n=e[0];if(1==e.length&&M.documentCommands.includes(n.key))if(n.key==M.color){const t=n.value;if(null!=t){const e=await this._colorPreviewService.getPreviewAsync(t.color);document.execCommand("foreColor",!1,e.toString()),this._usedColors.push({preview:e.toString(),color:t.color})}else console.warn("Incorrect color value")}else document.execCommand(n.key,!1,n.value);else await N.customInlineCommand(e,this._range,this._innerDiv,this._colorPalette,this._colorPreviewService);null==this._range||this._range.collapsed||await this._onSelectionChange(!1),await this._updateStyles()}getParagraphStyle(){return this.isActive?this._paragraphStyle:null}async setParagraphStyle(t){if(!this.isActive)return;if(this._removeCurrentStyles(t,this._paragraphStyle),S.isEmpty(t))return;const e=N.paragraphStyleToCommands(t);if(0==e.length)return;const n=e[0];1==e.length&&M.documentCommands.includes(n.key)?(this._innerDiv.focus(),document.execCommand(n.key,!1,n.value)):await this._customParagraphCommand(e),await this._updateStyles()}_validateInputText(t,e){this._inputTextValidator.validateWithConfirmation(t).then((t=>{t.isTextValid?e():!0===t.isInputConfirmed&&(this.ensureFocus(),e(),this._invalidCharEntered.notify())}))}_convertInputEventToKeyboardCommand(t){return"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Shift"===t.key||"Alt"===t.key||"Control"===t.key||"Windows"===t.key||"CapsLock"===t.key||"NumLock"===t.key||"Clear"===t.key||"Home"===t.key||"PageUp"===t.key||"PageDown"===t.key||"End"===t.key||"NumLock"===t.key||"Insert"===t.key||"ScrollLock"===t.key||"Pause"===t.key||"F1"===t.key||"F2"===t.key||"F3"===t.key||"F4"===t.key||"F5"===t.key||"F6"===t.key||"F7"===t.key||"F8"===t.key||"F9"===t.key||"F10"===t.key||"F11"===t.key||"F12"===t.key||"Escape"===t.key||"ContextMenu"===t.key||"Meta"===t.key||"Tab"===t.key?null:"Backspace"==t.key?{type:F.InputCommandType.deleteToLeft}:"Delete"==t.key?{type:F.InputCommandType.deleteToRight}:"Enter"==t.key?{type:F.InputCommandType.insertNewLine}:t.ctrlKey?null:{type:F.InputCommandType.insertChar}}_updateTextMetrics(){if(!this._isActive)return;const t=this._textMetrics.update(this._innerDiv.textContent.length,N.getCurrentParagraphLength(),N.getCorrectLinesCount(this._innerDiv));this._currentTextInfo.updateTextMetrics(this._textMetrics),t&&this._textMetricsChangedEvent.notify(this._textMetrics)}_updateColors(){const t=this._innerDiv.querySelectorAll("span[style*=color]");for(let e=0;e<t.length;e++){const n=t.item(e);if(o.l(n.style.color))return;const r=this._rgbColorParser.parse(n.style.color),i=this._findUsedColor(r);if(null==i)return;const a=this._colorPalette.addColorToPaletteReturnIndex({color:i,preview:r});j.setColorIndex(n,a)}}_findUsedColor(t){if(null==t)return null;const e=this._usedColors.find((e=>this._colorParser.parse(e.preview).equals(t)));return null!=e?e.color:null}_focusOnDiv(){const t=document.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null;null!=e&&this._innerDiv.contains(e.commonAncestorContainer)||(this._innerDiv.focus(),t.removeAllRanges(),t.addRange(this._range))}async _onSelectionChange(t=!0){if(null==this._innerDiv)return;const e=document.getSelection(),n=e.rangeCount>0?e.getRangeAt(0):null;null!=n&&this._innerDiv.contains(n.commonAncestorContainer)&&(this._range=n,this._currentTextInfo.updateSelection(e),this._updateTextMetrics(),t&&await this._updateStyles())}async _updateStyles(){if(!this.isActive)return;const t=await this._updateInlineStyles(),e=this._updateParagraphStyles();(t||e)&&this.styleChanged.fire()}async _updateInlineStyles(){if(null==this._range||this._range.startContainer==this._innerDiv)return!1;const t=N.getDefaultInlineStyle(this._defaultInlineStyle),e=async n=>{if(n&&(N.isParagraph(n)||await e(n.parentNode),N.isSpan(n))){const e=n.attributes.style,r=Object(h.b)(null!=e?e.value:null),i=n.attributes.colordata,o=Object(h.b)(null!=i?i.value:null),a=L.getElementFontValue(n,this._innerDiv);if(null!=a){const e=L.getFontSettings(a,this._fontService,this._useSimpleFontList);null!=e.postScriptName&&(t.font.postScriptName=e.postScriptName),null!=e.fauxBold&&(t.font.fauxBold=e.fauxBold),null!=e.fauxItalic&&(t.font.fauxItalic=e.fauxItalic)}const s=L.getFontSizeValue(r,this._previewScale);null!=s&&(t.font.size=s);const l=L.getUnderlineValue(r);null!=l&&(t.underline=l);const u=L.getAllCapsValue(r);null!=u&&(t.font.allCaps=u);const c=L.getLeadingValue(r,this._previewScale);null!=c&&(t.leading=c);const p=L.getTrackingValue(r);null!=p&&(t.tracking=p);const f=L.getSubValue(r);null!=f&&(t.subscript=f);const d=L.getSupValue(r);null!=d&&(t.superscript=d);const g=L.getOpenTypeValue(r);null!=g&&(t.openType=g);const m=null!=r.color?this._rgbColorParser.parse(r.color):null,y=this._findUsedColor(m);if(null!=y)t.color={color:y,preview:m};else{const e=await this._htmlParser.getColorValue(r,o,this._colorPalette);null!=e&&(t.color=this._colorPalette.getPaletteColorAt(e))}const _=await this._htmlParser.getStrokeValue(r,o,this._colorPalette,this._previewScale);if(null!=_){let e=!1;t.stroke={},null!=_.size&&(t.stroke.size=_.size,e=t.stroke.size>0),null!=_.colorIndex&&(t.stroke.color=this._colorPalette.getPaletteColorAt(_.colorIndex),e=e||!t.stroke.color.color.isTransparent),t.stroke.enabled=e}}};return await e(this._range.startContainer),!S.isEqual(this._inlineStyle,t)&&(this._inlineStyle=t,!0)}_updateParagraphStyles(){if(null==this._range||this._range.startContainer==this._innerDiv)return!1;const t=this._getDefaultParagraphStyle(),e=n=>{if(N.isParagraph(n)||N.isListItem(n)){const e=n.attributes.style,r=Object(h.b)(null!=e?e.value:null),i=L.getAlignmentValue(r);null!=i&&(t.alignment=i);const o=L.getFirstLineIndentValue(r,this._previewScale);null!=o&&(t.firstLineIndent=o);const a=L.getSpaceAfterValue(r,this._previewScale);null!=a&&(t.spaceAfter=a);const s=L.getSpaceBeforeValue(r,this._previewScale);null!=s&&(t.spaceBefore=s);const l=L.getLeftIndentValue(r,this._previewScale);null!=l&&(t.leftIndent=l);const u=L.getRightIndentValue(r,this._previewScale);null!=u&&(t.rightIndent=u)}else n&&e(n.parentNode)};return e(this._range.startContainer),!S.isEqual(this._paragraphStyle,t)&&(this._paragraphStyle=t,!0)}_removeCurrentStyles(t,e){S.keys(t).forEach((n=>{const r=e[n],i=t[n];null!=r?"stroke"===n?(S.isEqual(i,r)||i.enabled===r.enabled&&i.size===r.size&&i.color instanceof a.Color&&i.color.equals(r.color))&&delete t[n]:"openType"===n||(i instanceof a.Color?i.equals(r)&&delete t[n]:i instanceof Object?this._removeCurrentStyles(i,r):i===r&&delete t[n]):console.warn(`_removeCurrentStyles: Incorrect current value state: key ${n} not found`)}))}_inlineStyleToCommands(t){const e=[];if(null!=t.font){const n=j.fontSettingsToHtmlValue(t.font,this._fontService,this._useSimpleFontList);if(null!=n){if(null!=this._inlineStyle){const t=j.fontSettingsToHtmlValue(this._inlineStyle.font,this._fontService,this._useSimpleFontList);this._removeCurrentStyles(n,t)}null!=n.family&&e.push({key:M.fontName,value:n.family}),null!=n.bold&&e.push({key:M.bold,value:n.bold}),null!=n.italic&&e.push({key:M.italic,value:n.italic})}null!=t.font.size&&e.push({key:M.fontSize,value:t.font.size}),null!=t.font.allCaps&&e.push({key:M.allCaps,value:t.font.allCaps})}return null!=t.underline&&e.push({key:M.underline,value:t.underline}),null!=t.leading&&e.push({key:M.leading,value:t.leading}),null!=t.tracking&&e.push({key:M.tracking,value:t.tracking}),null!=t.color&&e.push({key:M.color,value:t.color}),null!=t.stroke&&e.push({key:M.stroke,value:t.stroke}),null!=t.subscript&&e.push({key:M.subscript,value:t.subscript}),null!=t.superscript&&e.push({key:M.superscript,value:t.superscript}),null!=t.openType&&e.push({key:M.openType,value:t.openType}),e}async _customParagraphCommand(t){if(null==this._range)return;const e=document.getSelection(),n=this._div.cloneNode();for(let r=0;r<this._innerDiv.childNodes.length;r++){const i=this._innerDiv.childNodes.item(r);if(!N.isParagraph(i))return;const o=i.cloneNode(!0);e.containsNode(i,!0)&&await N.applyCommands(o,t,this._colorPalette,this._colorPreviewService),n.appendChild(o)}this._innerDiv.focus(),document.execCommand("selectAll"),document.execCommand("insertHTML",!1,n.innerHTML),await this._onSelectionChange(!1)}async _setDefaultStyles(t,e){this._inlineStyle=null,this._defaultInlineStyle=t,this._paragraphStyle=null,this._defaultParagraphStyle=e;const n=this._inlineStyleToCommands(t),r=N.paragraphStyleToCommands(e,!1);await N.applyCommands(this._innerDiv,[...n,...r],this._colorPalette,this._colorPreviewService)}_getDefaultParagraphStyle(){return S.clone(this._defaultParagraphStyle)}_updateLimitsEvent(t=!1,e=!1){const n={isLimitsBroken:t,isPastePrevented:e};this._textLimitsViolationEvent.notify(n)}}var U=n(419),V=n(744),q=n(743),G=n(520),$=n(451),X=n(406);function K(t,e){void 0!==t&&null!=t&&e(t)}var Y=n(426),J=n(581),Z=n(485),Q=n(484),tt=n(449);class et{}class nt{constructor(t){this._parser=new l.a(t),this._serializer=new u.a(t)}extract(t,e,n,r){let i=this._parser.parse(t,e,n,r),{spanStyle:o,paragraphStyle:a}=this._calculateDefaultStyles(i);return this._removeDefaultStyles(i,a,o),{text:this._serializer.serialize(i,e),paragraphStyle:a,spanStyle:o}}_calculateDefaultStyles(t){if(!t)throw new X.b("text parameter must not be null.");var e={spanStyle:null,paragraphStyle:null};const n=new Map,r=new Map;if(t.blocks)for(let i of t.blocks)i instanceof c.Paragraph&&this._processParagraph(i,n,r);return e.paragraphStyle=this._buildParagraphStyle(n),e.spanStyle=this._buildSpanStyle(r),e}_buildSpanStyle(t){const e=this._processStyleCollection(t),n=(t,n)=>{e.has(t)&&n(e.get(t))};var r=new E.c;return n(Q.a.color,(t=>r.color=t)),n(Q.a.fontName,(t=>r.fontName=t)),n(Q.a.fontSize,(t=>r.fontSize=t)),n(Q.a.bold,(t=>r.bold=t)),n(Q.a.italic,(t=>r.italic=t)),n(Q.a.allCaps,(t=>r.allCaps=t)),n(Q.a.leading,(t=>r.leading=t)),n(Q.a.openType,(t=>r.openTypeFeatures=t)),n(Q.a.tracking,(t=>r.tracking=t)),n(Q.a.underline,(t=>r.underline=t)),n(Q.a.penWidth,(t=>r.penWidth=t)),n(Q.a.penColor,(t=>r.penColor=t)),r}_buildParagraphStyle(t){var e,n,r=this._processStyleCollection(t),i=new J.c;return e=Z.b.alignment,r.has(e)&&(n=r.get(e),i.alignment=n),i}_processParagraph(t,e,n){var r;this._addStyleValue(e,Z.b.alignment,null===(r=t.style)||void 0===r?void 0:r.alignment),t.inlineElements&&this._processTopLevelInlineElements(t.inlineElements,n)}_processTopLevelInlineElements(t,e){for(let n of t)n instanceof E.b?this._processTopLevelSpanStyle(n.style,e):n instanceof c.InlineText&&this._processTopLevelSpanStyle(null,e)}_addStyleValue(t,e,n){if(t.has(e)){const r=t.get(e);null==n&&(r.hasEmptyValue=!0)}else{const r=new et;null==n?r.hasEmptyValue=!0:(r.value=n,r.hasEmptyValue=!1),t.set(e,r)}}_processTopLevelSpanStyle(t,e){this._addStyleValue(e,Q.a.color,null==t?void 0:t.color),this._addStyleValue(e,Q.a.fontName,null==t?void 0:t.fontName),this._addStyleValue(e,Q.a.fontSize,null==t?void 0:t.fontSize),this._addStyleValue(e,Q.a.bold,null==t?void 0:t.bold),this._addStyleValue(e,Q.a.italic,null==t?void 0:t.italic),this._addStyleValue(e,Q.a.allCaps,null==t?void 0:t.allCaps),this._addStyleValue(e,Q.a.leading,null==t?void 0:t.leading),this._addStyleValue(e,Q.a.openType,null==t?void 0:t.openTypeFeatures),this._addStyleValue(e,Q.a.tracking,null==t?void 0:t.tracking),this._addStyleValue(e,Q.a.underline,null==t?void 0:t.underline),this._addStyleValue(e,Q.a.penWidth,null==t?void 0:t.penWidth),this._addStyleValue(e,Q.a.penColor,null==t?void 0:t.penColor)}_processStyleCollection(t){const e=new Map;for(let[n,r]of t)!1===r.hasEmptyValue&&e.set(n,r.value);return e}_removeDefaultStyles(t,e,n){if(t.blocks)for(let r of t.blocks)r instanceof c.Paragraph&&(this._removeDefaultStylesFromParagraph(r,e),r.inlineElements&&this._removeDefaultStylesFromInlineElements(r.inlineElements,n,[]))}_removeDefaultStylesFromInlineElements(t,e,n){for(let r of t)if(r instanceof E.b&&(this._removeDefaultStylesFromSpan(r,e,n),r.content)){const t=[r,...n];this._removeDefaultStylesFromInlineElements(r.content,e,t)}}_removeDefaultStylesFromSpan(t,e,n){if(!t.style)return;const r=(t,e)=>{if(t instanceof tt.a)return t.equals(e);if(t instanceof c.NumericValue)return t.equals(e);if(t instanceof Array){if(!(e instanceof Array))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1;return!0}return t instanceof E.a?t.equals(e):t===e},i=i=>{const o=e[i],a=t.style[i];if(null!=o){const e=((t,e)=>{if(0==n.length)return!1;for(let i of n){if(!i.style)continue;const n=i.style[t];if(null!=n&&!r(e,n))return!0}return!1})(i,o);r(o,a)&&!e&&(t.style[i]=null)}};i("allCaps"),i("bold"),i("color"),i("italic"),i("fontName"),i("fontSize"),i("leading"),i("openTypeFeatures"),i("penWidth"),i("penColor"),i("tracking"),i("underline")}_removeDefaultStylesFromParagraph(t,e){t.style&&null!=e.alignment&&e.alignment===t.style.alignment&&(t.style.alignment=null)}}var rt,it=n(761),ot=n(531),at=n(589),st=n(591),lt=n(432);!function(t){t[t.Static=0]="Static",t[t.Active=1]="Active",t[t.InEdit=2]="InEdit"}(rt||(rt={}));var ut,ct,ht=n(421),pt=n(741);!function(t){t[t.noProcessingRequired=0]="noProcessingRequired",t[t.toProcessInEditMode=1]="toProcessInEditMode",t[t.enterToEditMode=2]="enterToEditMode",t[t.exitFromEditMode=3]="exitFromEditMode",t[t.outsideSelection=4]="outsideSelection"}(ut||(ut={})),function(t){t[t.Text=0]="Text",t[t.Frame=1]="Frame",t[t.WrappingPath=2]="WrappingPath",t[t.Initialization=3]="Initialization"}(ct||(ct={}));var ft,dt=n(425),gt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},mt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},yt=function(){function t(t,e){this._itemHandler=t,this._colorPreviewService=e}return Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(t){this._text=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rectangle",{get:function(){return this._rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"previewScale",{get:function(){return this._previewScale},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"frames",{get:function(){return this._frames},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wrappingPath",{get:function(){return this._wrappingPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"colorPalette",{get:function(){return this._colorPalette},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultCharStyle",{get:function(){return this._defaultCharStyle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultParagraphStyle",{get:function(){return this._defaultParagraphStyle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTextVertical",{get:function(){return this._isTextVertical},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isTextBounded",{get:function(){return this._isTextBounded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"overflowStrategy",{get:function(){return this._overflowStrategy},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstBaselineOffset",{get:function(){return this._firstBaselineOffset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstBaselineMinOffset",{get:function(){return this._firstBaselineMinOffset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFitToPath",{get:function(){return this._isFitToPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),t.prototype.getActualFrames=function(){return this._itemHandler.getFramesData()},t.prototype.update=function(e){return void 0===e&&(e=null),gt(this,void 0,void 0,(function(){var n,r,o,a,s,l,u,c,h,p,f,d,g,m,y,_,b;return mt(this,(function(v){switch(v.label){case 0:return n=this._itemHandler.item,r=this._itemHandler,o=r instanceof lt.j&&n instanceof i.q,a=r instanceof lt.k&&n instanceof i.x,s=r instanceof lt.l&&n instanceof i.eb,this._text=null!=e?e:r.getTextForRendering(),this._rectangle=r.rectangle.toRectangleF(),this._previewScale=n.previewScale,this._frames=r.getFramesData(),this._wrappingPath=r.getWrappingPathData(),l=this,[4,this._getColorPalette(r)];case 1:return l._colorPalette=v.sent(),this._colorPalette.add_itemAdded((function(t){return r.item.colorPalette.add(t.item.color)})),u=this,[4,t.getDefaultInlineStyle(n,this._colorPreviewService)];case 2:return u._defaultCharStyle=v.sent(),this._defaultParagraphStyle=t.getDefaultParagraphStyle(n),this._isTextBounded=o,c=!1,h=null,p=null,f=null,d=null,g=null,m=null,y=null,o&&(h=(_=n).overflowStrategy,p=_.verticalAlignment,f=_.firstBaselineOffset,d=_.firstBaselineMinOffset,c=_.isVertical),a&&(g=(b=n).fitToPath,m=b.start,y=b.end),s&&(c=n.isVertical),this._isTextVertical=c,this._verticalAlignment=p,this._overflowStrategy=h,this._firstBaselineOffset=f,this._firstBaselineMinOffset=d,this._isFitToPath=g,this._start=m,this._end=y,[2]}}))}))},t.prototype._getColorPalette=function(t){return gt(this,void 0,void 0,(function(){var e,n=this;return mt(this,(function(r){switch(r.label){case 0:return[4,Promise.all(t.item.colorPalette.select((function(t){return gt(n,void 0,void 0,(function(){var e;return mt(this,(function(n){switch(n.label){case 0:return e={color:t},[4,this._colorPreviewService.getPreviewAsync(t)];case 1:return[2,(e.preview=n.sent(),e)]}}))}))})))];case 1:return e=r.sent(),[2,new dt.a(e)]}}))}))},t.getDefaultInlineStyle=function(t,e){return gt(this,void 0,void 0,(function(){var n,r,i,o,s,l;return mt(this,(function(u){switch(u.label){case 0:return r={font:{postScriptName:t.font.postScriptName,size:t.font.size,fauxBold:t.font.fauxBold,fauxItalic:t.font.fauxItalic,allCaps:t.font.allCaps},underline:t.underline,leading:t.leading,tracking:t.tracking},i={color:t.color.clone()},[4,e.getPreviewAsync(t.color)];case 1:return r.color=(i.preview=u.sent(),i),(n=r).baselineShift=t.baselineShift,n.horizontalScale=t.horizontalScale,n.verticalScale=t.verticalScale,o={},null==t.stroke?[3,3]:(s=o,l={color:t.stroke.color.clone()},[4,e.getPreviewAsync(t.stroke.color)]);case 2:return s.color=(l.preview=u.sent(),l),o.size=t.stroke.size,o.enabled=o.size>0&&!o.color.color.isTransparent,[3,4];case 3:o.color={color:new a.RgbColor(0,0,0,0),preview:new a.RgbColor(0,0,0,0)},o.size=0,o.enabled=!1,u.label=4;case 4:return n.stroke=o,t.font.openTypeFeatures.length>0&&(n.openType=t.font.openTypeFeatures.map((function(t){var e=t.tag,n=t.value;return new c.OpenTypeFeature(e,n)}))),[2,n]}}))}))},t.getDefaultParagraphStyle=function(t){var e={alignment:t.alignment};return(t instanceof i.q||t instanceof i.ab)&&(e.firstLineIndent=t.paragraphSettings.FirstLineIndent,e.spaceAfter=t.paragraphSettings.SpaceAfter,e.spaceBefore=t.paragraphSettings.SpaceBefore,e.leftIndent=t.paragraphSettings.LeftIndent,e.rightIndent=t.paragraphSettings.RightIndent),e},t}(),_t=n(594),bt=function(){return bt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},bt.apply(this,arguments)},vt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},wt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ct=function(){function t(t){var e=this;this._exitedEditModeEvent=new s.c,this._enteredEditModeEvent=new s.c,this._userZoomInProgress=!1,this._onMobileTextEditorInitialized=function(){e._waitMobileTextEditorInit=!1,e._itemHandler===e._canvas.currentItemHandler?e.enterEditMode(0,0):e._canvas.redraw()},this._onSelectedItemHandlerChanged=function(){return vt(e,void 0,void 0,(function(){return wt(this,(function(t){switch(t.label){case 0:return this._textState!==rt.InEdit?[3,2]:[4,this.exitEditMode()];case 1:t.sent(),t.label=2;case 2:return[4,this._setTextState(this.isOnlyThisItemSelected()?rt.Active:rt.Static)];case 3:return t.sent(),[2]}}))}))},this._onCanvasSelectionLocked=function(){e.isStatic||(e._isTextImageValid=!1,e._updateTextImage())},this._onTextStateChanged=function(){return vt(e,void 0,void 0,(function(){return wt(this,(function(t){switch(t.label){case 0:return!this.ready||this._userZoomInProgress?[2]:this.isStatic&&this._isTextImageValid||this.isMobile&&this.isInEdit?[3,2]:[4,this._updateText(ct.Frame)];case 1:t.sent(),t.label=2;case 2:return this._redrawText(),[2]}}))}))},this._onCanvasScroll=function(){e._textState==rt.InEdit&&e._textEditor.processZoomChangedEvent()},this._onCanvasZoomChanged=function(t){return vt(e,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return this._userZoomInProgress=!t.fullUpdate,t.fullUpdate?this._textState===rt.InEdit?[3,2]:[4,this._setTextState(this.isOnlyThisItemSelected()?rt.Active:rt.Static)]:[3,3];case 1:e.sent(),e.label=2;case 2:this._isTextImageValid=!1,this._redrawText(),e.label=3;case 3:return this._textState==rt.InEdit&&this._textEditor.processZoomChangedEvent(),[2]}}))}))},this._onFrameChanged=function(t){e.updateItemHandler(t)},this._onStyleChanged=function(){e.updateItemHandler(),e._canvas.redrawDesign(),e._canvas.updateSelection()},this._onInvalidInput=function(){return vt(e,void 0,void 0,(function(){return wt(this,(function(t){switch(t.label){case 0:return[4,this.exitEditMode()];case 1:return t.sent(),[2]}}))}))},this._itemHandler=t,this._canvas=this._itemHandler.canvas,this._textRenderer=this._canvas.textRenderer,this._activeTextCanvasHandler=this._canvas.activeTextCanvasHandler,this._listStyleSheetManagerFactory=new z.d(this._getListSettingFromConfig(this._canvas.viewer.configuration.listSettings)),this._listStyleSheetManager=this._listStyleSheetManagerFactory.create(),this._colorPreviewService=this._itemHandler.colorPreviewService,this._tw=this._createEngineWrapper(),this._textStateValue=this.isOnlyThisItemSelected()?rt.Active:rt.Static,this._textImageChanged=new s.a,this._initialFormattedText="",this._isEnterToEditModeLocked=!1,this._isExitFromEditModeLocked=!1,this._mouseDownStartedInside=!1,this._waitMobileTextEditorInit=!1,this._isTextImageValid=!1,this._isDisposed=!1,this._isCropped=null,this._ready=!1,this._failed=!1,this.bindToCanvas()}return Object.defineProperty(t.prototype,"_textEditor",{get:function(){return this._canvas.textEditor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isMobile",{get:function(){return this._textEditor instanceof W},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){return this._ready},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"failed",{get:function(){return this._failed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isStatic",{get:function(){return this._textState===rt.Static},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this._textState===rt.Active},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInEdit",{get:function(){return this._textState===rt.InEdit},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCropped",{get:function(){return null==this._isCropped&&(this._isCropped=this._tw.textMeasurer.isTextCropped()),this._isCropped},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enteredEditModeEvent",{get:function(){return this._enteredEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exitedEditModeEvent",{get:function(){return this._exitedEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeTextEditor",{get:function(){return this._textState===rt.InEdit?this._textEditor:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canRedo",{get:function(){return this._textEditor.canRedo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canUndo",{get:function(){return this._textEditor.canUndo},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){return vt(this,void 0,void 0,(function(){return wt(this,(function(t){switch(t.label){case 0:return[4,this._initEngineWrapper()];case 1:return t.sent(),[2]}}))}))},t.prototype.enterEditMode=function(t,e){return vt(this,void 0,void 0,(function(){var n,r,o=this;return wt(this,(function(a){switch(a.label){case 0:return(this._itemHandler.item.textPermissions.allowChangeText||this._canvas.ignorePermissionsMode)&&this._textEditor?this._textEditor.isActive||this._isEnterToEditModeLocked?(console.warn("TextEditorController: Cannot enter to edit mode when the editor is active"),[2]):(this._isEnterToEditModeLocked=!0,n=function(t){return vt(o,void 0,void 0,(function(){var e;return wt(this,(function(n){switch(n.label){case 0:return[4,this._setTextState(rt.InEdit)];case 1:return n.sent(),this._initialFormattedText=this._itemHandler.isEmptyTextPlaceholder()?"":this._itemHandler.item.text,this._itemHandler instanceof lt.j&&(null===(e=this._itemHandler.item)||void 0===e?void 0:e.overflowStrategy)==i.X.ExpandBox&&(this._initialBoundedRect=this._itemHandler.getTextRectangle().toRectangleF()),[4,this._initEngineWrapper(this._initialFormattedText)];case 2:return n.sent(),[4,this._initActiveTextEditor()];case 3:return n.sent(),this._bindToEditor(),this._textEditor.enterEditMode(t),this._setCanvasForEnterToEdit(),this._enteredEditModeEvent.notify(this),this._isEnterToEditModeLocked=!1,[2]}}))}))},r={x:t,y:e},this._textEditor instanceof st.a&&!this._itemHandler.item.transform.isEmpty?[4,this._itemHandler.frontEndUpdate()]:[3,2]):[2];case 1:a.sent(),a.label=2;case 2:return[4,n(r)];case 3:return a.sent(),[2]}}))}))},t.prototype.exitEditMode=function(t){return void 0===t&&(t=!1),vt(this,void 0,void 0,(function(){var e;return wt(this,(function(n){switch(n.label){case 0:return null==this._textEditor||this._isExitFromEditModeLocked?[2]:(this._isExitFromEditModeLocked=!0,[4,this._textEditor.getFormattedText()]);case 1:return e=n.sent(),this._textEditor.exitEditMode(),this._unbindFromEditor(),this._updateItemListStyles(),this._itemHandler.item.isTextPlaceholder&&""===e&&this._restorePlaceholderText(),this._initialFormattedText===e?[3,3]:[4,this._handleTextChanged(e)];case 2:n.sent(),n.label=3;case 3:return[4,this._setTextState(t?rt.Active:rt.Static)];case 4:return n.sent(),this._setCanvasForExitFromEdit(),this._exitedEditModeEvent.notify(this),this._isExitFromEditModeLocked=!1,[2]}}))}))},t.prototype.updateItemHandler=function(t){this._isCropped=null;var e=this._itemHandler.item,n=this._itemHandler,r=n instanceof lt.l,o=n instanceof lt.k,a=n instanceof lt.h,s=n instanceof lt.j&&e instanceof i.q,l=s?e.overflowStrategy:null;if(r||o||a){var u=t;(null==t||t.isEmpty())&&(u=this.measureText()),this._itemHandler.updateRectangle(u),this._canvas.redrawDesign()}else if(s&&l===i.X.ExpandBox){var c=null!=t?t:this.measureTextFrame(!0);if(c&&!c.isEmpty())if(c.height>this._initialBoundedRect.height){var h=this._initialBoundedRect.clone();h.height=c.height+1.5,this._itemHandler.updateRectangle(h)}else this._itemHandler.updateRectangle(this._initialBoundedRect);this._tw.textHandler.setTextFrames(this._itemHandler.getFramesData(),!1),this._canvas.redrawDesign(),this._canvas.updateSelection(),this._itemHandler.raiseChanged()}else this._itemHandler.raiseChanged()},t.prototype.bindToCanvas=function(){this._canvas.add_onScroll(this._onCanvasScroll),this._canvas.add_zoomChanged(this._onCanvasZoomChanged),this._canvas.add_selectedItemHandlerChanged(this._onSelectedItemHandlerChanged),this._canvas.add_onSelectionLocked(this._onCanvasSelectionLocked)},t.prototype.unbindFromCanvas=function(){var t,e,n,r;null===(t=this._canvas)||void 0===t||t.remove_onScroll(this._onCanvasScroll),null===(e=this._canvas)||void 0===e||e.remove_zoomChanged(this._onCanvasZoomChanged),null===(n=this._canvas)||void 0===n||n.remove_selectedItemHandlerChanged(this._onSelectedItemHandlerChanged),null===(r=this._canvas)||void 0===r||r.remove_onSelectionLocked(this._onCanvasSelectionLocked)},t.prototype.add_staticTextImageChanged=function(t){this._textImageChanged.add(t)},t.prototype.remove_staticTextImageChanged=function(t){this._textImageChanged.remove(t)},t.prototype.dispose=function(){this.clearText(),this.unbindFromCanvas(),this._isDisposed=!0},t.prototype.processKeyEvent=function(t){return vt(this,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return t.code!==F.Keys.Escape?[3,2]:[4,this.exitEditMode(!0)];case 1:return e.sent(),[2,!0];case 2:return[4,this._textEditor.processKeyEvent(t)];case 3:return[2,e.sent()]}}))}))},t.prototype.processMouseEvent=function(t,e){return vt(this,void 0,void 0,(function(){var n;return wt(this,(function(r){switch(r.label){case 0:switch(n=this._getMouseEvent(t),this._updateMouseDownStartedInside(n.type,e),this._getMouseCommandType(n,e)){case ut.noProcessingRequired:return[3,1];case ut.toProcessInEditMode:return[3,2];case ut.enterToEditMode:return[3,3];case ut.exitFromEditMode:return[3,5];case ut.outsideSelection:return[3,7]}return[3,8];case 1:return[2,!1];case 2:return this.isMobile||this._textEditor.processMouseEvent(n),[3,8];case 3:return this.isMobile&&!this._textEditor.isReady?(this._textEditor.editorInitialized.remove(this._onMobileTextEditorInitialized),this._textEditor.editorInitialized.add(this._onMobileTextEditorInitialized),this._waitMobileTextEditorInit=!0,this._canvas.redraw(),[2,!1]):[4,this.enterEditMode(n.x,n.y)];case 4:return r.sent(),[3,8];case 5:return[4,this.exitEditMode()];case 6:return r.sent(),[2,!1];case 7:return this._canvas.enableSelection(),[2,!1];case 8:return this._defineCanvasCursor(e),[2,!0]}}))}))},t.prototype.clearText=function(){},t.prototype.updateText=function(t){return vt(this,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return[4,this._updateText(this._getUpdateTextTrigger(t))];case 1:return e.sent(),[2]}}))}))},t.prototype.transformText=function(t){var e,n=this._itemHandler.item,r=this._itemHandler.getControlCenter(),i=n.previewScale,o=n.opacity,a=null===(e=n.mask)||void 0===e?void 0:e.vectorMask,s=this._tw.engineHandler;this._textRenderer.transformText(s,t,r,i,o,a)},t.prototype.measureText=function(t){var e=this._itemHandler.item.previewScale;return this._tw.textMeasurer.measureText(e,t)},t.prototype.measureTextFrame=function(t){return void 0===t&&(t=!1),this._tw.textMeasurer.measureTextFrame(t)},t.prototype.redrawActiveText=function(){var t;if(!this._isDisposed&&(this._textState===rt.Active||this._textState===rt.InEdit)){var e=this._itemHandler.item,n=!this.isInEdit&&this._itemHandler.isEmptyTextPlaceholder()?.5:1,r=e.opacity*n,i=this._tw.engineHandler,o=e.transform,a=this._itemHandler.getControlCenter(),s=e.previewScale,l=this._textState!==rt.InEdit?null===(t=e.mask)||void 0===t?void 0:t.vectorMask:null;this._textRenderer.drawText(i,o,a,s,r,l),this._textState===rt.InEdit&&this._textEditor.redraw()}},t.prototype.undo=function(){this._textEditor.undo()},t.prototype.redo=function(){this._textEditor.redo()},t.prototype._createEngineWrapper=function(){var t=this._canvas.textWhizz,e=this._canvas.fontRegistry;return new ot.a(t,e.textWhizzFontRegistry,this._listStyleSheetManager,this._colorPreviewService,this._canvas.viewer.colorParser)},t.prototype._getEngineWrapperInitData=function(t){return void 0===t&&(t=null),vt(this,void 0,void 0,(function(){var e;return wt(this,(function(n){switch(n.label){case 0:return[4,(e=new yt(this._itemHandler,this._colorPreviewService)).update(t)];case 1:return n.sent(),[2,e]}}))}))},t.prototype._initEngineWrapper=function(t){return void 0===t&&(t=null),vt(this,void 0,void 0,(function(){var e,n;return wt(this,(function(r){switch(r.label){case 0:return this._listStyleSheetManager.initialize(this._parseItemListStyles(this._itemHandler.item)),n=(e=this._tw).initialize,[4,this._getEngineWrapperInitData(t)];case 1:return n.apply(e,[r.sent()]),[2]}}))}))},t.prototype._getTextWhizzEditorInitData=function(){var t=this._itemHandler.item,e=this._itemHandler,n=e instanceof lt.j&&t instanceof i.q,r=n?t.overflowStrategy:null,o=n?t.verticalAlignment:null,a=ht.a.getAllowTextFormatting(t,this._canvas.viewer.textFormattingEnabled),s=e.isEmptyTextPlaceholder(),l=t instanceof i.a||t instanceof i.x;return{rectangle:e.rectangle.toRectangleF(),previewScale:t.previewScale,textVerticalAlignment:o,overflowStrategy:r,isBoundedText:n,isTextFormattingEnabled:a,isNewLineEnabled:!(t instanceof i.x||t instanceof i.a),isEmptyTextPlaceholder:s,limits:{characterLimit:t.characterLimit,maxLineCount:t.maxLineCount,maxLineLength:t.maxLineLength,isSingleLineText:l}}},t.prototype._getMobileEditorInitData=function(){return vt(this,void 0,void 0,(function(){var t,e,n,r,o,a;return wt(this,(function(s){switch(s.label){case 0:return t=this._itemHandler.item,e=null,t instanceof i.eb&&(e=t.alignment),t instanceof i.a&&(e=i.qb.Center),[4,this._colorPreviewService.getPreviewAsync(t.borderColor)];case 1:return n=s.sent(),[4,this._colorPreviewService.getPreviewAsync(t.fillColor)];case 2:return r=s.sent(),o=t instanceof i.a||t instanceof i.x,a={text:this._initialFormattedText,rectangle:this._itemHandler.rectangle,textAlignment:e},[4,yt.getDefaultInlineStyle(t,this._colorPreviewService)];case 3:return[2,(a.defaultInlineStyle=s.sent(),a.defaultParagraphStyle=yt.getDefaultParagraphStyle(t),a.borderColor=n.toString(),a.borderWidth=t.borderWidth,a.fillColor=r.toString(),a.opacity=t.opacity,a.previewScale=t.previewScale,a.textFormattingEnabled=ht.a.getAllowTextFormatting(t,this._canvas.viewer.textFormattingEnabled),a.transform=t.transform,a.textVerticalAlignment=t instanceof i.q?t.verticalAlignment:null,a.listSettings=bt({},this._canvas.viewer.configuration.listSettings),a.limits={characterLimit:t.characterLimit,maxLineCount:t.maxLineCount,maxLineLength:t.maxLineLength,isSingleLineText:o},a)]}}))}))},t.prototype._initActiveTextEditor=function(){return vt(this,void 0,void 0,(function(){var t,e,n;return wt(this,(function(r){switch(r.label){case 0:return this.activeTextEditor?(t=this._getTextWhizzEditorInitData(),this._textEditor instanceof st.a?(this._textEditor.renderer.initialize(this._itemHandler),this._textEditor.initialize(this._tw,t,this._listStyleSheetManager),[3,3]):[3,1]):[3,3];case 1:return this._textEditor instanceof W?[4,this._getMobileEditorInitData()]:[3,3];case 2:e=r.sent(),n=this._tw.colorPalette,this._textEditor.initialize(e,n,this._listStyleSheetManager),r.label=3;case 3:return[2]}}))}))},t.prototype._bindToEditor=function(){this._textEditor.frameChanged.add(this._onFrameChanged),this._textEditor.styleChanged.add(this._onStyleChanged),this._textEditor.invalidCharEntered.add(this._onInvalidInput)},t.prototype._unbindFromEditor=function(){this._textEditor.frameChanged.remove(this._onFrameChanged),this._textEditor.styleChanged.remove(this._onStyleChanged),this._textEditor.invalidCharEntered.remove(this._onInvalidInput)},t.prototype._getListSettingFromConfig=function(t){return t?{maxNestingListLevel:t.maxLevel,defOrderedListLevelGap:t.levelIndent,defUnorderedListLevelGap:t.levelIndent,defOrderedListStyle:{firstLineIndent:t.firstLineIndent,leftIndent:t.listIndent,tabOffset:t.tabOffset,numberingFormat:t.numberingFormat},defUnorderedListStyle:{firstLineIndent:t.firstLineIndent,leftIndent:t.listIndent,tabOffset:t.tabOffset,bulletCharCode:t.bulletChar?t.bulletChar.charCodeAt(0):null},styleNameKey:"",styleNamePrefix:""}:null},t.prototype.redrawText=function(){this._redrawText()},t.prototype._updateMouseDownStartedInside=function(t,e){this._textState===rt.InEdit&&(t===at.a.mousedown&&(this._mouseDownStartedInside=e),t===at.a.mouseup&&(this._mouseDownStartedInside=!1))},t.prototype._getMouseCommandType=function(t,e){var n=this._textState===rt.InEdit;switch(t.type){case at.a.dblclick:return n?e?ut.toProcessInEditMode:ut.exitFromEditMode:ut.enterToEditMode;case at.a.mousedown:return n&&e?ut.toProcessInEditMode:ut.noProcessingRequired;case at.a.mousemove:return n?e||!t.isDrag||this._mouseDownStartedInside||Y.a.IsTouchDevice()?ut.toProcessInEditMode:ut.exitFromEditMode:ut.noProcessingRequired;case at.a.mouseup:return n?!e&&t.isClick?ut.exitFromEditMode:ut.toProcessInEditMode:this.isOnlyThisItemSelected()?ut.enterToEditMode:ut.noProcessingRequired}},t.prototype._getMouseEvent=function(t){var e=null,n=t.type===_t.b.Move,i=n?t.state:null;t.type===_t.b.PointerDown&&(e=at.a.mousedown),(t.type===_t.b.Hover||n&&i===_t.a.InProgress||i===_t.a.Started)&&(e=at.a.mousemove),(t.type===_t.b.Click||n&&i===_t.a.Finished)&&(e=at.a.mouseup);var o=this._translatePoint(new r.PointF(t.workspace.x,t.workspace.y));return{x:o.x,y:o.y,type:e,isClick:t.type===_t.b.Click,isDrag:t.type===_t.b.Move,clickCount:t.clickCount}},t.prototype._translatePoint=function(t){var e=this._canvas.offset,n=this._itemHandler.item.transform,r=this._itemHandler.item.previewScale,i=this._itemHandler.rectangle.toRectangleF();return t.translate(-e.x,-e.y),null!=n&&(t.rotateAt(-n.angle,i.center),t.translate(-n.translateX,-n.translateY)),t.scale(1/r,1/r),t},Object.defineProperty(t.prototype,"_textState",{get:function(){return this._textStateValue},enumerable:!0,configurable:!0}),t.prototype._setTextState=function(t){return vt(this,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return this._textStateValue===t?[2]:(this._textStateValue=t,[4,this._onTextStateChanged()]);case 1:return e.sent(),[2]}}))}))},t.prototype._redrawText=function(){this._textState===rt.Static&&(this._isTextImageValid||this._updateTextImage()),this._canvas.redrawActiveTexts()},t.prototype._updateTextImage=function(){this._itemHandler.clearImageContainer();var t=this._itemHandler.item.previewScale,e=this._tw.textMeasurer.measureText(t,!0),n=this._tw.engineHandler,r=this._textRenderer.getTextImage(n,e,t);this._textImageChanged.fire({url:r,rect:e}),this._isTextImageValid=!0},t.prototype._updateText=function(t){return vt(this,void 0,void 0,(function(){var e,n,r,i,o,a,s;return wt(this,(function(l){switch(l.label){case 0:if(this._isDisposed)return[2];if(!this.isMobile&&t===ct.Text&&(e=this._itemHandler.item.text,n=this._tw.textHandler.getFormattedText(),e===n))return[2];this._ready=!1,this._textState===rt.Static&&this._itemHandler.clearImageContainer(),l.label=1;case 1:return l.trys.push([1,7,,8]),t!==ct.Initialization&&t!==ct.Text?[3,4]:[4,this._initEngineWrapper()];case 2:return l.sent(),[4,this._initActiveTextEditor()];case 3:l.sent(),l.label=4;case 4:return t!==ct.Frame?[3,6]:[4,this._initEngineWrapper()];case 5:if(l.sent(),this._isDisposed)return[2];r=this._itemHandler.getFramesData(),this._tw.textHandler.setTextFrames(r,!1),l.label=6;case 6:return t===ct.WrappingPath&&(i=this._itemHandler.getWrappingPathData(),this._tw.textHandler.setWrappingPath(i)),[3,8];case 7:throw o=l.sent(),this._failed=!0,ot.a.createException(this._tw.engine,o);case 8:return this._isDisposed?[2]:(this._ready=!0,this._failed=!1,this._isCropped=null,this._isTextImageValid=!1,a=this._itemHandler.item.previewScale,s=this._tw.textMeasurer.measureText(a,!1),this._itemHandler.updateRectangle(s),this._redrawText(),this.isMobile?this._textState!==rt.InEdit||this._isExitFromEditModeLocked?[3,11]:[4,this.exitEditMode()]:[3,11]);case 9:return l.sent(),[4,this.enterEditMode(0,0)];case 10:l.sent(),l.label=11;case 11:return[2]}}))}))},t.prototype._getUpdateTextTrigger=function(t){return null==t?ct.Initialization:"text"===t.toLowerCase()?ct.Text:"frame"===t.toLowerCase()?ct.Frame:"wrappingpath"===t.toLowerCase()?ct.WrappingPath:null},t.prototype._restorePlaceholderText=function(){this._tw.textHandler.insertFormattedText(this._itemHandler.item.originalText),this.updateItemHandler()},t.prototype._updateItemListStyles=function(){var t=this._listStyleSheetManager.getAllStyleSheets().map((function(t){return t.getListStyleSheet()}));this._itemHandler.item.listStyles=this._serializeToItemListStyles(t)},t.prototype._handleTextChanged=function(t){return vt(this,void 0,void 0,(function(){var e;return wt(this,(function(n){switch(n.label){case 0:return this._isTextImageValid=!1,e=this._extractDefaultTextStyle(t),this._itemHandler.item.text=e.text,this._itemHandler.applyInlineStyle(this._convertFromModelSpanStyle(e.spanStyle)),this._itemHandler.applyParagraphStyle(this._convertFromModelParagraphStyle(e.paragraphStyle)),this.isMobile||!this._itemHandler.item?[3,2]:[4,this._initEngineWrapper()];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype._extractDefaultTextStyle=function(t){var e=this._tw.colorPalette.getPaletteColors(),n=new it.a(e),r=new nt(this._canvas.viewer.colorParser),i=this._tw.styleHandler.getDefaultCharStyle().font.size;return r.extract(t,n,i,this._listStyleSheetManager)},t.prototype._defineCanvasCursor=function(t){var e=t?pt.a.text:pt.a.defaultCursor;this._canvas.viewer.setCursor(e,!1)},t.prototype._setCanvasForExitFromEdit=function(){this._canvas.unsubscribeLimitsMessage(),this._activeTextCanvasHandler.moveActiveTextCanvasBack(),this._canvas.enableSelection(),this._canvas.redraw()},t.prototype._setCanvasForEnterToEdit=function(){this._canvas.subscribeLimitsMessage(),this._activeTextCanvasHandler.moveActiveTextCanvasOnTop(),this._canvas.disableSelection(),this._canvas.viewer.ensureFocus(),this._canvas.redraw()},t.prototype.isOnlyThisItemSelected=function(){return this._canvas.isOnlyThisItemHandlerSelected(this._itemHandler)},t.prototype._serializeToItemListStyles=function(t){return(null==t?void 0:t.length)>0?JSON.stringify(t):""},t.prototype._parseItemListStyles=function(t){return t.listStyles?JSON.parse(t.listStyles):[]},t.prototype._convertFromModelSpanStyle=function(t){var e,n,r,i,o,a=null;(t.fontName||t.fontSize)&&(a={postScriptName:t.fontName,size:null===(e=t.fontSize)||void 0===e?void 0:e.value,fauxBold:t.bold,fauxItalic:t.italic,allCaps:t.allCaps});var s=null;return(t.penColor||t.penWidth)&&(s={color:null===(n=t.penColor)||void 0===n?void 0:n.color,size:null===(r=t.penWidth)||void 0===r?void 0:r.value}),{font:a,color:null===(i=t.color)||void 0===i?void 0:i.color,underline:t.underline,leading:null===(o=t.leading)||void 0===o?void 0:o.value,tracking:t.tracking,stroke:s,openType:t.openTypeFeatures,subscript:t.sub,superscript:t.sup,verticalScale:t.verticalScale,horizontalScale:t.horizontalScale}},t.prototype._convertFromModelParagraphStyle=function(t){var e,n,r,i,o;return{alignment:this._convertToModelParagraphAlignment(t.alignment),firstLineIndent:null===(e=t.firstLineIndent)||void 0===e?void 0:e.value,spaceBefore:null===(n=t.spaceBefore)||void 0===n?void 0:n.value,spaceAfter:null===(r=t.spaceAfter)||void 0===r?void 0:r.value,leftIndent:null===(i=t.leftIndent)||void 0===i?void 0:i.value,rightIndent:null===(o=t.rightIndent)||void 0===o?void 0:o.value}},t.prototype._convertToModelParagraphAlignment=function(t){switch(t){case c.ParagraphAlignment.left:return i.qb.Left;case c.ParagraphAlignment.center:return i.qb.Center;case c.ParagraphAlignment.right:return i.qb.Right;case c.ParagraphAlignment.justification:return i.qb.Justify;case c.ParagraphAlignment.lastLeft:return i.qb.LastLeft;case c.ParagraphAlignment.lastCenter:return i.qb.LastCenter;case c.ParagraphAlignment.lastRight:return i.qb.LastRight}},t}(),Pt=n(470),xt=(ft=function(t,e){return ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},ft(t,e)},function(t,e){function n(){this.constructor=t}ft(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),St=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e}((function(){})),It=function(){function t(){}return t.getExecutionToken=function(){return new St},t.executeSingle=function(t,e,n){var r=this;if(void 0===n&&(n=null),!(t instanceof St))throw new Error("token must be acquired using method getExecutionToken");return null!=t.currentExecutionPromise||(t.getContinueTask=n,t.currentExecutionPromise=new Promise((function(n,i){return o=r,a=void 0,l=function(){var r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,5,6]),[4,e()];case 1:return o.sent(),t.getContinueTask?[4,t.getContinueTask()]:[3,3];case 2:o.sent(),o.label=3;case 3:return n(),[3,6];case 4:return r=o.sent(),i(r),[3,6];case 5:return t.currentExecutionPromise=null,[7];case 6:return[2]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{i(l.next(t))}catch(n){e(n)}}function r(t){try{i(l.throw(t))}catch(n){e(n)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(n,r)}i((l=l.apply(o,a||[])).next())}));var o,a,s,l}))),t.currentExecutionPromise},t}(),Ot=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Et=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Lt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Rt=function(t){function e(e,n,i,o){void 0===n&&(n=null);var a=t.call(this,null,e,n,i,o)||this;a._waitLoadFontsDef=null,a._waitLoadFontsLastInnerUpdate=null,a._frontEndUpdateExecutionToken=It.getExecutionToken(),a._initFrontEndRenderingDef=null,a._staticTextRect=null,a._exitedEditModeEvent=new s.c,a._enteredEditModeEvent=new s.c;var l=null!=a.item?a.item.sourceRectangle:null;return(null==l||l.isEmpty())&&(l=new r.RectangleF(0,0,10,10)),a.originalPath=r.Path.rectangle(l.left,l.top,l.width,l.height),a.controlPoints=[new r.PointF(l.left,l.top),new r.PointF(l.right,l.bottom)],a._imageContainer=new G.a((function(){return Tt(a,void 0,void 0,(function(){var t;return Et(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),null==this.canvas?[2]:(this.canvas.redraw(!0),[4,this.waitUpdate()]);case 1:return e.sent(),this.canvas.redraw(!0),[3,3];case 2:throw t=e.sent(),console.warn("Error in [NewBaseTextItemHandler].ctor ImageContainer loaded",t),t;case 3:return[2]}}))}))})),a._allowNegativeResize=!1,a}return Ot(e,t),e.prototype.isHighlightNeeded=function(){return this.editing},Object.defineProperty(e.prototype,"textEditorController",{get:function(){return this._textEditorController},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInEdit",{get:function(){var t;return null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textEditor",{get:function(){var t;return null===(t=this._textEditorController)||void 0===t?void 0:t.activeTextEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editing",{get:function(){return null!=this.textEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textCropped",{get:function(){return this.item.checkTextCrop?!(!this.ready||!this.frontEndRenderingReady)&&this._textEditorController.isCropped:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){var t;return null===(t=this._textEditorController)||void 0===t?void 0:t.ready},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frontEndRenderingReady",{get:function(){var t=null!=this._textWhizz,e=null!=this._textEditorController&&!this._textEditorController.failed,n=null!=this._fontRegistry&&this._fontRegistry.ready&&this._fontRegistry.containsFonts(this._getFonts());return t&&e&&n},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inPlaceEditingEnabled",{get:function(){return this.frontEndRenderingReady&&0==this.item.placeholders.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exitedEditModeEvent",{get:function(){return this._exitedEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enteredEditModeEvent",{get:function(){return this._enteredEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorPreviewService",{get:function(){return this._colorPreviewService},enumerable:!0,configurable:!0}),e.prototype.updateText=function(t){this._modifyItem((function(e){e.text=t}))},e.prototype.applyInlineStyle=function(t){var e=this;t&&(K(t.color,(function(t){return e.item.color=t})),K(t.font,(function(t){K(t.postScriptName,(function(t){return e.item.font.postScriptName=t})),K(t.allCaps,(function(t){return e.item.font.allCaps=t})),K(t.fauxBold,(function(t){return e.item.font.fauxBold=t})),K(t.fauxItalic,(function(t){return e.item.font.fauxItalic=t})),K(t.size,(function(t){return e.item.font.size=t}))})),K(t.leading,(function(t){return e.item.leading=t})),K(t.openType,(function(t){return e.item.font.openTypeFeatures=t})),K(t.stroke,(function(t){null==e.item.stroke&&(e.item.stroke=new i.pb),K(t.color,(function(t){return e.item.stroke.color=t})),K(t.size,(function(t){return e.item.stroke.size=t}))})),K(t.tracking,(function(t){return e.item.tracking=t})),K(t.underline,(function(t){return e.item.underline=t})))},e.prototype.applyParagraphStyle=function(t){var e=this;K(t.alignment,(function(t){return e.item.alignment=t}))},e.prototype.isEmpty=function(){var t;return this.item.isEmpty()&&!(null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit)},e.prototype.isEmptyTextPlaceholder=function(){return this.item.isTextPlaceholder&&""===this.item.text},e.prototype.setTextWhizzModule=function(t){this._textWhizz=t},e.prototype.onTextWhizzInit=function(){t.prototype.onTextWhizzInit.call(this),this.update()},e.prototype.waitUpdate=function(){return Tt(this,void 0,void 0,(function(){var e;return Et(this,(function(n){switch(n.label){case 0:return this._isDisposed?[2]:(e=[],this.frontEndRenderingReady||(e.push(this.waitInitFrontEndRendering()),this.update()),e.push(t.prototype.waitUpdate.call(this)),[4,Promise.all(e)]);case 1:return n.sent(),[2]}}))}))},e.prototype.frontEndUpdate=function(t,e,n){return Tt(this,void 0,void 0,(function(){var r=this;return Et(this,(function(i){switch(i.label){case 0:return this._isDisposed||null==this._fontRegistry&&null==this.canvas?[2]:(null==this._handlerUpdated&&(this._handlerUpdated=new q.a),this._isFrontEndRenderingInitialized()?[3,2]:[4,It.executeSingle(this._frontEndUpdateExecutionToken,(function(){return Tt(r,void 0,void 0,(function(){return Et(this,(function(t){switch(t.label){case 0:return[4,this.waitInitFrontEndRendering()];case 1:return t.sent(),[2]}}))}))}),(function(){return Tt(r,void 0,void 0,(function(){return Et(this,(function(r){switch(r.label){case 0:return[4,this._doFrontEndUpdate(t,e,n)];case 1:return r.sent(),[2]}}))}))}))]);case 1:return i.sent(),[3,4];case 2:return[4,this._doFrontEndUpdate(t,e,n)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},e.prototype.update=function(t,e,n){this._updateImpl(t,e,n)},e.prototype.updateAsync=function(t,e,n){return Tt(this,void 0,void 0,(function(){return Et(this,(function(r){switch(r.label){case 0:return[4,this._updateImpl(t,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.quickUpdate=function(){this.isVisible()&&this.canvas&&!this.frontEndRenderingReady&&this.update()},e.prototype.setRectangle=function(t,e){var n,i=r.RotatedRectangleF.fromRectangleF(this.getControlBounds()),o=t.getTransform(i);o.equals(this.item.transform)||(this.item.setTransform(o,e),(null===(n=this._textEditorController)||void 0===n?void 0:n.isActive)&&this._transformText(o))},e.prototype.updateRectangle=function(t){this._modifyItem((function(e){e.sourceRectangle=t,e.sourcePath=r.Path.rectangle(t.left,t.top,t.width,t.height)})),this.controlPoints=[new r.PointF(t.left,t.top),new r.PointF(t.right,t.bottom)],this.item.getItemChangedEvent().fire()},e.prototype.redrawActiveText=function(){null!=this.canvas&&null!=this._textEditorController&&this._textEditorController.redrawActiveText()},e.prototype.drawItemHandler=function(t){var e,n;if(null!=t&&null!=this.canvas&&null!=this._textWhizz)if(this._isReadyToDraw){var r=this.ready&&!(null===(e=this._textEditorController)||void 0===e?void 0:e.isStatic)&&this.canvas.isSelectionLocked();if(!this._isMobileTextEditorActive||r){this._hasVectorMask()&&!r&&(t.save(),this._clip(t));var i=this.isEmptyTextPlaceholder()?.5:1;if(this.renderFill(t,i),!this.ready||(null===(n=this._textEditorController)||void 0===n?void 0:n.isStatic)||r)try{V.a.renderTextImage(this,this._imageContainer,null,t,i,V.a.staticCanvasMargin)}catch(o){console.error(o)}this.renderStroke(t,i),this._hasVectorMask()&&!r&&t.restore()}}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.clearImageContainer=function(){this._imageContainer.clear()},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),e&&n&&this.frontEndRenderingReady&&this.update(null,null,this._getEndTransformTrigger(n))},e.prototype.processInPlaceEditingMouseEvent=function(t,e){return Tt(this,void 0,void 0,(function(){return Et(this,(function(n){switch(n.label){case 0:if(!this.inPlaceEditingEnabled)throw new X.c("Inplace is not enabled for this item!");return[4,this._textEditorController.processMouseEvent(t,e)];case 1:return[2,n.sent()]}}))}))},e.prototype.processInPlaceEditingKeyEvent=function(t){return Tt(this,void 0,void 0,(function(){return Et(this,(function(e){switch(e.label){case 0:if(!this.inPlaceEditingEnabled)throw new X.c("Inplace is not enabled for this item!");return t.preventDefault(),t.state===_t.a.Finished?[3,2]:[4,this._textEditorController.processKeyEvent(t)];case 1:return[2,e.sent()];case 2:return[2,!0]}}))}))},e.prototype.enterEditMode=function(){if(!this.inPlaceEditingEnabled)throw new X.c("Inplace is not enabled for this item!");this._textEditorController.enterEditMode(0,0)},e.prototype.exitEditMode=function(t){if(void 0===t&&(t=!1),!this.inPlaceEditingEnabled)throw new X.c("Inplace is not enabled for this item!");this._textEditorController.exitEditMode(t)},e.prototype.getTextForRendering=function(){return this.isEmptyTextPlaceholder()?this.item.originalText:this.item.text},e.prototype.dispose=function(){var e,n,r;null===(e=this._textEditorController)||void 0===e||e.exitedEditModeEvent.remove(this._onTextManagerExitedEditMode),null===(n=this._textEditorController)||void 0===n||n.enteredEditModeEvent.remove(this._onTextManagerEnteredEditMode),null===(r=this._textEditorController)||void 0===r||r.dispose(),this._textEditorController=null,this._imageContainer.dispose(),t.prototype.dispose.call(this)},e.prototype._updateImpl=function(t,e,n){return Tt(this,void 0,void 0,(function(){var r,i=this;return Et(this,(function(o){switch(o.label){case 0:return this.isVisible()||"text"==n?(r=function(){var t,n;"function"==typeof e&&e(),null===(t=i.canvas)||void 0===t||t.updateSelection(!0),null===(n=i.canvas)||void 0===n||n.redrawDesign()},[4,this.frontEndUpdate(t,r,n)]):[3,2];case 1:return o.sent(),[3,3];case 2:"function"==typeof t&&t(),o.label=3;case 3:return[2]}}))}))},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"text":this.update(null,null,"text");break;case"font":case"underline":case"color":case"alignment":case"leading":case"tracking":case"verticalScale":case"horizontalScale":case"previewScale":case"stroke":case"shadow":case"baselineShift":case"overlapLinesEnabled":case"maxLineCount":case"maxLineLength":this.update();break;case"checkTextCrop":!this.frontEndRenderingReady&&e.checkTextCrop&&this.update()}"checkTextCrop"!==n&&t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){var e,n,r;t.prototype._onItemVisibilityChanged.call(this),(null===(e=this.canvas)||void 0===e?void 0:e.isItemHandlerSelected(this))&&(this.isVisible()?null===(n=this._textEditorController)||void 0===n||n.updateItemHandler():null===(r=this._textEditorController)||void 0===r||r.clearText())},e.prototype._setDataItem=function(t,e){throw new X.e("NewBaseTextItemHandler._setDataItem")},e.prototype._createDataInstance=function(t){throw new X.e("NewBaseTextItemHandler._createDataInstance")},e.prototype._onAddedOnCanvas=function(e){var n;this._textWhizz=e.textWhizz,t.prototype._onAddedOnCanvas.call(this,e),null===(n=this._textEditorController)||void 0===n||n.bindToCanvas()},e.prototype._onRemovedFromCanvas=function(e){var n;t.prototype._onRemovedFromCanvas.call(this,e),null===(n=this._textEditorController)||void 0===n||n.unbindFromCanvas()},e.prototype._transformText=function(t){this._textEditorController.transformText(t)},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype.renderFill=function(t,e){var n=this.item,r=this.rectangle,i=this._getItemColorPreviews().fillColorPreview;U.a.fillRectangle(t,r,null==i?void 0:i.toString(),n.opacity*e)},e.prototype.renderStroke=function(t,e){var n=this._getActualBorderWidth();if(!(n<=0)){var i=this.item,o=this.rectangle;o.width+=n,o.height+=n;var a=r.Path.rotatedRectangle(o),s=this._getItemColorPreviews(),l=s.borderColorPreview,u=s.altBorderColorPreview;U.a.drawStroke(t,a,o.center,new r.Transform,n,l.toString(),null==u?void 0:u.toString(),i.opacity*e,i.dash)}},e.prototype._getEndTransformTrigger=function(t){return"frame"},e.prototype._onFrontEndRenderingInitialized=function(){},e.prototype._initFrontEndRendering=function(){return Tt(this,void 0,void 0,(function(){var t=this;return Et(this,(function(e){switch(e.label){case 0:return this._textEditorController=new Ct(this),[4,this._textEditorController.initialize()];case 1:return e.sent(),this._textEditorController.add_staticTextImageChanged((function(e){var n;null==e.url?(t._imageContainer.clear(),null===(n=t.canvas)||void 0===n||n.redraw()):(t._staticTextRect=e.rect,t._imageContainer.updateUrl(e.url))})),this._textEditorController.exitedEditModeEvent.add(this._onTextManagerExitedEditMode.bind(this)),this._textEditorController.enteredEditModeEvent.add(this._onTextManagerEnteredEditMode.bind(this)),this._onFrontEndRenderingInitialized(),[2]}}))}))},e.prototype._onTextManagerEnteredEditMode=function(){this._enteredEditModeEvent.notify(this),this.canvas.redrawActiveTexts()},e.prototype._onTextManagerExitedEditMode=function(){this._exitedEditModeEvent.notify(this)},e.prototype._getPreviewScaleLimits=function(){var t=null,e=null;return null==this.canvas||null==this.canvas.maxFontSize||isNaN(this.canvas.maxFontSize)||(t=this.canvas.maxFontSize/this.item.font.size),null==this.canvas||null==this.canvas.minFontSize||isNaN(this.canvas.minFontSize)||(e=this.canvas.minFontSize/this.item.font.size),{min:e,max:t}},e.prototype.waitInitFrontEndRendering=function(){return Tt(this,void 0,void 0,(function(){var t,e,n,r,i,o;return Et(this,(function(a){switch(a.label){case 0:return null==this.canvas?[2,null]:null!=this._fontRegistry&&null!=this._textEditorController?[2]:null!=this._initFrontEndRenderingDef?[2,this._initFrontEndRenderingDef.promise]:(this._initFrontEndRenderingDef=new q.a,[4,this.canvas.waitFontRegistryInitialized()]);case 1:if(a.sent(),null==this.canvas||null!=this._textEditorController)return[3,11];a.label=2;case 2:a.trys.push([2,7,8,9]),t=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._getFonts()),e=t.next(),a.label=3;case 3:return e.done?[3,6]:(n=e.value,this._fontRegistry.containsFonts([n])?[3,5]:[4,this._fontRegistry.loadFonts([n])]);case 4:a.sent(),a.label=5;case 5:return e=t.next(),[3,3];case 6:return[3,9];case 7:return r=a.sent(),i={error:r},[3,9];case 8:try{e&&!e.done&&(o=t.return)&&o.call(t)}finally{if(i)throw i.error}return[7];case 9:return[4,this._initFrontEndRendering()];case 10:a.sent(),a.label=11;case 11:return this._initFrontEndRenderingDef.resolve(),this._initFrontEndRenderingDef=null,[2]}}))}))},e.prototype._pathToTextWhizzPath=function(t){return Object(Pt.b)(this._textWhizz,t)},Object.defineProperty(e.prototype,"_isMobileTextEditorActive",{get:function(){return this.textEditor instanceof W},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_fontRegistry",{get:function(){var t;return null===(t=this.canvas)||void 0===t?void 0:t.fontRegistry},enumerable:!0,configurable:!0}),e.prototype._beforeFrontEndUpdate=function(){var t=this;if(!this.item.transform.isEmpty){var e=this.getControlCenter(),n=this.item.transform.clone();n.setAngle(0),this._modifyItem((function(r){var i;t._applyTransform(r,n,e),null!=(null===(i=r.mask)||void 0===i?void 0:i.vectorMask)&&(r.mask.vectorMask=t._getTransformedClippingPath(n)),r.transform.clear({keepAngle:!0,supressOnChanged:!0})}))}},e.prototype._isFrontEndRenderingInitialized=function(){return null!=this._textEditorController},e.prototype._doFrontEndUpdate=function(t,e,n){return Tt(this,void 0,void 0,(function(){var r,i=this;return Et(this,(function(o){switch(o.label){case 0:return this._isDisposed||null==this.canvas?(null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null),[2]):(r=function(){return Tt(i,void 0,void 0,(function(){var r;return Et(this,(function(i){switch(i.label){case 0:"function"==typeof t&&t(),this._beforeFrontEndUpdate(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._textEditorController.updateText(n)];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),console.log(this._textWhizz.getExceptionMessage(r)),console.log(this._textWhizz.getExceptionName(r)),r;case 4:return"function"==typeof e&&e(),null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null),[2]}}))}))},this.frontEndRenderingReady?[4,r()]:[3,2]);case 1:return o.sent(),[3,4];case 2:return[4,this._waitLoadFonts(r)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},e.prototype._waitLoadFonts=function(t){var e=this;if(this._waitLoadFontsLastInnerUpdate=t,null!=this._waitLoadFontsDef)return this._waitLoadFontsDef.promise;this._waitLoadFontsDef=new q.a;var n=new Array;return n.push(this._fontRegistry.loadFonts(this._getFonts())),Promise.all(n).then((function(){e._waitLoadFontsLastInnerUpdate&&e._waitLoadFontsLastInnerUpdate(),e._waitLoadFontsDef.resolve(),e._waitLoadFontsDef=null})).catch((function(t){e._waitLoadFontsDef.reject(t),e._waitLoadFontsDef=null})),this._waitLoadFontsDef.promise},e.prototype._getFonts=function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Lt(arguments[e]));return t}([this.item.font.postScriptName],o.i(this.item.text))},e.typeName="NewBaseTextItemHandler",e}($.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.b})),n.d(e,"d",(function(){return i.RgbColor})),n.d(e,"c",(function(){return o.Path})),n.d(e,"e",(function(){return o.Transform})),n.d(e,"g",(function(){return a.a})),n.d(e,"f",(function(){return s.h})),n(445),n(409);var r=n(406),i=n(413),o=n(407),a=(n(444),n(510)),s=(n(426),n(497),n(410)),l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(){function t(t){this._dictionary=new Map(t)}t.prototype.hasEqual=function(t){return this.tryGetKeyEqualTo(t).hasKey},t.prototype.tryGetKeyEqualTo=function(t){var e,n;if(this.has(t))return{hasKey:!0,key:t};try{for(var r=l(this.keys()),i=r.next();!i.done;i=r.next()){var o=i.value;if(o.equals(t))return{hasKey:!0,key:o}}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return{hasKey:!1,key:null}},t.prototype.tryGetValueOf=function(t){var e=this.tryGetKeyEqualTo(t),n=e.hasKey,r=e.key;return{hasValue:n,value:null!=r?this.get(r):null}},t.prototype.clear=function(){this._dictionary.clear()},t.prototype.delete=function(t){return this._dictionary.delete(t)},t.prototype.forEach=function(t,e){this._dictionary.forEach(t,e)},t.prototype.get=function(t){return this._dictionary.get(t)},t.prototype.has=function(t){return this._dictionary.has(t)},t.prototype.set=function(t,e){return this._dictionary.set(t,e),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._dictionary.size},enumerable:!0,configurable:!0}),t.prototype.entries=function(){return this._dictionary.entries()},t.prototype.keys=function(){return this._dictionary.keys()},t.prototype.values=function(){return this._dictionary.values()},t.prototype[Symbol.iterator]=function(){var t,e,n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,7]),t=l(this._dictionary),e=t.next(),o.label=1;case 1:return e.done?[3,4]:[4,e.value];case 2:o.sent(),o.label=3;case 3:return e=t.next(),[3,1];case 4:return[3,7];case 5:return n=o.sent(),r={error:n},[3,7];case 6:try{e&&!e.done&&(i=t.return)&&i.call(t)}finally{if(r)throw r.error}return[7];case 7:return[2]}}))}}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Trim=0]="Trim",t[t.Bleed=1]="Bleed",t[t.Total=2]="Total"}(r||(r={}))},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.Square=1]="Square",t[t.Tight=2]="Tight"}(r||(r={}))},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.Normal="Normal",t.Multiply="Multiply",t.Screen="Screen",t.Overlay="Overlay",t.Darken="Darken",t.Lighten="Lighten",t.ColorDodge="ColorDodge",t.ColorBurn="ColorBurn",t.HardLight="HardLight",t.SoftLight="SoftLight",t.Difference="Difference",t.Exclusion="Exclusion",t.None="None"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r,i=n(450),o=n(455),a=n(430),s=n(557),l=n(446),u=n(413),c=n(409),h=n(406),p=n(411),f=n(410),d=n(416),g=n(501),m=n(443),y=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},b=function(t){function e(n){var r=t.call(this)||this;return r._borderWidth=1,r._fillColor=new u.RgbColor(112,112,112,255),r._borderColor=new u.RgbColor(0,0,0,255),r._altBorderColor=null,r._dash=[],r._fixedBorderWidth=!1,r._overprintStroke=!1,r._overprintFill=!1,r.sourcePathId=null,r.sourcePathLoaded=!1,r._stubPath=null,r._pathLoadedEvent=new c.a,r.type=e.type,r.sourcePath=null!=n?n:new o.a(""),r.sourceRectangle=new a.a(0,0,10,10),r.shapePermissions=new s.a,r._setViolationSettings(new g.a,!0),r._ignorePermissionsChange=!0,r.manipulationPermissions.resizeGrips=new l.a(!0,!0),r.itemPermissions.itemToolbarPermissions.showEditButton=!1,r.itemPermissions.itemToolbarPermissions.showSelectButton=!1,r._ignorePermissionsChange=!1,r}return y(e,t),Object.defineProperty(e.prototype,"fixedBorderWidth",{get:function(){return this._fixedBorderWidth},set:function(t){this._fixedBorderWidth!==t&&(this._fixedBorderWidth=t,this._propertyChanged.notify(this,"fixedBorderWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borderWidth",{get:function(){return this._borderWidth},set:function(t){this._borderWidth!==t&&(this._borderWidth=t,this._propertyChanged.notify(this,"borderWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePath",{get:function(){return this._sourcePath},set:function(t){Object(f.g)(this._sourcePath,t)||(this._sourcePath=t,!0!==this.sourcePathLoaded&&this._propertyChanged.notify(this,"sourcePath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceRectangle",{get:function(){return this._sourceRectangle},set:function(t){a.a.isEqual(this._sourceRectangle,t)||(this._sourceRectangle=t,this._propertyChanged.notify(this,"sourceRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borderColor",{get:function(){return this._borderColor},set:function(t){u.Color.equals(this._borderColor,t)||(this._borderColor=t,this._propertyChanged.notify(this,"borderColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintStroke",{get:function(){return this._overprintStroke},set:function(t){this._overprintStroke!==t&&(this._overprintStroke=t,this._propertyChanged.notify(this,"overprintStroke"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillColor",{get:function(){return this._fillColor},set:function(t){u.Color.equals(this._fillColor,t)||(this._fillColor=t,this._propertyChanged.notify(this,"fillColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintFill",{get:function(){return this._overprintFill},set:function(t){this._overprintFill!==t&&(this._overprintFill=t,this._propertyChanged.notify(this,"overprintFill"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altBorderColor",{get:function(){return this._altBorderColor},set:function(t){u.Color.equals(this._altBorderColor,t)||(this._altBorderColor=t,this._propertyChanged.notify(this,"altBorderColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dash",{get:function(){return this._dash},set:function(t){p.isEqual(this._dash,t)||(this._dash=t,this._propertyChanged.notify(this,"dash"))},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=!1,this.isRenderTypeIsNormal||(this.shapePermissions.allowChangeBorderColor=!1,this.shapePermissions.allowChangeFillColor=!1)},Object.defineProperty(e.prototype,"shapePermissions",{get:function(){return this._shapePermissions},set:function(t){if(null==t)throw new h.a("shapePermissions cannot be null");Object(f.g)(this._shapePermissions,t)||(null!=this._shapePermissions&&this._shapePermissions.propertyChanged.remove(this._onPermissionsChanged),this._shapePermissions=t,this.applyPermissionsConstrain(),this._shapePermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"shapePermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof g.a))throw new h.a("Shape ViolationSettings property must has ShapeViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.shapePermissions=null!=e._shapePermissions?e._shapePermissions.clone():null,n._stubPath=null!=e._stubPath?e._stubPath.clone():null,n.dash=p.clone(e._dash),n.altBorderColor=null!=e._altBorderColor?e._altBorderColor.clone():null,n.fillColor=null!=e._fillColor?e._fillColor.clone():null,n.borderColor=null!=e._borderColor?e._borderColor.clone():null,n.sourceRectangle=null!=e._sourceRectangle?e._sourceRectangle.clone():null,null!=e.sourcePathId?n.sourcePathId=e.sourcePathId:n.sourcePath=null!=e._sourcePath?e._sourcePath.clone():null,n.borderWidth=e._borderWidth,n.fixedBorderWidth=e.fixedBorderWidth,n.overprintStroke=e.overprintStroke,n.overprintFill=e.overprintFill},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(f.g)(this._shapePermissions,e._shapePermissions),i=Object(f.g)(this._stubPath,e._stubPath),o=Object(f.g)(this._dash,e._dash),a=Object(f.g)(this._altBorderColor,e._altBorderColor),s=Object(f.g)(this._fillColor,e._fillColor),l=Object(f.g)(this._borderColor,e._borderColor),u=Object(f.g)(this._sourceRectangle,e._sourceRectangle),c=Object(f.g)(this.sourcePathId,e.sourcePathId),h=Object(f.g)(this._sourcePath,e._sourcePath),p=Object(f.g)(this._borderWidth,e._borderWidth),d=Object(f.g)(this._fixedBorderWidth,e._fixedBorderWidth),g=Object(f.g)(this._overprintStroke,e._overprintStroke),m=Object(f.g)(this._overprintFill,e._overprintFill);return n&&r&&i&&o&&a&&s&&l&&u&&c&&h&&p&&d&&g&&m},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["shapePermissions"].concat(e));return n.shapePermissions=this.shapePermissions.getSimplifiedObject(),null==this.sourcePathId?n.sourcePath=null!=this.sourcePath?this.sourcePath.toString():null:n.sourcePath=null,n},e.prototype._onPathLoaded=function(){this._pathLoadedEvent.notify(this)},e.prototype.getPathLoadedEvent=function(){return this._pathLoadedEvent},e.type="ShapeItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(d.a)({factory:new m.b,displayName:"Alternative border color"}),_("design:type",u.Color),_("design:paramtypes",[u.Color])],e.prototype,"altBorderColor",null),e}(i.a)},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.BlackAndWhite=1]="BlackAndWhite",t[t.FlipVertical=2]="FlipVertical",t[t.FlipHorizontal=3]="FlipHorizontal",t[t.Colorize=4]="Colorize",t[t.Grayscale=5]="Grayscale"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(451),o=n(407),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r,i){void 0===n&&(n=null);var a=this;return null!=e?(a=t.call(this,o.Path.rectangle(e.sourceRectangle.left,e.sourceRectangle.top,e.sourceRectangle.width,e.sourceRectangle.height),e,n,r,i)||this)._controlPoints=[new o.PointF(e.sourceRectangle.left,e.sourceRectangle.top),new o.PointF(e.sourceRectangle.right,e.sourceRectangle.bottom)]:a=t.call(this,null,e,n)||this,a._allowNegativeResize=!0,a}return a(e,t),e.prototype.setRectangle=function(e,n){e.width=Math.abs(e.width),e.height=Math.abs(e.height),t.prototype.setRectangle.call(this,e,n)},Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.sourceRectangle=e.sourceRectangle},e.typeName="RectangleItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(455);class i{constructor(){this._path=new r.a}moveTo(t,e){this._path.moveTo(t,e)}lineTo(t,e){this._path.lineTo(t,e)}quadraticCurveTo(t,e,n,r){this._path.quadraticTo(t,e,n,r)}bezierCurveTo(t,e,n,r,i,o){this._path.cubicTo(t,e,n,r,i,o)}closePath(){this._path.close()}get path(){return this._path}}function o(t,e){const n=new t.Path;for(let r of e.segments)switch(r.name){case"Z":n.close();break;case"M":n.moveTo(r.getPoint(0).x,r.getPoint(0).y);break;case"L":n.lineTo(r.getPoint(0).x,r.getPoint(0).y);break;case"Q":n.curveTo3(r.getPoint(0).x,r.getPoint(0).y,r.getPoint(1).x,r.getPoint(1).y);break;case"C":n.curveTo4(r.getPoint(0).x,r.getPoint(0).y,r.getPoint(1).x,r.getPoint(1).y,r.getPoint(2).x,r.getPoint(2).y)}return n}function a(t){let e=new i;return t.parse(e),e.path}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(406),o=n(412),a=n(441),s=n(408),l=n(421),u=n(489),c=n(432),h=n(463),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},d=function(t){function e(e,n,r,i,o,a,s){var l=t.call(this,n.dataList.map((function(t){return t.item})),e,n)||this;return l._productHandler=r,l._product=i,l._variableItemHelper=o,l._commandManager=a,l._eventManager=s,l}return p(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this._setImageDataList(this._args.dataList,this._args.keepLocation)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._setImageDataList=function(t,n){var r,i;this._normalizeDataList(t);try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),p=o.next();!p.done;p=o.next()){var f=p.value,d=f.item,g=f.imageData,m=f.tags,y=f.rotatedRectangle;if(d instanceof s.cb){d.contentPermissions.imagePermissions.allowKeepOverlayColor||l.a.applyOverlayEffect(d,new s.Y);var _=l.a.createImageContentForPlaceholder(d,g,this._productHandler,this._args.dpi);_ instanceof s.J&&this._ensureImageItemName(_),d.isStubContent=!1,null!=_&&null!=m&&(_.tags=m),this._commandManager.execute(u.a.addContent,{placeholder:d,content:_},a.a.NotUpdate)}else{var b=l.a.getImageItem(d),v=this._productHandler.getHandler(b);b.effect!==c.e.Colorize&&(b.fillColor=new h.d(0,0,0,0)),b.imagePermissions.allowKeepOverlayColor||l.a.applyOverlayEffect(b,new s.Y),e.setDataToImage(g,b),null!=m&&(b.tags=m),null!=y?v.setTransformedRectangle(y):v.updateRectangle(n),v.quickUpdate(),this._ensureImageItemName(b)}this._eventManager.imageContentChangedEvent.notify(d)}}catch(w){r={error:w}}finally{try{p&&!p.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}this._productHandler.updateSelection()},e.prototype._ensureImageItemName=function(t){t.isVariable&&(t.isVariable=!1,this._variableItemHelper.setVariableValue(t,!0,!0))},e.prototype._normalizeDataList=function(t){for(var e=[],n=t.length,r=function(n){var r=t[n].item;if(r instanceof s.cb&&null!=r.linkId&&-1===e.indexOf(r.linkId)){var o=i._product.getAllItems({ignoreMockups:!1,flatGroupItems:!0}).filter((function(t){return t instanceof s.cb&&t.linkId===r.linkId}));t.push.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}(o.map((function(e){return{item:e,imageData:t[n].imageData,tags:t[n].tags}})))),e.push(r.linkId)}},i=this,o=0;o<n;o++)r(o)},e.prototype.redo=function(){throw new i.e},e.prototype.undo=function(){throw new i.e},e.setDataToImage=function(t,e){null!=t.name&&(e.displayName=t.name),e.isUserImage=t.isUserImage,e.source.setIdWithOrigin(t.storageId,t.origin),e.source.pageIndex=t.pageIndex,e.source.width=t.size.width,e.source.height=t.size.height,e.source.isVector=t.isVector},e}(o.a)},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var r,i=n(482),o=n(582);!function(t){t[t.none=0]="none",t[t.bullet=1]="bullet",t[t.minus=2]="minus"}(r||(r={}));class a{}class s extends o.a{isMatch(t){return t instanceof s&&!!super.isMatch(t)&&this.type===t.type}}class l extends i.a{constructor(){super(...arguments),this.items=[]}}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.pointTextFrame=0]="pointTextFrame",t[t.pathTextFrame=1]="pathTextFrame",t[t.shapeTextFrame=2]="shapeTextFrame",t[t.archedTextFrame=3]="archedTextFrame"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(434),i=n(422),o=n(411),a=n(406),s=function(){function t(t,e,n,r,i,o){if(this._equalityTolerance=1e-6,6==arguments.length)this.setTransform(t,e,n,r,i,o);else{if(0!=arguments.length)throw new Error("Arguments error");this.setTransform(1,0,0,1,0,0)}}return Object.defineProperty(t.prototype,"angle",{get:function(){return Object(i.d)(Math.atan(-this.m01/this.m00))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleX",{get:function(){return Math.sqrt(this.m00*this.m00+this.m10*this.m10)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleY",{get:function(){return Math.sqrt(this.m01*this.m01+this.m11*this.m11)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"translateX",{get:function(){return this.m02},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"translateY",{get:function(){return this.m12},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIdentity",{get:function(){return Object(i.e)(this.m00,1,this._equalityTolerance)&&Object(i.e)(this.m01,0,this._equalityTolerance)&&Object(i.e)(this.m02,0,this._equalityTolerance)&&Object(i.e)(this.m10,0,this._equalityTolerance)&&Object(i.e)(this.m11,1,this._equalityTolerance)&&Object(i.e)(this.m12,0,this._equalityTolerance)},enumerable:!0,configurable:!0}),t.prototype.setTransform=function(t,e,n,r,i,o){this.m00=t,this.m10=e,this.m01=n,this.m11=r,this.m02=i,this.m12=o},t.prototype.transformPoint=function(t,e){void 0===e&&(e=!1);var n=e?new r.a:t,i=t.x,o=t.y;return n.x=i*this.m00+o*this.m01+this.m02,n.y=i*this.m10+o*this.m11+this.m12,n},t.prototype.concatenate=function(t){var e=this.m00,n=this.m01;this.m00=e*t.m00+n*t.m10,this.m01=e*t.m01+n*t.m11,this.m02=e*t.m02+n*t.m12+this.m02;var r=this.m10,i=this.m11;return this.m10=r*t.m00+i*t.m10,this.m11=r*t.m01+i*t.m11,this.m12=r*t.m02+i*t.m12+this.m12,this},t.prototype.rotate=function(e){e=Object(i.c)(e);var n=Math.cos(e),r=Math.sin(e);return this.concatenate(new t(n,r,-r,n,0,0))},t.prototype.rotateAt=function(t,e,n){return this.translate(e,n),this.rotate(t),this.translate(-e,-n),this},t.prototype.scale=function(e,n){return this.concatenate(new t(e,0,0,n,0,0))},t.prototype.scaleRelativeToPoint=function(e,n,r){return this.concatenate(new t(e,0,0,n,r.x*(1-e),r.y*(1-n)))},t.prototype.translate=function(e,n){return this.concatenate(new t(1,0,0,1,e,n))},t.prototype.clone=function(){return new t(this.m00,this.m10,this.m01,this.m11,this.m02,this.m12)},t.prototype.updateObjectByMatrix=function(t,e,n){if(null==t)throw new a.a("object cannot be null");if(!o.isNumber(t[e])||!o.isNumber(t[e]))throw new a.a("object members by given keys nust be a numbers!");var i=this.transformPoint(new r.a(t[e],t[n]));return t[e]=i.x,t[n]=i.y,t},t.prototype.getInversed=function(){var e=this._determinant;return new t(this.m11/e,-this.m10/e,-this.m01/e,this.m00/e,(this.m01*this.m12-this.m11*this.m02)/e,(this.m10*this.m02-this.m00*this.m12)/e)},t.prototype.equals=function(t){return Object(i.e)(this.m00,t.m00,this._equalityTolerance)&&Object(i.e)(this.m01,t.m01,this._equalityTolerance)&&Object(i.e)(this.m02,t.m02,this._equalityTolerance)&&Object(i.e)(this.m10,t.m10,this._equalityTolerance)&&Object(i.e)(this.m11,t.m11,this._equalityTolerance)&&Object(i.e)(this.m12,t.m12,this._equalityTolerance)},Object.defineProperty(t.prototype,"_determinant",{get:function(){return this.m00*this.m11-this.m01*this.m10},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";var r,i,o,a,s,l,u,c;n.d(e,"d",(function(){return r})),n.d(e,"f",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"h",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),function(t){t[t.ShrinkToContentWidth=0]="ShrinkToContentWidth",t[t.StretchToContentWidth=1]="StretchToContentWidth",t[t.ShrinkOrStretchToContentWidth=2]="ShrinkOrStretchToContentWidth",t[t.ShrinkToContentHeight=3]="ShrinkToContentHeight",t[t.StretchToContentHeight=4]="StretchToContentHeight",t[t.ShrinkOrStretchToContentHeight=5]="ShrinkOrStretchToContentHeight",t[t.ShrinkToContent=6]="ShrinkToContent",t[t.StretchToContent=7]="StretchToContent",t[t.ShrinkOrStretchToContent=8]="ShrinkOrStretchToContent"}(r||(r={})),function(t){t[t.Size=0]="Size",t[t.Scale=1]="Scale"}(i||(i={})),function(t){t[t.Clip=0]="Clip",t[t.FitToWidth=1]="FitToWidth",t[t.FitToBox=2]="FitToBox",t[t.ExpandBox=3]="ExpandBox"}(o||(o={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify",t[t.LastLeft=4]="LastLeft",t[t.LastRight=5]="LastRight",t[t.LastCenter=6]="LastCenter"}(a||(a={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(s||(s={})),function(t){t[t.Ascent=0]="Ascent",t[t.CapHeight=1]="CapHeight",t[t.Leading=2]="Leading",t[t.XHeight=3]="XHeight",t[t.Fixed=4]="Fixed",t[t.EmboxHeight=5]="EmboxHeight"}(l||(l={})),function(t){t[t.Off=0]="Off",t[t.WidthOnly=1]="WidthOnly",t[t.HeightOnly=2]="HeightOnly",t[t.WidthHeight=3]="WidthHeight"}(u||(u={})),function(t){t[t.Off=0]="Off",t[t.FitToBox=1]="FitToBox",t[t.FitToWidth=2]="FitToWidth",t[t.Fill=3]="Fill"}(c||(c={}))},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.AZTEC="AZTEC",t.CODABAR="CODABAR",t.CODE_39="CODE_39",t.CODE_93="CODE_93",t.CODE_128="CODE_128",t.DATA_MATRIX="DATA_MATRIX",t.EAN_8="EAN_8",t.EAN_13="EAN_13",t.ITF="ITF",t.PDF_417="PDF_417",t.QR_CODE="QR_CODE",t.UPC_A="UPC_A",t.UPC_E="UPC_E",t.MSI="MSI",t.PLESSEY="PLESSEY",t.IMB="IMB",t.DATABAR_EXPANDED_STACKED="DATABAR_EXPANDED_STACKED"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(422),i=function(){function t(t){this.FirstLineIndent=0,this.SpaceAfter=0,this.SpaceBefore=0,this.LeftIndent=0,this.RightIndent=0,null!=t&&(this.FirstLineIndent="number"==typeof t.FirstLineIndent?t.FirstLineIndent:0,this.SpaceAfter="number"==typeof t.SpaceAfter?t.SpaceAfter:0,this.SpaceBefore="number"==typeof t.SpaceBefore?t.SpaceBefore:0,this.LeftIndent="number"==typeof t.LeftIndent?t.LeftIndent:0,this.RightIndent="number"==typeof t.RightIndent?t.RightIndent:0)}return t.prototype.equals=function(e){return e instanceof t&&Object(r.e)(this.FirstLineIndent,e.FirstLineIndent)&&Object(r.e)(this.SpaceAfter,e.SpaceAfter)&&Object(r.e)(this.SpaceBefore,e.SpaceBefore)&&Object(r.e)(this.LeftIndent,e.LeftIndent)&&Object(r.e)(this.RightIndent,e.RightIndent)},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.clone=function(){return new t(this)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var r,i=n(502),o=n(509),a=n(446),s=n(430),l=n(406),u=n(409),c=n(411),h=n(468),p=n(510),f=n(479),d=n(410),g=n(480),m=n(416),y=n(466),_=n(413),b=n(563),v=n(443),w=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),C=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},P=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},x=function(t){function e(n,r,i,l,u){var c=t.call(this)||this;return c._effect=h.a.None,c._overlayEffect=null,c.type=e.type,c.mviKeepTemplateTransform=!1,c.values=[],c.allowedSubfolder=null,c.allowedTabs=null,c.ratioWidthToHeight=null,c.isUserImage=!1,c._onSourcePropertyChanged=function(t,e){switch(e){case"url":case"id":case"pageIndex":c._propertyChanged.notify(c,"source");break;case"isVector":c.applyPermissionsConstrain(),c._propertyChanged.notify(c,"source")}},c._onOverlayEffectPropertyChanged=function(t,e){c._propertyChanged.notify(c,"overlayEffect")},c.imagePermissions=new o.a,c._setViolationSettings(new b.a,!0),c.manipulationPermissions.resizeGrips=new a.a(!0,!1),c.shapePermissions.allowChangeFillColor=!1,c.imagePermissions.allowKeepOverlayColor=!1,c.itemPermissions.itemToolbarPermissions.showSelectButton=!0,c.source=null!=n?new e.ImageSource(n):new e.ImageSource,null!=u&&(c.ratioWidthToHeight=u),null!=i&&null!=l?c.sourceRectangle=new s.a(0,0,i,l):(null!=i&&c.SetWidth(i),null!=l&&c.SetHeight(l)),null!=r&&(c.sourceRectangle.left=r.x,c.sourceRectangle.top=r.y),c}return w(e,t),e.prototype._copy=function(e,n,r,i){var o,a;if(t.prototype._copy.call(this,e,n,r,i),n.imagePermissions=null!=e._imagePermissions?e._imagePermissions.clone():null,n.effect=e._effect,n.overlayEffect=null!=e.overlayEffect?e.overlayEffect.clone():null,n.source=e._source.clone(),n.mviKeepTemplateTransform=e.mviKeepTemplateTransform,null!=e.values){n.values=[];try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.values),l=s.next();!l.done;l=s.next()){var u=l.value;n.values.push(u.clone())}}catch(h){o={error:h}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}}n.allowedSubfolder=e.allowedSubfolder,n.allowedTabs=c.clone(e.allowedTabs),n.ratioWidthToHeight=e.ratioWidthToHeight,n.isUserImage=e.isUserImage},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(d.g)(this._imagePermissions,e._imagePermissions)&&Object(d.g)(this._effect,e._effect)&&Object(d.g)(this._source,e._source)&&Object(d.g)(this.mviKeepTemplateTransform,e.mviKeepTemplateTransform)&&Object(d.g)(this.overlayEffect,e.overlayEffect)&&Object(d.c)(this.values,e.values)&&Object(d.g)(this.allowedSubfolder,e.allowedSubfolder)&&Object(d.c)(this.allowedTabs,e.allowedTabs)&&Object(d.g)(this.ratioWidthToHeight,e.ratioWidthToHeight)&&Object(d.g)(this.isUserImage,e.isUserImage)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},Object.defineProperty(e.prototype,"imagePermissions",{get:function(){return this._imagePermissions},set:function(t){if(null==t)throw new l.a("imagePermissions cannot be null");Object(d.g)(this._imagePermissions,t)||(null!=this._imagePermissions&&this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged),this._imagePermissions=t,this.applyPermissionsConstrain(),this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"imagePermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof b.a))throw new l.a("Shape ViolationSettings property must has ImageViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null==this.imagePermissions||this.imagePermissions.allowEditImage?null!=this.source&&this.source.isVector?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,null==this.imagePermissions||this.imagePermissions.allowChangeImage?this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=!1},Object.defineProperty(e.prototype,"displayName",{get:function(){var t=this;if(null==this._displayName&&null!=this.values&&this.values.length>0){var e=this.values.find((function(e){return e.value.id===t.source.id}));null!=e&&(this.displayName=e.name)}return this._displayName},set:function(t){t!=this._displayName&&(this._displayName=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(t){this._source===t||null!=this._source&&this._source.equals(t)||(null!=this._source&&this._source.removePropertyChanged(this._onSourcePropertyChanged),this._source=t,null!=this._source&&this._source.addPropertyChanged(this._onSourcePropertyChanged),this._propertyChanged.notify(this,"source"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effect",{get:function(){return this._effect},set:function(t){this._effect!==t&&(this._effect=t,this._propertyChanged.notify(this,"effect"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overlayEffect",{get:function(){return this._overlayEffect},set:function(t){f.a.equals(this.overlayEffect,t)||(this._unsubscribeOverlayEffectPropertyChanged(),this._overlayEffect=t,this._subscribeOverlayEffectPropertyChanged(),this._propertyChanged.notify(this,"overlayEffect"))},enumerable:!0,configurable:!0}),e.prototype._subscribeOverlayEffectPropertyChanged=function(){null!=this.overlayEffect&&this.overlayEffect.addPropertyChanged(this._onOverlayEffectPropertyChanged)},e.prototype._unsubscribeOverlayEffectPropertyChanged=function(){null!=this.overlayEffect&&this.overlayEffect.removePropertyChanged(this._onOverlayEffectPropertyChanged)},e.prototype.SetWidth=function(t,e){this.sourceRectangle.width=t,null!=e&&(e=!0),null!=this.source.id&&e&&(this.sourceRectangle.height=this._calculateHeight(t))},e.prototype.SetHeight=function(t,e){this.sourceRectangle.height=t,null!=e&&(e=!0),null!=this.source.id&&e&&(this.sourceRectangle.width=this._calculateWidth(t))},e.prototype.getSource=function(){throw new l.e},e.prototype._calculateHeight=function(t){if(null==this.ratioWidthToHeight)throw new l.c("Field ratioWidthToHeight is not set!");return t/this.ratioWidthToHeight},e.prototype._calculateWidth=function(t){if(null==this.ratioWidthToHeight)throw new l.c("Field ratioWidthToHeight is not set!");return t*this.ratioWidthToHeight},e.prototype.getSimplifiedObject=function(e){c.isArray(e)||c.isString(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["imagePermissions"].concat(e));return n.source={id:this.source.id,width:this.source.width,height:this.source.height,isVector:this.source.isVector,pageIndex:this.source.pageIndex,url:this.source.url,actualSize:this.source.actualSize,saveAspectRatio:this.source.saveAspectRatio,origin:this.source.origin},n.imagePermissions=this.imagePermissions.getSimplifiedObject(),n},e.prototype.getOriginalImageSize=function(){return{width:Object(p.a)(this.source.width,this.source.dpiX||72),height:Object(p.a)(this.source.height,this.source.dpiY||72)}},e.type="ImageItem",C([Object(m.a)({factory:new v.d("subfolder"),displayName:"Allowed subfolder"}),P("design:type",String)],e.prototype,"allowedSubfolder",void 0),C([Object(m.a)({factory:new v.a(Array),displayName:"Allowed tabs"}),P("design:type",Array)],e.prototype,"allowedTabs",void 0),C([Object(m.a)({factory:new v.d("Image"),displayName:"Display name"}),P("design:type",Object),P("design:paramtypes",[Object])],e.prototype,"displayName",null),C([Object(m.a)({enumObject:h.a}),P("design:type",Number),P("design:paramtypes",[Number])],e.prototype,"effect",null),C([Object(m.a)({factory:new v.c(f.a,{color:new _.CmykColor(0,0,0,0,255),opacity:1,blendMode:y.a.Normal}),displayName:"Overlay effect"}),P("design:type",f.a),P("design:paramtypes",[f.a])],e.prototype,"overlayEffect",null),e}(i.a);!function(t){var e=function(){function t(t){c.extend(this,t)}return t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(t){return null!=t&&Object(d.g)(this.id,t.id)&&Object(d.g)(this.width,t.width)&&Object(d.g)(this.height,t.height)&&Object(d.g)(this.isVector,t.isVector)},t}();t.ImageMetaData=e;var n,r=function(){function t(t,e,n){this.name=t,this.value=e,this.transformedRectangle=n}return t.prototype.clone=function(){return new t(this.name,this.value.clone(),this.transformedRectangle.clone())},t.prototype.equals=function(t){return null!=t&&Object(d.g)(this.name,t.name)&&Object(d.g)(this.value,t.value)&&Object(d.g)(this.transformedRectangle,t.transformedRectangle)},t}();t.ImageItemValue=r,function(t){t[t.None=0]="None",t[t.StorageId=3]="StorageId",t[t.Url=4]="Url"}(n=t.ImageSourceType||(t.ImageSourceType={}));var i=function(){function t(t,e,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=!1),void 0===o&&(o=!0),this._storageId=null,this._url=null,this._type=n.None,this._isVector=!1,this._pageIndex=0,this._origin=null,this._actualSize=!1,this._saveAspectRatio=!0,this._dpiX=72,this._dpiY=72,this._propertyChanged=new u.c,this._storageId=t,null!=t&&(this._type=n.StorageId,this._origin=a),this._url=e,null!=e&&(this._type=n.Url,this._actualSize=i,this._saveAspectRatio=o)}return t.prototype.clone=function(){var e=new t;return e.id=this.id,e.url=this.url,e._type=this._type,e._width=this._width,e._height=this._height,e._isVector=this._isVector,e._pageIndex=this._pageIndex,e._origin=null!=this._origin?this._origin.clone():null,e._actualSize=this._actualSize,e._saveAspectRatio=this._saveAspectRatio,e._dpiX=this._dpiX,e._dpiY=this._dpiY,e},t.prototype.equals=function(t){return Object(d.g)(this.id,t.id)&&Object(d.g)(this.url,t.url)&&Object(d.g)(this._type,t._type)&&Object(d.g)(this._width,t._width)&&Object(d.g)(this._height,t._height)&&Object(d.g)(this._origin,t._origin)&&Object(d.g)(this._saveAspectRatio,t._saveAspectRatio)&&t._pageIndex===this._pageIndex&&JSON.stringify(t._origin)===JSON.stringify(this._origin)&&t._actualSize===this._actualSize&&t._saveAspectRatio===this._saveAspectRatio},Object.defineProperty(t.prototype,"id",{get:function(){return this._storageId},set:function(t){this._storageId!==t&&(this._storageId=t,this._propertyChanged.notify(this,"id"))},enumerable:!0,configurable:!0}),t.prototype.setIdWithOrigin=function(t,e){this.id=t,this._setOrigin(e)},Object.defineProperty(t.prototype,"url",{get:function(){return this._url},set:function(t){this._url!==t&&(this._url=t,this._propertyChanged.notify(this,"url"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width!==t&&(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height!==t&&(this._height=t,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVector",{get:function(){return this._isVector},set:function(t){this._isVector!==t&&(this._isVector=t,this._propertyChanged.notify(this,"isVector"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageIndex",{get:function(){return this._pageIndex},set:function(t){t!==this._pageIndex&&(this._pageIndex=t,this._propertyChanged.notify(this,"pageIndex"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this._origin},enumerable:!0,configurable:!0}),t.prototype._setOrigin=function(t){t!==this._origin&&(this._origin=t,this._propertyChanged.notify(this,"origin"))},Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return this._actualSize},set:function(t){this._actualSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"saveAspectRatio",{get:function(){return this._saveAspectRatio},set:function(t){this._saveAspectRatio=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dpiX",{get:function(){return this._dpiX},set:function(t){t>0&&(this._dpiX=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dpiY",{get:function(){return this._dpiY},set:function(t){t>0&&(this._dpiY=t)},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t}();t.ImageSource=i,function(t){var e=function(){function t(t){c.extend(this,t||{}),null!=t&&null!=t.originalSize&&(this.originalSize=new g.a(t.originalSize.width,t.originalSize.height))}return t.prototype.equals=function(t){return null==t&&Object(d.g)(this.type,t.type)&&Object(d.g)(this.data,t.data)&&Object(d.g)(this.originalSize,t.originalSize)},t.prototype.clone=function(){return new t(this)},t}();t.Origin=e}(i=t.ImageSource||(t.ImageSource={}))}(x||(x={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(413),i=n(407),o=n(409),a=n(416),s=n(466),l=n(443),u=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},c=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(){function t(e){if(this._color=null,this._opacity=null,this._blendMode=null,this.$_propertyChanged=new o.c,this.type=t.type,null!=e){var n=e.color,i=e.opacity,a=e.blendMode;this.color=n instanceof r.Color?n:null,this.blendMode="string"==typeof a?a:null,this.opacity="number"==typeof i?i:null}}return t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e.color,o=e.opacity,a=e.blendMode;return r.Color.equals(n,this.color)&&(null==o&&null==this.opacity||Object(i.EqualsOfFloatNumbers)(o,this.opacity))&&(null==a&&null==this.blendMode||a===this.blendMode)},t.prototype.getSimplifiedObject=function(){return{color:this.color,blendMode:this.blendMode,opacity:this.opacity}},t.equals=function(t,e){return null==t&&null==e||null!=t&&t.equals(e)},t.prototype.clone=function(){return new t({blendMode:this.blendMode,color:null!=this.color?this.color.clone():null,opacity:this.opacity})},Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){r.Color.equals(this.color,t)||(this._color=t,this.$_propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blendMode!==t&&(this._blendMode=t,this.$_propertyChanged.notify(this,"blendMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this._opacity},set:function(t){this.opacity!==t&&(this._opacity=t,this.$_propertyChanged.notify(this,"opacity"))},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this.$_propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this.$_propertyChanged.remove(t)},t.type="OverlayEffect",u([Object(a.a)({factory:new l.b}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"color",null),u([Object(a.a)({enumObject:s.a}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"blendMode",null),u([Object(a.a)({factory:new l.d(0)}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"opacity",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(410),i=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.width=t,this.height=e}return t.prototype.equals=function(t){return null!=t&&Object(r.g)(this.width,t.width)&&Object(r.g)(this.height,t.height)},t.prototype.clone=function(){return new t(this.width,this.height)},t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.NotContent=0]="NotContent",t[t.PlaceholderContent=1]="PlaceholderContent",t[t.TopFrame=2]="TopFrame",t[t.BottomFrame=3]="BottomFrame"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(526);class i{constructor(t,e){this.tag=t,this.value=e}equals(t){return this.tag===t.tag&&this.value==t.value}}class o{}class a extends r.a{constructor(){super(...arguments),this.content=[]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}r.fontName="font-name",r.fontSize="font-size",r.color="color",r.bold="bold",r.italic="italic",r.underline="underline",r.penColor="pen-color",r.penWidth="pen-width",r.tracking="tracking",r.leading="leading",r.sub="sub",r.sup="sup",r.allCaps="all-caps",r.smallCaps="small-caps",r.fontFamily="font-family",r.fontStyle="font-style",r.wordSpacingScale="word-spacing-scale",r.supSize="sup-size",r.supPosition="sup-position",r.subSize="sub-size",r.subPosition="sub-position",r.digitType="digit-type",r.openType="ot",r.baselineShift="baseline-shift",r.inkName="ink-name",r.inkSolidity="ink-solidity",r.inkColor="ink-color",r.penInkName="pen-ink-name",r.penInkSolidity="pen-ink-solidity",r.penInkColor="pen-ink-color",r.horizontalScale="horz-scale",r.verticalScale="vert-scale"},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));class r{}r.alignment="alignment",r.firstLineIndent="first-line-indent",r.spaceAfter="space-after",r.spaceBefore="space-before",r.leftIndent="left-indent",r.rightIndent="right-indent",r.listType="list-type";class i{}i.type="list-type",i.bulletChar="bullet-char",i.bulletNumberTabPosition="bullet-number-tab-position",i.numberFormat="number-format",i.numberMode="number-mode",i.level="level",i.startAt="number-start-at"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(433);class i{constructor(t,e){this._colorPalette=t,this._colorParser=e}serialize(t){if(null==t)throw new r.b("Color must not be null");const e=this.getColorIndex(t.color);return e>-1?e:this._colorPalette.addColorToPaletteReturnIndex(t)}getColorIndex(t){return this._colorPalette.getPaletteColors().findIndex((e=>{e.color.equals(t)}))}containsColor(t){return this._colorPalette.getPaletteColors().some((e=>{e.color.equals(t)}))}parse(t){if((t=t.trim()).match(/^\d+$/)){const e=parseInt(t),n=this._colorPalette.getPaletteColorAt(e);if(!n)throw new r.b(`ColorPalette does not contain color with index ${e}.`);return n}return{color:this._colorParser.parse(t)}}containsColorWithIndex(t){return this._colorPalette.getPaletteColorAt(t)>t}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(406),i=n(608),o=n(530),a=n(531);class s{static getTextRange(t){if(t instanceof i.a)return t;this.throwException("range")}static getPosition(t){if(t instanceof o.a)return t;this.throwException("position")}static getEngine(t){if(t instanceof a.a)return t;this.throwException("engine")}static throwException(t){throw new r.c(`Fail to unwrap TextWhizz ${t}!`)}}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return Dt})),n.d(e,"d",(function(){return Ht})),n.d(e,"a",(function(){return Wt})),n.d(e,"c",(function(){return Ut}));var r,i=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},o=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=function(){function t(t){this._productHandler=t}return t.prototype._switchSurface=function(t){var e=this._productHandler.product;if(null!=e){var n=e.surfaces;if(!(n.length<=0)){var r=n.indexOf(this._productHandler.currentSurface);-1===r&&(console.warn("Current surface is not found in product"),r=0);var i,o=n.length-1;i=null!=t?Math.max(Math.min(r+t,o),0):r<o?r+1:0,this.switchToSurface(n.get(i))}}},t.prototype.switchToSurface=function(t){return i(this,void 0,void 0,(function(){var e;return o(this,(function(n){return null==(e=this._productHandler.product)?[2]:0===e.surfaces.length?(console.warn("Surfaces are not found!"),[2]):(this._productHandler.currentSurface===t||(this._productHandler.currentSurface=t),[2])}))}))},t.prototype.getNextSurface=function(t){return i(this,void 0,void 0,(function(){var e,n,r,i;return o(this,(function(o){return null==(e=this._productHandler.product)?[2]:(n=e.surfaces).length<=0?[2,null]:(-1==(r=n.indexOf(this._productHandler.currentSurface))&&(console.warn("Current surface is not found in product"),r=0),i=r,null!=t?i+=t:i++,[2,e.surfaces.get(i)])}))}))},t.prototype.switchToNextSurface=function(){this._switchSurface()},t.prototype.switchSurfaceForward=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this._switchSurface(1),[2]}))}))},t.prototype.switchSurfaceBackward=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this._switchSurface(-1),[2]}))}))},t}();!function(t){t.switchToSurface="switchToSurface",t.getNextSurface="getNextSurface",t.switchToNextSurface="switchToNextSurface",t.switchSurfaceForward="switchSurfaceForward",t.switchSurfaceBackward="switchSurfaceBackward"}(r||(r={}));var s,l,u=n(406),c=n(441),h=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},s(t,e)},function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n,r){var i=t.call(this,r,n)||this;return i._product=e,i}return h(e,t),e}(c.b),f=function(){function t(){}return t.prototype.rotate=function(t,e){t.rotateAngle+=this._getRotationTypeAngle(e)},t.prototype._getRotationTypeAngle=function(t){switch(t){case l.Rotate180:return 180;case l.Rotate270:return 270;default:return 90}},t}();!function(t){t[t.None=0]="None",t[t.Rotate90=90]="Rotate90",t[t.Rotate180=180]="Rotate180",t[t.Rotate270=270]="Rotate270",t[t.Auto=-1]="Auto"}(l||(l={}));var d,g=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),m=function(t){function e(e,n,r,i){var o=t.call(this,r,n,i)||this;return o._productHandler=e,o._rotationAlgorithm=new f,o}return g(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this.rotateProduct(this._args.rotationType)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e.prototype.rotateProduct=function(t){return null!=this._productHandler&&null!=this._product&&this._rotationAlgorithm.rotate(this._productHandler.currentSurface,t),this._productHandler.contentAngle},e}(p),y=n(445),_=n(407),b=n(408),v=n(421),w=n(413),C=n(492),P=n(432),x=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},S=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},I=function(){function t(t,e,n){this._itemData=t,this._colorPreviewServce=e,this._colorParser=n}return t.prototype.applyImage=function(t){var e=this.applyShape(t);return this._applyColor(t,"overlayColor","fillColor")||e},t.prototype.applyLine=function(t){var e=this._applyOpacity(t);return this._applyColor(t)||e},t.prototype.applyDashedLine=function(t){var e=this._applyOpacity(t);return e=this._applyColor(t)||e,this._applyColor(t,"altColor","altColor")||e},t.prototype.applyBaseText=function(t){return x(this,void 0,void 0,(function(){var e;return S(this,(function(n){switch(n.label){case 0:return e=this.applyShape(t),e=this._applyColor(t)||e,e=this._applyFont(t)||e,e=this._applyTextProperty(t,"underline")||e,e=this._applyTextProperty(t,"tracking")||e,e=this._applyTextProperty(t,"leading")||e,[4,this._applyShadow(t)];case 1:return e=n.sent()||e,[2,e=this._applyStroke(t)||e]}}))}))},t.prototype.applyShape=function(t){var e=this._applyOpacity(t);return e=this._applyFillColor(t)||e,e=this._applyBorderColor(t)||e,this._applyBorderWidth(t)||e},t.prototype.applyClipart=function(t){return this._applyClipartColors(t)},t.prototype.applyBarcode=function(t){var e=this.applyShape(t);return this._applyBarcodeColor(t)||e},t.prototype.applyPlaceholder=function(t){var e=!1;return v.a.getContentEffect(t)===P.e.Colorize&&(e=this._applyColor(t,"contentFillColor","fillColor")||e,this._itemData.fillColor=null),e=this.applyShape(t)||e,this._applyColor(t,"overlayColor")||e},t.prototype._applyFillColor=function(t){return this._applyColor(t,"fillColor","fillColor")},t.prototype._applyClipartColors=function(t){var e=this,n=!1;return this._itemData.clipartColors.forEach((function(r,i){null!=r&&e._tryApplyColor(r,(function(e){t.setColor(t.colorGroups[i],e),n=!0}))})),n},t.prototype._applyTextFillColor=function(t){return this._applyColor(t,"fillColor","textFillColor")},t.prototype._applyFont=function(t){if(null==this._itemData.font)return!1;var e=!1;return this._itemData.font.postScriptName&&(t.font.postScriptName=this._itemData.font.postScriptName,e=!0),null!=this._itemData.font.fauxItalic&&(t.font.fauxItalic=this._itemData.font.fauxItalic,e=!0),null!=this._itemData.font.fauxBold&&(t.font.fauxBold=this._itemData.font.fauxBold,e=!0),this._itemData.font.size&&(t.font.size=this._itemData.font.size,e=!0),null!=this._itemData.font.allCaps&&(t.font.allCaps=this._itemData.font.allCaps,e=!0),e},t.prototype._applyTextProperty=function(t,e){return null!=this._itemData[e]&&(t[e]=this._itemData[e],!0)},t.prototype._applyShadow=function(t){return x(this,void 0,void 0,(function(){var e,n;return S(this,(function(r){switch(r.label){case 0:return null==this._itemData.shadow||null==t.shadow?[2,!1]:(e=!1,[4,this._colorPreviewServce.getPreviewAsync(t.shadow.color)]);case 1:return n=r.sent(),this._itemData.shadow.color&&this._itemData.shadow.color!==n.toString()&&(e=this._tryApplyColor(this._itemData.shadow.color,(function(e){return t.shadow.color=e}))),this._itemData.shadow.angle&&this._itemData.shadow.angle!==t.shadow.angle&&(t.shadow.angle=this._itemData.shadow.angle,e=!0),this._itemData.shadow.distance&&this._itemData.shadow.distance!==t.shadow.distance&&(t.shadow.distance=this._itemData.shadow.distance,e=!0),this._itemData.shadow.size&&this._itemData.shadow.size!==t.shadow.size&&(t.shadow.size=this._itemData.shadow.size,e=!0),[2,e]}}))}))},t.prototype._applyStroke=function(t){if(null==this._itemData.stroke||null==t.stroke)return!1;var e=!1;return this._itemData.stroke.color&&(e=this._tryApplyColor(this._itemData.stroke.color,(function(e){return t.stroke.color=e}))),this._itemData.stroke.size&&this._itemData.stroke.size!==t.stroke.size&&(t.stroke.size=this._itemData.stroke.size,e=!0),e},t.prototype._applyOpacity=function(t){return null!=this._itemData.opacity&&(t.opacity=this._itemData.opacity,!0)},t.prototype._applyBorderColor=function(t){return this._applyColor(t,"borderColor","borderColor")},t.prototype._applyBorderWidth=function(t){return null!=this._itemData.borderWidth&&(t.borderWidth=this._itemData.borderWidth,!0)},t.prototype._applyColor=function(t,e,n){return void 0===e&&(e="color"),void 0===n&&(n="color"),null!=this._itemData[n]&&this._tryApplyColor(this._itemData[n],(function(n){"overlayColor"===e&&(t instanceof b.J||t instanceof b.cb)?v.a.setOverlayEffectColor(t,n):t[e]=n}))},t.prototype._tryApplyColor=function(t,e){var n=this._colorParser.parse(t);return!!n&&(e(n),!0)},t.prototype._applyBarcodeColor=function(t){return this._applyColor(t,"color","barcodeColor")},t}(),O=n(410),T=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},E=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},L=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},R=function(){function t(t,e){this._colorPreviewService=t,this._colorParser=e}return t.prototype.apply=function(t,e,n){return T(this,void 0,void 0,(function(){var r,i,o,a,s,l,u;return E(this,(function(c){switch(c.label){case 0:if(!t)return[2,!1];r=!1,c.label=1;case 1:c.trys.push([1,6,7,8]),i=L(t.getAllItems()),o=i.next(),c.label=2;case 2:return o.done?[3,5]:(a=o.value,[4,this.applyToItem(a,e,n)]);case 3:r=c.sent()||r,c.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return s=c.sent(),l={error:s},[3,8];case 7:try{o&&!o.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}return[7];case 8:return[2,r]}}))}))},t.prototype.applyToItem=function(t,e,n){return T(this,void 0,void 0,(function(){var r,i,o;return E(this,(function(a){switch(a.label){case 0:return r=n||t.themeBinding,t&&e&&r?(i=this._getItemDataByItemType(t,e,r),o=new I(i,this._colorPreviewService,this._colorParser),t instanceof b.J?[2,o.applyImage(t)]:t instanceof b.cb?[2,this._applyToPlaceholder(t,e,r)]:t instanceof b.y?[2,o.applyDashedLine(t)]:t instanceof b.T?[2,o.applyLine(t)]:t instanceof b.o?[4,o.applyBaseText(t)]:[3,2]):[2,!1];case 1:return[2,a.sent()];case 2:return t instanceof b.k?[2,o.applyBarcode(t)]:t instanceof b.kb?[2,o.applyShape(t)]:t instanceof b.r?[2,o.applyClipart(t)]:[2]}}))}))},t.prototype._getItemDataByItemType=function(t,e,n){return t instanceof b.J?this._getMergedItemData(e,n,n.img):t instanceof b.T?this._getMergedItemData(e,n,n.line):t instanceof b.o?this._getMergedItemData(e,n,n.text):t instanceof b.k?this._getMergedItemData(e,n,n.barcode):this._getMergedItemData(e,n)},t.prototype._applyToPlaceholder=function(t,e,n){return T(this,void 0,void 0,(function(){var r,i,o,a,s,l,u,c,h,p,f,d,g;return E(this,(function(m){switch(m.label){case 0:return r=!1,null!=(i=this._getMergedItemData(e,n)).fillColor&&v.a.isBgContainerItem(t)&&v.a.clearImageContent(t),t.content instanceof b.N?[4,this.applyToItem(t.content,e,n)]:[3,2];case 1:r=m.sent(),m.label=2;case 2:if(null==t.topFrames)return[3,10];m.label=3;case 3:m.trys.push([3,8,9,10]),o=L(t.topFrames),a=o.next(),m.label=4;case 4:return a.done?[3,7]:(c=a.value,[4,this.applyToItem(c,e)]);case 5:r=m.sent()||r,m.label=6;case 6:return a=o.next(),[3,4];case 7:return[3,10];case 8:return s=m.sent(),p={error:s},[3,10];case 9:try{a&&!a.done&&(f=o.return)&&f.call(o)}finally{if(p)throw p.error}return[7];case 10:if(null==t.bottomFrames)return[3,18];m.label=11;case 11:m.trys.push([11,16,17,18]),l=L(t.bottomFrames),u=l.next(),m.label=12;case 12:return u.done?[3,15]:(c=u.value,[4,this.applyToItem(c,e)]);case 13:r=m.sent()||r,m.label=14;case 14:return u=l.next(),[3,12];case 15:return[3,18];case 16:return h=m.sent(),d={error:h},[3,18];case 17:try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(d)throw d.error}return[7];case 18:return[2,new I(i,this._colorPreviewService,this._colorParser).applyPlaceholder(t)||r]}}))}))},t.prototype._getMergedItemData=function(t,e,n){var r,i,o=this;void 0===n&&(n=null);var a=new C.b;if(e.styles){var s=e.styles.map((function(e){return o._getThemeItemData(e,t)}));try{for(var l=L(s),u=l.next();!u.done;u=l.next()){var c=u.value;c&&(a=this._applyStyle(a,c))}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}return this._applyTHBMColor(t,e,n,a)},t.prototype._applyStyle=function(t,e){return t.color=Object(O.a)(t.color,e.color),t.fillColor=Object(O.a)(t.fillColor,e.fillColor),t.borderColor=Object(O.a)(t.borderColor,e.borderColor),t.borderWidth=Object(O.a)(t.borderWidth,e.borderWidth),t.altColor=Object(O.a)(t.altColor,e.altColor),t.leading=Object(O.a)(t.leading,e.leading),t.tracking=Object(O.a)(t.tracking,e.tracking),t.underline=Object(O.a)(t.underline,e.underline),t.horizontalLineColor=Object(O.a)(t.horizontalLineColor,e.horizontalLineColor),t.verticalLineColor=Object(O.a)(t.verticalLineColor,e.verticalLineColor),t.barcodeColor=Object(O.a)(t.barcodeColor,e.barcodeColor),t.opacity=Object(O.a)(t.opacity,e.opacity),t.font=this._applySettings(t.font,e.font),t},t.prototype._applyTHBMColor=function(t,e,n,r){var i=this;return r.fillColor=Object(O.a)(r.fillColor,this._getTHMBColor(e.fill,t)),r.textFillColor=Object(O.a)(r.textFillColor,this._getTHMBColor(e.textFill,t)),r.borderColor=Object(O.a)(r.borderColor,this._getTHMBColor(e.border,t)),r.color=Object(O.a)(r.color,this._getTHMBColor(n,t)),r.altColor=Object(O.a)(r.altColor,this._getTHMBColor(e.altline,t)),r.horizontalLineColor=Object(O.a)(r.horizontalLineColor,this._getTHMBColor(e.horizontal,t)),r.verticalLineColor=Object(O.a)(r.verticalLineColor,this._getTHMBColor(e.vertical,t)),r.barcodeColor=Object(O.a)(r.barcodeColor,this._getTHMBColor(e.barcode,t)),null!=e.shadow&&(null==r.shadow&&(r.shadow=new C.c),r.shadow.color=Object(O.a)(r.shadow.color,this._getTHMBColor(e.shadow,t))),null!=e.stroke&&(null==r.stroke&&(r.stroke=new C.d),r.stroke.color=Object(O.a)(r.stroke.color,this._getTHMBColor(e.stroke,t))),r.clipartColors=null!=e.clipartColors?e.clipartColors.map((function(e){return i._getTHMBColor(e,t)})):[],r},t.prototype._applySettings=function(t,e){var n,r;if(null==e)return t;if(null==t)return e;try{for(var i=L(Object.getOwnPropertyNames(e)),o=i.next();!o.done;o=i.next()){var a=o.value,s=e[a];null!=s&&(t[a]=s)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},t.prototype._getThemeItemData=function(t,e){return t?e[t]:null},t.prototype._getTHMBColor=function(t,e){return t?e[t]:null},t}(),k=n(464),j=n(471),A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},B=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},M=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},N=function(t){function e(e,n,r,i,o,a,s,l){var u=t.call(this,r,n,i)||this;return u._productHandler=e,u._commandManager=o,u._productThemeManager=a,u._canvas=s,u._eventManager=l,u}return A(e,t),e.prototype._executeCommandBody=function(){return F(this,void 0,void 0,(function(){var t,e=this;return B(this,(function(n){return t=this._args.data instanceof b.K,[2,this.changeBackground(this._args.surfaces,t?"image":"solidColor",t?function(t){t instanceof b.cb&&e._setBgImage(t,e._args.data)}:function(t){return F(e,void 0,void 0,(function(){return B(this,(function(e){switch(e.label){case 0:return t instanceof b.cb||t instanceof b.gb?[4,this._selectBgRectangleColor(t,this._args.data)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t?null:this._args.data)]}))}))},e.prototype.changeBackground=function(t,e,n,r){return F(this,void 0,void 0,(function(){var i,o,a,s,l,c,h,p,f=this;return B(this,(function(d){switch(d.label){case 0:switch(d.trys.push([0,,9,10]),i=void 0,e){case"image":case"solidColor":i=t.map((function(t){return f.getOrCreateBgItems(t,e)})).reduce((function(t,e){return t.concat(e)}),[]);break;default:throw new u.e}d.label=1;case 1:d.trys.push([1,6,7,8]),o=M(i),a=o.next(),d.label=2;case 2:return a.done?[3,5]:(s=a.value)instanceof b.cb||s instanceof b.gb?(s instanceof b.cb&&(v.a.clearImageContent(s),l=s.content,r instanceof w.Color?(r.equals(s.fillColor)||(s.themeBinding.fill=null,l.themeBinding.fill=null),s.fillColor=r):null!=r&&(s.themeBinding.fill=r.title,l.themeBinding.fill=r.title)),[4,n(s)]):[3,4];case 3:d.sent(),d.label=4;case 4:return a=o.next(),[3,2];case 5:return[3,8];case 6:return c=d.sent(),h={error:c},[3,8];case 7:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 8:return v.a.updateItems(i,this._productHandler,this._canvas),[2,i];case 9:return[7];case 10:return[2]}}))}))},e.prototype.getOrCreateBgItems=function(t,e){var n,r,i,o,a=this,s=function(t){var e=new b.cb(t);return e.contentResizeMode=b.ib.Fill,e.content=new b.J,a._productHandler.getHandler(e.content).setRectangle(_.RotatedRectangleF.fromRectangleF(t)),e},l=function(t){return t.every((function(t){return t instanceof b.cb||t instanceof b.gb}))},c=t.containers.first((function(t){return t.name===y.a.BG_CONTAINER_NAME})),h=c.items.toArray();if(0===h.length){var p=s((g=t.printAreas.getItem(0)).getBounds(k.a.Bleed));return this._addItem(t,c,p,!1),[p]}if(t.printAreas.length===h.length){for(var f=[],d=0;d<t.printAreas.length;d++){var g=t.printAreas.getItem(d),m=h[d];if(m instanceof b.J){var w=m,C=w.frontendPermissions;this._commandManager.execute(Wt.deleteItems,{items:[w],force:!0}),(p=s(g.getBounds(k.a.Bleed))).frontendPermissions=C,this._addItem(t,c,p,!1),f.push(p)}else if(m instanceof b.cb){var P=m;if(e!==y.a.BG_SOLIDCOLOR){var x=g.getBounds(k.a.Bleed),S=_.Path.rectangle(x.left,x.top,x.width,x.height),I=!1;P.sourcePath.isEqual(S)||(P.sourcePath=S,I=!0),_.RectangleF.isEqual(P.sourceRectangle,x)||(P.sourceRectangle=x,I=!0),(I&&0!==P.transform.translateX||0!==P.transform.translateY)&&(P.transform.setTranslateX(0),P.transform.setTranslateY(0));var O=_.RotatedRectangleF.fromRectangleF(x),T=this._productHandler.getHandler(P.content);T.getTransformedRectangle().equals(O)||(T.setTransformedRectangle(O,!0),I=!0),I&&v.a.updateItems(h,this._productHandler,this._canvas,{redraw:!1})}else P.content instanceof b.J&&P.content.source.type!=b.J.ImageSourceType.None&&(P.sourceRectangle=g.getBounds(k.a.Bleed));f.push(P)}}return f}if(l(h)){var E=y.a.BG_SOLIDCOLOR;if(e===E){var L=h.find((function(t){return t.name===E}));if(null==L){var R=(i=(g=t.printAreas.getItem(0)).getBounds(k.a.Bleed),o=new b.gb(i),a._productHandler.getHandler(o).setRectangle(_.RotatedRectangleF.fromRectangleF(i)),o.borderWidth=0,o);R.name=E,this._addItem(t,c,R,!1)}}if(null!=this._historyArgs.history&&this._historyArgs.history.pause(),l(h=c.items.toArray()))try{for(var j=M(h),A=j.next();!A.done;A=j.next()){var F=A.value,B=F.name===E;F.visualizationPermissions.noPrint=e===E?!B:B,F.visualizationPermissions.noShow=e===E?!B:B}}catch(N){n={error:N}}finally{try{A&&!A.done&&(r=j.return)&&r.call(j)}finally{if(n)throw n.error}}return v.a.updateItems(h,this._productHandler,this._canvas,{redraw:!0}),null!=this._historyArgs.history&&this._historyArgs.history.resume(),h}throw new u.e("Containers contains unexpected content")},e.prototype._addItem=function(t,e,n,r){this._commandManager.execute(Ht.addItems,{surface:t,targetContainer:e,items:[n],selectOnCanvas:!0})},e.prototype._setBgImage=function(t,e){var n,r=t.content;this._productHandler.getHandler(r).setTransformedRectangle(this._getBgImageRectangle(t,e)),t.fillColor=new w.RgbColor(0,0,0,0),r.fillColor=new w.RgbColor(0,0,0,0),null!=r.overlayEffect&&(r.imagePermissions.allowKeepOverlayColor?v.a.setOverlayEffectColor(r,r.overlayEffect.color):r.overlayEffect.color=null),j.a.setDataToImage(e,r),null===(n=this._eventManager)||void 0===n||n.imageContentChangedEvent.fire(t)},e.prototype._getBgImageRectangle=function(t,e){var n,r,i=this._productHandler.getHandler(t).getTransformedRectangle(!1),o=e.size.width/e.size.height;return o<i.width/i.height?r=(n=i.width)/o:n=(r=i.height)*o,new _.RotatedRectangleF(i.centerX,i.centerY,n,r,0)},e.prototype._selectBgRectangleColor=function(t,e){return F(this,void 0,void 0,(function(){return B(this,(function(n){switch(n.label){case 0:return e instanceof w.Color?(t.fillColor=e,[3,3]):[3,1];case 1:return null==e?[3,3]:(t.themeBinding.fill=e.title,[4,new R(this._canvas.viewer.colorPreviewService,this._canvas.viewer.colorParser).applyToItem(t,this._productThemeManager.currentProductTheme)]);case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(p),z=n(411),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),H=function(t){function e(e,n,r){var i=t.call(this,r,n)||this;return i.surface=e,i}return D(e,t),e}(c.b),W=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},V=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},q=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},G=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(q(arguments[e]));return t},$=function(t){function e(e,n,r,i,o,a,s,l){var u=t.call(this,r.surface,n,r)||this;return u._productHandler=e,u._productThemeManager=i,u._canvas=o,u._variableItemHelper=a,u._commandManager=s,u._eventManager=l,u}return W(e,t),e.prototype._executeCommandBody=function(){return U(this,void 0,void 0,(function(){var t,e,n,r,i,o,a,s,l,u,c,h;return V(this,(function(p){switch(p.label){case 0:return t=this._args,e=t.items,n=t.targetGroupItem,r=t.index,i=t.orderIndex,o=z.extend({targetContainer:this._productHandler.userEditContainer,surface:this._productHandler.currentSurface,selectOnCanvas:!0,index:null,orderIndex:null,ignoreOrderRules:!1,ignoreCanvasRotate:!0,createCloneName:!1},this._args),this._historyArgs.history.pause(),null==n?[3,2]:[4,this._insertItemsIntoGroupItem(e,n,r,i)];case 1:return p.sent(),this._eventManager.itemCollectionChangedEvent.notify(),[3,11];case 2:p.trys.push([2,7,8,9]),a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),s=a.next(),p.label=3;case 3:return s.done?[3,6]:(l=s.value,[4,this._addItem(o,l)]);case 4:p.sent(),p.label=5;case 5:return s=a.next(),[3,3];case 6:return[3,9];case 7:return u=p.sent(),c={error:u},[3,9];case 8:try{s&&!s.done&&(h=a.return)&&h.call(a)}finally{if(c)throw c.error}return[7];case 9:return this._canvas.updateTexts(),[4,v.a.waitForItemsUpdated(e,this._canvas)];case 10:p.sent(),p.label=11;case 11:return e.some((function(t){return t instanceof b.eb}))||this._canvas.redraw(),this._historyArgs.history.resume(),o.selectOnCanvas&&this._commandManager.execute(Ut.selectItems,{items:e.filter((function(t){return!t.locked}))}),[2]}}))}))},e.prototype._addItem=function(t,e){return U(this,void 0,void 0,(function(){var n,r,i,o,a;return V(this,(function(s){switch(s.label){case 0:return null==this._productThemeManager.currentProductTheme?[3,2]:[4,new R(this._canvas.viewer.colorPreviewService,this._canvas.viewer.colorParser).applyToItem(e,this._productThemeManager.currentProductTheme)];case 1:s.sent(),s.label=2;case 2:return null==t.index&&(t.index=-1),n=t.targetContainer,this._args.createCloneName&&(e.name=v.a.createCloneName(e,this._variableItemHelper,this._productHandler)),(r=n.items).add(e),-1!==t.index?n.items.move(r.length-1,t.index):!t.ignoreOrderRules&&e instanceof b.J&&r.length>1&&(i=z.find(r.toArray().slice().reverse(),(function(t){return t instanceof b.q||t instanceof b.ab})),o=z.find(r.toArray(),(function(t){return t instanceof b.o})),a=-1,null!=i?a=r.indexOf(i)+1:null!=o&&(a=r.indexOf(o)),-1!==a&&n.items.move(r.length-1,a)),[2]}}))}))},e.prototype._insertItemsIntoGroupItem=function(t,e,n,r){return U(this,void 0,void 0,(function(){var i,o,a;return V(this,(function(s){switch(s.label){case 0:if(e instanceof b.R?e.addItems(t,n,r):e.addItems(t,n),!((i=G(t,t.filter((function(t){return t instanceof b.G})).reduce((function(t,e){return G(t,e.getNestedItems(!0))}),[]))).length>0))return[3,2];for(o=e;null!=o.parentGroupItem;)o=o.parentGroupItem;return a=o.locked,o.locked=!0,[4,v.a.waitForItemsUpdated(i,this._canvas)];case 1:s.sent(),o.locked=a,s.label=2;case 2:return[2]}}))}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(H),X=n(412),K=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},J=function(t){function e(e,n,r,i,o,a){var s,l=t.call(this,r.items,n,r)||this;return l._productHandler=e,l._canvas=i,l._commandManager=a,l._conf=null===(s=null==o?void 0:o.messages)||void 0===s?void 0:s.delete,null==l._conf&&(l._conf={enabled:!1}),l}return K(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){return t=z.extend({force:!1,autoUngroup:!0,autoParentGroupDelete:!0},this._args),this.deleteItems(t.items,t.force,t.autoUngroup,t.autoParentGroupDelete),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.deleteItems=function(t,e,n,r){var i,o,a=this;if(0!=t.length){var s=t.every((function(t){return a._productHandler.getHandler(t).getPermissions().allowDelete}));if((s||e)&&(e||!this._conf.enabled||confirm(this._conf.message))){for(var l=new Map,u=0;u<t.length;u++){var c=t[u],h=c.parentGroupItem;null!=h?(l.has(h)||l.set(h,[]),l.get(h).push(c)):this.deleteItem(c)}try{for(var p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),f=p.next();!f.done;f=p.next()){var d=Y(f.value,2),g=d[0],m=d[1];this._removeChildItemsFromGroup(g,m,r,n)}}catch(y){i={error:y}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}this._canvas.updateTexts(),this._canvas.updateSelection(),this._productHandler.redraw()}}},e.prototype._removeChildItemsFromGroup=function(t,e,n,r){t instanceof b.R?e.forEach((function(e){return t.removeItems([e])})):e.forEach((function(e){return t.items.remove(e)})),n&&0===t.items.length?this.deleteItem(t):r&&t.items.length<2&&this._commandManager.execute(Wt.ungroupItems,{items:t.items.toArray()})},e.prototype.deleteItem=function(t){if(null!=t){var e=null!=t.parentGroupItem?t.parentGroupItem:t.parentContainer;null!=e&&e.items.contains(t)&&(e instanceof b.R?e.removeItems([t]):e.items.remove(t))}},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Z=n(437),Q=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tt=function(t){function e(e,n,r){void 0===r&&(r=null);var i=t.call(this,n)||this;return i._productHandler=e,i._canvas=r,i}return Q(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e,n,r=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){return null==this._canvas||(t=[],e=this._args.items,n=null!=this._args.multiSelectMode?this._args.multiSelectMode:d.None,e.forEach((function(e){var i=r._productHandler.getHandler(e),o=!1;(i instanceof P.b||i instanceof P.i)&&i.isEmpty()&&(o=!0),null==i||i.isLocked()||!i.isVisible()&&!o||(r._canvas.isItemHandlerSelected(i)&&n===d.Invert?r._canvas.removeSelectedItemHandler(i):n!==d.None?r._canvas.getSelectedItemHandlers().contains(i)||r._canvas.addSelectedItemHandler(i):t.push(i),r.lastSelectedItem=e)})),n===d.None&&this._canvas.setSelectedItemHandlers(t),this._canvas.redraw()),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a);!function(t){t[t.None=0]="None",t[t.Add=1]="Add",t[t.Invert=2]="Invert"}(d||(d={}));var et=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nt=function(t){function e(e,n,r){var i=t.call(this,null)||this;return i._productHandler=e,i._commandManager=n,i._canvas=r,i._canSelectItem=function(t){var e=i._productHandler.currentSurface;return null!=e&&!t.visualizationPermissions.noShow&&!t.locked&&e.getBackgroundItem()!=t},i}return et(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return t=this._productHandler.currentSurface,e=this._productHandler.userEditContainer,null==t||null==(n=t.printAreas)||n.count()<=0||null==(r=t.getAllItems({ignoreMockups:!0}).where((function(t){return t.parentContainer==e})).toArray())||r.length<=0||null==this._canvas?[2]:(null==i&&(i=r.reverse().find(this._canSelectItem)),[4,this._canvas.waitUpdate()]);case 1:return o.sent(),null!=i&&this._commandManager.execute(Ut.selectItems,{items:[i]}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),rt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=function(t){function e(e){var n=t.call(this,null)||this;return n._canvas=e,n}return rt(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return this._canvas.clearSelectedItemHandlers(),this._canvas.redraw(),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),ot=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),at=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},st=function(t){function e(e,n,r,i,o){var a=t.call(this,r.items,n,r)||this;return a._productHandler=e,a._commandManager=i,a._variableItemHelper=o,a}return ot(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s,l,u=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(c){switch(c.label){case 0:return 0==this._items.length?[2]:(t=this._items[0].parentContainer,e=this._items[0].parentGroupItem,n=this._items.map((function(t){return u.cloneItem(t)})),r=[],i=[],o=[],a=function(t,a){var s=u._items.findIndex((function(e){return e===t}));if(s>-1&&(r.push(a),i.push({item:n[s],index:a}),e instanceof b.R)){var l=e.getItemOrderIndex(t);o.push({clone:n[s],orderIndex:l+1})}},e?e.items.toArray().forEach(a):t.items.toArray().forEach(a),s=Math.max.apply(Math,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(at(arguments[e]));return t}(r))+1,l=i.sort((function(t,e){return t.index-e.index})).reverse().map((function(t){return t.item})),e?(e instanceof b.R?o.sort((function(t,e){return t.orderIndex-e.orderIndex})).reverse().forEach((function(t){return e.addItem(t.clone,null,t.orderIndex)})):e.addItems(l,s),[3,3]):[3,1]);case 1:return[4,this._commandManager.execute(Ht.addItems,{surface:t.parentComponent,targetContainer:t,items:l,selectOnCanvas:!0,index:s,ignoreOrderRules:null,ignoreCanvasRotate:!0,createCloneName:!0})];case 2:c.sent(),c.label=3;case 3:return[4,this._commandManager.execute(Ut.selectItems,{items:n})];case 4:return c.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.cloneItem=function(t){var e=t.clone(!0),n=5,r=5,i=this._productHandler.contentAngle;i>0&&(90!==i&&180!==i||(r=-5),180!==i&&270!==i||(n=-5));var o=this._productHandler.regionForCurrentContainer,a=v.a.getItemBoundsForViolationCheck(this._productHandler.getHandler(t));a.left+=n,a.top+=r;var s=0,l=0;null==o||o.containsRectangle(a)||(s=o.right-a.right,l=o.bottom-a.bottom,s=s<0?s:0,l=l<0?l:0);var u=function(t){t.transform.move(n+s,r+l),t instanceof b.cb&&t.updateContentAndFrames(u),t instanceof b.G&&t.applyToItems(u)};for(var c in u(e),e)-1!=c.indexOf("$$")&&delete e[c];return e},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),lt=n(435),ut=n(564),ct=function(){return ct=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ct.apply(this,arguments)},ht=function(){function t(t,e,n){var r=this;this._productHandler=t,this._canvas=e,this._eventManager=n,this.maskSymbol="%",this._eventManager.addItemAdded((function(t){return r.initVariableItem(t.item)}))}return t.prototype.initVariableItems=function(t){var e=this;t.getAllItems({ignoreMockups:!1,flatGroupItems:!0,excludeGroupItems:!0}).forEach((function(t){return e.initVariableItem(t)}))},t.prototype.setVariableValues=function(t,e){var n=this;0!==t.length&&t.forEach((function(t){n.setVariableValue(t,e)}))},t.prototype.setVariableValue=function(t,e,n){v.a.isVariableItem(t)&&this._setVariableValue(t,e),t instanceof b.cb&&!t.isEmptyContent&&v.a.isVariableItem(t.content)&&this._setVariableValue(t.content,e),n||v.a.updateItems([t],this._productHandler,this._canvas)},t.prototype.getVariableItemDisplayName=function(t){if(null!=t){var e=this.maskSymbol,n=new RegExp("^"+e+"|"+e+"$","gm");return t.replace(n,"")}},t.prototype._isCanBeVariable=function(t){return t.canSetIsVariable()},t.prototype.getRealItemName=function(t){return this._isCanBeVariable(t)&&t.isVariable?t.name.replace(new RegExp("^"+this.maskSymbol+"|"+this.maskSymbol+"$","gm"),""):t.name},t.prototype.createNewItemName=function(t,e){return this._isCanBeVariable(t)&&t.isVariable?""+this.maskSymbol+e+this.maskSymbol:e},t.prototype._setVariableValue=function(t,e){if(t.isVariable!==e){if(e)t.name=""+this.maskSymbol+t.name+this.maskSymbol;else{var n=new RegExp("^"+this.maskSymbol+"|"+this.maskSymbol+"$","gm");t.name=t.name.replace(n,"")}t.isVariable=e}},t.prototype.initVariableItem=function(t){var e=t instanceof b.cb&&!t.isEmptyContent?t.content:t;if(e instanceof b.u){var n=this.maskSymbol,r=e.name;0===r.indexOf(n)&&r.lastIndexOf(n)===r.length-1&&(e.isVariable=!0)}},t.getVariablesFromItems=function(e){var n=[];return e.forEach((function(e){var r;e instanceof b.o?r=t.getVariablesFromTextItem(e):e instanceof b.cb?r=t.getVariablesFromPlaceholderItem(e):e instanceof b.k?r=t.getVariablesFromBarcodeItem(e):e instanceof b.J?r=t.getVariablesFromImageItem(e):e instanceof b.A?r=t.getVariablesFromEllipseItem(e):e instanceof b.gb?r=t.getVariablesFromRectangleItem(e):e instanceof b.kb?r=t.getVariablesFromShapeItem(e):e instanceof b.R?r=t.getVariablesFromLayoutItem(e):e instanceof b.G&&(r=t.getVariablesFromGroupItem(e)),z.isEmpty(null!=r?z.without(r,null):null)||r.forEach((function(t){null==n.find((function(e){return e.name==t.name&&e.type==t.type}))&&n.push(t)}))})),n},t.getVariablesFromLayoutItem=function(t){var e=t.getSortedItems();return null!=e?this.getVariablesFromItems(e.reverse()):this.getVariablesFromGroupItem(t)},t.getVariablesFromGroupItem=function(t){return this.getVariablesFromItems(t.getNestedItems(!0))},t.getVariablesFromShapeItem=function(t){return null},t.getVariablesFromEllipseItem=function(t){return null},t.getVariablesFromRectangleItem=function(t){return null},t.getVariablesFromImageItem=function(t){return t.isVariable?[{name:t.name,type:"Image",value:null}]:null},t.getVariablesFromPlaceholderItem=function(t){if(!t.isVariable)return null;if(t instanceof b.cb&&t.isBarcodePlaceholder){var e=t.content;return[ct(ct({},this.getVariablesFromBarcodeItem(e,!0)[0]),{name:t.name,type:"BarcodePlaceholder"})]}return[{name:t.name,type:"ImagePlaceholder",value:null}]},t.getVariablesFromBarcodeItem=function(t,e){return void 0===e&&(e=!1),e||t.isVariable?[{name:t.name,type:"Barcode",barcodeFormat:t.barcodeFormat,barcodeSubType:t.barcodeSubType,value:t.barcodeContent}]:null},t.getVariablesFromTextItem=function(e){var n=[];if(t.isInStringPlacehodler(e))return e.placeholders.forEach((function(t){n.push({name:t.name,type:"InString",value:null!=t.value&&""!==t.value?t.value:t.name})})),n;var r=t.getInterpolationVariables(e);return z.isEmpty(r)?e.isVariable?[{name:e.name,type:"Text",value:e.text}]:null:r},t.getInterpolationVariables=function(e){var n=[];if(t.isInStringPlacehodler(e))return n;for(var r=O.m(e.text)?O.r(e.text):e.text,i=/\{\{(.+?)\}\}/g,o=i.exec(r);null!=o;){var a={name:o[1],type:"InString",value:o[1],values:[],mask:null};n.push(a),o=i.exec(r)}return n},t.isInStringPlacehodler=function(t){return t instanceof b.o&&t.placeholders.length>0},t}(),pt=function(){function t(){}return t.prototype.convert=function(t){var e=this._replaceInterpolationStrings(t);if(e.isEmpty)return!1;t.originalText=e.inStringText,t.text=e.inStringText;var n=t.placeholders;return t.placeholders.addRange(n.concat(e.placeholders)),!0},t.prototype._replaceInterpolationStrings=function(t){var e,n,r=ht.getInterpolationVariables(t),i=new ft;if(z.isEmpty(r))return i;var o,a,s=t.text;try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),u=l.next();!u.done;u=l.next()){var c=u.value,h="[#"+c.name+"]",p="{{"+c.name+"}}";s=O.m(t.text)?dt(s,p,h):(o=p,a=h,s.replace(o,a));var f=new ut.a(h,c.name,c.mask,c.name,c.values);i.placeholders.push(f)}}catch(d){e={error:d}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return i.inStringText=s,i},t}(),ft=function(){function t(){this.placeholders=[]}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return z.isEmpty(this.placeholders)},enumerable:!0,configurable:!0}),t}();function dt(t,e,n){var r=(new DOMParser).parseFromString("<body>"+t+"</body>","text/xml").getElementsByTagName("body")[0];if(!r.textContent.includes(e))return t;for(var i=r,o=null;i!==o;){if(!(i=z.find(i.childNodes,(function(t){return t.textContent.includes(e)}))))return t;z.isEmpty(i.childNodes)&&(o=i)}return o.textContent=o.textContent.replace(e,n),r.innerHTML}var gt,mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yt=function(t){function e(e,n,r,i){var o=t.call(this,r,n)||this;return o._productHandler=e,o._canvas=i,o}return mt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return this.replaceInterpolationPlaceholders(),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.replaceInterpolationPlaceholders=function(){var t=z.filter(this._product.getAllItems({ignoreMockups:!1,flatGroupItems:!0}),(function(t){return t instanceof lt.a})),e=new pt,n=[];return t.forEach((function(t){e.convert(t)&&n.push(t)})),n.length>0&&v.a.updateItems(n,this._productHandler,this._canvas),n},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(p),_t=n(444),bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vt=function(t){function e(e,n,r,i,o){var a=t.call(this,n,e,r)||this;return a._productThemeManager=i,a._commandManager=o,a}return bt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this._productThemeManager.applyProductTheme(this._args.theme,this._product,this._commandManager)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(p),wt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ct=function(t){function e(e,n,r,i,o){var a=t.call(this,[r.placeholder],n,r)||this;return a._productHandler=e,a._productThemeManager=i,a._eventManager=o,a}return wt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){return t=this._args.content,e=this._args.placeholder,n=this._productHandler.getHandler(e),null!=t?(r=this._productHandler.getHandler(t),e.content=t,i=this._productThemeManager.currentProductTheme,e.contentPermissions.imagePermissions.allowKeepOverlayColor||null!=e.contentOverlayEffect?null!=i&&this._productThemeManager.applyToItem(e,i):e.imageContent.overlayEffect=null,n.content=r,e.content.getItemChangedEvent().fire()):(e.content=null,n.content=null,e.itemPermissions.itemToolbarPermissions.showEditButton=!0),this._eventManager.imageContentChangedEvent.fire(e),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Pt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=function(t){function e(e,n,r,i){var o=t.call(this,r.items,n,r)||this;return o._productHandler=e,o._canvas=i,o}return Pt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){if(0===this._items.length)return[2];null!=this._canvas&&this._canvas.pauseRedraw();try{for(t=0;t<this._items.length;t++)this.alignItem(this._items[t],this._args.align)}finally{null!=this._canvas&&this._canvas.continueRedraw(),this._canvas.updateTexts()}return[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.alignItem=function(t,e){var n=this._productHandler.getHandler(t);n instanceof P.a&&this._canvas.alignItemHandler(n,e)},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It=function(t){function e(e,n,r){var i=t.call(this,null,e,n)||this;return i._canvas=r,i}return St(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){null!=this._canvas&&this._canvas.pauseRedraw();try{this._canvas.alignItemHandlers(this._args.align)}finally{null!=this._canvas&&this._canvas.continueRedraw()}return[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Ot=n(450),Tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Et=function(t){function e(e,n,r,i,o){var a=t.call(this,r.items,n,r)||this;return a._productHandler=e,a._commandManager=i,a._canvas=o,a}return Tt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this.bringItems(this._items,this._args.position)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.bringItems=function(t,e){var n=this;if(0!==t.length){var r=this._productHandler.currentSurface;"front"===e||"levelUp"===e?r.containers.reverse().forEach((function(r){return r.items.reverse().forEach((function(r){r instanceof Ot.a&&z.contains(t,r)&&n.bringItem(r,e,!1)}))})):"bottom"!==e&&"levelDown"!==e||r.containers.forEach((function(r){return r.items.forEach((function(r){r instanceof Ot.a&&z.contains(t,r)&&n.bringItem(r,e,!1)}))}));var i=t.map((function(t){return n._productHandler.getHandler(t)}));this._canvas.setSelectedItemHandlers(i),this._canvas.updateTexts()}},e.prototype.bringItem=function(t,e,n){if(null==n&&(n=!0),t.itemPermissions.allowZOrderChange){var r=t.parentContainer.items.toArray(),i=z.indexOf(r,t),o=r.length-1,a=i;if(i>=0)switch(e){case"front":a=o;break;case"levelUp":a=Math.min(i+1,o);break;case"levelDown":a=Math.max(i-1,0);break;case"bottom":a=0}this._commandManager.execute(Wt.moveItem,{item:t,newIndex:a,needUpdate:n})}},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rt=function(t){function e(e,n,r){var i=t.call(this,[r.item],n,r)||this;return i._productHandler=e,i}return Lt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this.moveTo(this._args.item,this._args.newIndex,this._args.needUpdate)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.moveTo=function(t,e,n){null==n&&(n=!0);var r=null!=t?t.parentContainer:null;if(null!=r){var i=r.items.toArray(),o=Math.max(i.length-1,0),a=z.indexOf(i,t);e=Math.min(Math.max(e,0),o),a=Math.min(Math.max(a,0),o);var s=this._getMoveRange(i,a);if(null==s)return;if(e<s[0]?e=s[0]:e>s[1]&&(e=s[1]),a===e)return;r.items.move(a,e),this._productHandler.redraw()}},e.prototype._getMoveRange=function(t,e){if(e<0)return null;if(null==t)return null;if(e>=t.length)return null;for(var n=e,r=e,i=e-1;i>=0&&t[i].itemPermissions.allowZOrderChange;i--)n=i;for(i=e+1;i<t.length&&t[i].itemPermissions.allowZOrderChange;i++)r=i;return[n,r]},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),kt=n(440),jt=n(538),At=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ft=function(t){function e(e,n,r,i){var o=t.call(this,i.items,r,i)||this;return o._canvas=e,o._productHandler=n,o}return At(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){if(this._items.length<3)return[2];null!=this._canvas&&this._canvas.pauseRedraw();try{this._distributeItemHandler(this._items,this._args.distribute)}finally{null!=this._canvas&&this._canvas.continueRedraw()}return[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e.prototype._distributeItemHandler=function(t,e){var n=this,r=t.map((function(t){return n._productHandler.getHandler(t)})).filter((function(t){return!t.locked&&(e===gt.horizontal&&t.getPermissions().allowMoveHorizontal||e===gt.vertical&&t.getPermissions().allowMoveVertical)})),i=_.RectangleF.getOverallBounds(r.map((function(t){return t.bounds}))),o=i.height,a=i.width;if(e===gt.horizontal)for(var s=r.reduce((function(t,e){return t+e.bounds.width}),0),l=(a-s)/(r.length-1),u=r.slice(0).sort((function(t,e){return t.bounds.center.x-e.bounds.center.x})),c=1;c<u.length-1;c++){var h=(y=u[c]).bounds.center,p=y.bounds,f=u[c-1].bounds.right+l+p.width/2;(b=y.rectangle).centerX=f,this._updateItemRectangle(y,b,h)}if(e===gt.vertical){var d=r.reduce((function(t,e){return t+e.bounds.height}),0),g=(o-d)/(r.length-1),m=r.slice(0).sort((function(t,e){return t.bounds.center.y-e.bounds.center.y}));for(c=1;c<m.length-1;c++){h=(y=m[c]).bounds.center,p=y.bounds;var y,b,v=m[c-1].bounds.bottom+g+p.height/2;(b=y.rectangle).centerY=v,this._updateItemRectangle(y,b,h)}}this._canvas.updateSelection(),this._canvas.redraw()},e.prototype._updateItemRectangle=function(t,e,n){t instanceof kt.a?(t.setRectangle(e,null,!0),t.updateContentAndFrames((function(t){var r=t.rectangle;r.centerX+=e.centerX-n.x,r.centerY+=e.centerY-n.y,t.setRectangle(r)}))):t instanceof jt.a?t.setRectangle(e,null,!0):t.setRectangle(e),t.update()},e}(X.a);!function(t){t.vertical="vertical",t.horizontal="horizontal"}(gt||(gt={}));var Bt,Mt,Nt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zt=function(t){function e(e,n,r){var i=t.call(this,[],n,r)||this;return i._itemsDataApplier=e,i}return Nt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){switch(n.label){case 0:switch(this._args.type){case Bt.AutoScaledTextItem:t=new b.g;break;case Bt.BarcodeItem:t=new b.k;break;case Bt.BoundedTextItem:t=new b.q;break;case Bt.CurvedTextItem:t=new b.x;break;case Bt.EllipseItem:t=new b.A;break;case Bt.ImageItem:t=new b.J;break;case Bt.LineItem:t=new b.T;break;case Bt.PathBoundedTextItem:t=new b.ab;break;case Bt.PlaceholderItem:t=new b.cb;break;case Bt.PlainTextItem:t=new b.eb;break;case Bt.RectangleItem:t=new b.gb;break;case Bt.ArchedTextItem:t=new b.a;break;case Bt.ShapeItem:t=new b.kb}return null==this._args.itemData?[2,t]:(e=null==this._args.relativeToPrintArea||this._args.relativeToPrintArea,[4,this._itemsDataApplier.applyToItem(t,this._args.itemData,{changePosition:!0,relativeToPrintArea:e})]);case 1:return n.sent(),[2,t]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a);(Mt=Bt||(Bt={})).isText=function(t){return[Mt.AutoScaledTextItem,Mt.BoundedTextItem,Mt.CurvedTextItem,Mt.PathBoundedTextItem,Mt.PlainTextItem,Mt.ArchedTextItem].includes(t)},Mt.getType=function(t){if(t instanceof b.g)return Mt.AutoScaledTextItem;if(t instanceof b.k)return Mt.BarcodeItem;if(t instanceof b.q)return Mt.BoundedTextItem;if(t instanceof b.x)return Mt.CurvedTextItem;if(t instanceof b.A)return Mt.EllipseItem;if(t instanceof b.J)return Mt.ImageItem;if(t instanceof b.T)return Mt.LineItem;if(t instanceof b.ab)return Mt.PathBoundedTextItem;if(t instanceof b.cb)return Mt.PlaceholderItem;if(t instanceof b.eb)return Mt.PlainTextItem;if(t instanceof b.a)return Mt.ArchedTextItem;if(t instanceof b.gb)return Mt.RectangleItem;if(t instanceof b.kb)return Mt.ShapeItem;if(t instanceof b.R)return Mt.LayoutItem;if(t instanceof b.r)return Mt.ClipartItem;if(t instanceof b.G)return Mt.GroupItem;throw new u.a("ItemType: Unexpected item!")},function(t){t[t.AutoScaledTextItem=0]="AutoScaledTextItem",t[t.BarcodeItem=1]="BarcodeItem",t[t.BoundedTextItem=2]="BoundedTextItem",t[t.CurvedTextItem=3]="CurvedTextItem",t[t.EllipseItem=4]="EllipseItem",t[t.ImageItem=5]="ImageItem",t[t.LineItem=6]="LineItem",t[t.PathBoundedTextItem=7]="PathBoundedTextItem",t[t.PlaceholderItem=8]="PlaceholderItem",t[t.PlainTextItem=9]="PlainTextItem",t[t.RectangleItem=10]="RectangleItem",t[t.ArchedTextItem=11]="ArchedTextItem",t[t.ShapeItem=12]="ShapeItem",t[t.GroupItem=13]="GroupItem",t[t.LayoutItem=14]="LayoutItem",t[t.ClipartItem=15]="ClipartItem"}(Bt||(Bt={}));var Dt,Ht,Wt,Ut,Vt,qt,Gt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$t=function(t){function e(e,n,r,i){var o=t.call(this,[],r,i)||this;return o._itemsDataApplier=e,o._productHandler=n,o}return Gt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:t=null!=this._args.items?this._args.items:this._productHandler.selectedItems,e=t.filter((function(t){return t instanceof(i._args.type||Object)})),n=0,o.label=1;case 1:return n<e.length?(r=e[n],[4,this._itemsDataApplier.applyToItem(r,this._args.itemData,this._args.applyParams)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return this._productHandler.redraw(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Xt=n(428),Kt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(t){function e(e,n,r){var i=t.call(this,[],n,e)||this;return i._productHandler=r,i}return Kt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){return t=null!=this._args.items?this._args.items:this._productHandler.selectedItems,e=this._args.scale,t.forEach((function(t){if(t instanceof b.cb){var r=n._productHandler.getHandler(t);r.forceQualityChangeInfoBar=null!=n._args.forceQualityChangeInfoBar&&n._args.forceQualityChangeInfoBar,Object(Xt.d)(r.getContentScale(),e)||r.setContentScale(e),n._historyArgs.historyUpdateMode!==c.a.NotUpdate&&r.quickUpdate()}})),this._productHandler.updateSelection(),this._productHandler.redraw(),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Jt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=function(t){function e(e,n,r){var i=t.call(this,[],n,e)||this;return i._productHandler=r,i}return Jt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){return(null!=this._args&&null!=this._args.items?this._args.items:this._productHandler.selectedItems).forEach((function(e){e instanceof b.cb&&t._productHandler.getHandler(e).resetContent()})),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Qt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(t){function e(e,n,r){var i=t.call(this,[],n,e)||this;return i._productHandler=r,i}return Qt(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){return null==this._args.barcodeFormat||(t=null!=this._args.items?this._args.items:this._productHandler.selectedItems,z.isEmpty(t)||((e=new b.i).barcodeFormat=this._args.barcodeFormat,e.barcodeSubType=this._args.barcodeFormat===b.j.QR_CODE?b.m.VCard:b.m.None,t.filter((function(t){return t instanceof b.cb})).forEach((function(t){if(null==t.content||null==t.barcodeFormat||!(t.content instanceof b.k))return!1;t.content=v.a.createImageContentForPlaceholder(t,e,n._productHandler),t.content.barcodeContent=null,t.isStubContent=!0,n._productHandler.getHandler(t).content=n._productHandler.getHandler(t.content)})))),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),ee=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ne=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},re=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ne(arguments[e]));return t},ie=function(t){function e(e,n,r){var i=t.call(this,[],n,e)||this;return i._productHandler=r,i}return ee(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){return(null!=this._args.items?this._args.items:this._productHandler.selectedItems).filter((function(t){return t instanceof b.ab})).forEach((function(e){return t._setColumnCount(e,t._args.value)})),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._setColumnCount=function(t,e){for(var n=function(t){if(0===t.length)return _.RectangleF.empty;var e=Math.min.apply(Math,re(t.map((function(t){return t.left})))),n=Math.max.apply(Math,re(t.map((function(t){return t.right})))),r=Math.min.apply(Math,re(t.map((function(t){return t.top})))),i=Math.max.apply(Math,re(t.map((function(t){return t.bottom}))));return _.RectangleF.FromLTRB(e,r,n,i)}(t.boundingPaths.map((function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.position="absolute",e.style.visibility="hidden";var n=document.createElementNS("http://www.w3.org/2000/svg","path");e.appendChild(n),n.setAttribute("d",t.toString());var r=document.querySelector("body");r.appendChild(e);var i,o=(i=n.getBBox(),new _.RectangleF(i.x,i.y,i.width,i.height));return r.removeChild(e),o}))),r=(n.width-10*(e-1))/e,i=[],o=0;o<e;o++){var a=n.left+(r+10)*o,s=n.top,l=a+r,u=s+n.height,c=new _.Path;c.moveTo(a,s),c.lineTo(l,s),c.lineTo(l,u),c.lineTo(a,u),c.lineTo(a,s),i.push(c)}t.boundingPaths=i},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ae=function(t){function e(e,n,r){var i=t.call(this,[],n,e)||this;return i._productHandler=r,i}return oe(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){return t=null!=this._args.items?this._args.items:this._productHandler.selectedItems,e=null==this._args.clockwise||this._args.clockwise,t.filter((function(t){return t instanceof b.cb})).forEach((function(t){var r=n._productHandler.getHandler(t);return e?r.rotateContentRight():r.rotateContentLeft()})),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),se=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),le=function(t){function e(e,n,r,i){var o=t.call(this,[],n,e)||this;return o._productHandler=r,o._commandManager=i,o}return se(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s,l,u=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(c){switch(c.label){case 0:return t=this._args,e=t.items,n=t.selectOnCanvas,[4,Promise.all(e.map((function(t){return v.a.positionItemInArea(u._productHandler,t,u._args.sourceWidth,u._args.sourceHeight,!1),u._commandManager.execute(Ht.addItems,{items:[t],selectOnCanvas:!1,ignoreOrderRules:!0,ignoreCanvasRotate:!1})})))];case 1:return c.sent(),(r=this._productHandler.contentAngle)>0?[4,this._productHandler.waitUpdate()]:[3,3];case 2:c.sent(),i=this._productHandler.userEditContainer,o=this._productHandler.userEditPrintArea,a=i.region,s=null!=a?a:o.bounds,l=s.center,v.a.rotateItems(this._productHandler,e,l,-r),c.label=3;case 3:return n&&this._commandManager.execute(Ut.selectItems,{items:e.filter((function(t){return!t.locked}))}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),ue=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(t){function e(e,n,r,i,o){var a=t.call(this,[],n,e)||this;return a._productHandler=r,a._product=i,a._commandManager=o,a}return ue(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return t=this._productHandler.userEditContainer,e=this._product.getAllItems({ignoreMockups:!0}).filter((function(e){var n=e.parentContainer.parentComponent===i._productHandler.currentSurface,r=e.parentContainer.id===t.id,o=e.itemPermissions.allowRemoveOnLayoutChange;return n&&r&&o})),n=function(t){return t instanceof b.o&&0===t.placeholders.length&&0===t.values.length},r=e.filter((function(t){return t instanceof b.cb||n(t)})),this._args.items.forEach((function(t){t.fromLayout=!0,t.itemPermissions.allowRemoveOnLayoutChange=!0,v.a.positionItemInArea(i._productHandler,t,i._args.sourceWidth,i._args.sourceHeight,!0),i._commandManager.execute(Ht.addItems,{items:[t],selectOnCanvas:!1,ignoreOrderRules:!0,ignoreCanvasRotate:!0,createCloneName:null==r||null==r.find((function(e){return e.name===t.name}))})})),[4,this._productHandler.waitUpdate()];case 1:return o.sent(),v.a.changeItemsContent(this._product,this._productHandler,this._commandManager,r,this._args.items,!0),0!==e.length&&this._commandManager.execute(Wt.deleteItems,{items:e,force:!0}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),he=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pe=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},fe=function(t){function e(e,n,r){var i=t.call(this,null,e,n)||this;return i._commandManager=r,i}return he(e,t),e.prototype._executeCommandBody=function(){var t,e,n,r,i;return e=this,n=void 0,i=function(){var e,n,r,i,o,a,s,l,u,c,h,p,f;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(d){switch(d.label){case 0:return e=this._args,n=e.items,r=e.asLayoutItem,null==n||0===n.length?[2]:(i=pe(n,1),o=i[0],a=o.parentContainer,s=o.parentGroupItem,l=(null!=s?s.items:a.items).toArray(),n.some((function(t){return t.parentGroupItem!==s}))?[2]:(u=Math.max.apply(Math,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(pe(arguments[e]));return t}(n.map((function(t){return l.indexOf(t)}))))-n.length+1,c=n.sort((function(t,e){return l.indexOf(t)-l.indexOf(e)})),h=c.map((function(t){return t.clone()})),(p=r?new b.R(h):new b.G(h)).name=null!==(t=this._args.name)&&void 0!==t?t:"Group item",f=this._getTargetOrderIndex(p,s),this._commandManager.execute(Ut.clearSelection),this._commandManager.execute(Wt.deleteItems,{items:n,force:!0,autoUngroup:!1,autoParentGroupDelete:!1}),[4,this._commandManager.execute(Ht.addItems,{items:[p],targetContainer:a,index:u,selectOnCanvas:!0,targetGroupItem:s,orderIndex:f})]));case 1:return d.sent(),[2]}}))},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e.prototype._getTargetOrderIndex=function(t,e){if(e instanceof b.R){var n=e.getItemsOrder();if(null!=n)return n.indexOf(t.items.first().id)}return null},e}(X.a),de=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ge=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},me=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},ye=function(t){function e(e,n,r){var i=t.call(this,null,e,n)||this;return i._commandManager=r,i}return de(e,t),e.prototype._executeCommandBody=function(){return ge(this,void 0,void 0,(function(){var t,e,n;return me(this,(function(r){switch(r.label){case 0:return t=this._args,e=t.items,n=t.keepNestedGroups,[4,this._ungroupItems(e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype._ungroupItems=function(t,e){return void 0===e&&(e=!1),ge(this,void 0,void 0,(function(){var n,r,i=this;return me(this,(function(o){switch(o.label){case 0:return[4,this._commandManager.execute(Ut.clearSelection)];case 1:return o.sent(),n=this._historyArgs.history,0===t.length?[2]:!e&&t.every((function(t){return t instanceof b.G&&t.groupItemPermissions.allowUngroup}))?(n.pause(),t.forEach((function(t){return i._ungroupItems(t.items.toArray(),!0)})),n.resume(),[2]):t.every((function(t,e,n){var r=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(n,1)[0];return null!=t.parentGroupItem&&t.parentGroupItem===r.parentGroupItem}))?(n.pause(),[4,this._extractItemsFromGroupItem(t)]):[2];case 2:return r=o.sent(),n.resume(),[4,this._commandManager.execute(Ut.selectItems,{items:r})];case 3:return o.sent(),[2]}}))}))},e.prototype._extractItemsFromGroupItem=function(t){return ge(this,void 0,void 0,(function(){var e,n,r,i,o,a,s,l,u;return me(this,(function(c){switch(c.label){case 0:return(e=t[0].parentGroupItem).items.toArray().filter((function(e){return!t.includes(e)})).length<2&&(t=e.items.toArray()),n=t.map((function(t){return t.clone()})).reverse(),r=e.parentContainer,i=e.parentGroupItem,o=null!=i?i.items.toArray():r.items.toArray(),a=o.indexOf(e),s=null,i instanceof b.R&&(l=i.getItemsOrder())&&(u=l.indexOf(e.id),s=u),[4,this._commandManager.execute(Wt.deleteItems,{items:t,force:!0,autoUngroup:!1,autoParentGroupDelete:!0})];case 1:return c.sent(),0!==e.items.length?[3,3]:[4,this._commandManager.execute(Wt.deleteItems,{items:[e],force:!0,autoUngroup:!1})];case 2:c.sent(),c.label=3;case 3:return[4,this._commandManager.execute(Ht.addItems,{targetContainer:r,items:n,index:a,orderIndex:s,selectOnCanvas:!1,targetGroupItem:i})];case 4:return c.sent(),[2,n]}}))}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),_e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),be=function(t){function e(e,n,r,i,o,a,s){var l=t.call(this,null,e,n)||this;return l._productHandler=r,l._product=i,l._commandManager=o,l._productThemeManager=a,l._canvas=s,l}return _e(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s,l;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(u){switch(u.label){case 0:return t=this._args,e=t.targetGroupItem,n=t.newItems,null==e||null==n||n.length<1?[2]:(r=!1,i=this._productHandler.getHandler(e),o=i.getTransformedRectangle(r),a=e.items.toArray(),v.a.changeItemsContent(this._product,this._productHandler,this._commandManager,a,n,!1),e.items.clear(),e.addItems(n),(s=e.getNestedItems(!0).filter((function(t){return t instanceof b.o}))).length>0?[4,v.a.waitForItemsUpdated(s,this._canvas)]:[3,2]);case 1:u.sent(),u.label=2;case 2:return l=i.getTransformedRectangle(r).bounds,v.a.positionItemInArea(this._productHandler,e,l.width,l.height,!0,o,l.center,r),null!=this._productThemeManager.currentProductTheme&&this._updateAppliedProductTheme(),0===o.angle?[3,5]:s.length>0?[4,v.a.waitForItemsUpdated(s,this._canvas)]:[3,4];case 3:u.sent(),u.label=4;case 4:v.a.rotateItems(this._productHandler,[e],o.center,o.angle),u.label=5;case 5:return this._commandManager.execute(Ut.selectItems,{items:[e]}),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._updateAppliedProductTheme=function(){this._commandManager.execute(Dt.applyProductTheme,{theme:this._productThemeManager.currentProductTheme})},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),ve=n(507),we=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ce=function(t){function e(e,n){return t.call(this,null,e,n)||this}return we(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){if(t=this._args,e=t.clipartItem,n=t.colorGroup,r=t.newColor,!(e instanceof ve.a)||null==n||null==r)throw new Error("ChangeClipartItemColorCommand: Uncorrect arguments");if(!(r instanceof w.Color||r.color instanceof w.Color))throw new Error("ChangeClipartItemColorCommand: Uncorrect color");return e.setColor(n,r),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xe=function(t){function e(e,n,r,i){var o=t.call(this,n,e,r)||this;return o._commandManager=i,o}return Pe(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){switch(n.label){case 0:return t=v.a.getEmptyPlaceholdersFromProduct(this._product),e=this._args.metadataList.map((function(e,n){return{imageData:e,item:t[n]}})).filter((function(t){return null!=t.item})),[4,this._commandManager.execute(Wt.setImageMetadata,{dataList:e})];case 1:return n.sent(),[2,e.map((function(t){return t.item}))]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(p),Se=n(37),Ie=n(519),Oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Te=function(){return Te=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Te.apply(this,arguments)},Ee=function(t){function e(e,n,r,i,o,a){var s=t.call(this,n,e,r)||this;return s._productHandler=i,s._commandManager=o,s._canvas=a,s._executeCommandBody=function(){return t=s,e=void 0,r=function(){var t,e,n,r=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:null!=this._canvas&&this._canvas.pauseRedraw(),i.label=1;case 1:return i.trys.push([1,,4,7]),t=this._convertedArgs.target,e=this._items.map(this._productHandler.getHandler),null==this._canvas?[3,3]:(n=this._canvas.getAllItemHandlers(),[4,Promise.all(e.filter((function(t){return t instanceof P.b&&!n.includes(t)})).map((function(t){return t.updateForExternalCanvas(r._canvas),t.waitUpdate()})))]);case 2:i.sent(),i.label=3;case 3:return e.forEach((function(t){t.startTransform(),t.beginUpdate()})),t instanceof _t.Product?(this._resizeProduct(t),null!=this._canvas&&this._canvas.viewer._onResize(this,!1)):t instanceof _t.PrintArea?this._resizePrintArea(t):z.isArray(t)&&(t[0]instanceof _t.Surface?t.forEach((function(t){return r._resizeSurface(t)})):t[0]instanceof b.N&&this._resizeItems(t)),this._items.map(this._productHandler.getHandler).forEach((function(t){t.endTransform(!0,!0),t.endUpdate()})),[3,7];case 4:return null==this._canvas?[3,6]:[4,this._canvas.waitUpdate()];case 5:i.sent(),this._canvas.updateSelection(),this._canvas.continueRedraw(),this._canvas.updateTexts(),i.label=6;case 6:return[7];case 7:return[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},s._resizeProduct=function(t){t.surfaces.forEach((function(t){return s._resizeSurface(t)}))},s._resizeSurface=function(t){var e,n,r=new _.RectangleF(0,0,t.width,t.height),i=null!==(e=s._getResizeOptions().originX)&&void 0!==e?e:Ie.a.Left,o=null!==(n=s._getResizeOptions().originY)&&void 0!==n?n:Ie.a.Top,a=s._getTransformMatrix(r,i,o);t.mockup.allContainers.forEach((function(e){return s._resizeMockupContainer(e,a,t)})),t.printAreas.forEach((function(t){return s._resizePrintAreaBounds(t,a)})),t.containers.forEach((function(e){return s._resizeContainer(e,a,t)})),a.updateObjectByMatrix(t,"width","height")},s._resizeMockupContainer=function(t,e,n){null!=t.size&&t.size.updateByMatrix(e),s._resizeContainer(t,e,n)},s._resizeContainer=function(t,e,n,r){void 0===r&&(r=null),null!=t.region&&t.region.updateByMatrix(e);var i=function(t){return r.bounds.intersectsWith(s._productHandler.getHandler(t).bounds)},o=t.items.toArray().filter((function(t){return null==r||i(t)})),a=s._getResizeOptions(t).resize,l=s._getItemsMatrix(o,a,e,n),u=s._getResizeOptions(t).resetPlaceholderContent;t.items.forEach((function(t){var n=null!=r?s._getTranslateMatrixRelativeToPrintArea(r.bounds,s._productHandler.getHandler(t).bounds,i(t)?l:e):l;s._resizeItem(t,n,u)}))},s._resizeItems=function(t){var e,n,r;if(s._getResizeOptions().resize===Xt.b.Original)throw new u.c("Original type not supported when resizing items.");if(1===t.length){var i=s._productHandler.getHandler(t[0]).rectangle;i.angle=0,r=i.bounds}else r=s._getItemsBounds(t);var o=null!==(e=s._getResizeOptions().originX)&&void 0!==e?e:Ie.a.Center,a=null!==(n=s._getResizeOptions().originY)&&void 0!==n?n:Ie.a.Center,l=s._getTransformMatrix(r,o,a),c=s._getItemsMatrix(t,s._getResizeOptions().resize,l,null);t.forEach((function(t){var e;return s._resizeItem(t,c,null===(e=s._defaultResizeOptions.resetPlaceholderContent)||void 0===e||e)}))},s._resizeItem=function(t,e,n){var r=function(t){var n;t.transformByMatrix(e,!1);var r=t.item;r instanceof b.J&&(null===(n=r.values)||void 0===n||n.filter((function(t){return null!=(null==t?void 0:t.transformedRectangle)})).forEach((function(t){t.transformedRectangle=t.transformedRectangle.transformByMatrix(e)})))},i=function(t){n&&null!=t.content&&t.content.updateRectangle(!1,t.item.contentResizeMode,t)},o=s._productHandler.getHandler(t);r(o),o instanceof P.m&&(o.updateContentAndFrames(r),i(o)),o instanceof P.d&&o.itemHandlers.toArray().filter((function(t){return t instanceof P.m})).forEach(i)},s._resizePrintAreaBounds=function(t,e){t.bounds.updateByMatrix(e)},s._resizePrintArea=function(t){var e=s._product.surfaces.toArray().find((function(e){return e.printAreas.contains(t)})),n=s._getMatrixForPrintArea(t);e.containers.forEach((function(r){return s._resizeContainer(r,n,e,t)})),e.printAreas.forEach((function(e){e!==t&&s._resizePrintAreaBounds(e,s._getTranslateMatrixRelativeToPrintArea(t.bounds,e.bounds,n))})),s._resizePrintAreaBounds(t,n),s._resizeSurfaceByPrintArea(e)},s._resizeSurfaceByPrintArea=function(t){var e=_.RectangleF.getOverallBounds(t.printAreas.toArray().map((function(t){return t.bounds})));new _.RectangleF(0,0,t.width,t.height).containsRectangle(e)||(t.width=Math.max(t.width,e.right),t.height=Math.max(t.height,e.bottom),e.left>=0||e.top>=0||s._commandManager.execute(Wt.translateItems,{items:t.getAllItems().toArray(),translateX:-Math.min(0,e.left),translateY:-Math.min(0,e.top)}))},s._getTransformMatrix=function(t,e,n){var r=Object(Xt.g)(t,e,n),i=new _.Matrix;return i.scaleRelativeToPoint(s._getScaleMultiplier(s._args.width,t.width),s._getScaleMultiplier(s._args.height,t.height),r),i},s._getScaleMultiplier=function(t,e){if("string"==typeof t){if(/%$/.test(t))return Number(t.split(/%/)[0])/100;var n=parseFloat(t);if(isNaN(n))throw new u.a("ResizeCommand: Wrong string format: "+t);t=n}if(t<=0)throw new u.a("ResizeCommand: Wrong value: "+t);if(e<=0)throw new u.a("ResizeCommand: Wrong parentSize: "+e);return t/e},s._convertedArgs=null!=s._args.target?s._args:s._convertExternalConfig(s._args),s}return Oe(e,t),Object.defineProperty(e.prototype,"_items",{get:function(){var t=this._convertedArgs.target;if(t instanceof _t.Product)return t.getAllItems();if(t instanceof _t.PrintArea){var e=this._product.surfaces.firstOrDefault((function(e){return e.printAreas.contains(t)}));return null==e?[]:e.getAllItems().toArray()}return z.isArray(t)?t[0]instanceof b.N?t:t[0]instanceof _t.Surface?z.flatten(t.map((function(t){return t.getAllItems().toArray()}))):[]:[]},enumerable:!0,configurable:!0}),e.prototype._getTranslateMatrixRelativeToPrintArea=function(t,e,n){var r=new _.Matrix;if(e.bottom<=t.top||e.right<=t.left)return r;if(t.intersectsWith(e))return n;var i=t.clone().updateByMatrix(n);return r.translate(e.left>t.right||Object(Xt.d)(t.right-e.left,0)?i.right-t.right:0,e.top>t.bottom||Object(Xt.d)(t.bottom-e.top,0)?i.bottom-t.bottom:0),r},e.prototype._getItemsMatrix=function(t,e,n,r){var i,o,a;if(e!==Xt.b.Original){var s=this._getItemsBounds(t),l=s.clone().updateByMatrix(n),u=e===Xt.b.Arbitrary&&t.some((function(t){return t.transform.angle%90!=0})),c=Object(Xt.e)(s,l,u?Xt.b.Fit:e);a=_.RectangleF.getMatrix(s,c)}else{var h=null!==(i=this._getResizeOptions().originX)&&void 0!==i?i:Ie.a.Center,p=null!==(o=this._getResizeOptions().originY)&&void 0!==o?o:Ie.a.Center;a=this._getTranslateMatrixForOriginalMode(n,r,h,p)}return a},e.prototype._getTranslateMatrixForOriginalMode=function(t,e,n,r){var i=new _.RectangleF(0,0,e.width,e.height),o=Object(Xt.g)(i,n,r),a=i.updateByMatrix(t),s=Object(Xt.g)(a,n,r),l=new _.Matrix;return l.translate(s.x-o.x,s.y-o.y),l},e.prototype._getResizeOptions=function(t){var e=this;return Object(Se.maybe)(this._args.containerOptions).bind((function(e){return Object(Se.maybe)(t).map((function(t){return e[t.name]}))})).caseOf({just:function(t){return Te(Te({},e._defaultResizeOptions),t)},nothing:function(){return e._defaultResizeOptions}})},Object.defineProperty(e.prototype,"_defaultResizeOptions",{get:function(){return Te({resize:Xt.b.Fit,resetPlaceholderContent:!0},this._args.defaultOptions||{})},enumerable:!0,configurable:!0}),e.prototype._getItemsBounds=function(t){var e=this;return z.isEmpty(t)?_.RectangleF.empty:_.RectangleF.getOverallBounds(t.map((function(t){return e._productHandler.getHandler(t).bounds})))},e.prototype._getMatrixForPrintArea=function(t){var e,n,r=null!==(e=this._getResizeOptions().originX)&&void 0!==e?e:Ie.a.Left,i=null!==(n=this._getResizeOptions().originY)&&void 0!==n?n:Ie.a.Top;return this._getTransformMatrix(t.bounds,r,i)},e.prototype._convertExternalConfig=function(t){var e;switch(t.targetType){case"surfaces":if(z.isEmpty(t.targetIds))throw new u.a("ResizeCommand: target Ids cannot be empty");e=this._product.surfaces.toArray().filter((function(e){return t.targetIds.includes(e.id)}));break;case"items":if(z.isEmpty(t.targetIds))throw new u.a("ResizeCommand: target Ids cannot be empty");e=this._productHandler.currentSurface.getAllItems({ignoreMockups:!1,flatGroupItems:!0}).toArray().filter((function(e){return t.targetIds.includes(e.id)}));break;case"printArea":if(z.isEmpty(t.targetIds))throw new u.a("ResizeCommand: target Ids cannot be empty");e=z.flatten(this._product.surfaces.toArray().map((function(t){return t.printAreas.toArray()}))).find((function(e){return t.targetIds.includes(e.id)}));break;default:e=this._product}return{target:e,width:t.width,height:t.height,containerOptions:t.containerOptions,defaultOptions:t.defaultOptions}},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(p),Le=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Re=function(t){function e(e,n,r,i){var o=t.call(this,[],e,n)||this;return o._productHandler=r,o._canvas=i,o._convertedArgs=null!=n.items?n:o._convertExternalConfig(n),o._items=o._convertedArgs.items,o}return Le(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){return t=this._transformMatrix,this._items.forEach((function(n){var r=function(n){e._productHandler.getHandler(n).transformByMatrix(t,!1)};r(n),n instanceof b.cb&&n.updateContentAndFrames(r)})),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},Object.defineProperty(e.prototype,"_transformMatrix",{get:function(){var t=this._parentRectangle,e=Object(O.o)(this._args.translateX,t.width),n=Object(O.o)(this._args.translateY,t.height),r=new _.Matrix;return r.translate(e,n),r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_parentRectangle",{get:function(){return Object(Se.maybe)(this._items[0]).map((function(t){return t.parentContainer})).map((function(t){return{surface:t.parentComponent,container:t}})).map((function(t){var e=t.surface,n=t.container;return{printArea:e.printAreas.get(0),container:n}})).map((function(t){var e=t.printArea,n=t.container;return Object(Se.maybe)(n.region).caseOf({just:function(t){return _.RectangleF.union(e.bounds,t)},nothing:function(){return e.bounds}})})).caseOf({just:function(t){return new b.nb(t.width,t.height)},nothing:function(){return new b.nb(100,100)}})},enumerable:!0,configurable:!0}),e.prototype._convertExternalConfig=function(t){if(z.isEmpty(t.itemIds))throw new u.a("TranslateItemsCommand: itemIds cannot be null.");return{items:this._productHandler.currentSurface.getAllItems({ignoreMockups:!1,flatGroupItems:!0}).toArray().filter((function(e){return t.itemIds.includes(e.id)})),translateX:t.translateX,translateY:t.translateY}},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),ke=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),je=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Ae=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Fe=function(t){function e(e,n,r,i){var o=t.call(this,r.items,n,r)||this;return o._productHandler=e,o._cm=i,o}return ke(e,t),e.prototype._executeCommandBody=function(){return je(this,void 0,void 0,(function(){var t,e,n,r,i,o,a=this;return Ae(this,(function(s){switch(s.label){case 0:return t=this._args,e=t.align,n=t.group,r=t.items,n&&r?(i=this._productHandler.getHandler(n).bounds,o=r.map((function(t){return n.items.toArray().includes(t)?a.alignItemIntoGroup(t,e,i):Promise.resolve()})),[4,Promise.all(o)]):[2];case 1:return s.sent(),[2]}}))}))},e.prototype.alignItemIntoGroup=function(t,e,n){return je(this,void 0,void 0,(function(){var r,i,o,a,s,l,u,c,h,p,f,d,g,m,y;return Ae(this,(function(_){switch(_.label){case 0:switch(r=n.top,i=n.bottom,o=n.left,a=n.right,s=n.center,l=s.x,u=s.y,c=this._productHandler.getHandler(t).bounds,h=c.top,p=c.bottom,f=c.left,d=c.right,g=c.center,m=g.x,y=g.y,e){case"top":return[3,1];case"bottom":return[3,3];case"left":return[3,5];case"right":return[3,7];case"horizontalCenter":return[3,9];case"verticalCenter":return[3,11]}return[3,13];case 1:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:0,translateY:r-h})];case 2:case 4:case 6:case 8:case 10:case 12:return _.sent(),[3,13];case 3:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:0,translateY:i-p})];case 5:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:o-f,translateY:0})];case 7:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:a-d,translateY:0})];case 9:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:l-m,translateY:0})];case 11:return[4,this._cm.execute(Wt.translateItems,{items:[t],translateX:0,translateY:u-y})];case 13:return[2]}}))}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Be=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Me=function(t){function e(e,n,r,i){var o=t.call(this,n.items,e)||this;return o._commandManager=r,o._canvas=i,o}return Be(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){switch(r.label){case 0:return[4,this._commandManager.execute(Wt.deleteItems,{items:this._items,force:!0})];case 1:return r.sent(),t=this._items,e=[],t.forEach((function(t){if(t instanceof b.G){var n=new b.R(t.items.toArray(),new b.z);n.name=t.name.includes("Group item")?t.name.replace("Group item","Layout item"):t.name,e.push(n)}})),[4,this._commandManager.execute(Ht.addItems,{items:e})];case 2:return r.sent(),e.forEach((function(t){n._canvas.viewer.getHandler(t).generateAndApplyAutolayoutSettings()})),[2,e]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Ne=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ze=function(t){function e(e,n,r){var i=t.call(this,n.items,e)||this;return i._commandManager=r,i}return Ne(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){switch(n.label){case 0:return[4,this._commandManager.execute(Wt.deleteItems,{items:this._items,force:!0})];case 1:return n.sent(),t=this._items,e=[],t.forEach((function(t){if(t instanceof b.R){var n=new b.G(t.items.toArray().map((function(t){return t.clone(!0)})));n.name=t.name.includes("Layout item")?t.name.replace("Layout item","Group item"):t.name,e.push(n)}})),[4,this._commandManager.execute(Ht.addItems,{items:e})];case 2:return n.sent(),[2,e]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),De=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),He=function(t){function e(e,n,r){var i=t.call(this,[n.item],e,n)||this;return i._commandManager=r,i}return De(e,t),e.prototype._executeCommandBody=function(){return t=this,n=void 0,i=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){if(null==this._args.item||null==this._args.targetItem)throw new u.a("SetImageItemCommand: item and target item cannot be null");return t={dataList:[{imageData:e.getImageData(this._args.item),item:this._args.targetItem,tags:this._args.item.tags}],dpi:this._args.dpi,keepLocation:this._args.keepLocation},this._commandManager.execute(Wt.setImageMetadata,t,c.a.NotUpdate),[2]}))},new((r=void 0)||(r=Promise))((function(e,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(t,n||[])).next())}));var t,n,r,i},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e.getImageData=function(t){var e,n;if(null==t.source)return null;var r=new b.K;return r.isUserImage=t.isUserImage,r.storageId=t.source.id,r.pageIndex=t.source.pageIndex,r.isVector=t.source.isVector,r.name=null!==(e=t.displayName)&&void 0!==e?e:t.name,r.origin=null===(n=t.source.origin)||void 0===n?void 0:n.clone(),r.size.width=t.source.width,r.size.height=t.source.height,r},e}(X.a),We=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ue=function(t){function e(e,n,r,i){var o=t.call(this,null,e,n)||this;return o._productHandler=r,o._commandManager=i,o}return We(e,t),e.prototype._executeCommandBody=function(){var t,e,n,r,i,o,a;return r=this,i=void 0,a=function(){var r,i,o;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(a){switch(a.label){case 0:return null==(r=this._args.item)?[2]:!(r instanceof b.kb)||r instanceof b.cb?(console.warn("ConvertItemToPlaceholderCommand: item type "+r.type+" is not supported"),[2]):((i=new b.cb(r.sourceRectangle.clone())).sourcePath=r.sourcePath.clone(),i.sourcePathId=r.sourcePathId,i.transform=r.transform.clone(),i.name=r.name,o=this._productHandler.isItemSelected(r),[4,this._commandManager.execute(Wt.replaceItemCommand,{item:i,oldItem:r})]);case 1:return a.sent(),o?[4,this._commandManager.execute(Ut.selectItems,{items:[i]})]:[3,3];case 2:a.sent(),a.label=3;case 3:return r instanceof b.u?(i.content=r,i.isStubContent=r instanceof b.J,i.barcodeFormat=null!==(e=null===(t=r)||void 0===t?void 0:t.barcodeFormat)&&void 0!==e?e:null,r instanceof b.J&&(i.allowedSubfolder=r.allowedSubfolder,i.allowedTabs=null===(n=r.allowedTabs)||void 0===n?void 0:n.slice())):(i.fillColor=r.fillColor,i.borderColor=r.borderColor,i.borderWidth=r.borderWidth),i.manipulationPermissions=r.manipulationPermissions.clone(),i.visualizationPermissions=r.visualizationPermissions.clone(),i.itemPermissions=r.itemPermissions.clone(),i.shapePermissions=r.shapePermissions.clone(),[2,i]}}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Ve=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qe=function(t){function e(e,n,r,i){var o=t.call(this,null,e,n)||this;return o._productHandler=r,o._commandManager=i,o}return Ve(e,t),e.prototype._executeCommandBody=function(){var t,e,n,r,i;return e=this,n=void 0,i=function(){var e,n,r,i,o;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(a){switch(a.label){case 0:return null==(e=this._args.item)?[2]:e instanceof b.cb?(e.isEmptyContent?((r=new b.kb(e.sourcePath.clone())).sourcePath=e.sourcePath.clone(),r.sourcePathId=e.sourcePathId,r.transform=e.transform.clone(),r.name=e.name,r.manipulationPermissions=e.manipulationPermissions.clone(),r.visualizationPermissions=e.visualizationPermissions.clone(),r.itemPermissions=e.itemPermissions.clone(),r.shapePermissions=e.shapePermissions.clone(),r.fillColor=e.fillColor,r.borderColor=e.borderColor,r.borderWidth=e.borderWidth,n=r):((i=e.content.clone()).name=e.name,e.content=null,i.parentPlaceholder=null,(n=i)instanceof b.J&&(n.allowedSubfolder=e.allowedSubfolder,n.allowedTabs=null===(t=e.allowedTabs)||void 0===t?void 0:t.slice())),o=this._productHandler.isItemSelected(e),[4,this._commandManager.execute(Wt.replaceItemCommand,{item:n,oldItem:e})]):(console.warn("ConvertPlaceholderToItemCommand: item type "+e.type+" is not supported"),[2]);case 1:return a.sent(),o?[4,this._commandManager.execute(Ut.selectItems,{items:[n]})]:[3,3];case 2:a.sent(),a.label=3;case 3:return[2,n]}}))},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Ge=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$e=function(t){function e(e,n,r){var i=t.call(this,r.surface,n,r)||this;return i._productHandler=e,i}return Ge(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){return t=z.extend({surface:this._productHandler.currentSurface},this._args),null!=(e=t.surface.printAreas.firstOrDefault())&&(e.bleed=t.bleed),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(H),Xe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ke=function(t){function e(e,n){var r=t.call(this,e)||this;return r._canvas=n,r}return Xe(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){return t=this._canvas.viewer,e=_.RectangleF.getOverallBounds(this._args.items.map((function(e){return t.getHandler(e).bounds}))),t.zoomToRectangle(e),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),Ye=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Je=function(t){function e(e,n){var r=t.call(this,e)||this;return r._canvas=n,r}return Ye(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){if(t=this._canvas.viewer,e=this._args.safetyLine,null==(n=t.surface.printAreas.toArray().find((function(t){return t.safetyLines.contains(e)}))))throw new u.a("Safety line '"+e.name+"' doesn't exist in current surface");return r=e.getRectangle(n.getBounds(k.a.Trim)),t.zoomToRectangle(r),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),Ze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qe=function(t){function e(e){var n=t.call(this,null)||this;return n._canvas=e,n}return Ze(e,t),e.prototype.execute=function(){var t,e,n,r,i,o;return n=this,r=void 0,o=function(){var n;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){return null==(n=null===(e=null===(t=this._canvas)||void 0===t?void 0:t.selectionVisibleRectangle)||void 0===e?void 0:e.bounds)||this._canvas.viewer.zoomToRectangle(n),[2]}))},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{l(o.next(t))}catch(n){e(n)}}function s(t){try{l(o.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}))},e}(Z.a),tn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),en=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},nn=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},rn=function(t){function e(e,n,r,i){void 0===i&&(i=null);var o=t.call(this,n.items,e,n)||this;return o._productHandler=r,o._canvas=i,o}return tn(e,t),e.prototype._executeCommandBody=function(){var t,e,n,r;return en(this,void 0,void 0,(function(){var i,o,a,s,l,u,c,h,p=this;return nn(this,(function(f){switch(f.label){case 0:return i=null!==(t=this._args.itemsRect)&&void 0!==t?t:_.RectangleF.getOverallBounds(this._items.map((function(t){return p._productHandler.getHandler(t).bounds}))),o=Object(Xt.e)(i,this._args.rect,Xt.b.Fit),a=_.RotatedRectangleF.fromRectangleF(i),s=_.RotatedRectangleF.fromRectangleF(o),l=new Map,u=new Map,c=function(t){return en(p,void 0,void 0,(function(){var e;return nn(this,(function(n){switch(n.label){case 0:return l.set(t.id,t.visualizationPermissions.noShow),t.visualizationPermissions.noShow=!1,u.set(t.id,t.visible),t.visible=!0,(e=this._productHandler.getHandler(t)).update(),[4,e.waitUpdate()];case 1:return n.sent(),e.startTransform(),e.transformRectangle(a,s),[2]}}))}))},[4,Promise.all(this._items.map(c))];case 1:return f.sent(),this._items.map(this._productHandler.getHandler).forEach((function(t){t.onResized(),t.endTransform(!0,!0)})),h=function(t){t.visualizationPermissions.noShow=l.get(t.id),t.visible=u.get(t.id)},this._items.forEach(h),null===(e=this._canvas)||void 0===e||e.updateTexts(),null===(n=this._canvas)||void 0===n||n.updateSelection(),null===(r=this._canvas)||void 0===r||r.redraw(),[2]}}))}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),on=n(812),an=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(t){function e(e,n,r){var i=t.call(this,null,e,n)||this;return i._commandManager=r,i}return an(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){switch(e.label){case 0:return null==this._args.item?[2]:this._args.item instanceof b.o?(t=this._args.item)instanceof b.g?[4,this._commandManager.execute(Wt.convertTextItem,{item:t,to:Bt.PlainTextItem})]:[3,2]:(console.warn("FixUnsupportedTextCommand: item type "+this._args.item.type+" is not supported"),[2]);case 1:t=e.sent(),e.label=2;case 2:return on.a.containsRtlChars(t.text)&&(t.text=on.a.removeRtlChars(t.text)),t.shadow=null,t.overlapLinesEnabled=!1,t instanceof b.a||(t.maxLineCount=null),t instanceof b.ab&&(t.isVertical=!1),t instanceof b.q&&(t.isVertical=!1,t.scheduledFitMode=null),t instanceof b.eb&&(t.isVertical=!1),[2,t]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),ln=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),un=function(t){function e(e,n,r,i){var o=t.call(this,null,e,n)||this;return o._productHandler=r,o._commandManager=i,o}return ln(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(l){switch(l.label){case 0:if(t=this._args,e=t.item,n=t.to,null==e||null==n)return[2];if(e instanceof b.q&&this._args.to===Bt.BoundedTextItem||e instanceof b.eb&&this._args.to===Bt.PlainTextItem||e instanceof b.a&&this._args.to===Bt.ArchedTextItem)return console.warn("ConvertTextItemCommand: item type "+e.type+" to "+this._args.to+" is not supported"),[2];switch(r=this._productHandler.getHandler(e).rectangle,i=null,this._args.to){case Bt.PlainTextItem:i=new b.eb(e.text,r.location);break;case Bt.BoundedTextItem:(i=new b.q(e.text,r.toRectangleF())).manipulationPermissions.resizeGrips.corner=[b.hb.arbitrary,b.hb.proportional];break;case Bt.ArchedTextItem:i=Object(O.f)(new b.a(e.text,r.location),{bend:.25});break;default:return console.warn("ConvertTextItemCommand: destination item type "+this._args.to+" is not supported"),[2]}return e.copyTo(i),this._productHandler.exitEditMode(),[4,this._commandManager.execute(Wt.replaceItemCommand,{item:i,oldItem:e})];case 1:return l.sent(),[4,this._productHandler.waitUpdate()];case 2:return l.sent(),(o=this._productHandler.getHandler(i)).parentGroupItemHandler instanceof P.f&&o.parentGroupItemHandler.applyLayout(),e instanceof b.a&&(i.textPermissions.allowChangeLeading=!0,i.textPermissions.allowChangeTextAlignment=!0),n===Bt.BoundedTextItem?(a=r.toRectangleF(),e instanceof b.eb&&(s=.02*a.width,a.width+=s,e.alignment==b.qb.Right||e.alignment==b.qb.LastRight?a.left-=s:e.alignment!=b.qb.Center&&e.alignment!=b.qb.LastCenter||(a.left-=s/2),a.height*=1.1),o.setRectangle(_.RotatedRectangleF.fromRectangleF(a,r.angle))):v.a.alignHandlerToRect(o,r,e),o.update(),[4,this._productHandler.waitUpdate()];case 3:return l.sent(),[4,this._commandManager.execute(Ut.selectItems,{items:[i]})];case 4:return l.sent(),[2,i]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),cn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i._canvas=n,i._commandManager=r,i}return cn(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:if(t=this._args,e=t.rect,n=t.multiSelectMode,null==e)throw new u.a("SelectItemsByRectCommand: rect cannot be null");return Object(_.EqualsOfFloatNumbers)(e.width,0)||Object(_.EqualsOfFloatNumbers)(e.height,0)?[2]:(r=function(t){return a._canvas.viewer.productHandler.userEditContainer==t.item.parentContainer&&!a._canvas.isLockedOrDisabled(t)&&e.contains(t.rectangle.center)},i=this._canvas.getAllItemHandlers({onlyVisible:!0}).filter(r).map((function(t){return t.item})),o={items:i,multiSelectMode:n},[4,this._commandManager.execute(Ut.selectItems,o)]);case 1:return s.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),pn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(t){function e(e,n,r){var i=t.call(this,[],e,n)||this;return i._productHandler=r,i}return pn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:if(t=this._args,e=t.items,n=t.matrix,r=t.finished,i=t.newAngle,null==e||null==n)throw new u.a("TransformItemsCommand: items and matrix cannot be null!");return r=null==r||r,e.map(this._productHandler.getHandler).forEach((function(t){t.transformByMatrix(n,r,i),t instanceof P.m&&t.updateContentAndFrames((function(t){return t.transformByMatrix(n,r,i)}))})),[4,this._productHandler.waitUpdate()];case 1:return o.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),dn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gn=function(t){function e(e,n,r){var i=t.call(this,[],e,n)||this;return i._commandManager=r,i}return dn(e,t),e.prototype._executeCommandBody=function(){var t,e,n,r,i;return e=this,n=void 0,i=function(){var e,n,r,i,o,a,s,l;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(c){switch(c.label){case 0:if(e=this._args,n=e.item,r=e.oldItem,null==n||null==r)throw new u.a("ReplaceItemsCommand: item and oldItem must be not null!");return i=r.parentGroupItem,o=r.parentContainer,null==(a=null===(t=null!=i?i:o)||void 0===t?void 0:t.items)?[2]:(s=i instanceof b.R?i.getItemOrderIndex(r):null,l=a.indexOf(r),[4,this._commandManager.execute(Wt.deleteItems,{items:[r],autoParentGroupDelete:!1,autoUngroup:!1,force:!0})]);case 1:return c.sent(),i instanceof b.R?i.addItem(n,l,s):a.insertAt(l,n),[2]}}))},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}))},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),mn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yn=function(t){function e(e,n,r){var i=t.call(this,r.surface,n,r)||this;return i._productHandler=e,i}return mn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(n){return t=z.extend({surface:this._productHandler.currentSurface},this._args),null!=(e=t.surface.printAreas.firstOrDefault())&&(e.slug=t.slug),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(H),_n=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bn=function(t){function e(e,n,r){var i=t.call(this,[e.placeholder],null,e)||this;return i._productHandler=n,i._commandManager=r,i}return _n(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:if(t=this._args,e=t.placeholder,n=t.state,null==e)throw new u.a("EditPlaceholderCommand: placeholder cannot be null!");return e.isStubOrEmpty||e.isBarcodePlaceholder||!e.placeholderPermissions.allowEditContent||null==(r=this._productHandler.getHandler(e))||r.editing===n?[2]:[4,this._commandManager.execute(Ut.selectItems,{items:[e]})];case 1:return i.sent(),r.editing=n,[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),vn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wn=function(t){function e(e,n,r){var i=t.call(this,[],e,n)||this;return i._commandManager=r,i}return vn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(l){switch(l.label){case 0:if(t=this._args,e=t.angle,n=t.items,r=t.origin,i=t.finished,null==e||null==n||null==r)throw new u.a("RotateItemsCommand: angle, items and origin cannot be null");return e=Object(_.normalizeAngle)(e),o=(new _.Matrix).rotateAt(e,r.x,r.y),a={items:n,matrix:o,finished:i,newAngle:e},s=i?c.a.ForceUpdate:c.a.NotUpdate,[4,this._commandManager.execute(Wt.transformItems,a,s)];case 1:return l.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),Cn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pn=function(t){function e(e,n,r){var i=t.call(this,[],e,n)||this;return i._commandManager=r,i}return Cn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:if(t=this._args,e=t.delta,n=t.items,r=t.finished,null==e||null==n)throw new u.a("NewTranslateItemsCommand: delta and items cannot be null");return i=(new _.Matrix).translate(e.x,e.y),o={items:n,matrix:i,finished:r},a=r?c.a.ForceUpdate:c.a.NotUpdate,[4,this._commandManager.execute(Wt.transformItems,o,a)];case 1:return s.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),xn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sn=function(t){function e(e,n,r){var i=t.call(this,[],e,n)||this;return i._commandManager=r,i}return xn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){var t,e,n,r,i,o,a,s,l,h;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(p){switch(p.label){case 0:if(t=this._args,e=t.origin,n=t.scaleX,r=t.scaleY,i=t.items,o=t.finished,a=t.angle,null==e||null==i||null==n||null==r)throw new u.a("ResizeItemsCommand: origin, scale and items cannot be null");return s=null==a||Object(_.EqualsOfFloatNumbers)(a,0)?(new _.Matrix).scaleRelativeToPoint(n,r,e):(new _.Matrix).translate(e.x,e.y).rotate(a).scale(n,r).rotate(-a).translate(-e.x,-e.y),l={items:i,matrix:s,finished:o},h=o?c.a.ForceUpdate:c.a.NotUpdate,[4,this._commandManager.execute(Wt.transformItems,l,h)];case 1:return p.sent(),[2]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.redo=function(){throw new u.e},e.prototype.undo=function(){throw new u.e},e}(X.a),In=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),On=function(t){function e(e,n){var r=t.call(this,e)||this;return r._viewer=n,r}return In(e,t),e.prototype.execute=function(){var t,e,n,r,i,o,a,s;return i=this,o=void 0,s=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){if(null==(null===(t=this._args)||void 0===t?void 0:t.delta))throw new u.a("MoveViewportCommand: delta cannot be null");return null==(null===(e=this._viewer)||void 0===e?void 0:e.element)||(this._viewer.element.scrollLeft+=null!==(n=this._args.delta.x)&&void 0!==n?n:0,this._viewer.element.scrollTop+=null!==(r=this._args.delta.y)&&void 0!==r?r:0),[2]}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{l(s.next(t))}catch(n){e(n)}}function r(t){try{l(s.throw(t))}catch(n){e(n)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(n,r)}l((s=s.apply(i,o||[])).next())}))},e}(Z.a),Tn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r._canvas=n,r}return Tn(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){if(t=this._args,e=t.withoutUpdate,n=t.zoom,r=t.preventEvent,null==n)throw new u.a("SetZoomCommand: zoom cannot be null!");return this._canvas.viewer.setZoom(this._args.zoom,{skipZoomToCenter:!0,preventEvent:null!=r&&r},!1,null!=e&&e),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(Z.a),Ln=n(813),Rn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kn=function(t){function e(e,n){var r=t.call(this)||this;return r._viewer=e,r._cm=n,r}return Rn(e,t),e.prototype.execute=function(){if(null!=this._viewer){var t=this._viewer.selectedItems[0];if(null!=t&&null!=t.parentGroupItem){var e=this._filterItems(t.parentGroupItem.items);return this._cm.execute(Ut.selectItems,{items:e})}var n=this._filterItems(this._viewer.userEditContainer.items);return this._cm.execute(Ut.selectItems,{items:n})}},e.prototype._filterItems=function(t){var e=this;return t.toArray().filter((function(t){var n=e._viewer.getHandler(t);return n.isVisible()&&!n.isLocked()}))},e}(Z.a);!function(){function t(t,e,n,r,i,o,s){this._history=t,this._productHandler=e,this._productThemeManager=n,this._variableItemHelper=r,this._eventManager=i,this._canvas=o,this._itemsDataApplier=s,this._surfaceManager=new a(e)}Object.defineProperty(t.prototype,"_product",{get:function(){return this._productHandler.product},enumerable:!0,configurable:!0}),t.prototype.execute=function(t,e,n){var i,o;this._log(t,e);var a,s={history:this._history,historyUpdateMode:n};switch(t){case r.switchToSurface:this._surfaceManager.switchToSurface(e.value instanceof _t.Surface?e.value:this._product.surfaces.get(e.value));break;case r.getNextSurface:this._surfaceManager.getNextSurface(e.spinIndex);break;case r.switchSurfaceForward:this._surfaceManager.switchSurfaceForward();break;case r.switchSurfaceBackward:this._surfaceManager.switchSurfaceBackward();break;case Dt.rotateProduct:a=new m(this._productHandler,s,this._product,e);break;case Dt.replaceInterpolationPlaceholders:a=new yt(this._productHandler,s,this._product,this._canvas);break;case Dt.changeBackground:a=new N(this._productHandler,s,this._product,e,this,this._productThemeManager,this._canvas,this._eventManager);break;case Dt.applyProductTheme:a=new vt(s,this._product,e,this._productThemeManager,this);break;case Dt.fillPlaceholders:a=new xe(s,this._product,e,this);break;case Dt.resize:a=new Ee(s,this._product,e,this._productHandler,this,this._canvas);break;case Ht.addItems:a=new $(this._productHandler,s,e,this._productThemeManager,this._canvas,this._variableItemHelper,this,this._eventManager);break;case Ht.setBleed:a=new $e(this._productHandler,s,e);break;case Ht.setSlug:a=new yn(this._productHandler,s,e);break;case Wt.deleteItems:a=new J(this._productHandler,s,e,this._canvas,this.configuration,this);break;case Wt.cloneItems:a=new st(this._productHandler,s,e,this,this._variableItemHelper);break;case Wt.addContent:a=new Ct(this._productHandler,s,e,this._productThemeManager,this._eventManager);break;case Wt.alignItems:a=new xt(this._productHandler,s,e,this._canvas);break;case Wt.alignIntoGroup:a=new Fe(this._productHandler,s,e,this);break;case Wt.groupAlign:a=new It(s,e,this._canvas);break;case Wt.bringItems:a=new Et(this._productHandler,s,e,this,this._canvas);break;case Wt.moveItem:a=new Rt(this._productHandler,s,e);break;case Wt.createItem:a=new zt(this._itemsDataApplier,s,e);break;case Wt.editItems:a=new $t(this._itemsDataApplier,this._productHandler,s,e);break;case Wt.setImageMetadata:a=new j.a(s,e,this._productHandler,this._product,this._variableItemHelper,this,this._eventManager);break;case Wt.setImageItem:a=new He(s,e,this);break;case Wt.placeholderContentScale:a=new Yt(e,s,this._productHandler);break;case Wt.placeholderContentReset:a=new Zt(e,s,this._productHandler);break;case Wt.changeBarcodeFormat:a=new te(e,s,this._productHandler);break;case Wt.changeColumnCount:a=new ie(e,s,this._productHandler);break;case Wt.placeholderContentRotate:a=new ae(e,s,this._productHandler);break;case Wt.insertItemsIntoArea:a=new le(e,s,this._productHandler,this);break;case Wt.changeLayout:a=new ce(e,s,this._productHandler,this._product,this);break;case Wt.groupItems:a=new fe(s,e,this);break;case Wt.ungroupItems:a=new ye(s,e,this);break;case Wt.replaceGroupItemContent:a=new be(s,e,this._productHandler,this._product,this,this._productThemeManager,this._canvas);break;case Wt.changeClipartItemColor:a=new Ce(s,e);break;case Wt.translateItems:a=new Re(s,e,this._productHandler,this._canvas);break;case Wt.convertGroupIntoLayout:a=new Me(s,e,this,this._canvas);break;case Wt.convertLayoutIntoGroup:a=new ze(s,e,this);break;case Wt.convertItemToPlaceholder:a=new Ue(s,e,this._productHandler,this);break;case Wt.convertPlaceholderToItem:a=new qe(s,e,this._productHandler,this);break;case Wt.placeItemsToArea:a=new rn(s,e,this._productHandler,this._canvas);break;case Wt.convertTextItem:a=new un(s,e,this._productHandler,this);break;case Wt.transformItems:a=new fn(s,e,this._productHandler);break;case Wt.rotateItems:a=new wn(s,e,this);break;case Wt.newTranslateItems:a=new Pn(s,e,this);break;case Wt.resizeItems:a=new Sn(s,e,this);break;case Wt.replaceItemCommand:a=new gn(s,e,this);break;case Wt.fixUnsupportedText:a=new sn(s,e,this);break;case Wt.editPlaceholder:a=new bn(e,this._productHandler,this);break;case Wt.distributeItems:return new Ft(this._canvas,this._productHandler,s,e).execute();case Ut.selectItems:a=new tt(this._productHandler,e,this._canvas);break;case Ut.selectItemsByRect:a=new hn(e,this._canvas,this);break;case Ut.selectAll:a=new kn(null===(i=this._canvas)||void 0===i?void 0:i.viewer,this);break;case Ut.selectFirst:a=new nt(this._productHandler,this,this._canvas);break;case Ut.clearSelection:a=new it(this._canvas);break;case Vt.zoomToItems:a=new Ke(e,this._canvas);break;case Vt.zoomToSafetyLine:a=new Je(e,this._canvas);break;case Vt.zoomToSelection:a=new Qe(this._canvas);break;case Vt.setZoom:a=new En(e,this._canvas);break;case qt.moveViewPort:a=new On(e,null===(o=this._canvas)||void 0===o?void 0:o.viewer);break;default:throw new u.a}return null==a?void 0:a.execute()},t.prototype._log=function(t,e){Ln.a.debugLog("Command "+t+" is executing!",Ln.b.CommandManager)}}(),function(t){t.rotateProduct="rotateProduct",t.replaceInterpolationPlaceholders="replaceInterpolationPlaceholders",t.changeBackground="changeBackground",t.applyProductTheme="applyProductTheme",t.fillPlaceholders="fillPlaceholders",t.resize="resize"}(Dt||(Dt={})),function(t){t.addItems="addItems",t.setBleed="setBleed",t.setSlug="setSlug"}(Ht||(Ht={})),function(t){t.deleteItems="deleteItems",t.cloneItems="cloneItems",t.addContent="addContent",t.alignItems="alignItems",t.alignIntoGroup="alignIntoGroup",t.groupAlign="groupAlign",t.bringItems="bringItems",t.moveItem="moveItem",t.createItem="createItem",t.editItems="editItems",t.setImageMetadata="setImageMetadata",t.setImageItem="setImageItem",t.placeholderContentScale="placeholderContentScale",t.placeholderContentReset="placeholderContentReset",t.placeholderContentRotate="placeholderContentRotate",t.changeBarcodeFormat="changeBarcodeFormat",t.changeColumnCount="changeColumnCount",t.insertItemsIntoArea="insertItemsIntoArea",t.changeLayout="changeLayout",t.groupItems="groupItems",t.ungroupItems="ungroupItems",t.replaceGroupItemContent="replaceGroupItemContent",t.changeClipartItemColor="changeClipartItemColor",t.convertGroupIntoLayout="convertGroupIntoLayout",t.convertLayoutIntoGroup="convertLayoutIntoGroup",t.translateItems="translateItems",t.convertItemToPlaceholder="itemToPlaceholder",t.convertPlaceholderToItem="placeholderToItem",t.placeItemsToArea="placeItemsToArea",t.convertTextItem="convertTextItem",t.transformItems="transformItems",t.rotateItems="rotateItems",t.fixUnsupportedText="fixUnsupportedText",t.replaceItemCommand="replaceItemCommand",t.editPlaceholder="editPlaceholder",t.distributeItems="distributeItems",t.newTranslateItems="newTranslateItems",t.resizeItems="resizeItems"}(Wt||(Wt={})),function(t){t.clearSelection="clearSelection",t.selectFirst="selectFirst",t.selectItems="selectItems",t.selectItemsByRect="selectItemsByRect",t.selectAll="selectAll"}(Ut||(Ut={})),function(t){t.zoomToItems="zoomToItems",t.zoomToSafetyLine="zoomToSafetyLine",t.zoomToSelection="zoomToSelection",t.setZoom="setZoom"}(Vt||(Vt={})),function(t){t.moveViewPort="moveViewPort"}(qt||(qt={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return h}));class r{constructor(t){this._textManager=t}getSelectionRightParagraphLength(){const t=this.getSelection();if(null==t)return-1;const e=t.getRightPosition();return this.getParagraphLength(e.getParagraphIndex())}getSelectionRightParagraphIndex(){const t=this.getSelection();return null==t?-1:t.getRightPosition().getParagraphIndex()}getSelectionLeftParagraphIndex(){const t=this.getSelection();return null==t?-1:t.getLeftPosition().getParagraphIndex()}getSelectionLeftParagraphLength(){const t=this.getSelection();if(null==t)return-1;const e=t.getLeftPosition();return this.getParagraphLength(e.getParagraphIndex())}getSelectionRightParagraphOffset(){const t=this.getSelection();return null==t?-1:t.getRightPosition().getOffset()}getSelectionLeftParagraphOffset(){const t=this.getSelection();return null==t?-1:t.getLeftPosition().getOffset()}get isCursorAtTheBeginningOfParagraph(){var t;const e=this.getCursorPosition(),n=this.getParagraphIndex(),r=null===(t=this._textManager.getParagraphText(n))||void 0===t?void 0:t.getStartPosition();return e.getOffset()===r.getOffset()&&e.getLineIndex()===r.getLineIndex()}get isCaretAtTheEndOfParagraph(){return this._textManager.isCaretOnEndOfParagraph()}get isParagraphEmpty(){var t;return 0===(null===(t=this.getParagraphText().getPlainText())||void 0===t?void 0:t.length)}get isParagraphAListItem(){const t=this.getSelection();if(null==t||t.isEmpty)return this._textManager.isParagraphAListItem(this.getParagraphIndex());const e=this.getSelection().getParagraphIndexes()[0];return this._textManager.isParagraphAListItem(e)}get isSelectionCollapsed(){return this._textManager.isSelectionCollapsed()}get isSelectionMultiline(){const t=this._textManager.getSelectedTextRange();if(null==t)return!1;const e=t.getLeftPosition(),n=t.getRightPosition();return e.getParagraphIndex()!=n.getParagraphIndex()}getParagraphIndex(){return this._textManager.getCurrentParagraphIndex()}getParagraphText(){return this._textManager.getParagraphText(this.getParagraphIndex())}getTextFromStartOfParagraph(){const t=this.getParagraphText().getStartPosition(),e=this._textManager.getCurrentPosition();return this._textManager.getTextRangeByPositions(t,e)}getCursorPosition(){return this._textManager.getCurrentPosition()}getSelection(){return this._textManager.getSelectedTextRange()}getTextMetrics(){return{textLength:this._textManager.getTextLength(),currentLineLength:this._textManager.getCurrentParagraphLength(),linesCount:this._textManager.getParagraphCount()}}getParagraphLength(t){return this._textManager.getParagraphLength(t)}getNextParagraphLength(){const t=this._textManager.getCurrentParagraphIndex()+1;return this._textManager.getParagraphLength(t)}getPreviousParagraphLength(){const t=this._textManager.getCurrentParagraphIndex()-1;return this._textManager.getParagraphLength(t)}getListItemLevel(){var t;return null===(t=this._textManager.getListItemStyle(this.getParagraphIndex()))||void 0===t?void 0:t.level}findItemToContinueBulletedList(t){return this._textManager.findItemToContinueBulletedList(this.getParagraphIndex(),t)}findItemToContinueNumberedList(t,e){return this._textManager.findItemToContinueNumberedList(this.getParagraphIndex(),t,e)}}var i=n(429);class o{constructor(t,e){this.limitsViolated=t,this.pastedLimitsViolated=e}get isViolated(){return this.limitsViolated||this.pastedLimitsViolated}}class a{constructor(t){this._limits=null,this._currentTextInfo=null,this._currentTextInfo=t}setLimits(t){this._limits=t}validateInput(t){if(null==this._limits)return new o(!1,!1);if(null==t)return new o(!1,!1);if(t.type==i.b.pasteFromClipboard)return this.validatePastedText(t.initData);const{characterLimit:e,maxLineCount:n,maxLineLength:r}=this._limits,{textLength:a,currentLineLength:s,linesCount:l}=this._currentTextInfo.getTextMetrics(),{isSelectionCollapsed:u,isSelectionMultiline:c,selectionEndParagraphOffset:h,selectionStartParagraphOffset:p,selectionEndParagraphLength:f,isCursorAtTheBeginningOfParagraph:d,isCursorAtTheEndOfParagraph:g,previousParagraphLength:m,nextParagraphLength:y}=this._getTextInfo(),_=t.type===i.b.insertNewLine||t.type===i.b.insertLineBreak;if(u){if((_||t.type===i.b.insertChar)&&e&&a&&a>=e)return new o(!0,!1);if(t.type===i.b.insertChar&&r&&s&&s>=r)return new o(!0,!1);if(t.type===i.b.insertTab&&(e&&a&&a>=e-3||s&&s>=r-3))return new o(!0,!1)}if(c&&(t.type==i.b.deleteToLeft||t.type===i.b.deleteToRight)&&p+f-h>r)return new o(!0,!1);if(c&&t.type==i.b.insertChar&&p+f-h+1>r)return new o(!0,!1);if(_&&n&&l&&l>=n)return new o(!0,!1);if(r&&s>0){if(t.type===i.b.deleteToLeft&&d&&u&&s+m>r&&m>0)return new o(!0,!1);if(t.type===i.b.deleteToRight&&g&&u&&s+y>r&&y>0)return new o(!0,!1)}return new o(!1,!1)}validatePastedText(t){if(null==this._limits)return new o(!1,!1);if(null==t)return new o(!1,!1);const e=this._isPastedTextInLimits(t);return new o(!1,!e)}_isPastedTextInLimits(t){const{maxLineLength:e,characterLimit:n,maxLineCount:r}=this._limits,i=t.split(/\r?\n/);return!(n&&!this._validateInsertedTextForCharacterCount(i)||e&&!this._validateInsertedTextForMaxLineLength(i)||r&&!this._validateInsertedTextForMaxLineCount(i))}_validateInsertedTextForMaxLineCount(t){if(1==t.length)return!0;const{maxLineCount:e}=this._limits,{linesCount:n}=this._currentTextInfo.getTextMetrics(),{selectionEndParagraphIndex:r,selectionStartParagraphIndex:i}=this._getTextInfo();return!(n-(r-i-1)+(t.length-2)>e)}_validateInsertedTextForMaxLineLength(t){const{maxLineLength:e}=this._limits,{currentLineLength:n}=this._currentTextInfo.getTextMetrics(),{selectionEndParagraphOffset:r,selectionStartParagraphOffset:i,selectionEndParagraphLength:o}=this._getTextInfo();if(1==t.length){if(n-(r-i)+t[0].length>e)return!1}else{if(t[0].length+i>e)return!1;for(let n=1;n<t.length-1;n++)if(t[n].length>e)return!1;if(t[t.length-1].length+(o-r)>e)return!1}return!0}_validateInsertedTextForCharacterCount(t){const{characterLimit:e}=this._limits,{textLength:n}=this._currentTextInfo.getTextMetrics(),{isSelectionCollapsed:r,isSelectionMultiline:i,selectionEndParagraphIndex:o,selectionStartParagraphIndex:a,selectionEndParagraphOffset:s,selectionStartParagraphOffset:l,selectionStartParagraphLength:u}=this._getTextInfo();let c=0;if(!r)if(i){c+=u-l;for(var h=a+1;h<o;h++)c+=this._currentTextInfo.getParagraphLength(h);c+=s}else c=s-l;let p=0;return t.forEach((t=>p+=t.length)),!(n-c+p>e)}_getTextInfo(){return{isSelectionCollapsed:this._currentTextInfo.isSelectionCollapsed,isSelectionMultiline:this._currentTextInfo.isSelectionMultiline,selectionStartParagraphOffset:this._currentTextInfo.getSelectionLeftParagraphOffset(),selectionEndParagraphOffset:this._currentTextInfo.getSelectionRightParagraphOffset(),selectionStartParagraphLength:this._currentTextInfo.getSelectionLeftParagraphLength(),selectionEndParagraphLength:this._currentTextInfo.getSelectionRightParagraphLength(),selectionStartParagraphIndex:this._currentTextInfo.getSelectionLeftParagraphIndex(),selectionEndParagraphIndex:this._currentTextInfo.getSelectionRightParagraphIndex(),isCursorAtTheBeginningOfParagraph:this._currentTextInfo.isCursorAtTheBeginningOfParagraph,isCursorAtTheEndOfParagraph:this._currentTextInfo.isCaretAtTheEndOfParagraph,previousParagraphLength:this._currentTextInfo.getPreviousParagraphLength(),nextParagraphLength:this._currentTextInfo.getNextParagraphLength()}}}var s=n(406);class l{constructor(){this._isInitialized=!1}get isInitialized(){return this._isInitialized}initialize(t){if(t.textEngineWrapper&&t.styleManager){this._isInitialized=!0;const e=t.textEngineWrapper;this._textHandler=e.textHandler,this._styleHandler=e.styleHandler,this._metadataHandler=e.metadataHandler,this._listStyleSheetManager=t.styleManager;const n=this._listStyleSheetManager.getListSetting();this._styleNameKey=n.styleNameKey,this._maxNestingListLevel=n.maxNestingListLevel,this._defaultBulletCharCode=n.defUnorderedListStyle.bulletCharCode}else this._isInitialized=!1}actualizeStyleManager(){this._checkInitialization("Failed to actualize style manager!");const t=this._listStyleSheetManager.getAllStyleSheets().map((t=>t.name));for(let e of t){const t=this._listStyleSheetManager.getStyleSheet(e),n=this._getAllListItemIndexesByName(e),r=this._getListStylesForLevels(n);for(let e of r){const n=e.level;t.setListStyle(n,e)}}}isParagraphAListItem(t){return this._checkInitialization("Failed to check if paragraph is a list!"),this._isParagraphAListItem(t)}isParagraphsTheSameList(t){return this._checkInitialization("Failed to check if paragraphs are the same list!"),this._isParagraphsTheSameList(t)}findItemToContinueBulletedList(t,e){const n="Failed to find the previous list item to continue bulleted list!";return this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._findItemToContinueBulletedList(t,e)}findItemToContinueNumberedList(t,e,n){const r="Failed to find the previous list item to continue bulleted list!";return this._checkInitialization(r),this._checkParagraphIndexesExistence([t],r),this._findItemToContinueNumberedList(t,e,n)}getListItemStyle(t){const e="Failed to get the style of the list item!";return this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._getListStyleByIndex(t)}applyListType(t,e){const n="Failed to apply a list type to paragraphs!";return this._checkInitialization(n),this._checkParagraphIndexesExistence(t,n),e===i.d.none&&this._throwException(n,"The list type is not specified!"),this._applyListType(t,e)}createBulletedListItem(t,e){const n="Failed to create bulleted list item!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph is already a list item!"),this._createBulletedListItem(t,e)}createNumberedListItem(t,e){const n="Failed to create numbered list item!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph is already a list item!"),this._createNumberedListItem(t,e)}addListItem(t,e){const n="Failed to add an item to an existing list!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t,e],n),this._isParagraphAListItem(e)||this._throwException(n,"It's not a list!"),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph being added is already a list item!"),this._addListItem(t,e)}deleteListItem(t){const e="Failed to delete delete an existing list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._deleteListItem(t)}increaseListItemIndent(t){const e="Failed to increases the nesting level of the list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._increaseListItemIndent(t)}decreaseListItemIndent(t){const e="Failed to decrease the nesting level of the list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._decreaseListItemIndent(t)}_isParagraphAListItem(t){return null!=this._getListStyleNameByIndex(t)}_isParagraphsTheSameList(t){let e=null;for(let n of t){if(!this._isParagraphAListItem(n))return!1;const t=this._getListStyleNameByIndex(n);if(null!=e){if(t!==e)return!1}else e=t}return!0}_isParagraphsAreListItems(t){for(let e of t)if(!this._isParagraphAListItem(e))return!1;return!0}_isParagraphsHaveTheSameListType(t,e){var n;for(let r of t)if((null===(n=this._getListStyleByIndex(r))||void 0===n?void 0:n.type)!==e)return!1;return!0}_findItemToContinueBulletedList(t,e){if(0===t)return null;const n=t-1;if(!this._isParagraphAListItem(n))return null;const r=this._getListStyleByIndex(n);return r.type!==i.d.bullets||r.bulletCharCode!==e?null:n}_findItemToContinueNumberedList(t,e,n){if(0===t)return null;const r=this._findPreviousListItemIndex(t);if(null==r)return null;const o=this._getListStyleByIndex(r);return o.type!==i.d.numbers||o.numberingFormat!==e||o.itemNumber!==n-1?null:r}_findPreviousListItemIndex(t){for(let e=t-1;e>=0;e--)if(this._isParagraphAListItem(e))return e;return null}_findPreviousRelatedListItemIndex(t,e,n){for(let r=e-1;r>=0;r--){if(!this._isParagraphAListItem(r)||this._getListStyleNameByIndex(r)!==t)continue;if(null==n)return r;const e=this._getListItemLevelByIndex(r);if(e<n)return null;if(e===n)return r}return null}_findNextRelatedListItemIndex(t,e,n){const r=this._textHandler.getParagraphCount()-1;for(let i=e+1;i<=r;i++){if(!this._isParagraphAListItem(i)||this._getListStyleNameByIndex(i)!==t)continue;if(null==n)return i;const e=this._getListItemLevelByIndex(i);if(e<n)return null;if(e===n)return i}return null}_getListItemLevelByIndex(t){const e=this._getListStyleByIndex(t);return null==e?void 0:e.level}_getAllListItemIndexesByName(t){const e=[],n=this._textHandler.getParagraphCount();for(let r=0;r<n;r++)this._getListStyleNameByIndex(r)===t&&e.push(r);return e}_getAllLevelsOfListItems(t,e){let n=[];for(let r of t){const t=this._getListStyleByIndex(r);-1===n.indexOf(t.level)&&(e?e===t.type&&n.push(t.level):n.push(t.level))}return n.sort(((t,e)=>t-e))}_createBulletedListItem(t,e){const n=this._listStyleSheetManager.createDefaultBulletedStyleSheet(e),r=this._getListStyleFromManager(n.name,t,i.d.bullets,0);this._setListStyleAndName(t,n.name,r)}_createNumberedListItem(t,e){const n=this._listStyleSheetManager.createDefaultNumberedStyleSheet(e),r=this._getListStyleFromManager(n.name,t,i.d.numbers,0);this._setListStyleAndName(t,n.name,r)}_addListItem(t,e){const n=this._getListStyleNameByIndex(e),r=this._getListStyleByIndex(e);if(this._findPreviousRelatedListItemIndex(n,t)!==e)throw new s.c("Failed to add an item to an existing list! An existing list item is not a previous item of the same list!");if(r.type===i.d.numbers&&r.itemNumber++,this._setListStyleAndName(t,n,r),r.type===i.d.numbers){const e=t+1,i=r.itemNumber+1;this._recountListItemsStartingAt(n,e,i,r.level)}}_deleteListItem(t){const e=this._getListStyleNameByIndex(t),n=this._getListStyleByIndex(t);this._deleteListStyleAndName(t),this._recountListItemsAfterDeletingItem(t,e,n)}_recountListItemsAfterDeletingItem(t,e,n){n.type===i.d.numbers&&this._recountListItemsOfCurrentLevelAfterDeletingItem(t,e,n);const r=n.level+1;if(r<=this._maxNestingListLevel){const n=this._getListStyleByNameAndLevel(e,r);(null==n?void 0:n.type)===i.d.numbers&&this._recountListItemsOfNextLevelAfterDeletingItem(t,e,r)}}_recountListItemsOfCurrentLevelAfterDeletingItem(t,e,n){this._recountListItemsStartingAt(e,t,n.itemNumber,n.level)}_recountListItemsOfNextLevelAfterDeletingItem(t,e,n){const r=this._findPreviousRelatedListItemIndex(e,t),i=this._findNextRelatedListItemIndex(e,t);if(null!=r&&null!=i){const t=this._getListStyleByIndex(r),o=this._getListStyleByIndex(i);t.level===n&&o.level===n&&this._recountListItemsStartingAt(e,i,t.itemNumber+1,n)}}_applyListType(t,e){const n=this._isParagraphsTheSameList(t)&&!this._isParagraphsHaveTheSameListType(t,e),r=this._isParagraphsAreListItems(t)&&this._isParagraphsHaveTheSameListType(t,e),i=!this._isParagraphsTheSameList(t)&&!this._isParagraphsHaveTheSameListType(t,e);if(r)this._applyListTypeRemoving(t);else if(n)this._applyListTypeChanging(t,e);else if(i){if(!this._isParagraphsAreListItems(t)&&this._tryToApplyListTypeJoining(t,e))return;this._applyListTypeCreating(t,e)}}_applyListTypeRemoving(t){t.forEach((t=>this._deleteListItem(t)))}_applyListTypeChanging(t,e){const n=this._getListStyleNameByIndex(t[0]),r=this._getAllLevelsOfListItems(t);for(let o of r)e===i.d.numbers?this._changeListTypeToNumbers(n,o):this._changeListTypeToBullets(n,o)}_changeListTypeToNumbers(t,e){const n=this._listStyleSheetManager.getDefaultListStyle(i.d.numbers,e),r=this._getAllListItemIndexesByName(t);let o=0;for(let a of r){const r=this._getListStyleByIndex(a);r.level<e?o=0:r.level===e&&(0===o&&(o=this._canBecomeTheFirstListItem(a,t,r.level)?1:2),r.type=i.d.numbers,r.numberingFormat=n.numberingFormat,r.itemNumber=o,this._setListStyleByIndex(a,r),o++)}}_changeListTypeToBullets(t,e){const n=this._listStyleSheetManager.getDefaultListStyle(i.d.bullets,e),r=this._getAllListItemIndexesByName(t);for(let o of r){const t=this._getListStyleByIndex(o);t.level===e&&(t.type=i.d.bullets,t.bulletCharCode=n.bulletCharCode,this._setListStyleByIndex(o,t))}}_applyListTypeCreating(t,e){const n=this._getListStylesForLevels(t,e),r=this._listStyleSheetManager.createStyleSheet(n);for(let i of t){const t=this._isParagraphAListItem(i)?this._getListItemLevelByIndex(i):0,n=this._getListStyleFromManager(r.name,i,e,t);this._isParagraphAListItem(i)&&this._deleteListItem(i),this._setListStyleAndName(i,r.name,n)}if(e===i.d.numbers){const e=this._getAllLevelsOfListItems(t,i.d.numbers);for(let t of e)this._recountAllListItemsOfRequiredLevel(r.name,t)}}_tryToApplyListTypeJoining(t,e){const n=t[0];if(0===n)return!1;if(!this._isParagraphAListItem(n)&&this._isParagraphAListItem(n-1))return this._tryToApplyListTypeJoiningWithShiftLevel(t,e);const r=this._getListStyleByIndex(n);return!(!this._isParagraphAListItem(n)||r.type!==e)&&this._tryToApplyListTypeJoiningWithSaveLevel(t,e)}_tryToApplyListTypeJoiningWithShiftLevel(t,e){let n,r=0;const i=t[0]-1,o=this._getListStyleByIndex(i),a=this._getListStyleNameByIndex(i);if(o.type===e)n=i,r=o.level;else{const t=this._getAllListItemIndexesByName(a).filter((t=>t<i));if(r=this._getAllLevelsOfListItems(t,e)[0],!r)return!1;for(let e of t.sort(((t,e)=>e-t)))if(this._getListStyleByIndex(e).level===r){n=e;break}}return this._applyListTypeJoining(t,e,n,r),!0}_tryToApplyListTypeJoiningWithSaveLevel(t,e){const n=t[0];return this._applyListTypeJoining(t,e,n,0),!0}_applyListTypeJoining(t,e,n,r){var o;const a=this._getListStyleNameByIndex(n);for(let i of t){let t;if(this._isParagraphAListItem(i)){const e=this._getListItemLevelByIndex(i)+r;t=e<=this._maxNestingListLevel-1?e:this._maxNestingListLevel-1}else t=r;let n=null!==(o=this._getListStyleByNameAndLevel(a,t))&&void 0!==o?o:this._getListStyleFromManager(a,i,e,t);this._isParagraphAListItem(i)&&this._deleteListItem(i),this._setListStyleAndName(i,a,n)}if(e===i.d.numbers){const e=this._getAllLevelsOfListItems(t,i.d.numbers);for(let t of e)this._recountAllListItemsOfRequiredLevel(a,t)}}_increaseListItemIndent(t){const e=this._getListItemLevelByIndex(t)+1;e>this._maxNestingListLevel-1||this._changeListItemIndent(t,e,!0)}_decreaseListItemIndent(t){const e=this._getListItemLevelByIndex(t)-1;e<0||this._changeListItemIndent(t,e,!1)}_changeListItemIndent(t,e,n){var r;const o=this._getListStyleNameByIndex(t),a=this._getListStyleByIndex(t),s=null!==(r=this._getListStyleByNameAndLevel(o,e))&&void 0!==r?r:this._getListStyleFromManager(o,t,a.type,e);s.type===i.d.numbers&&(s.itemNumber=this._getListItemNumberOfNewLevelAfterChangeIndent(t,o,s),this._recountListItemsOfNewLevelAfterChangeIndent(t,o,s)),this._setListStyleByIndex(t,s),a.type===i.d.numbers&&this._recountListItemsOfCurrentLevelAfterChangeIndent(t,o,a,n)}_recountListItemsOfCurrentLevelAfterChangeIndent(t,e,n,r){const i=t+1,o=r?n.itemNumber:1;this._recountListItemsStartingAt(e,i,o,n.level)}_recountListItemsOfNewLevelAfterChangeIndent(t,e,n){if(null!=this._findNextRelatedListItemIndex(e,t,n.level)){const r=t+1,i=n.itemNumber+1;this._recountListItemsStartingAt(e,r,i,n.level)}}_getListItemNumberOfNewLevelAfterChangeIndent(t,e,n){const r=this._findPreviousRelatedListItemIndex(e,t,n.level);return null!=r?this._getListStyleByIndex(r).itemNumber+1:1}_recountListItemsStartingAt(t,e,n,r){const i=this._getAllListItemIndexesByName(t).filter((t=>t>=e));let o=!1,a=n;for(let s of i){const e=this._getListItemLevelByIndex(s);if(e===r)o=!0,1===a&&(a=this._canBecomeTheFirstListItem(s,t,e)?1:2),this._setListStyleByIndex(s,{itemNumber:a}),a++;else if(o&&e<r)return}}_recountAllListItemsOfRequiredLevel(t,e){let n=0;const r=this._getAllListItemIndexesByName(t);for(let i of r){const r=this._getListStyleByIndex(i);r.level<e?n=0:r.level===e&&(0===n&&(n=this._canBecomeTheFirstListItem(i,t,r.level)?1:2),r.itemNumber=n,this._setListStyleByIndex(i,r),n++)}}_canBecomeTheFirstListItem(t,e,n){if(0===t)return!0;const r=this._findPreviousRelatedListItemIndex(e,t);return null==r||this._getListItemLevelByIndex(r)<n}_getListStyleNameByIndex(t){var e;const n=this._metadataHandler.getMetadata(t);return(null===(e=null==n?void 0:n.getProperty(this._styleNameKey))||void 0===e?void 0:e.value)||null}_getListStyleByIndex(t){if(!this._isParagraphAListItem(t))return null;const e=this._styleHandler.getParagraphStyleByIndex(t);return null==e?null:this._convertFromParagraphStyle(e)}_getListStyleByNameAndLevel(t,e){const n=this._getAllListItemIndexesByName(t);for(let r of n){const t=this._getListStyleByIndex(r);if(t.level===e)return t}return null}_getListStylesForLevels(t,e){let n=[],r=[];for(let i of t){const t=this._getListStyleByIndex(i);null!=t&&-1===n.indexOf(t.level)&&(e&&e!==t.type||(n.push(t.level),r.push(t)))}return r.sort(((t,e)=>t.level>e.level?1:0))}_setListStyleAndName(t,e,n){this._setListStyleNameByIndex(t,e),this._setListStyleByIndex(t,n)}_setListStyleNameByIndex(t,e){const n=[{name:this._styleNameKey,value:e}],r=this._metadataHandler.createMetadata(n);this._metadataHandler.setMetadata(t,r)}_setListStyleByIndex(t,e){this._styleHandler.setParagraphStyleByIndex(t,this._convertToParagraphStyle(e))}_deleteListStyleAndName(t){this._deleteListStyleNameByIndex(t),this._clearListStyleByIndex(t)}_deleteListStyleNameByIndex(t){this._metadataHandler.deleteMetadata(t)}_clearListStyleByIndex(t){this._styleHandler.setParagraphStyleByIndex(t,{listType:i.d.none,level:0,bulletCharCode:this._defaultBulletCharCode,numberingFormat:i.h.none,startNumber:0,firstLineIndent:0,leftIndent:0,tabOffset:0})}_getListStyleFromManager(t,e,n,r){var o;const a=this._listStyleSheetManager.getStyleSheet(t),s=null!==(o=null==a?void 0:a.getListStyle(r))&&void 0!==o?o:this._getDefaultListStyleFromManager(e,n,r);return n===i.d.numbers&&(s.itemNumber=1),s}_getDefaultListStyleFromManager(t,e,n){const r=this._listStyleSheetManager.getDefaultListStyle(e,n),i=this._isParagraphAListItem(t)?this._getListStyleByIndex(t):null;return(null==i?void 0:i.bulletCharCode)&&(r.bulletCharCode=i.bulletCharCode),(null==i?void 0:i.numberingFormat)&&(r.numberingFormat=i.numberingFormat),r}_checkInitialization(t){if(!this._isInitialized)throw new s.c(`${t} The list service is not initialized!`)}_checkParagraphIndexesExistence(t,e){if(0===t.length)throw new s.c(`${e} Paragraph indexes are not specified!`);const n=this._textHandler.getParagraphCount();for(let r of t)if(r>=n)throw new s.c(`${e} Invalid paragraph index!`)}_throwException(t,e){throw new s.c(`${t} ${e}`)}_convertFromParagraphStyle(t){return{type:t.listType,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,itemNumber:t.startNumber,bulletCharCode:t.bulletCharCode}}_convertToParagraphStyle(t){return{listType:t.type,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,numberingMode:i.i.startAt,startNumber:t.itemNumber,bulletCharCode:t.bulletCharCode}}}class u{constructor(t){if(!t.name)throw new s.c("List stylesheet name cannot be null or undefined");this._name=t.name,this._listStyles=[],t.listLevelsStyles&&t.listLevelsStyles.forEach((t=>this.setListStyle(t.level,t)))}get name(){return this._name}setListStyle(t,e){let n=this.getListStyle(t);n?(n.type=e.type,n.tabOffset=e.tabOffset,n.numberingFormat=e.numberingFormat,n.itemNumber=e.itemNumber,n.bulletCharCode=e.bulletCharCode,n.firstLineIndent=e.firstLineIndent,n.leftIndent=e.leftIndent):(e.level=t,this._listStyles.push(e))}getListStyle(t){const e=this._listStyles.filter((e=>e.level===t));return e.length>0?e[0]:null}getAllListStyles(){return this._listStyles}getListStyleSheet(){return{name:this._name,listLevelsStyles:this._listStyles}}}class c{constructor(t){this._styleNameKey=t.styleNameKey,this._styleNamePrefix=t.styleNamePrefix,this._maxNestingListLevel=t.maxNestingListLevel,this._defOrderedListLevelGap=t.defOrderedListLevelGap,this._defUnorderedListLevelGap=t.defUnorderedListLevelGap,this._defOrderedListStyle={type:i.d.numbers,tabOffset:t.defOrderedListStyle.tabOffset,firstLineIndent:t.defOrderedListStyle.firstLineIndent,leftIndent:t.defOrderedListStyle.leftIndent,numberingFormat:t.defOrderedListStyle.numberingFormat},this._defUnorderedListStyle={type:i.d.bullets,tabOffset:t.defUnorderedListStyle.tabOffset,firstLineIndent:t.defUnorderedListStyle.firstLineIndent,leftIndent:t.defUnorderedListStyle.leftIndent,bulletCharCode:t.defUnorderedListStyle.bulletCharCode},this.clearAllStyleSheets(),this._styleSheetTemplates=t.styleSheetTemplates?t.styleSheetTemplates.map((t=>new u(t))):[]}initialize(t){this.clearAllStyleSheets(),t&&(t.forEach((t=>{this.isStyleSheetExists(t.name)||this._styleSheets.push(new u(t))})),this._lastStyleNumber=this._getLastStyleNumber())}getListSetting(){var t;return{styleNameKey:this._styleNameKey,styleNamePrefix:this._styleNameKey,maxNestingListLevel:this._maxNestingListLevel,defOrderedListStyle:this._defOrderedListStyle,defUnorderedListStyle:this._defUnorderedListStyle,defOrderedListLevelGap:this._defOrderedListLevelGap,defUnorderedListLevelGap:this._defUnorderedListLevelGap,styleSheetTemplates:null===(t=this._styleSheetTemplates)||void 0===t?void 0:t.map((t=>t.getListStyleSheet()))}}isStyleSheetExists(t){return null!=this.getStyleSheet(t)}getStyleSheet(t){const e=this._styleSheets.filter((e=>e.name===t));return(null==e?void 0:e.length)>0?e[0]:null}getStyleSheetsCount(){return this._styleSheets.length}getAllStyleSheets(){return this._styleSheets}clearAllStyleSheets(){this._styleSheets=[],this._lastStyleNumber=0}createStyleSheet(t){return this._createListStyleSheet(t)}createEmptyStyleSheet(){return this._createEmptyListStyleSheet()}createDefaultBulletedStyleSheet(t){let e=this._findUnorderedListStyleTemplate(t);if(e)return this._createListStyleSheetFromTemplate(e);const n=this.getDefaultListStyle(i.d.bullets,0);return n.bulletCharCode=t,this._createDefaultListStyleSheet(n)}createDefaultNumberedStyleSheet(t){let e=this._findOrderedListStyleTemplate(t);if(e)return this._createListStyleSheetFromTemplate(e);const n=this.getDefaultListStyle(i.d.numbers,0);return n.numberingFormat=t,this._createDefaultListStyleSheet(n)}getDefaultListStyle(t,e){switch(t){case i.d.none:return null;case i.d.bullets:return this._createListStyle(this._getDefUnorderedListStyle(e));case i.d.numbers:return this._createListStyle(this._getDefOrderedListStyle(e))}}getDefaultListLevelGap(t){switch(t){case i.d.none:return 0;case i.d.bullets:return this._defOrderedListLevelGap;case i.d.numbers:return this._defUnorderedListLevelGap}}_getDefUnorderedListStyle(t){const e=this._defUnorderedListStyle.leftIndent+t*this._defUnorderedListLevelGap;return{type:i.d.bullets,level:t,tabOffset:this._defUnorderedListStyle.tabOffset,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:e,bulletCharCode:this._defUnorderedListStyle.bulletCharCode}}_getDefOrderedListStyle(t){const e=this._defOrderedListStyle.leftIndent+t*this._defOrderedListLevelGap;return{type:i.d.numbers,level:t,tabOffset:this._defOrderedListStyle.tabOffset,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:e,numberingFormat:this._defOrderedListStyle.numberingFormat}}_getNextStyleName(){return this._lastStyleNumber++,this._styleNamePrefix+this._lastStyleNumber}_getLastStyleNumber(){let t=0;return this._styleSheets.forEach((e=>{const n=this._parseStyleName(e.name);null!=n&&n>t&&(t=n)})),t}_parseStyleName(t){if(!t.startsWith(this._styleNamePrefix))return null;const e=parseInt(t.replace(this._styleNamePrefix,""));return isNaN(e)?null:e}_createListStyleSheet(t){const e={name:this._getNextStyleName(),listLevelsStyles:t},n=new u(e);return this._styleSheets.push(n),n}_createEmptyListStyleSheet(){return this._createListStyleSheet()}_createDefaultListStyleSheet(t){return t.level=0,this._createListStyleSheet([t])}_createListStyleSheetFromTemplate(t){const e=[];return t.getAllListStyles().forEach((t=>e.push(this._createListStyle(t)))),this._createListStyleSheet(e)}_findOrderedListStyleTemplate(t){for(let e of this._styleSheetTemplates){const n=e.getAllListStyles().filter((e=>e.type===i.d.numbers&&0===e.level&&e.numberingFormat===t));if((null==n?void 0:n.length)>0)return e}return null}_findUnorderedListStyleTemplate(t){for(let e of this._styleSheetTemplates){const n=e.getAllListStyles().filter((e=>e.type===i.d.bullets&&0===e.level&&e.bulletCharCode===t));if((null==n?void 0:n.length)>0)return e}return null}_createListStyle(t){return{type:t.type,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,itemNumber:t.itemNumber,bulletCharCode:t.bulletCharCode}}}class h{constructor(t){var e,n,r,i;this._listSetting=t,this._styleNameKey="stylename",this._styleNamePrefix="style",this._defOrderedListStyle=null!==(e=null==t?void 0:t.defOrderedListStyle)&&void 0!==e?e:this._getDefaultOrderedListStyle(),this._defUnorderedListStyle=null!==(n=null==t?void 0:t.defUnorderedListStyle)&&void 0!==n?n:this._getDefaultUnorderedListStyle(),this._defOrderedListLevelGap=null!==(r=null==t?void 0:t.defOrderedListLevelGap)&&void 0!==r?r:30,this._defUnorderedListLevelGap=null!==(i=null==t?void 0:t.defUnorderedListLevelGap)&&void 0!==i?i:30,null!=(null==t?void 0:t.maxNestingListLevel)?this._maxNestingListLevel=t.maxNestingListLevel>3?3:t.maxNestingListLevel:this._maxNestingListLevel=3,null!=(null==t?void 0:t.styleSheetTemplates)?this._styleSheetTemplates=t.styleSheetTemplates.map((t=>new u(t))):this._styleSheetTemplates=this._getStyleSheetTemplates()}create(){const t={styleNameKey:this._styleNameKey,styleNamePrefix:this._styleNamePrefix,maxNestingListLevel:this._maxNestingListLevel,defOrderedListStyle:this._defOrderedListStyle,defUnorderedListStyle:this._defUnorderedListStyle,defOrderedListLevelGap:this._defOrderedListLevelGap,defUnorderedListLevelGap:this._defUnorderedListLevelGap,styleSheetTemplates:this._styleSheetTemplates.map((t=>t.getListStyleSheet()))};return new c(t)}_getDefaultOrderedListStyle(){return{numberingFormat:i.h.number,firstLineIndent:-20,leftIndent:30,tabOffset:30}}_getDefaultUnorderedListStyle(){return{bulletCharCode:8226,firstLineIndent:-20,leftIndent:30,tabOffset:30}}_getStyleSheetTemplates(){let t=[];const e={name:"template0",listLevelsStyles:[{level:0,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent,tabOffset:this._defUnorderedListStyle.tabOffset},{level:1,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent+this._defUnorderedListLevelGap,tabOffset:this._defUnorderedListStyle.tabOffset},{level:2,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent+2*this._defUnorderedListLevelGap,tabOffset:this._defUnorderedListStyle.tabOffset}]},n={name:"template0",listLevelsStyles:[{level:0,type:i.d.numbers,numberingFormat:i.h.number,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent,tabOffset:this._defOrderedListStyle.tabOffset},{level:1,type:i.d.numbers,numberingFormat:i.h.lowerRoman,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent+this._defOrderedListLevelGap,tabOffset:this._defOrderedListStyle.tabOffset},{level:2,type:i.d.numbers,numberingFormat:i.h.lowerLetter,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent+2*this._defOrderedListLevelGap,tabOffset:this._defOrderedListStyle.tabOffset}]},r=new u(e),o=new u(n);return t.push(r),t.push(o),t}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return a}));var r=function(){},i=function(){},o=function(){},a=function(){}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(406),i=function(){function t(t){this._value="00000000-0000-0000-0000-000000000000",null!=t?this.value=t:this.generateNewGuid()}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){if(!this.isValid(t))throw new r.c(t+"is incorrect uuid!");this._value=t},enumerable:!0,configurable:!0}),t.prototype.isValid=function(t){return t=t.toUpperCase(),null!=new RegExp("\\b(?:[A-F0-9]{8})(?:-[A-F0-9]{4}){3}-(?:[A-F0-9]{12})\\b").exec(t)},t.prototype.generateNewGuid=function(){var t=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}));this.value=e},t.prototype.toString=function(){return this._value},t.prototype.equals=function(t){return t._value===this._value},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(425),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return s}));var r="The item already belongs to this collection, or to another collection.",i="The item was not found in this collection.",o="setPoint: Index out of range.",a="addPoint: Index out of range.",s="removePoint: Index out of range."},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(424),o=n(411),a=n(406),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return s(e,t),Object.defineProperty(e.prototype,"parentContainer",{get:function(){return this._parentContainer},set:function(t){this._parentContainer=t,this._onContainerChanged()},enumerable:!0,configurable:!0}),e.prototype._onContainerChanged=function(){},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r),i&&(n.parentContainer=e.parentContainer)},e.prototype.clone=function(t,n){if(void 0===t&&(t=!1),void 0===n&&(n=!1),this.type!==e.type)throw new a.e(".clone() method must be overridden in "+this.type+" class");var r=new e;return this._copy(this,r,t,n),r},e.prototype.copyTo=function(t){this._copy(this,t,!0,!0)},e.prototype.update=function(t){this._copy(t,this,!0,!1)},e.prototype.getSimplifiedObject=function(e){o.isArray(e)||o.isString(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["parentContainer"].concat(e));return n.$type=this.type,n},e.type="base",e}(i.a)},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Normal=0]="Normal",t[t.Grayscale=1]="Grayscale",t[t.Solid=2]="Solid"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(409),i=n(410),o=function(){function t(){this._vectorMask=null,this._maskChangedEvent=new r.a}return Object.defineProperty(t.prototype,"vectorMask",{get:function(){return this._vectorMask},set:function(t){this._vectorMask=t,this._maskChangedEvent.notify(this)},enumerable:!0,configurable:!0}),t.prototype.addMaskChanged=function(t){this._maskChangedEvent.add(t)},t.prototype.removeMaskChanged=function(t){this._maskChangedEvent.remove(t)},t.prototype.clone=function(){var e=new t;return e.vectorMask=null!=this.vectorMask?this.vectorMask.clone():null,e},t.prototype.equals=function(t){return Object(i.g)(this.vectorMask,t.vectorMask)},t.prototype.getSimplifiedObject=function(){var t={};return t.vectorMask=null!=this.vectorMask?this.vectorMask.toString():null,t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(556),o=n(439),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowShape=n,r}return a(e,t),e.prototype.clone=function(n){void 0===n&&(n=null);var r=null!=n?n:new e;return r.allowShape=this.allowShape,t.prototype.clone.call(this,r)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowShape===e.allowShape},e.type="ShapeViolationSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(o.a)(),s("design:type",Boolean)],e.prototype,"allowShape",void 0),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r,i=n(413),o=n(503),a=n(457),s=n(407),l=n(411),u=n(410),c=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){var n=t.call(this)||this;return n._maskOpacity=.45,n._parentPlaceholder=null,n.type=e.type,n.borderWidth=0,n.fillColor=new i.RgbColor(0,0,0,0),n._ignorePermissionsChange=!0,n.itemPermissions.itemToolbarPermissions.showEditButton=!0,n._ignorePermissionsChange=!1,n}return c(e,t),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._maskOpacity},set:function(t){s.EqualsOfFloatNumbers(this._maskOpacity,t)||(this._maskOpacity=t,this._propertyChanged.notify(this,"maskOpacity"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentPlaceholder",{get:function(){return this._parentPlaceholder},set:function(t){this._parentPlaceholder=t,this._propertyChanged.notify(this,"parentPlaceholder")},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){null!=this.parentPlaceholder&&(this.parentPlaceholder.isCoverMode?(this.manipulationPermissions.resizeGrips.edgeConstraint=!1,this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(!1),this.manipulationPermissions.allowRotateConstraint=!1):(this.manipulationPermissions.resizeGrips.edgeConstraint=null,this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(null),this.manipulationPermissions.allowRotateConstraint=null),this.parentPlaceholder.applyPermissionsConstrain()),this.isRenderTypeIsNormal||(this.itemPermissions.allowOpacityChange=!1,this.shapePermissions.allowChangeBorderColor=!1,this.shapePermissions.allowChangeFillColor=!1)},e.prototype.getSimplifiedObject=function(e){return l.isArray(e)||l.isString(e)||(e=[]),t.prototype.getSimplifiedObject.call(this,["parentPlaceholder"].concat(e))},e.prototype._canSetIsVariable=function(){return!0},e.prototype._getPrintAreaBounds=function(){var t=null!=this.parentContainer?this.parentContainer:null!=this.parentPlaceholder?this.parentPlaceholder.parentContainer:null;return t instanceof a.d?t.parentComponent.bounds:null},e.prototype._getParentContainer=function(){return null!=this.parentPlaceholder?this.parentPlaceholder.parentContainer:null},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n._maskOpacity=e._maskOpacity,n.isVariable=e.isVariable},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(u.g)(this._maskOpacity,e._maskOpacity)&&Object(u.g)(this.isVariable,e.isVariable)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="ContentItem",e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(467),o=n(430),a=n(455),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n){void 0===n&&(n=new o.a(0,0,10,10));var r=t.call(this,a.a.rectangle(n.left,n.top,n.width,n.height))||this;return r.type=e.type,r.sourceRectangle=n,r}return s(e,t),e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="RectangleItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return u}));var r,i=n(413),o=n(422),a=n(409),s=n(416),l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};!function(t){t.Miter="Miter",t.Round="Round",t.Bevel="Bevel"}(r||(r={}));var u=function(){function t(e){this._color=new i.RgbColor(0,0,0,255),this._size=0,this._lineJoin=r.Miter,this.type=t.type,this._propertyChanged=new a.c,null!=e&&(this.color=null!=e.color?e.color:new i.RgbColor(0,0,0,255),this.size=null!=e.size?e.size:0,this.lineJoin=null!=e.lineJoin?e.lineJoin:r.Miter)}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){i.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(t){this._size!==t&&(this._size=t,this._propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this._propertyChanged.notify(this,"lineJoin"))},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(e){return e instanceof t&&this.color.equals(e.color)&&Object(o.e)(this.size,e.size)&&this.lineJoin==e.lineJoin},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.getSimplifiedObject=function(){return{color:this.color.toString(),size:this.size,lineJoin:this.lineJoin}},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.type="StrokeSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(s.a)({enumObject:r}),l("design:type",String),l("design:paramtypes",[String])],t.prototype,"lineJoin",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(413),i=n(422),o=n(409),a=function(){function t(t){this._color=new r.RgbColor(0,0,0,255),this._angle=0,this._distance=0,this._size=0,this._propertyChanged=new o.c,null!=t&&(this.color=null!=t.color?t.color:new r.RgbColor(0,0,0,255),this.angle=null!=t.angle?t.angle:0,this.distance=null!=t.distance?t.distance:0,this.size=null!=t.size?t.size:0)}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){r.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle!==t&&(this._angle=t,this._propertyChanged.notify(this,"angle"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._distance},set:function(t){this._distance!==t&&(this._distance=t,this._propertyChanged.notify(this,"distance"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(t){this._size!==t&&(this._size=t,this._propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(e){return e instanceof t&&this.color.equals(e.color)&&Object(i.e)(this.angle,e.angle)&&Object(i.e)(this.distance,e.distance)&&Object(i.e)(this.size,e.size)},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.getSimplifiedObject=function(){return{color:this.color.toString(),angle:this.angle,distance:this.distance,size:this.size}},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(){this._allowChangeBarcodeType=!0,this._allowChangeBarcodeContent=!0,this._allowChangeBarcodeColor=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"allowChangeBarcodeType",{get:function(){return this._allowChangeBarcodeType},set:function(t){this._allowChangeBarcodeType!==t&&(this._allowChangeBarcodeType=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBarcodeContent",{get:function(){return this._allowChangeBarcodeContent},set:function(t){this._allowChangeBarcodeContent!==t&&(this._allowChangeBarcodeContent=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBarcodeColor",{get:function(){return this._allowChangeBarcodeColor},set:function(t){this._allowChangeBarcodeColor!==t&&(this._allowChangeBarcodeColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeBarcodeType=this.allowChangeBarcodeType,t.allowChangeBarcodeContent=this.allowChangeBarcodeContent,t.allowChangeBarcodeColor=this.allowChangeBarcodeColor,t},t.prototype.clone=function(){var e=new t;return e.allowChangeBarcodeType=this.allowChangeBarcodeType,e.allowChangeBarcodeContent=this.allowChangeBarcodeContent,e.allowChangeBarcodeColor=this.allowChangeBarcodeColor,e},t.prototype.equals=function(t){return this.allowChangeBarcodeColor===t.allowChangeBarcodeColor&&this.allowChangeBarcodeContent===t.allowChangeBarcodeContent&&this.allowChangeBarcodeType===t.allowChangeBarcodeType},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return i}));var r,i,o=n(508),a=n(413),s=n(467),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(){return u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=function(t){function e(n,r){void 0===r&&(r=null);var i=t.call(this,n)||this;return i.type=e.type,i._colorGroups=[],i._onItemAdded=function(t){e._generateColorGroups([t.item]).forEach((function(t){var e;if(t.targets=t.targets.filter((function(t){return!i.colorGroups.some((function(e){return e.targets.some((function(e){var n=e.itemId,r=e.prop;return n===t.itemId&&r===t.prop}))}))})),!(t.targets.length<1)){var n=i.colorGroups.find((function(e){return e.color.equals(t.color)}));null!=n?(e=n.targets).push.apply(e,h(t.targets)):(null==i.themeBinding.clipartColors&&(i.themeBinding.clipartColors=new Array(i.colorGroups.length).fill(null)),i.colorGroups.push(t),i.themeBinding.clipartColors.push(null))}}))},i._onItemRemoved=function(t){var e=t.item.id;i.colorGroups.forEach((function(t){t.targets.some((function(t){return t.itemId===e}))&&(t.targets=t.targets.filter((function(t){return t.itemId!==e})))})),i.colorGroups.some((function(t){return 0===t.targets.length}))&&i.colorGroups.filter((function(t){return 0===t.targets.length})).map((function(t){return i.colorGroups.indexOf(t)})).forEach((function(t){i.colorGroups.splice(t,1),null!=i.themeBinding.clipartColors&&i.themeBinding.clipartColors.splice(t,1)}))},i._ignorePermissionsChange=!0,i.groupItemPermissions.allowSelectNestedItems=!1,i.groupItemPermissions.allowUngroup=!1,i._ignorePermissionsChange=!1,i.colorGroups=null!=r?r:e._generateColorGroups(i.items.toArray()),i.items.add_itemAdded(i._onItemAdded),i.items.add_itemRemoved(i._onItemRemoved),i}return l(e,t),e.prototype.getSimplifiedObject=function(e){return void 0===e&&(e=[]),t.prototype.getSimplifiedObject.call(this,e)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.groupItemPermissions&&(this.groupItemPermissions.allowSelectNestedItemsContraint=!1,this.groupItemPermissions.allowUngroupContraint=!1)},Object.defineProperty(e.prototype,"colorGroups",{get:function(){return this._colorGroups},set:function(t){this._colorGroups=t},enumerable:!0,configurable:!0}),e.prototype.setColor=function(t,e){var n=this;if(!this.colorGroups.includes(t))throw Error("Unexpected colorgroup");var r=e instanceof a.Color?e:e.color;t.color.equals(r)||(e instanceof a.Color||(null==this.themeBinding.clipartColors&&(this.themeBinding.clipartColors=new Array(this.colorGroups.length).fill(null)),this.themeBinding.clipartColors[this.colorGroups.indexOf(t)]=e.title),t.targets.forEach((function(t){var e=t.prop,i=t.itemId,o=n.items.first((function(t){return t.id===i}));if(!(o instanceof s.a))throw new Error("Unexpected item in colorgroup");n._setShapeItemColor(e,o,r.clone())})),t.color=r.clone(),this._propertyChanged.notify(this,"colorGroups"))},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i);var o=e.colorGroups.map((function(t){return t.clone()}));if(r){var a=n.items.toArray().map((function(t){return t.id})),s=e.items.toArray().map((function(t){return t.id})),l=o.reduce((function(t,e){return h(t,e.targets)}),[]);a.forEach((function(t,e){return l.filter((function(t){return t.itemId===s[e]})).forEach((function(e){return e.itemId=t}))}))}n.colorGroups=o},e._generateColorGroups=function(t){return t.filter((function(t){return t instanceof s.a})).reduce((function(t,e){var n=t.find((function(t){return t.color.equals(e.fillColor)}));if(null==n&&(n=new f(e.fillColor),t.push(n)),n.targets.push({itemId:e.id,prop:i.FillColor}),e.borderWidth>0){var r=t.find((function(t){return t.color.equals(e.borderColor)}));null==r&&(r=new f(e.borderColor),t.push(r)),r.targets.push({itemId:e.id,prop:i.BorderColor})}return t}),[])},e.prototype._setShapeItemColor=function(t,e,n){switch(t){case i.BorderColor:e.borderColor=n;break;case i.FillColor:e.fillColor=n}},e.type="ClipartItem",e}(o.a),f=function(){function t(t,e){void 0===e&&(e=[]),this.color=t,this.targets=e}return t.prototype.clone=function(){return new t(this.color.clone(),h(this.targets.map((function(t){return u({},t)}))))},t}(),d=function(){};!function(t){t[t.BorderColor=0]="BorderColor",t[t.FillColor=1]="FillColor"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i=n(450),o=n(425),a=n(740),s=n(406),l=n(410),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=function(t){function e(n){var r=t.call(this)||this;return r.items=new o.a,r.type=e.type,r.groupItemPermissions=new a.a,r._ignorePermissionsChange=!0,r._groupItemPermissions.allowReplaceContent=!1,r._ignorePermissionsChange=!1,r.items.add_itemAdded((function(t){t.item.parentGroupItem=r,r._propertyChanged.notify(r,"items")})),r.items.add_itemRemoved((function(t){t.item.parentGroupItem=null,r._propertyChanged.notify(r,"items")})),null!=n&&r.items.addRange(n),r}return u(e,t),Object.defineProperty(e.prototype,"groupItemPermissions",{get:function(){return this._groupItemPermissions},set:function(t){if(null==t)throw new s.a("groupItemPermissions cannot be null");Object(l.g)(this._groupItemPermissions,t)||(null!=this._groupItemPermissions&&this._groupItemPermissions.propertyChanged.remove(this._onPermissionsChanged),this._groupItemPermissions=t,this._groupItemPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),e.prototype.addItems=function(t,e){var n;null!=e&&(t=t.reverse()),null!=t&&0!==t.length&&(null!=e&&e>-1?this.items.insertAt(e,t):(n=this.items).add.apply(n,h(t)))},e.prototype._onContainerChanged=function(){var t=this;this.applyToItems((function(e){e.parentContainer=t.parentContainer}))},e.prototype.addItem=function(t,e){null!=e&&e>-1?this.items.insertAt(e,t):this.items.add(t)},e.prototype.removeItems=function(t){var e,n;if(null!=t&&t.length>0)try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.items.remove(o)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.getNestedItems=function(t){void 0===t&&(t=!1);for(var n=[],r=h(this.items);r.length>0;){var i=r.shift();i instanceof e&&(r.splice.apply(r,h([r.indexOf(i),0],i.items)),t)||n.push(i)}return n},e.prototype.getSimplifiedObject=function(e){void 0===e&&(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["groupManipulationPermissions","itemRemovedEvent","groupItemPermissions","items"].concat(e));return n.items=this.items.toArray().map((function(t){return t.getSimplifiedObject()})),n.groupItemPermissions=this.groupItemPermissions.getSimplifiedObject(),n},e.prototype._copy=function(e,n,r,i){if(t.prototype._copy.call(this,e,n,r,i),!(e.items.length<=0)){var o=e.items.toArray().map((function(t){return t.clone(r,i)}));n.items.clear(),n.items.addRange(o),n.groupItemPermissions=e.groupItemPermissions.clone()}},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButton=!1,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1},e.prototype.applyToItems=function(t){this.items.forEach(t)},Object.defineProperty(e.prototype,"manipulationPermissions",{get:function(){if(0===this.items.length)return this.groupManipulationPermissions;var t=this.groupManipulationPermissions.clone();return this.getNestedItems(!0).forEach((function(e){t.allowDelete=t.allowDelete&&e.manipulationPermissions.allowDelete})),Object.freeze(t),t},set:function(t){throw new Error("You cannot use ManipulationPermissions setter with GroupItem. Use groupManipulationPermissions setter instead")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groupManipulationPermissions",{get:function(){return t.prototype.getManipulationPermissions.call(this)},set:function(e){t.prototype.setManipulationPermissions.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.isChildVisible=function(t){return!0},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(l.g)(this.groupItemPermissions,e.groupItemPermissions),i=Object(l.c)(h(this.items),h(e.items));return n&&r&&i},e.type="GroupItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(409),i=n(416),o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=function(){function t(t){this._allowChangeImage=!0,this.allowEditImageConstraint=null,this._allowEditImage=!0,this._allowKeepOverlayColor=!1,this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeImage=t,this.allowEditImage=t,this.allowKeepOverlayColor=t}return Object.defineProperty(t.prototype,"allowChangeImage",{get:function(){return this._allowChangeImage},set:function(t){this._allowChangeImage!==t&&(this._allowChangeImage=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowEditImage",{get:function(){return null!=this.allowEditImageConstraint?this.allowEditImageConstraint:this._allowEditImage},set:function(t){this._allowEditImage!==t&&(this._allowEditImage=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowKeepOverlayColor",{get:function(){return this._allowKeepOverlayColor},set:function(t){this._allowKeepOverlayColor!==t&&(this._allowKeepOverlayColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowChangeImage=this.allowChangeImage,e.allowEditImage=this.allowEditImage,e.allowKeepOverlayColor=this.allowKeepOverlayColor,e},t.prototype.equals=function(t){return this.allowChangeImage===t.allowChangeImage&&this.allowEditImage===t.allowEditImage&&this.allowKeepOverlayColor===t.allowKeepOverlayColor},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeImage=this.allowChangeImage,t.allowEditImage=this.allowEditImage,t.allowKeepOverlayColor=this.allowKeepOverlayColor,t},function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)({ignore:!0}),o("design:type",Boolean)],t.prototype,"allowEditImageConstraint",void 0),t}()},function(t,e,n){"use strict";function r(t,e){return t/e*72}n.d(e,"a",(function(){return r})),n(407),n(406),n(426)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(411),i=n(410),o=n(480),a=function(){function t(t){if(this.storageId=null,this.size=new o.a,this.name=null,this.isUserImage=!1,this.isVector=!1,this.pageIndex=0,"string"==typeof t)try{t=JSON.parse(t)}catch(e){console.warn("Unable to parse ImageMetaData from string ",t,e),t=null}r.isObject(t)&&r.extend(this,t)}return t.fromInterface=function(e,n){var r=new t;return r.storageId=e.id,r.size=new o.a(e.width,e.height),r.name=void 0!==n?n:null,null!=e.isVector&&(r.isVector=e.isVector),r},t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(t){return this.storageId===t.storageId&&Object(i.g)(this.size,t.size)&&Object(i.g)(this.name,t.name)&&Object(i.g)(this.isUserImage,t.isUserImage)&&Object(i.g)(this.isVector,t.isVector)&&Object(i.g)(this.pageIndex,t.pageIndex)},t}()},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return L}));var r,i,o,a,s=n(467),l=n(478),u=n(511),c=n(413),h=n(566),p=n(446),f=n(561),d=n(430),g=n(455),m=n(406),y=n(476),_=n(410),b=n(479),v=n(416),w=n(466),C=n(468),P=n(563),x=n(443),S=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),I=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},O=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},T=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},E=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(T(arguments[e]));return t};!function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.Top=2]="Top",t[t.Bottom=3]="Bottom"}(i||(i={})),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Left=3]="Left"}(o||(o={})),function(t){t[t.Fit=0]="Fit",t[t.Fill=1]="Fill",t[t.Original=2]="Original"}(a||(a={}));var L=function(t){function e(n){var r=t.call(this,null!=n?g.a.rectangle(n.left,n.top,n.width,n.height):null)||this;return r._isStubContent=!1,r._isCoverMode=!1,r._contentResizeMode=a.Fill,r._contentEffect=C.a.None,r._contentFillColor=null,r._contentOverlayEffect=null,r.stubStorageMeta=null,r.linkId=null,r.allowedSubfolder=null,r.allowedTabs=null,r.contentVerticalAlignment=i.None,r.contentHorizontalAlignment=o.None,r.type=e.type,r._content=null,r._topFrames=[],r._bottomFrames=[],r._onContentOverlayEffectPropertyChanged=function(t,e){r._propertyChanged.notify(r,"contentOverlayEffect")},r.fixedStubContentSize=!1,r.sourceRectangle=null!=n?n:new d.a(0,0,10,10),r.fillColor=new c.RgbColor(0,0,0,0),r.borderWidth=0,r.placeholderPermissions=new h.a,r._contentPermissions=new f.a,r._contentPermissions.propertyChanged.add(r._onPermissionsChanged),r._setViolationSettings(new P.a,!0),r._ignorePermissionsChange=!0,r.manipulationPermissions.resizeGrips=new p.a(!0,!0,!1),r.shapePermissions.allowChangeFillColor=!1,r.itemPermissions.allowRemoveOnLayoutChange=!0,r.itemPermissions.itemToolbarPermissions.showEditButton=!0,r.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=null,r.itemPermissions.itemToolbarPermissions.showSelectButton=!0,r.contentPermissions.imagePermissions.allowKeepOverlayColor=!1,r._ignorePermissionsChange=!1,r}return S(e,t),Object.defineProperty(e.prototype,"contentEffect",{get:function(){return this._contentEffect},set:function(t){this._contentEffect!==t&&(this._contentEffect=t,this._propertyChanged.notify(this,"contentEffect"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFillColor",{get:function(){return this._contentFillColor},set:function(t){this._contentFillColor!==t&&(this._contentFillColor=t,this._propertyChanged.notify(this,"contentFillColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStubContent",{get:function(){return this._isStubContent},set:function(t){this._isStubContent!==t&&(this._isStubContent=t,this._setStubStorageMeta(),this.applyPermissionsConstrain(),this._propertyChanged.notify(this,"isStubContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentResizeMode",{get:function(){return this.isCoverMode?a.Fill:this.isBarcodePlaceholder?a.Fit:this._contentResizeMode},set:function(t){this._contentResizeMode!==t&&(this._contentResizeMode=t,this._propertyChanged.notify(this,"contentResizeMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentOverlayEffect",{get:function(){return this._contentOverlayEffect},set:function(t){b.a.equals(this.contentOverlayEffect,t)||(this._unsubscribeContentOverlayEffectPropertyChanged(),this._contentOverlayEffect=t,this._subscribeContentOverlayEffectPropertyChanged(),this._propertyChanged.notify(this,"contentOverlayEffect"))},enumerable:!0,configurable:!0}),e.prototype._subscribeContentOverlayEffectPropertyChanged=function(){null!=this.contentOverlayEffect&&this.contentOverlayEffect.addPropertyChanged(this._onContentOverlayEffectPropertyChanged)},e.prototype._unsubscribeContentOverlayEffectPropertyChanged=function(){null!=this.contentOverlayEffect&&this.contentOverlayEffect.removePropertyChanged(this._onContentOverlayEffectPropertyChanged)},Object.defineProperty(e.prototype,"isCoverMode",{get:function(){return null==this.barcodeFormat&&this._isCoverMode},set:function(t){this._isCoverMode!==t&&(this._isCoverMode=t,this.isEmptyContent||this.content.applyPermissionsConstrain(),this._propertyChanged.notify(this,"isCoverMode"))},enumerable:!0,configurable:!0}),e.prototype.getImagePermissions=function(){return null!=this.contentPermissions?this.contentPermissions.imagePermissions:this.content instanceof l.a?this.content.imagePermissions:null},e.prototype.applyPermissionsConstrain=function(){var t=this.itemPermissions.itemToolbarPermissions,e=this.getImagePermissions(),n=null==e||e.allowChangeImage,r=null!=e&&e.allowEditImage,i=null!=this.content&&this.content instanceof l.a&&null!=this.content.source&&this.content.source.isVector;this.isStubOrEmpty||!r||i?t.showEditButtonConstraint=!1:t.showEditButtonConstraint=null,t.showSelectButtonConstraint=!(!n||this.isStubOrEmpty)&&null,null!=this.placeholderPermissions&&(this.placeholderPermissions.showSelectButtonConstraint=!!n&&null),null!=this.contentPermissions&&null!=this.contentPermissions.imagePermissions&&(null!=this.barcodeFormat?this.contentPermissions.imagePermissions.allowEditImageConstraint=!1:this.contentPermissions.imagePermissions.allowEditImageConstraint=null),this.isBarcodePlaceholder&&(null!=this.manipulationPermissions&&(this.manipulationPermissions.resizeGrips.edge=!1,this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1)),null!=this.itemPermissions&&null!=t&&(t.showSelectButton=!1,t.showEditButtonConstraint=null),null!=this.placeholderPermissions&&(this.placeholderPermissions.allowEditContent=!1,this.placeholderPermissions.showHandleButton=!1),null!=this.contentPermissions&&null!=this.contentPermissions.barcodePermissions&&(this.contentPermissions.barcodePermissions.allowChangeBarcodeContent?this.placeholderPermissions.showSelectButtonConstraint=null:(this.placeholderPermissions.showSelectButtonConstraint=!1,t.showEditButtonConstraint=this.contentPermissions.barcodePermissions.allowChangeBarcodeContent)))},Object.defineProperty(e.prototype,"contentPermissions",{get:function(){return this._contentPermissions},set:function(t){if(null==t)throw new m.a("ContentPermissions cannot be null");Object(_.g)(this._contentPermissions,t)||(this._contentPermissions.propertyChanged.remove(this._onPermissionsChanged),this._contentPermissions=t,this._contentPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholderPermissions",{get:function(){return this._placeholderPermissions},set:function(t){if(null==t)throw new m.a("placeholderPermissions cannot be null");Object(_.g)(this._placeholderPermissions,t)||(null!=this._placeholderPermissions&&this._placeholderPermissions.propertyChanged.remove(this._onPermissionsChanged),this._placeholderPermissions=t,this.applyPermissionsConstrain(),this._placeholderPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"placeholderPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof P.a))throw new m.a("Shape ViolationSettings property must has ImageViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},Object.defineProperty(e.prototype,"isFrame",{get:function(){return null!=this._topFrames&&this._topFrames.length>0||null!=this._bottomFrames&&this._bottomFrames.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){this._content=t,this.isEmptyContent||(this._content.parentPlaceholder=this,this._content.parentContainer=null,this._content.applyPermissionsConstrain()),this.applyPermissionsConstrain(),this._setStubStorageMeta(),this._propertyChanged.notify(this,"content")},enumerable:!0,configurable:!0}),e.prototype._setStubStorageMeta=function(){this.isStubContent&&this._content instanceof l.a?this.stubStorageMeta=new u.a({isUserImage:this._content.isUserImage,isVector:this._content.source.isVector,name:"Stub content",size:{width:this._content.source.width,height:this._content.source.height},storageId:this._content.source.id,origin:this._content.source.origin}):this.stubStorageMeta=null},Object.defineProperty(e.prototype,"topFrames",{get:function(){return this._topFrames},set:function(t){var e=this;if(null==t)throw new m.a;this._topFrames=t,this._topFrames.forEach((function(t){t.parentPlaceholder=e,t.parentContainer=null}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomFrames",{get:function(){return this._bottomFrames},set:function(t){var e=this;if(null==t)throw new m.a;this._bottomFrames=t,this._bottomFrames.forEach((function(t){t.parentPlaceholder=e,t.parentContainer=null}))},enumerable:!0,configurable:!0}),e.prototype.updateContentAndFrames=function(t){null!=this.content&&t(this.content),null!=this.topFrames&&this.topFrames.forEach((function(e){t(e)})),null!=this.bottomFrames&&this.bottomFrames.forEach((function(e){t(e)}))},Object.defineProperty(e.prototype,"imageContent",{get:function(){if(null!=this._content&&!(this._content instanceof l.a))throw new m.c("Not image content!");return this._content},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmptyContent",{get:function(){return null==this._content},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStubOrEmpty",{get:function(){return this.isStubContent||this.isEmptyContent},enumerable:!0,configurable:!0}),e.prototype._canSetIsVariable=function(){return!0},Object.defineProperty(e.prototype,"isBarcodePlaceholder",{get:function(){return null!=this.barcodeFormat},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this,["_content","imageContent","placeholderPermissions","contentPermissions","isFrame","isEmptyContent","isStubOrEmpty","isBarcodePlaceholder"]);return e.content=null!=this.content?this.content.getSimplifiedObject():null,e.placeholderPermissions=this.placeholderPermissions.getSimplifiedObject(),e.contentPermissions=this.contentPermissions.getSimplifiedObject(),e},e.prototype._copy=function(e,n,r,i){if(t.prototype._copy.call(this,e,n,r,i),n.linkId=e.linkId,n.allowedSubfolder=e.allowedSubfolder,n.allowedTabs=null!=e.allowedTabs?e.allowedTabs.map((function(t){return t})):null,n.contentVerticalAlignment=e.contentVerticalAlignment,n.contentHorizontalAlignment=e.contentHorizontalAlignment,n.placeholderPermissions=e.placeholderPermissions.clone(),null!=e.content?(null==n.content?n.content=e.content.clone(r,i):n.content.update(e.content),n.content.parentPlaceholder=n):n.content=null,e.topFrames.length===n.topFrames.length)for(var o=0;o<e.topFrames.length;o++)n.topFrames[o].update(e.topFrames[o]),n.topFrames[o].parentPlaceholder=n;else n.topFrames=e.topFrames.map((function(t){var e=t.clone(r,i);return e.parentPlaceholder=n,e}));if(e.bottomFrames.length===n.bottomFrames.length)for(o=0;o<e.bottomFrames.length;o++)n.bottomFrames[o].update(e.bottomFrames[o]),n.bottomFrames[o].parentPlaceholder=n;else n.bottomFrames=e.bottomFrames.map((function(t){var e=t.clone(r,i);return e.parentPlaceholder=n,e}));n.stubStorageMeta=null!=e.stubStorageMeta?e.stubStorageMeta.clone():null,n.isStubContent=e.isStubContent,n.isCoverMode=e.isCoverMode,n.contentResizeMode=e.contentResizeMode,n.contentEffect=e.contentEffect,n.contentFillColor=null!=e._contentFillColor?e._contentFillColor.clone():null,n.contentOverlayEffect=null!=e.contentOverlayEffect?e.contentOverlayEffect.clone():null,n.barcodeFormat=e.barcodeFormat,n.contentPermissions=e.contentPermissions.clone(),n.isVariable=e.isVariable},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(_.c)(E([this._content],this._topFrames,this._bottomFrames),E([e._content],e._topFrames,e._bottomFrames))&&Object(_.g)(this.linkId,e.linkId)&&Object(_.g)(this.allowedSubfolder,e.allowedSubfolder)&&Object(_.c)(this.allowedTabs,e.allowedTabs)&&Object(_.g)(this.contentVerticalAlignment,e.contentVerticalAlignment)&&Object(_.g)(this.contentHorizontalAlignment,e.contentHorizontalAlignment)&&Object(_.g)(this._placeholderPermissions,e._placeholderPermissions)&&Object(_.g)(this.stubStorageMeta,e.stubStorageMeta)&&Object(_.g)(this._isStubContent,e._isStubContent)&&Object(_.g)(this._isCoverMode,e._isCoverMode)&&Object(_.g)(this._contentResizeMode,e._contentResizeMode)&&Object(_.g)(this._contentEffect,e._contentEffect)&&Object(_.g)(this.barcodeFormat,e.barcodeFormat)&&Object(_.g)(this._contentPermissions,e._contentPermissions)&&Object(_.g)(this.isVariable,e.isVariable)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PlaceholderItem",I([Object(v.a)({factory:new x.c(u.a),displayName:"Stub storage meta"}),O("design:type",u.a)],e.prototype,"stubStorageMeta",void 0),I([Object(v.a)({type:"string"}),O("design:type",String)],e.prototype,"linkId",void 0),I([Object(v.a)({factory:new x.d("subfolder"),displayName:"Allowed subfolder"}),O("design:type",String)],e.prototype,"allowedSubfolder",void 0),I([Object(v.a)({factory:new x.a(Array),displayName:"Allowed tabs"}),O("design:type",Array)],e.prototype,"allowedTabs",void 0),I([Object(v.a)({enumObject:i}),O("design:type",Object)],e.prototype,"contentVerticalAlignment",void 0),I([Object(v.a)({enumObject:o}),O("design:type",Object)],e.prototype,"contentHorizontalAlignment",void 0),I([Object(v.a)({enumObject:C.a}),O("design:type",Number),O("design:paramtypes",[Number])],e.prototype,"contentEffect",null),I([Object(v.a)({factory:new x.b,displayName:"Content fill color"}),O("design:type",c.Color),O("design:paramtypes",[c.Color])],e.prototype,"contentFillColor",null),I([Object(v.a)({enumObject:a}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"contentResizeMode",null),I([Object(v.a)({enumObject:y.a,factory:new x.d(y.a.QR_CODE),displayName:"Barcode format"}),O("design:type",String)],e.prototype,"barcodeFormat",void 0),I([Object(v.a)({factory:new x.c(b.a,{color:new c.CmykColor(0,0,0,0,255),opacity:1,blendMode:w.a.Normal}),displayName:"Content overlay effect"}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"contentOverlayEffect",null),I([Object(v.a)({type:"item"}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"content",null),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(469),o=n(481),a=n(407),s=n(419),l=n(520),u=n(410),c=n(408),h=n(426),p=n(413),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,r,i){void 0===n&&(n=null);var a=t.call(this,e,n,r,i)||this;return a._onCanvasChangedDelegate=null,a._contentType=o.a.NotContent,a._parentPlaceholder=null,a._pixelWidth=0,a._pixelHeight=0,a._needToDownloadImage=!1,a._imageContainer=new l.a(a._onImageLoaded.bind(a)),a}return f(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentPlaceholder",{get:function(){return this._parentPlaceholder},set:function(t){this._parentPlaceholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentType",{get:function(){return this._contentType},set:function(t){this._contentType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return this._imageContainer.isLoaded},enumerable:!0,configurable:!0}),e.prototype.isVisible=function(){return null!=this._parentPlaceholder?this._parentPlaceholder.isVisible():t.prototype.isVisible.call(this)},e.prototype.quickUpdate=function(){this._updateImageUrl()},e.prototype.setRectangle=function(e,n){var r,i=this._parentPlaceholder,s=this._contentType===o.a.TopFrame||this._contentType===o.a.BottomFrame;if(null!=i&&i.item.isCoverMode&&!i.item.isStubContent&&!s){var l=i.rectangle,u=e.clone(),c=Object(a.EqualsOfFloatNumbers)(Object(a.normalizeAngle)(u.angle-l.angle)%180,90),h=this.rectangle;if(null!=h&&null!=i.previousRectangle&&!i.editing){var p,f=i.previousRectangle.width/i.previousRectangle.height,d=l.width/l.height,g=h.width/h.height,m=d>g!=f>g;p=d>g?m?l.width/g/i.previousRectangle.height:l.width/i.previousRectangle.width:m?l.height*g/i.previousRectangle.width:l.height/i.previousRectangle.height,u.width=h.width*p,u.height=h.height*p,u.center=l.center;var y=u.angle;u.angle=0;var _=(i.previousRectangle.centerX-h.centerX+h.width/2)*p-u.width/2,b=(i.previousRectangle.centerY-h.centerY+h.height/2)*p-u.height/2;(r=new a.PointF(-_,-b)).rotateAt(l.angle-i.previousRectangle.angle),u.centerX=l.centerX+r.x,u.centerY=l.centerY+r.y,u.rotateAt(y,u.center)}var v=c?u.height:u.width,w=c?u.width:u.height;if(v<l.width||w<l.height){var C=Math.max(l.width/v,l.height/w);u.width*=C,u.height*=C}var P=l.angle;l.angle=0;var x=l.bounds,S=u.clone();S.rotateAt(-P,l.center);var I=S.bounds;return(r=new a.PointF(0,0)).x=x.left<I.left?x.left-I.left:0,r.x=x.right>I.right?x.right-I.right:r.x,r.y=x.top<I.top?x.top-I.top:0,r.y=x.bottom>I.bottom?x.bottom-I.bottom:r.y,r.rotate(P),u.centerX+=r.x,u.centerY+=r.y,void t.prototype.setRectangle.call(this,u,n)}t.prototype.setRectangle.call(this,e,n)},e.prototype.updateRectangle=function(t,e,n,r,i,o){null==e&&(e=c.ib.Fit),null==t&&(t=!1);var a=this.getTransformedRectangle(!1);if(r=null!=r?r:this.bounds.width,i=null!=i?i:this.bounds.height,t){var s=r/i,l=a.location;a.width=a.height*s,a.location=l}else if(null!=this.parentPlaceholder&&(a=this.parentPlaceholder.getTransformedRectangle(!1)),e===c.ib.Original&&this.item instanceof c.J){var u=this.item.getOriginalImageSize(),h=null!=o?this.item.source.dpiX/o:1;a.width=u.width*h,a.height=u.height*h}else h=1,e===c.ib.Fit?h=Math.min(a.width/r,a.height/i):e===c.ib.Fill&&(h=Math.max(a.width/r,a.height/i)),a.width=r*h,a.height=i*h;if(null!=n){var p=n.getTransformedRectangle(!1);switch(n.item.contentVerticalAlignment){case c.ub.Top:a.centerY=p.centerY-(p.height-a.height)/2;break;case c.ub.Center:a.centerY=p.centerY;break;case c.ub.Bottom:a.centerY=p.centerY+(p.height-a.height)/2}switch(n.item.contentHorizontalAlignment){case c.H.Left:a.centerX=p.centerX-(p.width-a.width)/2;break;case c.H.Center:a.centerX=p.centerX;break;case c.H.Right:a.centerX=p.centerX+(p.width-a.width)/2}}this.setTransformedRectangle(a)},e.prototype.drawItemHandler=function(t,e){if(null!=t&&null!=this.canvas)if(this._isReadyToDraw){var n=null!=this._parentPlaceholder?this._parentPlaceholder.rectangle:this.rectangle,r=this.rectangle,i=this._getItemColorPreviews(),o=i.fillColorPreview,l=i.borderColorPreview,u=i.altBorderColorPreview;this._hasVectorMask()&&(t.save(),this._clip(t));var c=this.isNormalRenderingType?this.item.opacity:1;s.a.fillRectangle(t,r,null==o?void 0:o.toString(),c),this._imageContainer.isLoaded?this._drawImage(t,this.canvas.disableSmoothing):this._imageContainer.isLoading&&this.canvas.drawWaitClock(null!=e?e:t,new a.PointF(n.centerX,n.centerY));var h=this._getActualBorderWidth();r.width+=h,r.height+=h,s.a.drawStroke(t,a.Path.rotatedRectangle(r),r.center,new a.Transform,h,null==l?void 0:l.toString(),null==u?void 0:u.toString(),this.item.opacity,this.item.dash),this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.drawMaskedContent=function(t){if(this._drawImage(t,this.canvas.disableSmoothing,this.item.maskOpacity),null!=this._parentPlaceholder){t.globalCompositeOperation="destination-out";var e=this._parentPlaceholder;s.a.fillPath(t,e.originalPath,e.getControlCenter(),e.item.transform,"#fff"),t.globalCompositeOperation="source-over"}},e.prototype.transformByMatrix=function(e,n,r){var i;void 0===r&&(r=null),(null===(i=this.parentPlaceholder)||void 0===i?void 0:i.editing)&&this.parentPlaceholder.setContentUpdating(!n),t.prototype.transformByMatrix.call(this,e,n,r)},e.prototype.dispose=function(){if(this._imageContainer.dispose(),this._onCanvasChangedDelegate){var e=this.canvas;e&&e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate}t.prototype.dispose.call(this)},e.prototype._getDrawingFillColor=function(){return this.item.fillColor},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t},e.prototype._onItemPropertyChanged=function(e,n){var r,i;switch(n){case"maskOpacity":break;case"parentPlaceholder":this.parentPlaceholder=null!=e.parentPlaceholder?null===(i=null===(r=this.canvas)||void 0===r?void 0:r.handlerFactory)||void 0===i?void 0:i.get(e.parentPlaceholder):null}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getSrc=function(){var t=this._imageContainer.source;return u.l(t)?this._createImageUrl():t},e.prototype._setSrc=function(t){this._imageContainer.source=t},e.prototype._onImageLoaded=function(t,e){try{null!=this.canvas&&this.canvas.redraw(),this.isLoadingImage=!1,this._dispatchReadyEvent()}catch(n){throw console.error("Exception in ["+this.getTypeName()+"#"+this.name+"]._onImageLoaded",n),n}},e.prototype._createImageUrl=function(){return null},e.prototype._updateImageUrl=function(){if(this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createImageUrl();e!==this._imageContainer.source&&(null==e?(this._imageContainer.clear(),t.redraw()):this._imageContainer.updateUrl(e))}}},e.prototype._onCanvasChanged=function(t){t.fullUpdate&&this._updateImageUrl()},e.prototype._getItemColorPreviews=function(){var e=t.prototype._getItemColorPreviews.call(this),n=e.borderColorPreview,r=e.altBorderColorPreview;return{fillColorPreview:this._getFillColorPreview(),borderColorPreview:n,altBorderColorPreview:r}},e.prototype._drawImage=function(t,e,n,r){var i=this.canvas,o=h.b.screenDpi*i.zoom/72,a=h.b.screenDpi*i.zoom/72,l=this.isNormalRenderingType?this.item.opacity:1,u=null!=n?l*n:l;s.a.drawImage(t,null!=r?r:this._imageContainer.image,this.rectangle,o,a,e,null,u)},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype._onAddedOnCanvas=function(e,n){if(t.prototype._onAddedOnCanvas.call(this,e,n||null!=this.parentPlaceholder),this._updateImageUrl(),!this._onCanvasChangedDelegate){var r=this.canvas;r&&(this._onCanvasChangedDelegate=this._onCanvasChanged.bind(this),r.add_zoomChanged(this._onCanvasChangedDelegate),this._needToDownloadImage&&this.update())}},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),e&&null!=this._onCanvasChangedDelegate&&(e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate)},e.prototype._getFillColorPreview=function(){var t=this._getDrawingFillColor(),e=this.isNormalRenderingType||(null==t?void 0:t.isTransparent)?t:new p.RgbColor(0,0,0,255),n=this._colorPreviewService.getPreview(e);return null!=this.item.fillColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(e,this._onColorPreviewLoaded),n},e.typeName="ContentItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var r,i=n(424),o=n(444),a=n(445),s=n(411),l=n(408),u=n(515),c=n(406),h=n(425),p=n(457),f=n(409),d=n(407),g=n(547),m=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_=function(t){function e(e,n,r,i,o,s,l){void 0===i&&(i=[]);var c=t.call(this,o,s)||this;if(c._rotateAngle=0,c._mockup=new u.a,c._printAreas=new h.a,c._previewMockups=new h.a,c._printAreasCollectionChangedEvent=new f.c,c._printAreaAddedEvent=new f.c,c._printAreaRemovedEvent=new f.c,c._onContainersItemAdded=function(t){t.item.parentComponent=c},c._onContainersItemRemoved=function(t){t.item.parentComponent=null},c.watermark=null,c._containers=new h.a,c._onPrintAreaAdded=function(t){var e=t.item;e.parentSurface=c,c._printAreaAddedEvent.notify(c,e)},c._onPrintAreaRemoved=function(t){var e=t.item;e.parentSurface=null,c._printAreaRemovedEvent.notify(c,e)},c.width=null!=e?e:100,c.height=null!=n?n:100,c.parentProduct=null,c.mockup=null!=r?r:new u.a,c.printAreas.add_itemAdded(c._onPrintAreaAdded),c.printAreas.add_itemRemoved(c._onPrintAreaRemoved),c.printAreas.setRange(i),c._containers.add_itemAdded(c._onContainersItemAdded),c._containers.add_itemRemoved(c._onContainersItemRemoved),l){var d=new p.d;d.name=a.a.BG_CONTAINER_NAME,c.containers.push(d);var g=new p.d;g.name=a.a.MAIN_CONTAINER_NAME,c.containers.push(g);var m=new p.d;m.name=a.a.FG_CONTAINER_NAME,c.containers.push(m)}return c}return m(e,t),Object.defineProperty(e.prototype,"rotateAngle",{get:function(){return this._rotateAngle},set:function(t){var e=Object(d.normalizeAngle)(t);e!==this._rotateAngle&&(this._rotateAngle=e,this._propertyChanged.notify(this,"rotateAngle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){t!==this._width&&(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){t!==this._height&&(this._height=t,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mockup",{get:function(){return this._mockup},set:function(t){if(null==t)throw new c.a("mockup can`t be null");t!==this._mockup&&(this._mockup=t,null!=this._mockup&&(this._mockup.parentSurface=this),this._propertyChanged.notify(this,"mockup"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewMockups",{get:function(){return this._previewMockups},set:function(t){var e,n;if(null!=this._previewMockups)try{for(var r=y(this._previewMockups),i=r.next();!i.done;i=r.next())i.value.parentSurface=null}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}if(this._previewMockups=t,null!=this._previewMockups)for(var o=0;o<this._previewMockups.length;++o)this._previewMockups.get(o).parentSurface=this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containers",{get:function(){return this._containers},set:function(t){if(null!=t&&t!==this._containers){null!=this._containers&&(this._containers.clear(),this._containers.remove_itemAdded(this._onContainersItemAdded),this._containers.remove_itemRemoved(this._onContainersItemRemoved)),this._containers=t;for(var e=0;e<this._containers.length;e++)this._onContainersItemAdded({index:e,item:this._containers.get(e)});this._containers.add_itemAdded(this._onContainersItemAdded),this._containers.add_itemRemoved(this._onContainersItemRemoved)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"printAreas",{get:function(){return this._printAreas},set:function(t){var e,n;if(null!=t&&t!==this._printAreas){null!=this._printAreas&&(this._printAreas.clear(),this._printAreas.remove_itemAdded(this._onPrintAreaAdded),this._printAreas.remove_itemRemoved(this._onPrintAreaRemoved)),this._printAreas=t;try{for(var r=y(this._printAreas),i=r.next();!i.done;i=r.next()){var o=i.value;this._onPrintAreaAdded({item:o})}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this._printAreas.add_itemAdded(this._onPrintAreaAdded),this._printAreas.add_itemRemoved(this._onPrintAreaRemoved)}},enumerable:!0,configurable:!0}),e.prototype.add_printAreaAdded=function(t){this._printAreaAddedEvent.add(t)},e.prototype.remove_printAreaAdded=function(t){this._printAreaAddedEvent.remove(t)},e.prototype.add_printAreaRemoved=function(t){this._printAreaRemovedEvent.add(t)},e.prototype.remove_printAreaRemoved=function(t){this._printAreaRemovedEvent.remove(t)},e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentProduct","nonChannelContainerItems"])},e.prototype.getAllItems=function(t){void 0===t&&(t={ignoreMockups:!1});var e=t.ignoreMockups?this.containers:g.empty().concat(this.mockup.underContainers.cast(),this.containers,this.mockup.overContainers.cast());null!=t.containerFilterFunc&&(e=e.where(t.containerFilterFunc));var n=e.selectMany((function(t){return t.items.cast()}));return(t.flatGroupItems||t.includePlaceholderContents)&&(n=n.aggregate(new h.a,(function(e,n){return n instanceof l.G?(e.addRange(n.getNestedItems()),t.excludeGroupItems||e.add(n)):e.add(n),t.includePlaceholderContents&&n instanceof l.cb&&(null!=n.content&&e.add(n.content),n.topFrames.concat(n.bottomFrames).forEach((function(t){return e.add(t)}))),e}))),n},e.getItems=function(t,e){return t instanceof Array&&(t=g.from(t)),t.selectMany((function(t){return t.getAllItems(e)})).toArray()},e.prototype.getBackgroundItem=function(){var t=this.containers.firstOrDefault((function(t){return t.name===a.a.BG_CONTAINER_NAME}));return null!=t?t.items.get(0):null},e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.width=e.width,n.height=e.height,n.rotateAngle=e.rotateAngle,n.mockup=e.mockup.clone(r),n.previewMockups.addRange(e.previewMockups.toArray().map((function(t){return t.clone(r)}))),n.printAreas.addRange(e.printAreas.toArray().map((function(t){return t.clone(r)}))),n.containers.addRange(e.containers.toArray().map((function(t){return t.clone(r)}))),n.watermark=null!=e.watermark?e.watermark.clone():null},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId(),this._mockup.generateNewIds(),this._previewMockups.forEach((function(t){return t.generateNewIds()})),this._printAreas.forEach((function(t){return t.generateNewIds()})),this._containers.forEach((function(t){return t.generateNewIds()}))},e.getAllItems=function(t,e){return void 0===e&&(e={ignoreMockups:!1}),t instanceof Array&&(t=g.from(t)),t.selectMany((function(t){return t.getAllItems(e)}))},Object.defineProperty(e.prototype,"nonChannelContainerItems",{get:function(){return s.flatten(this._containers.toArray().filter((function(t){return t.renderingType===o.RenderingType.Normal})).map((function(t){return t.items.toArray()})))},enumerable:!0,configurable:!0}),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(424),o=n(425),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n){void 0===e&&(e=[]),void 0===n&&(n=[]);var r=t.call(this)||this;return r.parentSurface=null,r._underContainers=new o.a,r._overContainers=new o.a,r._onContainerAdded=function(t){t.item.parentComponent=r},r.underContainers.add_itemAdded(r._onContainerAdded),r.underContainers.setRange(e),r.overContainers.add_itemAdded(r._onContainerAdded),r.overContainers.setRange(n),r}return a(e,t),e.prototype.isEmpty=function(){return this.underContainers.concat(this.overContainers).all((function(t){return t.items.empty}))},Object.defineProperty(e.prototype,"underContainers",{get:function(){return this._underContainers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overContainers",{get:function(){return this._overContainers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allContainers",{get:function(){return this._overContainers.concat(this._underContainers)},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentSurface","allContainers"])},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId(),this._underContainers.forEach((function(t){return t.generateNewIds()})),this._overContainers.forEach((function(t){return t.generateNewIds()}))},e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.underContainers.addRange(e.underContainers.toArray().map((function(t){return t.clone(r)}))),n.overContainers.addRange(e.overContainers.toArray().map((function(t){return t.clone(r)})))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return c}));var r,i=n(430),o=n(413),a=n(570),s=n(409),l=n(407),u=n(573);!function(t){t.Crop="Crop",t.Trim="Trim",t.Bleed="Bleed"}(r||(r={}));var c=function(){function t(t){this._propertyChanged=new s.c,this._name="bleed",this._widthPx=1,this._color=new o.RgbColor(255,255,255,255),this._altColor=new o.RgbColor(0,0,0,255),this._stepPx=10,this._margin=new u.a(10),this._borderRadius=null,this._pdfBox=null,null!=t&&Object.assign(this,t)}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name!==t&&(this._name=t,this._propertyChanged.notify(this,"name"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widthPx",{get:function(){return this._widthPx},set:function(t){l.EqualsOfFloatNumbers(this._widthPx,t)||(this._widthPx=t,this._propertyChanged.notify(this,"widthPx"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){o.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"altColor",{get:function(){return this._altColor},set:function(t){o.Color.equals(this._altColor,t)||(this._altColor=t,this._propertyChanged.notify(this,"altColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this._margin},set:function(t){"number"==typeof t&&(t=new u.a(t)),this._margin=t,this._propertyChanged.notify(this,"margin")},enumerable:!0,configurable:!0}),t.prototype.getMargin=function(){return this._margin},Object.defineProperty(t.prototype,"stepPx",{get:function(){return this._stepPx},set:function(t){l.EqualsOfFloatNumbers(this._stepPx,t)||(this._stepPx=t,this._propertyChanged.notify(this,"stepPx"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"borderRadius",{get:function(){return this._borderRadius},set:function(t){this._borderRadius!==t&&(this._borderRadius=t,this._propertyChanged.notify(this,"borderRadius"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pdfBox",{get:function(){return this._pdfBox},set:function(t){this._pdfBox!==t&&(this._pdfBox=t,this._propertyChanged.notify(this,"pdfBox"))},enumerable:!0,configurable:!0}),t.prototype.getRectangle=function(t){var e=this.getMargin();return i.a.FromLTRB(t.left+e.left,t.top+e.top,t.right-e.right,t.bottom-e.bottom)},t.prototype.getCornerRadiuses=function(t){return null==this.borderRadius?null:new a.a(this.getRectangle(t),72).convert(this.borderRadius)},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.prototype.clone=function(){var e,n=new t;return n.name=this.name,n.widthPx=this.widthPx,n.color=this.color.clone(),n.altColor=this.altColor.clone(),n.stepPx=this.stepPx,n.borderRadius=this.borderRadius,n.pdfBox=this.pdfBox,n.margin=null===(e=this._margin)||void 0===e?void 0:e.clone(),n},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){this.__type="ItemHandlerData",this.P=[],this.Tg=null,this.ID="vo"+(new Date).getTime()+Math.round(1e3*Math.random()),t&&(this.P=t.controlPoints,this.Tg=t.tag,this.ID=t.uniqueId)}return t.prototype.applyState=function(t,e){e&&(e.beginUpdate(),e.controlPoints=t.P,e.tag=t.Tg,e.uniqueId=t.ID,e.endUpdate())},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(411),i=n(606),o=n(424),a=n(413),s=n(449),l=n(456),u=n(407),c=n(516),h=n(425),p=n(479),f=function(){function t(t){this._additionalConverters=r.isArray(t)?t:[],this.productParser=new i.a(t)}return t.prototype.deserialize=function(t){var e=t;return"string"==typeof t&&(e=JSON.parse(t)),r.isObject(e)?this.productParser.parseProduct(e):null},t.prototype.serialize=function(t,e){return this.serializeModelComponent(t,e)},t.prototype.serializeModelComponent=function(t,e){var n=this;return null==e&&(e=!1),JSON.stringify(t,(function(t,e){if(e instanceof o.a)return e.getSimplifiedObject();if(e instanceof a.Color)return e.getData();if(e instanceof s.a)return e.getData();if(e instanceof l.a)return{scaleX:e.scaleX,scaleY:e.scaleY,translateX:e.translateX,translateY:e.translateY,angle:e.angle};if(e instanceof c.b)return{name:e.name,altColor:e.altColor,color:e.color,margin:e.margin,stepPx:e.stepPx,widthPx:e.widthPx,borderRadius:e.borderRadius,pdfBox:e.pdfBox};if(e instanceof u.SizeF)return e.width+", "+e.height;if(e instanceof u.Path)return e.toString();if(e instanceof h.a)return e.toArray();if(e instanceof p.a)return e.getSimplifiedObject();var i=r.find(n._additionalConverters,(function(t){return e instanceof t.typeCtor}));return null!=i&&((e=r.clone(e)).$type=i.type),e}),2)},t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.Left="left",t.Right="right",t.Top="top",t.Bottom="bottom",t.Center="center"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){var e=this;this._isDisposed=!1,this._src=null,this._onLoadedDelegate=function(n){if(!n.target)throw new Error('"e.target" is null.');e._onLoaded(n,n.target),t()},this._image=this._createImageObject(this._onLoadedDelegate),this._tmpImage=this._createImageObject(this._onLoadedDelegate)}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._loaded},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._loading},set:function(t){this._loading=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"image",{get:function(){return this._image},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._src},set:function(t){this._src===t||this._isDisposed||(this._loaded=!1,this._src=t,this._image.src=null==this._src?"":t)},enumerable:!0,configurable:!0}),t.prototype.updateUrl=function(t){this._isDisposed||(this._tmpImage.src!==t?(this._loading=!0,this._tmpImage.src=t,this._src=t):this._onLoadedDelegate({target:this._tmpImage}))},t.prototype.clear=function(){this.source=null},t.prototype.dispose=function(){this._tmpImage.removeEventListener("load",this._onLoadedDelegate),this._tmpImage=null,this._image.removeEventListener("load",this._onLoadedDelegate),this._image=null,this._isDisposed=!0},t.prototype._onLoaded=function(t,e){e===this._tmpImage&&(this._tmpImage=this._image,this._image=e,this._src=e.src),this._loaded=!0,this._loading=!1},t.prototype._createImageObject=function(t){var e=new Image;return e.crossOrigin="anonymous","function"==typeof t&&e.addEventListener("load",t),e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(436),o=n(407),a=n(419),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return s(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(e){if(t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$){var n=this._getBaselineLocation(),r=new o.RotatedRectangleF(n.x,n.y,6,6,0);a.a.fillRectangle(e,r,"red")}},e.prototype.onResized=function(){if(null!=this.canvas){var e=this.rectangle.height/this._height,n=parseFloat((this.item.font.size*e).toFixed(1)),r=parseFloat((this.item.leading*e).toFixed(1)),i=this.canvas,a=i.minFontSize;n="number"==typeof a?Math.max(n,a):n;var s=i.maxFontSize;if(n="number"==typeof s?Math.min(n,s):n,0!==r){var l=i.minLeading;r="number"==typeof l?Math.max(r,l):r;var u=i.maxLeading;r="number"==typeof u?Math.min(r,u):r}return Object(o.EqualsOfFloatNumbers)(n,this.item.font.size,.01)&&Object(o.EqualsOfFloatNumbers)(r,this.item.leading,.01)?(null!=this._startRectangle?(this.setRectangle(this._startRectangle),i.updateSelection(),delete this._startRectangle):this.update(null,null),!1):t.prototype.onResized.call(this)}},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.baselineLocation=e.baselineLocation},e.prototype._onItemPropertyChanged=function(e,n){var r=this;switch(n){case"baselineLocation":case"isVertical":this.update();break;case"alignment":var i=this.rectangle.location,o=this.canvas.history;null!=o&&o.pause(),this.update(null,(function(){var t=r.rectangle.location,e=i.x-t.x,n=i.y-t.y;r.item.transform.move(e,n),null!=o&&o.resume()}))}"alignment"!==n&&t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._getBaselineLocation=function(){var t=this.getControlCenter(),e=this.item.baselineLocation.clone();return e.transform(this.item.transform.clone(),t),e},e.typeName="PlainTextItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(436),o=n(459),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="BaseTextHandlerData",n}return a(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),null!=e.currentTextImage?n.currentTextImage=Object.assign(new i.b,e.currentTextImage):n.currentTextImage=null),t.prototype.applyState.call(this,e,n)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(436),o=n(407),a=n(419),s=n(408),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e,n,r,i){void 0===n&&(n=null),void 0===r&&(r=null);var o=t.call(this,e,n,r,i)||this;return o._lastRectangle=null,o._textAutoFitted=null,o._updateEmptyTextControlPoints(),o}return l(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.canvas.isItemHandlerSelected(this)&&this.canvas.isResizing()&&null!=this.startRectangle?this.startRectangle:this.rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastRectangle",{get:function(){return this._lastRectangle},set:function(t){this._lastRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAutoFitted",{get:function(){var t;return null==this._textAutoFitted&&(this._textAutoFitted=(t=this.item).overflowStrategy!==s.X.Clip&&(t.shrinkMode===s.mb.Scale||t.shrinkMode===s.mb.Size)&&(t.originalVerticalScale<t.verticalScale||t.originalHorizontalScale<t.horizontalScale)),this._textAutoFitted},enumerable:!0,configurable:!0}),e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode!==s.wb.None?o.Path.rotatedRectangle(this.getTextRectangle()):null},e.prototype.drawItemHandler=function(e){t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$&&a.a.drawRectangle(e,this.getTextRectangle(),1,"red",1)},e.prototype.getTextRectangle=function(){var t=this.getControlCenter(),e=o.RotatedRectangleF.fromRectangleF(this.item.textRectangle);return e.transform(this.item.transform.clone(),t),e},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this._textAutoFitted=null,this.item.scheduledFitMode=null,this.item.textRectangle=e.textRectangle,this.item.firstBaselineOffset=e.firstBaselineOffset,this.item.firstBaselineMinOffset=e.firstBaselineMinOffset},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textRectangle":case"verticalAlignment":case"isVertical":case"paragraphSettings":case"wrappingMargin":case"scheduledFitMode":case"shrinkMode":case"overflowStrategy":case"wrappingPath":case"firstBaselineOffset":case"firstBaselineMinOffset":case"characterLimit":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._updateEmptyTextControlPoints=function(){var t=this.item.textRectangle;this._controlPoints[0].x=t.left,this._controlPoints[0].y=t.top,this._controlPoints[1].x=t.right,this._controlPoints[1].y=t.bottom;var e=this.canvas;null!=e&&e.redraw()},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="BoundedTextItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(407),o=n(408),a=n(436),s=n(419),l=n(577),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._lastRectangle=null,o._lastRectangle=null,o}return u(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boundingPaths",{get:function(){var t=[],e=this.getControlCenter(),n=this.item.transform.clone();return this.originalBoundingPaths.forEach((function(r){var i=r.clone();i.transform(n,e),t.push(i)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalBoundingPaths",{get:function(){return this.item.boundingPaths},set:function(t){this.item.boundingPaths=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastRectangle",{get:function(){return this._lastRectangle},set:function(t){this._lastRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this.item.wrappingMargin},set:function(t){this.item.wrappingMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this.item.paragraphSettings},set:function(t){t instanceof o.Z||(t=new o.Z(t)),this.item.paragraphSettings=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this.item.isVertical},set:function(t){this.item.isVertical=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.canvas.isItemHandlerSelected(this)&&this.canvas.isResizing()&&null!=this.startRectangle?this.startRectangle:this.rectangle},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(e){if(t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$){var n=this.getControlCenter(),r=new i.Transform;this.boundingPaths.forEach((function(t){s.a.drawPath(e,t,n,r,1,"red",1)}))}},e.prototype.getBoundingPathsBounds=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return t=this.item.boundingPaths,[4,Promise.all(t.map((function(t){return l.a.getBounds(t)})))];case 1:return e=o.sent(),n=i.RectangleF.getOverallBounds(e),(r=i.RotatedRectangleF.fromRectangleF(n)).transform(this.item.transform.clone(),this.getControlCenter()),[2,r.toRectangleF()]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.boundingPaths=e.boundingPaths,this.item.wrappingMargin=e.wrappingMargin,this.item.characterLimit=e.characterLimit,this.item.paragraphSettings=e.paragraphSettings,this.item.isVertical=e.isVertical,this.item.firstBaselineOffset=e.firstBaselineOffset,this.item.firstBaselineMinOffset=e.firstBaselineMinOffset},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"boundingPaths":case"wrappingPath":case"wrappingMargin":case"paragraphSettings":case"isVertical":case"firstBaselineOffset":case"firstBaselineMinOffset":case"characterLimit":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="PathBoundedTextItemHandler",e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(420),i=n(427),o=n(527),a=n(484),s=n(485),l=n(749),u=n(583),c=n(750),h=n.n(c),p=n(460),f=n(472),d=n(600),g=n(486);class m{constructor(t){this._colorParser=t,this._colorConverter=null,this._existingStyles=[]}parse(t,e,n,r){const i=this._parse(t);return this._colorConverter=new g.a(e,this._colorParser),this._convert(i,n,r)}_isAccepted(t){const e=this.getNodeName(t);return"body"==e||"p"===e||"ol"===e||"li"===e||"ul"===e||"br"===e||"span"===e||"#text"===e}getNodeName(t){return t.nodeName.toLowerCase()}_dbgGetNodeContent(t){return"#text"==t.nodeName.toLowerCase()?t.textContent:""}_convertNode(t,e,n,r){const i=this.getNodeName(t);switch(i){case"body":return this._convertBody(t,e);case"p":return this._convertParagraph(t,e);case"span":return this._convertSpan(t,e);case"ol":return this._convertOrderedList(t,e,n,r);case"ul":return this._convertUnorderedList(t,e,n,r);case"li":return this._convertListItem(t,e);case"br":return this._convertBr(t,e);case"#text":return this._convertText(t);default:throw this._notImplemented(`_convertNode for ${i}`)}}_convertCommonListStyleToParagraphStyle(t,e,n,i,a){var s,l,u,c;if(!a)throw new o.a("listStyleSheetManager must be provided.");const h=new r.ParagraphListStyle;h.tabPosition=null===(s=null==n?void 0:n.textIndent)||void 0===s?void 0:s.value,h.level=null===(l=null==n?void 0:n.levelIndent)||void 0===l?void 0:l.value,t.listStyle=h,t.style=null!==(u=t.style)&&void 0!==u?u:new r.ParagraphStyle,(null==n?void 0:n.levelIndent)&&(t.style.leftIndent=n.levelIndent),(null==n?void 0:n.leftIndent)&&(t.style.leftIndent=n.leftIndent),(null==n?void 0:n.firstLineIndent)&&(t.style.firstLineIndent=n.firstLineIndent),t.listStyle.tabPosition=null!==(c=null==n?void 0:n.tabPosition)&&void 0!==c?c:this._calculateTabPosition(e,i),t.metadata||(t.metadata=new r.ParagraphMetadata);var p=this._findListStyle(a,t,n);const f=a.getListSetting().styleNameKey;t.metadata.set(f,p)}_convertOListItemToParagraph(t,e,n,i,o){var a;const s=new r.Paragraph;s.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(s,t.style,e.style,i,o),s.listStyle.type=r.ListStyleType.numbers;let l=p.c.numbers;return(null===(a=e.style)||void 0===a?void 0:a.type)&&(l=e.style.type),s.listStyle.formatType=d.f.fromListType(l),null!=n&&(s.listStyle.startAt=n,s.listStyle.mode=r.NumberMode.startAt),s}_convertUListItemToParagraph(t,e,n,i){var o,a;const s=new r.Paragraph;return s.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(s,t.style,e.style,n,i),s.listStyle.type=r.ListStyleType.bullets,s.listStyle.bulletChar=null===(a=this._convertUnorderedListBullet(null===(o=null==e?void 0:e.style)||void 0===o?void 0:o.type))||void 0===a?void 0:a.charCodeAt(0),s}_convertUnorderedListLevelIndent(t){return t?t.value:null}_convertUnorderedListBullet(t){if(t instanceof f.d)return String.fromCharCode(parseInt(t.value.substring(1)));switch(t){case f.c.minus:return"-";case f.c.bullet:default:return"•"}}_parse(t){var e=`<body>${t.replace(/ /g," ")}</body>`;const n=new h.a.DOMParser;try{return n.parseFromString(e,"text/html").getElementsByTagName("body")[0]}catch(r){throw console.error("_parse error",r),console.error(`xml: \n\r${e}`),r}}_convert(t,e,n){let r=[];if(t.childNodes)for(let i=0;i<t.childNodes.length;++i){const o=t.childNodes[i];if(this._isAccepted(o)){let t=this._convert(o,e,n);r.push(t)}}return this._convertNode(t,r,e,n)}_convertBr(t,e){return new r.Br}_convertText(t){const e=new r.InlineText;return e.value=t.textContent.replace(/</g,"<").replace(/>/g,">"),e}_convertBody(t,e){const n=new r.Text;let i=null;for(var o of e)if(o instanceof f.a)n.blocks.push(...o.items),i=n.blocks[n.blocks.length-1];else if(o instanceof p.a)n.blocks.push(...o.items),i=n.blocks[n.blocks.length-1];else if(o instanceof r.BlockElement)n.blocks.push(o),i=o;else if(o instanceof r.InlineElement){if(i||(i=new r.Paragraph,n.blocks.push(i)),!(i instanceof r.Paragraph))throw this._notImplemented("Inserting inline element into block element that is not paragraph");i.inlineElements.push(o)}return n}_convertParagraph(t,e){const n=new r.Paragraph;null!=e&&e.length>0&&n.inlineElements.push(...e);const i=t.getAttributeNode("style");let o=this._convertParagraphStyles(null==i?void 0:i.value);n.style=o.style,n.listStyle=o.listStyle;const a=t.getAttributeNode("metadata");return n.metadata=this._convertParagraphMetadata(null==a?void 0:a.value),n}_convertParagraphMetadata(t){if(Object(i.a)(t))return null;const e=Object(i.b)(t),n=new r.ParagraphMetadata;for(let r in e)n.set(r,e[r]);return n}_convertParagraphStyles(t){if(Object(i.a)(t))return{style:new r.ParagraphStyle,listStyle:null};const e=Object(i.b)(t);return{style:this._convertParagraphStyle(e),listStyle:this._convertParagraphListStyles(e)}}_convertParagraphListStyles(t){let e=new r.ParagraphListStyle;const n=t[s.a.type];null!=n&&(e.type=d.e.parse(n));const i=t[s.a.bulletChar];null!==i&&(e.bulletChar=d.a.parse(i));const o=t[s.a.bulletNumberTabPosition];null!=o&&(e.tabPosition=d.h.parseNumber(o));const a=t[s.a.numberMode];null!==a&&(e.mode=d.g.parse(a));const l=t[s.a.level];null!=l&&(e.level=d.h.parseNumber(l));const u=t[s.a.startAt];null!=u&&(e.startAt=d.h.parseNumber(u));const c=t[s.a.numberFormat];return null!=c&&(e.formatType=d.f.parse(c)),e}_convertParagraphStyle(t){let e=new r.ParagraphStyle;const n=t[s.b.alignment];null!=n&&(e.alignment=d.k.parse(n));const i=t[s.b.firstLineIndent];null!=i&&(e.firstLineIndent=d.h.parse(i));const o=t[s.b.spaceBefore];null!=o&&(e.spaceBefore=d.h.parse(o));const a=t[s.b.spaceAfter];null!=a&&(e.spaceAfter=d.h.parse(a));const l=t[s.b.leftIndent];null!=l&&(e.leftIndent=d.h.parse(l));const u=t[s.b.rightIndent];return null!=u&&(e.rightIndent=d.h.parse(u)),this._checkUnsupportedStyles([s.b,s.a],t,"paragraph"),e}_convertOrderedList(t,e,n,r){var i,o,a;let s=new p.a;const u=t.getAttributeNode("style");null!=u&&(s.style=this._convertOrderedListStyles(u.value));let c=null!==(o=null===(i=s.style)||void 0===i?void 0:i.start)&&void 0!==o?o:1;return(null===(a=s.style)||void 0===a?void 0:a.start)&&(c=s.style.start),s.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof l.a){let e=this._convertOListItemToParagraph(t,s,c,n,r);s.items.push(e),null!=c&&c++}})),s}_convertUnorderedList(t,e,n,r){let i=new f.a;const o=t.getAttributeNode("style");return null!=o&&(i.style=this._convertUnorderedListStyles(null==o?void 0:o.value)),i.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof l.a){let e=this._convertUListItemToParagraph(t,i,n,r);i.items.push(e)}})),i}_isListStylesMatch(t,e,n,r){return!(!t||!t.isMatch(e))}_findListStyle(t,e,n){for(let i of this._existingStyles)if(this._isListStylesMatch(i.style,n,i.lastParagraph,e))return i.lastParagraph=e,i.name;var r={style:n,name:t.createEmptyStyleSheet().name,lastParagraph:e};return this._existingStyles.push(r),r.name}_calculateTabPosition(t,e){return(null==t?void 0:t.fontSize)?2.5*t.fontSize.value:2.5*e}_convertListItem(t,e){const n=new l.a,r=t.getAttributeNode("style");return null!=r&&(n.style=this._convertListItemStyles(r.value)),null!=e&&e.length>0&&n.content.push(...e),n}_convertUbi(t,e){const n=new r.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t))),n.style=new r.SpanStyle;const i=this.getNodeName(t);switch(i){case"u":n.style.underline=!0;break;case"b":n.style.bold=!0;break;case"i":n.style.italic=!0;break;default:throw new o.a(`Unexpected node name ${i} while parsing UBI.`)}return n}_convertSpan(t,e){const n=new r.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t)));const i=t.getAttributeNode("style");return n.style=this._convertSpanStyles(null==i?void 0:i.value),n}_convertBaseListStyles(t,e){const n=e[u.a.levelIndent];null!=n&&(t.levelIndent=d.h.parse(n));const r=e[u.a.textIndent];null!=r&&(t.textIndent=d.h.parse(r));const i=e[u.a.leftIndent];null!=i&&(t.leftIndent=d.h.parse(i));const o=e[u.a.firstLineIndent];null!=i&&(t.firstLineIndent=d.h.parse(o))}_convertListItemStyles(t){let e=new l.b;const n=Object(i.b)(t)[u.b.fontSize];return null!=n&&(e.fontSize=d.h.parse(n)),e}_convertOrderedListStyles(t){let e=new p.b;const n=Object(i.b)(t);this._convertBaseListStyles(e,n);const r=n[u.c.start];null!=r&&(e.start=d.h.parseNumber(r));const o=n[u.c.type];return null!=o&&(e.type=d.j.parse(o)),e}_convertUnorderedListStyles(t){let e=new f.b;const n=Object(i.b)(t);this._convertBaseListStyles(e,n);const r=n[u.d.type];return null!=r&&(e.type=d.l.parse(r)),e}_convertSpanStyles(t){if(null==t)return null;const e=new r.SpanStyle,n=Object(i.b)(t),o=n[a.a.fontName];o&&(e.fontName=o);const s=n[a.a.underline];null!=s&&(e.underline=this._parseBool(s));const l=n[a.a.bold];null!=l&&(e.bold=this._parseBool(l));const u=n[a.a.italic];null!=u&&(e.italic=this._parseBool(u));const c=n[a.a.fontSize];null!=c&&(e.fontSize=d.h.parse(c));const h=n[a.a.leading];null!=h&&(e.leading=d.h.parse(h));const p=n[a.a.tracking];null!=p&&(e.tracking=d.h.parseNumber(p));const f=n[a.a.sup];null!=f&&(e.sup=this._parseBool(f));const g=n[a.a.supSize];null!=g&&(e.supSize=d.h.parseNumber(g));const m=n[a.a.sub];null!=m&&(e.sub=this._parseBool(m));const y=n[a.a.subSize];null!=y&&(e.subSize=d.h.parseNumber(y));const _=n[a.a.color];null!=_&&(e.color=this._colorConverter.parse(_));const b=n[a.a.penColor];null!=b&&(e.penColor=this._colorConverter.parse(b));const v=n[a.a.penWidth];null!=v&&(e.penWidth=d.h.parse(v));const w=n[a.a.allCaps];null!=w&&(e.allCaps=this._parseBool(w));const C=n[a.a.smallCaps];null!=C&&(e.smallCaps=this._parseBool(C));const P=n[a.a.openType];null!=P&&(e.openTypeFeatures=d.i.parse(P));const x=n[a.a.horizontalScale];null!=x&&(e.horizontalScale=d.h.parseNumber(x));const S=n[a.a.verticalScale];return null!=S&&(e.verticalScale=d.h.parseNumber(S)),this._checkUnsupportedStyles([a.a],n,"span"),e}_checkUnsupportedStyles(t,e,n){const r={};for(let a of t)for(let t in a)r[a[t]]=1;const i=[];for(let a in e)r[a]||i.push(a);const o=i.join(", ");i.length>0&&console.warn(`GmXmlParser: unsupported ${n} styles: ${o}`)}_parseBool(t){return Object(i.a)(t)?null:"true"==t.toLowerCase()}_notImplemented(t=null){return new Error(`not implemented: ${t}`)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r extends Error{constructor(t){super(t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(433),i=n(420),o=n(584),a=n(486),s=n(585),l=n(586),u=n(587),c=n(460),h=n(472);class p{constructor(t){this._colorParser=t}serialize(t,e){if(null==t)throw new r.b("Text must be not null");return this._colorConverter=new a.a(e,this._colorParser),this._serializeBlocks(t.blocks)}_serializeBlocks(t){if(null==t)return"";let e="";for(let n of t)e+=this._serializeBlock(n);return e}_serializeBlock(t){if(t instanceof i.Paragraph)return this._serializeParagraph(t);if(t instanceof c.a)return this._serializeOrderedList(t);if(t instanceof h.a)return this._serializeUnorderedList(t);throw console.error("Unknown block type, serialization not implemented",t),new r.a("Unknown block type ")}_serializeParagraph(t){let e=this._serializeParagraphStyle(t.style,t.listStyle),n=this._serializeParagraphMetadata(t.metadata),r=[];n&&r.push(n),e&&r.push(e);let i="";if(t.inlineElements)for(let o of t.inlineElements)i+=this._serializeInlineElement(o);return this._buildTag("p",r,i)}_serializeParagraphMetadata(t){const e=[];if(t)for(let[n,r]of t)this._isEmpty(r)||e.push(`${n}: ${r}`);return e.length>0?this._buildAttribute("metadata",e):null}_serializeParagraphStyle(t,e){let n=[];return t&&(this._isEmpty(t.alignment)||n.push(`alignment: ${t.alignment}`),this._isEmpty(t.firstLineIndent)||n.push(`first-line-indent: ${t.firstLineIndent}`),this._isEmpty(t.spaceBefore)||n.push(`space-before: ${t.spaceBefore}`),this._isEmpty(t.spaceAfter)||n.push(`space-after: ${t.spaceAfter}`),this._isEmpty(t.leftIndent)||n.push(`left-indent: ${t.leftIndent}`),this._isEmpty(t.rightIndent)||n.push(`right-indent: ${t.rightIndent}`)),e&&(this._isEmpty(e.type)||n.push(`list-type: ${s.a.serialize(e.type)}`),this._isEmpty(e.mode)||n.push(`number-mode: ${u.a.serialize(e.mode)}`),this._isEmpty(e.bulletChar)||n.push(`bullet-char: ${o.a.serialize(e.bulletChar)}`),this._isEmpty(e.level)||n.push(`level: ${e.level}`),this._isEmpty(e.formatType)||n.push(`number-format: ${l.a.serialize(e.formatType)}`),this._isEmpty(e.startAt)||n.push(`number-start-at: ${e.startAt}`),this._isEmpty(e.tabPosition)||n.push(`bullet-number-tab-position: ${e.tabPosition}`)),n.length>0?this._buildAttribute("style",n):null}_serializeInlineText(t){return t.value}_serializeInlineElement(t){return t instanceof i.Span?this._serializeSpan(t):t instanceof i.InlineText?this._serializeInlineText(t):t instanceof i.Br?this._serializeBr(t):void 0}_serializeBr(t){return"<br />"}_serializeSpan(t){let e=t.style?this._serializeSpanStyle(t.style):null,n=e?`<span ${e}>`:"<span>",r="";return null!=t.content&&t.content.forEach((t=>{r+=this._serializeInlineElement(t)})),`${n}${r}</span>`}_serializeSpanStyle(t){let e=[];if(this._isEmpty(t.underline)||e.push(`underline: ${t.underline}`),this._isEmpty(t.bold)||e.push(`bold: ${t.bold}`),this._isEmpty(t.italic)||e.push(`italic: ${t.italic}`),this._isEmpty(t.fontName)||e.push(`font-name: ${t.fontName}`),this._isEmpty(t.fontSize)||e.push(`font-size: ${t.fontSize}`),this._isEmpty(t.leading)||e.push(`leading: ${t.leading}`),this._isEmpty(t.tracking)||e.push(`tracking: ${t.tracking}`),this._isEmpty(t.color)||e.push(`color: ${this._colorConverter.serialize(t.color)}`),this._isEmpty(t.penColor)||e.push(`pen-color: ${this._colorConverter.serialize(t.penColor)}`),this._isEmpty(t.penWidth)||e.push(`pen-width: ${t.penWidth}`),this._isEmpty(t.sub)||e.push(`sub: ${t.sub}`),this._isEmpty(t.subSize)||e.push(`sub-size: ${t.subSize}`),this._isEmpty(t.sup)||e.push(`sup: ${t.sup}`),this._isEmpty(t.supSize)||e.push(`sup-size: ${t.supSize}`),this._isEmpty(t.allCaps)||e.push(`all-caps: ${t.allCaps}`),this._isEmpty(t.smallCaps)||e.push(`small-caps: ${t.smallCaps}`),this._isEmpty(t.horizontalScale)||e.push(`horz-scale: ${t.horizontalScale}`),this._isEmpty(t.verticalScale)||e.push(`vert-scale: ${t.verticalScale}`),t.openTypeFeatures)for(let n of t.openTypeFeatures)e.push(`ot: ${n.tag},${n.value}`);return e.length>0?this._buildAttribute("style",e):null}_serializeOrderedList(t){let e=t.style?this._serializeOrderedListStyle(t.style):null,n=e?`<ol ${e}>`:"<ol>";return 0==t.items.length?`${n}</ol>`:`${n}${t.items.reduce(((t,e)=>t+this._serializeListItem(e)),"")}</ol>`}_serializeOrderedListStyle(t){let e=[];return this._isEmpty(t.start)||e.push(`start: ${t.start}`),this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||e.push(`type: ${c.c[t.type]}`),e.length>0?this._buildAttribute("style",e):null}_serializeUnorderedList(t){let e=t.style?this._serializeUnorderedListStyle(t.style):null,n=e?`<ul ${e}>`:"<ul>";return 0==t.items.length?`${n}</ul>`:`${n}${t.items.reduce(((t,e)=>t+this._serializeListItem(e)),"")}</ul>`}_serializeUnorderedListStyle(t){let e=[];return this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||(t.type instanceof h.d?e.push(`type: ${t.type.value}`):e.push(`type: ${h.c[t.type]}`)),e.length>0?this._buildAttribute("style",e):null}_serializeListItem(t){if(t instanceof i.Paragraph)return this._serializeParagraph(t);throw new Error("not implemented")}_buildTag(t,e,n){let r=`<${t}`;return e.forEach((t=>{r+=` ${t}`})),r+=">",n&&(r+=n),r+=`</${t}>`,r}_buildAttribute(t,e){return`${t}="${e.join("; ")}"`}_isEmpty(t){return null==t}}},function(t,e,n){"use strict";function r(t,e){return null==t&&null==e||null!=t&&null!=e&&t.isEqual(e)}function i(t,e){if(null==t&&null==e)return!0;if(null==t||null==e)return!1;const n=r(t.getStart(),e.getStart())&&r(t.getEnd(),e.getEnd()),i=r(t.getStart(),e.getEnd())&&r(t.getEnd(),e.getStart());return n||i}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(406),i=n(529),o=n(487);class a{constructor(t){if(this._textPosition=null,!t)throw new r.c("Text position cannot be null or undefined");this._textPosition=t}getLineIndex(){return this._textPosition.getLineIndex()}getOffset(){return this._textPosition.getOffset()}getParagraphIndex(){return this._textPosition.getParagraphIndex()}isEqualTo(t){const e=this.getEntry();return Object(i.a)(e,o.a.getPosition(t).getEntry())}getEntry(){return this._textPosition}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(406),i=n(413),o=n(420),a=n(754),s=n(599),l=n(761);class u{constructor(t,e,n,r,i,o=72){this._engine=t,this._fontRegistry=e,this._listStyleSheetManager=n,this._colorPreviewService=r,this._colorParser=i,this._dpi=o,this._initData=null,this._engineHandler=null,this._cursorHandler=new s.a(this),this._textHandler=new s.e(this,this,this._colorParser),this._styleHandler=new s.d(this,this._colorPreviewService),this._selectionHandler=new s.c(this),this._undoRedoHandler=new s.g(this),this._metadataHandler=new s.b(this),this._textMeasurer=new s.f(this)}get isInitialized(){return null!=this._engineHandler}initialize(t){this._initialize(t,!1)}get cursorHandler(){return this._cursorHandler}get textHandler(){return this._textHandler}get styleHandler(){return this._styleHandler}get selectionHandler(){return this._selectionHandler}get undoRedoHandler(){return this._undoRedoHandler}get metadataHandler(){return this._metadataHandler}get colorPalette(){var t;return null===(t=this._styleHandler)||void 0===t?void 0:t.colorPalette}get textMeasurer(){return this._textMeasurer}get engine(){return this._engine}get engineHandler(){return this._engineHandler}get initData(){return this._initData}clone(t){const e=this._initData.getActualFrames(),n=new u(this._engine,this._fontRegistry,this._listStyleSheetManager,this._colorPreviewService,this._colorParser,this._dpi);return n._initialize(this._initData,!0,t),n.textHandler.setTextFrames(e,!0),n}static createException(t,e){if("number"!=typeof e)throw e;const n=t.getExceptionMessage(e),i=t.getExceptionName(e);return new r.c(`${i}: ${n}`)}_initialize(t,e,n){try{this._initData=t,this._engineHandler=new this._engine.TextHandler(this._fontRegistry,this._dpi),this._initStyles(t),this._initText(t,e,n),this._initUndoRedo(),this._initCursor()}catch(r){throw u.createException(this._engine,r)}}_initStyles(t){t.colorPalette&&this._styleHandler.initialize(t.colorPalette),t.defaultCharStyle&&this._styleHandler.setDefaultCharStyle(t.defaultCharStyle),t.defaultParagraphStyle&&this._styleHandler.setDefaultParagraphStyle(t.defaultParagraphStyle)}_initText(t,e,n){if(this._textHandler.setTextFrames(t.frames,e),t.wrappingPath&&this._textHandler.setWrappingPath(t.wrappingPath),n)return void this._textHandler.insertFormattedText(n);let r,s;const u=new l.a(this.colorPalette.getPaletteColors());if(t.text instanceof o.Text)s=t.text;else{const e=this.colorPalette.getPaletteColors(),n=new l.a(e),r=this._styleHandler.getDefaultCharStyle().font.size;s=new a.GmXmlParser(this._colorParser).parse(t.text,n,r,this._listStyleSheetManager)}r=new a.GmXmlSerializer(this._colorParser).serialize(s,u);let c=0;for(;u.containsColorWithIndex(c);){let t=u.getColorByIndex(c),e=this.colorPalette.getPaletteColorAt(c);null==e?this.colorPalette.addColorToPalette(t):i.Color.equals(e.color,t.color)||console.warn(`differentColors: existingColor ${e}; paletteColor ${t}`),c++}this._textHandler.insertFormattedText(r)}_initUndoRedo(){this._engineHandler.clearUndoRedo()}_initCursor(){this._engineHandler.getCursor().set(this.engineHandler.getFirstPosition())}}},function(t,e,n){"use strict";(function(t){var r=n(417),i=n(453),o=n(815);function a(t){return r.a.isPlainObject(t)||r.a.isArray(t)}function s(t){return r.a.endsWith(t,"[]")?t.slice(0,-2):t}function l(t,e,n){return t?t.concat(e).map((function(t,e){return t=s(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const u=r.a.toFlatObject(r.a,{},null,(function(t){return/^is[A-Z]/.test(t)}));e.a=function(e,n,c){if(!r.a.isObject(e))throw new TypeError("target must be an object");n=n||new(o.a||FormData);const h=(c=r.a.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!r.a.isUndefined(e[t])}))).metaTokens,p=c.visitor||y,f=c.dots,d=c.indexes,g=(c.Blob||"undefined"!=typeof Blob&&Blob)&&r.a.isSpecCompliantForm(n);if(!r.a.isFunction(p))throw new TypeError("visitor must be a function");function m(e){if(null===e)return"";if(r.a.isDate(e))return e.toISOString();if(!g&&r.a.isBlob(e))throw new i.a("Blob is not supported. Use a Buffer instead.");return r.a.isArrayBuffer(e)||r.a.isTypedArray(e)?g&&"function"==typeof Blob?new Blob([e]):t.from(e):e}function y(t,e,i){let o=t;if(t&&!i&&"object"==typeof t)if(r.a.endsWith(e,"{}"))e=h?e:e.slice(0,-2),t=JSON.stringify(t);else if(r.a.isArray(t)&&function(t){return r.a.isArray(t)&&!t.some(a)}(t)||(r.a.isFileList(t)||r.a.endsWith(e,"[]"))&&(o=r.a.toArray(t)))return e=s(e),o.forEach((function(t,i){!r.a.isUndefined(t)&&null!==t&&n.append(!0===d?l([e],i,f):null===d?e:e+"[]",m(t))})),!1;return!!a(t)||(n.append(l(i,e,f),m(t)),!1)}const _=[],b=Object.assign(u,{defaultVisitor:y,convertValue:m,isVisitable:a});if(!r.a.isObject(e))throw new TypeError("data must be an object");return function t(e,i){if(!r.a.isUndefined(e)){if(-1!==_.indexOf(e))throw Error("Circular reference detected in "+i.join("."));_.push(e),r.a.forEach(e,(function(e,o){!0===(!(r.a.isUndefined(e)||null===e)&&p.call(n,e,r.a.isString(o)?o.trim():o,i,b))&&t(e,i?i.concat(o):[o])})),_.pop()}}(e),n}}).call(this,n(197).Buffer)},,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return Z})),n.d(e,"f",(function(){return h})),n.d(e,"g",(function(){return O})),n.d(e,"h",(function(){return S})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return w})),n.d(e,"l",(function(){return Y})),n.d(e,"m",(function(){return U})),n.d(e,"n",(function(){return H})),n.d(e,"o",(function(){return b})),n.d(e,"p",(function(){return P})),n.d(e,"c",(function(){return Q})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return G})),n.d(e,"e",(function(){return X})),n.d(e,"j",(function(){return i}));var r=n(429);class i{}class o{constructor(t){this.previousListItemIndex=t}}class a extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.previousListItemIndex;if(!this._textManager.isParagraphAListItem(t))return!1;const e=this._textManager.getCurrentParagraphIndex(),n=this._textManager.getCurrentCharStyle();return this._textManager.addListItem(e,t),this._deleteTextFromStartOfParagraphToCurrentPosition(e),this._textManager.setCurrentCharStyle(n),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition();if(e.isEqualTo(n))return;const r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class s extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t;if(null===(t=this._initData)||void 0===t?void 0:t.paragraphIndex)this._textManager.deleteListItem(this._initData.paragraphIndex);else{const t=this._textManager.getCurrentCharStyle(),e=this._textManager.getCurrentParagraphIndex();this._textManager.deleteListItem(e),this._textManager.setCurrentCharStyle(t)}return!0}}class l extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t,e;let n=null!==(e=null===(t=this._initData)||void 0===t?void 0:t.paragraphIndexes)&&void 0!==e?e:this._textManager.getSelectedParagraphIndexes();return!!this._textManager.isParagraphsTheSameList(n)&&(n.forEach((t=>this._textManager.increaseListItemIndent(t))),!0)}}class u extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t,e;let n=null!==(e=null===(t=this._initData)||void 0===t?void 0:t.paragraphIndexes)&&void 0!==e?e:this._textManager.getSelectedParagraphIndexes();return!!this._textManager.isParagraphsTheSameList(n)&&(n.forEach((t=>this._textManager.decreaseListItemIndent(t))),!0)}}class c{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=this._initData.listType,n=null!==(t=this._initData.paragraphIndexes)&&void 0!==t?t:this._textManager.getSelectedParagraphIndexes();return this._textManager.applyListType(n,e),!0}}class h{constructor(t){this.direction=t}}class p{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.direction;return this._tryToDeleteNextListItem(t),this._textManager.deleteTextToDirection(t),!0}_tryToDeleteNextListItem(t){if(null==this._textManager.getSelectedTextRange()&&this._isDeletionToTheRight(t)){const t=this._textManager.getCurrentParagraphIndex()+1;this._textManager.isParagraphAListItem(t)&&this._isCursorAtTheEndOfParagraph()&&this._textManager.deleteListItem(t)}}_isCursorAtTheEndOfParagraph(){var t;const e=this._textManager.getCurrentParagraphIndex(),n=this._textManager.getCurrentPosition(),r=null===(t=this._textManager.getParagraphText(e))||void 0===t?void 0:t.getEndPosition();return n.getOffset()===r.getOffset()&&n.getLineIndex()===r.getLineIndex()}_isDeletionToTheRight(t){return t===r.f.right||t===r.f.rightWord||t===r.f.textEnd||t===r.f.lineEnd||t===r.f.down}}class f{constructor(t){this._textManager=t}execute(){return!1!==this._textManager.canRedo&&(this._textManager.redo(),!0)}}class d{constructor(t){this._textManager=t}execute(){return!1!==this._textManager.canUndo&&(this._textManager.undo(),!0)}}class g{constructor(t,e){this.text=t,this.isNewLineEnabled=e}}class m{constructor(t,e){this._textManager=t,this._initData=e}get text(){return this._initData.text}execute(){let t=this._initData.text;return this._initData.isNewLineEnabled||(-1!==t.search("\n")||-1!==t.search("\r"))&&(t=t.replace("\r",""),t=t.replace("\n","")),this._textManager.insertPlainText(t),!0}}class y{constructor(t,e,n){this._textManager=t,this._fontRegistry=e,this._initData=n}execute(){var t;const e=this._initData.style;if(!e)return!1;const n=null===(t=e.font)||void 0===t?void 0:t.postScriptName;return null==n||this._fontRegistry.containsFonts([n])?this._textManager.setCurrentCharStyle(e):this._fontRegistry.loadFonts([n]).then((t=>this._textManager.setCurrentCharStyle(e))),!0}}class _{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.style;return!!t&&(this._textManager.setCurrentParagraphStyle(t),!0)}}class b{constructor(t){this.point=t}}class v{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),!0}}class w{constructor(t,e){this.direction=t,this.withSelection=e}}class C{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.direction,e=this._initData.withSelection;return this._textManager.moveCursorToDirection(t,e),!0}}class P{constructor(t,e){this.startPoint=t,this.endPoint=e}}class x{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setSelection(this._initData.startPoint,this._initData.endPoint),!0}}class S{constructor(t){this.isNewLineEnabled=t}}class I{constructor(t,e){this._textManager=t,this._initData=e}execute(){if(!this._initData.isNewLineEnabled)return!1;const t=this._textManager.getCurrentParagraphIndex(),e=this._textManager.getCurrentParagraphStyle(),n=this._textManager.getCurrentCharStyle();return this._textManager.insertNewLine(),this._textManager.getParagraphText(t+1).isEmpty&&(this._textManager.setCurrentCharStyle(n),this._textManager.setCurrentParagraphStyle(e)),!0}}class O{constructor(t){this.isNewLineEnabled=t}}class T{constructor(t,e){this._textManager=t,this._initData=e}execute(){return!!this._initData.isNewLineEnabled&&(this._textManager.insertPlainText("\n"),!0)}}class E{constructor(t){this._textManager=t}execute(){return this._textManager.insertPlainText("\t"),!0}}var L=n(410);class R{constructor(t,e){this._textManager=t,this._clipboard=e}execute(){const t=this._textManager.getSelectedTextRange();return!(null==t||!t.isValid||(this._clipboard.write(L.k(t.getFormattedText(),"\n")),0))}}class k{constructor(t){this._textManager=t}execute(){return this._textManager.clearCurrentFormatting(),!0}}class j{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{allCaps:!t.font.allCaps}}),!0}}class A{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{fauxBold:!t.font.fauxBold}}),!0}}class F{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{fauxItalic:!t.font.fauxItalic}}),!0}}class B{constructor(t){this._textManager=t}execute(){const t=!this._textManager.getCurrentCharStyle().superscript;return this._textManager.setCurrentCharStyle({superscript:t,subscript:!t&&void 0}),!0}}class M{constructor(t){this._textManager=t}execute(){const t=!this._textManager.getCurrentCharStyle().subscript;return this._textManager.setCurrentCharStyle({subscript:t,superscript:!t&&void 0}),!0}}class N{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({underline:!t.underline}),!0}}class z{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=null!==(t=this._initData.value)&&void 0!==t?t:1,n=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{size:n.font.size+e}}),!0}}class D{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=null!==(t=this._initData.value)&&void 0!==t?t:1,n=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{size:n.font.size-e}}),!0}}class H{constructor(t){this.alignment=t}}class W{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCurrentParagraphStyle({alignment:this._initData.alignment}),!0}}class U{constructor(t){this.point=t}}class V{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),this._textManager.selectCurrentWord(),!0}}class q{constructor(t){this._textManager=t}execute(){return this._textManager.selectAllText(),!0}}class G{constructor(t,e){this.paragraphIndex=t,this.bulletCharCode=e}}class $ extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.paragraphIndex,e=this._textManager.getCurrentCharStyle();return this._deleteTextFromStartOfParagraphToCurrentPosition(t),this._textManager.createBulletedListItem(t,this._initData.bulletCharCode),this._textManager.setCurrentCharStyle(e),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition(),r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class X{constructor(t,e){this.paragraphIndex=t,this.numberingFormat=e}}class K extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.paragraphIndex,e=this._textManager.getCurrentCharStyle();return this._deleteTextFromStartOfParagraphToCurrentPosition(t),this._textManager.createNumberedListItem(t,this._initData.numberingFormat),this._textManager.setCurrentCharStyle(e),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition(),r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class Y{constructor(t){this.point=t}}class J{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),this._textManager.selectCurrentParagraph(),!0}}class Z{constructor(t,e,n){this._textManager=t,this._fontRegistry=e,this._clipboard=n}create(t,e){switch(t){case r.a.undo:return new d(this._textManager);case r.a.redo:return new f(this._textManager);case r.a.setCursor:return new v(this._textManager,e);case r.a.moveCursor:return new C(this._textManager,e);case r.a.setSelection:return new x(this._textManager,e);case r.a.selectWord:return new V(this._textManager,e);case r.a.selectParagraph:return new J(this._textManager,e);case r.a.selectAllText:return new q(this._textManager);case r.a.insertNewLine:return new I(this._textManager,e);case r.a.insertLineBrake:return new T(this._textManager,e);case r.a.insertTab:return new E(this._textManager);case r.a.insertText:return new m(this._textManager,e);case r.a.deleteText:return new p(this._textManager,e);case r.a.copyToClipboard:return new R(this._textManager,this._clipboard);case r.a.clearFormatting:return new k(this._textManager);case r.a.setCharStyle:return new y(this._textManager,this._fontRegistry,e);case r.a.setParagraphStyle:return new _(this._textManager,e);case r.a.setCapitalLetters:return new j(this._textManager);case r.a.setFontBold:return new A(this._textManager);case r.a.setFontItalic:return new F(this._textManager);case r.a.setSuperscriptLetters:return new B(this._textManager);case r.a.setSubscriptLetters:return new M(this._textManager);case r.a.setFontUnderline:return new N(this._textManager);case r.a.increaseFontSize:return new z(this._textManager,e);case r.a.decreaseFontSize:return new D(this._textManager,e);case r.a.setAlignment:return new W(this._textManager,e);case r.a.addListItem:return new a(this._textManager,e);case r.a.creteBulletedListItem:return new $(this._textManager,e);case r.a.creteNumberedListItem:return new K(this._textManager,e);case r.a.deleteListItem:return new s(this._textManager,e);case r.a.increaseListItemIndent:return new l(this._textManager,e);case r.a.decreaseListItemIndent:return new u(this._textManager,e);case r.a.applyListItem:return new c(this._textManager,e)}}}class Q{constructor(t){this._defaultQueueSize=5,this._queue=[],this._queueSize=t||this._defaultQueueSize}getCommandsCount(){return this._queue.length}clearHistory(){this._queue=[]}addCommand(t){this._queue.push(t),this._isOverflow()&&this._queue.shift()}getLastCommand(t){return t?this._getLastCommand(t):this._getLastCommand(0)}_isOverflow(){return this.getCommandsCount()>this._queueSize}_getLastCommand(t){if(this.getCommandsCount()<=t)return null;const e=this.getCommandsCount()-1-t;return this._queue[e]}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var r,i=n(408),o=n(407),a=n(447),s=n(452),l=n(440),u=n(436),c=n(421),h=n(409),p=n(432),f=n(428),d=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},g=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},m=function(){function t(t,e,n,r){var i=this;this._item=t,this._itemHandlers=e,this._itemHandler=n,this._history=r,this._layoutEvent=new h.a,this._orderedItemHandlers=null,this._initialized=!1,this._disposed=!1,this._onChildItemHandlerChanging=function(t){i.applyLayout()},this._onChildItemHandlerPropertyChanged=function(t,e){return d(i,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:switch(e){case"font":case"text":case"tracking":case"leading":case"shadow":case"stroke":case"underline":case"sourceRectangle":case"borderWidth":case"transform":return[3,1]}return[3,3];case 1:return[4,t.waitUpdate()];case 2:return n.sent(),this.applyLayout(),[3,3];case 3:return[2]}}))}))},this._onItemPropertyChanged=function(t,e){switch(e){case"layoutSettings":i._orderedItemHandlers=null,i._updateItemsOrder();case"margin":i.applyLayout();break;case"orientation":i.applyLayout(!0);break;case"alignItems":case"justifyContent":i.applyLayout()}},this._ignoreLayoutApply=!1,this._filterHiddenItems=function(t){return!((t instanceof p.b||t instanceof p.i||t instanceof C)&&t.isEmpty())},this._item.addPropertyChanged(this._onItemPropertyChanged),this._itemHandlers.add_itemAdded(this._onItemHandlerAdded.bind(this)),this._itemHandlers.add_itemRemoved(this._onItemHandlerRemoved.bind(this)),this._itemHandlers.forEach((function(t){return t.addItemPropertyChanged(i._onChildItemHandlerPropertyChanged)})),this._init()}return t.prototype.dispose=function(){var t=this;this._disposed=!0,this._item.removePropertyChanged(this._onItemPropertyChanged),this._itemHandlers.remove_itemAdded(this._onItemHandlerAdded.bind(this)),this._itemHandlers.remove_itemRemoved(this._onItemHandlerRemoved.bind(this)),this._itemHandlers.forEach((function(e){return e.removeItemPropertyChanged(t._onChildItemHandlerPropertyChanged)}))},t.prototype.getLayoutEvent=function(){return this._layoutEvent},t.prototype.onItemRemoved=function(t){this._updateItemsOrder({removedItem:t.item}),this.applyLayout()},t.prototype.onItemHandlersCollectionChanged=function(){this._orderedItemHandlers=null},t.prototype._init=function(){return d(this,void 0,void 0,(function(){var t;return g(this,(function(e){switch(e.label){case 0:return this._initialized?[2]:(t=this._item.getItemsOrder(),[4,this._itemHandler.waitUpdate()]);case 1:return e.sent(),t||this._updateItemsOrder(),this._initialized=!0,this.applyLayout(),[2]}}))}))},t.prototype._onItemHandlerAdded=function(t){t.item.addItemPropertyChanged(this._onChildItemHandlerPropertyChanged),this._orderedItemHandlers=null},t.prototype._onItemHandlerRemoved=function(t){t.item.removeItemPropertyChanged(this._onChildItemHandlerPropertyChanged),this._orderedItemHandlers=null},t.prototype._updateItemsOrder=function(t){if(this._item.layoutSettings instanceof i.f){if(this._validateItemsOrder())return;if(null==this._item.getItemsOrder()){this._initSortedItemHandlers();var e=this._getSortedItemHandlers().map((function(t){return t.item.id}));this._item.setItemsOrder(e)}}},t.prototype._initSortedItemHandlers=function(){var t=this._itemHandler.getTransformedRectangle(!1,!0).center,e=this._item.transform.angle,n=this._item.layoutSettings.orientation;return this._orderedItemHandlers=this._itemHandlers.toArray().sort((function(r,o){return function(t,e){return n===i.e.horizontal?t.bounds.left-e.bounds.left:t.bounds.top-e.bounds.top}(r.getTransformedRectangle(!1,!0).rotateAt(-e,t),o.getTransformedRectangle(!1,!0).rotateAt(-e,t))})),this._orderedItemHandlers},t.prototype._validateItemsOrder=function(){var t=this._item.getItemsOrder();if(null==t)return!1;if(t.length!==this._item.items.length)return!1;var e=this._item.items.select((function(t){return t.id})).toArray();return t.every((function(t){return e.includes(t)}))},t.prototype._getSortedItemHandlers=function(){if(null!=this._orderedItemHandlers)return this._orderedItemHandlers;var t=this._item.getItemsOrder();if(!t)return null;var e=[],n=this._itemHandlers.toArray();if(n.length!=t.length)throw new Error("itemsOrder length does not match itemHandlers length");return t.forEach((function(t){var r=n.findIndex((function(e){return e.item.id==t}));if(-1==r)throw new Error("itemsOrder: Element with id "+t+" was not found in itemHandlers");e.push(n[r]),n.splice(r,1)})),this._orderedItemHandlers=e,this._orderedItemHandlers},t.prototype.getOrderedItems=function(){var t=this._item.getItemsOrder();if(t){var e=this._item.items.toArray();return e.sort((function(e,n){return t.indexOf(e.id)-t.indexOf(n.id)})),e}return null},Object.defineProperty(t.prototype,"ignoreLayoutApply",{set:function(t){this._ignoreLayoutApply=t},enumerable:!0,configurable:!0}),t.prototype.applyLayout=function(t){var e,n,r;if(void 0===t&&(t=!1),!this._disposed&&this._initialized&&!this._ignoreLayoutApply){this._ignoreLayoutApply=!0;try{var i=!(null===(e=this._history)||void 0===e?void 0:e.isPaused());i&&this._history.pause(),null===(n=this._itemHandler.canvas)||void 0===n||n.pauseRedraw();var o=this._applyLayoutImpl(t);null===(r=this._itemHandler.canvas)||void 0===r||r.continueRedraw(!0),i&&(o?this._history.resume(!0,!1,!0):this._history.resume(!1,!1,!0)),this._layoutEvent.notify(o)}finally{this._ignoreLayoutApply=!1}}},t.prototype._applyLayoutImpl=function(t){var e,n=this;void 0===t&&(t=!1);var r=this._getSortedItemHandlers();if(null!=r&&0!=r.length){var i=this._itemHandler.rectangle,a=i.center,s=this._item.layoutSettings,l=s.alignItems,u=s.orientation,c=s.margin,h=s.anchorPoint,p=(this._item.transform.angle,i.toRectangleF()),d=this._getAnchorPoint(p,h,u),g=this._getOriginalPoint(p,l,u);r=r.filter((function(t){return n._filterHiddenItems(t)}));var m=[];r.forEach((function(t){var e=n._getItemHandlerPositionRect(t,i,g,l,u),r=n._getPositionRectOffset(u,p,e)+c;g=n._getOriginalPoint(p,l,u,r),m.push(e)})),m=this._applyAnchor(m,p,h,u);var y=!1;r.forEach((function(t){var e=m.shift(),r=n._setItemHandlerPosition(t,i,e);y=y||r}));var _=this._itemHandlers.cast().where(this._filterHiddenItems),b=!1;if(_.any()){var v=_.select((function(t){return t.getTransformedRectangle(!1,!0)})).aggregate((function(t,e){return o.RotatedRectangleF.union(t,e)})),w=this._getSourceRectangleByAnchorPoint(v,d,u,h);if(t){var C=Object(f.i)(w.center,a);w.setTransform(C)}this._itemHandler.setSourceRectangle(w),b=!i.equals(w,.01)}var P=y||b;return P&&(null===(e=this._itemHandler.canvas)||void 0===e||e.updateTexts()),P}},t.prototype._getSourceRectangleByAnchorPoint=function(t,e,n,r){var a=t.angle,s=t.toRectangleF();if(n==i.e.horizontal)if(r==i.c.start)s.left=e.x;else if(r==i.c.center){var l=s.center.x-e.x;s.left-=l}else s.right=e.x;else if(r==i.c.start)s.top=e.y;else if(r==i.c.center){var u=s.center.y-e.y;s.top-=u}else s.bottom=e.y;return o.RotatedRectangleF.fromRectangleF(s,a)},t.prototype._getAnchorPoint=function(t,e,n){if(n==i.e.horizontal){var r=t.center.y;switch(e){case i.c.start:return new o.PointF(t.left,r);case i.c.center:return new o.PointF(t.center.x,r);case i.c.end:return new o.PointF(t.right,r)}}else{var a=t.center.x;switch(e){case i.c.start:return new o.PointF(a,t.top);case i.c.center:return new o.PointF(a,t.center.y);case i.c.end:return new o.PointF(a,t.bottom)}}},t.prototype._applyAnchor=function(t,e,n,r){if(0==t.length)return t;if(n==i.c.start)return t;var a=function(t){var a=0,s=0,l=t.reduce((function(t,e){return o.RectangleF.union(t,e)}));if(r==i.e.horizontal)if(n==i.c.center)a=l.center.x-e.center.x;else{if(n!=i.c.end)throw new Error("Invalid _applyAnchor operation. Orientation: '"+r+"' AnchorPoint: '"+n+"'");a=l.right-e.right}else if(n==i.c.center)s=l.center.y-e.center.y;else{if(n!=i.c.end)throw new Error("Invalid _applyAnchor operation. Orientation: '"+r+"' AnchorPoint: '"+n+"'");s=l.bottom-e.bottom}return new o.PointF(a,s)}(t);return t.map((function(t){return new o.RectangleF(t.left-a.x,t.top-a.y,t.width,t.height)}))},t.prototype._setItemHandlerPosition=function(t,e,n){var r=this,i=function(t){var o=t.getTransformedRectangle(!1,!0),a=o.clone();o.rotateAt(-e.angle,e.center);var s=o.bounds,l=n.left-s.left,u=n.top-s.top;return o.translate(l,u),o.rotateAt(e.angle,e.center),!a.equals(o)&&(r._setItemHandlerRectangle(t,o,i),!0)};return i(t)},t.prototype._setItemHandlerRectangle=function(t,e,n){var r=t.getBorderMargin();e.width-=2*r,e.height-=2*r,t instanceof C?t.setRectangle(e,!0,!0):(t.setRectangle(e),t instanceof p.m&&t.updateContentAndFrames(n),t instanceof a.a&&t.getNestedItemHandlers(!0).forEach((function(t){n(t)})))},t.prototype._getPositionRectOffset=function(t,e,n){return t==i.e.vertical?n.bottom-e.top:n.right-e.left},t.prototype._getItemHandlerPositionRect=function(t,e,n,r,o){var a=t.getTransformedRectangle(!1,!0);a.angle-=e.angle;var s=a.bounds,l=this._getOriginalPoint(s,r,o),u=n.x-l.x,c=n.y-l.y;return r===i.b.none&&o!==i.e.horizontal||(s.left+=u),r===i.b.none&&o!==i.e.vertical||(s.top+=c),s},t.prototype._getOriginalPoint=function(t,e,n,r){var a;return void 0===r&&(r=0),n==i.e.vertical?(a=e==i.b.start||e==i.b.none?new o.PointF(t.left,t.top):e==i.b.center?new o.PointF(t.center.x,t.top):new o.PointF(t.right,t.top)).y+=r:(a=e==i.b.start||e==i.b.none?new o.PointF(t.left,t.top):e==i.b.center?new o.PointF(t.left,t.center.y):new o.PointF(t.left,t.bottom)).x+=r,a},t}(),y=n(462),_=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},v=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},w=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},C=function(t){function e(n,r,i,o){void 0===o&&(o=null);var a=t.call(this,n,r,o)||this;return a._history=i,a._layoutEvent=new h.a,a._visibilityState=null,a._visibilityStateChangedEvent=new h.a,a._isEmpty=null,a._rectMap={},a._onChildItemChanged=function(t){var e=a.canvas.viewer.getHandler(t),n=e.rectangle;n.equals(a._rectMap[e.uniqueId])||(a._rectMap[e.uniqueId]=n,a.applyLayout())},a._onChildItemHandlerVisibilityChanged=function(){a._updateVisibilityState(),a.applyLayout()},a._onChildItemHandlerLayout=function(t){t&&(a._updateVisibilityState(),a.applyLayout())},a._onChildItemHandlerChanging=function(t){null!=a._layoutHandler&&a._layoutHandler instanceof m||a._resetSourceRectangle(),a.raiseChanging(a.item)},a._transformStarted=!1,a._transformedRectangle=null,a._applyMatrix=function(t,n,r){void 0===r&&(r=null);var i=function(e){return e.setRectangle(e.rectangle.transformByMatrix(t,r),!n)};if(i(a),a._transformStarted)for(var o=[a];o.length>0;)o.shift().itemHandlers.ofType(s.a).forEach((function(t){i(t),t instanceof e&&o.push(t),t instanceof l.a&&null!=t.content&&i(t.content)}))},a._onItemHandlerExitedEditMode=function(t){a._updateVisibilityState()},a._onItemHandlerEnteredEditMode=function(t){a._updateVisibilityState()},a._onChildGroupItemsChanged=function(t,e){"items"==e&&a._subscribeChildItemChanges(t)},a._subscribeChildItemHandlers(),a}return _(e,t),e.prototype.setItemHandlers=function(e){var n=this;this._unsubscribeChildItemHandlers(),t.prototype.setItemHandlers.call(this,e),this._initSourceRectangle().then((function(){n._initLayoutHandler(),n.applyLayout(null)})),this._subscribeChildItemHandlers()},e.prototype._isGroupHandler=function(){return!0},e.prototype._onItemPropertyChanged=function(t,e){"layoutSettings"===e&&this._initLayoutHandler()},e.prototype._initLayoutHandler=function(){this.item.layoutSettings instanceof i.f?this._layoutHandler instanceof m?this._layoutHandler._init():(this._layoutHandler=new m(this.item,this.itemHandlers,this,this._history),this._layoutHandler.getLayoutEvent().add(this._onLayoutHandlerLayoutEvent.bind(this))):(null!=this._layoutHandler&&this._layoutHandler.dispose(),this._layoutHandler=null)},e.prototype.getVisibilityStateChangedEvent=function(){return this._visibilityStateChangedEvent},e.prototype.getLayoutEvent=function(){return this._layoutEvent},e.prototype._onLayoutHandlerLayoutEvent=function(t){null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.updateButtonGroups(),this.getChangingEvent().notify(this.item),this.updateViolationContainerPosition(),this.canvas.redraw()),this._layoutEvent.notify(t)},e.prototype._initSourceRectangle=function(){return b(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return this.item.sourceRectangle&&!this.item.sourceRectangle.isEmpty()?[2]:[4,this._resetSourceRectangle()];case 1:return t.sent(),[2]}}))}))},e.prototype._resetSourceRectangle=function(){return b(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,this.waitUpdate()];case 1:return e.sent(),this.itemHandlers.any()&&(t=this.itemHandlers.cast().select((function(t){return t.rectangle})).aggregate((function(t,e){return o.RotatedRectangleF.union(t,e)})),this.setSourceRectangle(t)),[2]}}))}))},e.prototype.waitUpdate=function(){return b(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.itemHandlers.toArray().map((function(t){return t.waitUpdate()})))];case 1:return t.sent(),[2]}}))}))},e.prototype.startTransform=function(e){this._originalHeight=this.height,this._transformStarted=!0,this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!0),t.prototype.startTransform.call(this,e)},e.prototype.onResized=function(){var e=this.height/this._originalHeight;return null!=this.item.layoutSettings&&this.item.layoutSettings instanceof i.f&&(this.item.layoutSettings.margin*=e),t.prototype.onResized.call(this)},e.prototype._endTransform=function(e,n,r){var i,o,a,s;if(t.prototype._endTransform.call(this,e,n,r),null==this._transformedRectangle)return this._transformStarted=!1,void(this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!1));null===(i=this.canvas)||void 0===i||i.pauseRedraw();var l=this._transformedRectangle;this._transformedRectangle=null,this._transformStarted=!1,null===(o=this._history)||void 0===o||o.pause(),this.setSourceRectangle(l),this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!1),this.applyLayout(null),null===(a=this._history)||void 0===a||a.resume(!0,!1,!0),null===(s=this.canvas)||void 0===s||s.continueRedraw()},e.prototype._getChildrenHighlights=function(){var t=this;if(null==this._layoutHandler)return[];var e=[];return this.itemHandlers.toArray().filter((function(e){return t._layoutHandler._filterHiddenItems(e)})).forEach((function(t){return e.push.apply(e,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(w(arguments[e]));return t}(t.getHighlightRectangles()))})),e},Object.defineProperty(e.prototype,"_calculateRectangleFromChild",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype._getRectangle=function(){return this._transformedRectangle?this._transformedRectangle:t.prototype._getRectangle.call(this)},e.prototype.isEmpty=function(){var t=this._calculateIsEmpty();return this._updateIsEmpty(t),t},e.prototype.isVisible=function(){return t.prototype.isVisible.call(this)&&!this.isEmpty()},e.prototype.applyLayout=function(t){t instanceof l.a&&t.editing||(this.item.layoutSettings instanceof i.f&&this._layoutHandler?this._layoutHandler.applyLayout():(this._resetSourceRectangle(),this._onLayoutHandlerLayoutEvent(!1)))},e.prototype.getControlBounds=function(){return this.item.sourceRectangle?this.item.sourceRectangle:new o.RectangleF},e.prototype.setRectangle=function(e,n,r){if(void 0===r&&(r=!0),this._transformStarted)return this._transformedRectangle=e.clone(),void(r&&t.prototype.setRectangle.call(this,e,n));r&&t.prototype.setRectangle.call(this,e,n),this.setSourceRectangle(e)},e.prototype.setSourceRectangle=function(t){this.item.sourceRectangle=t.toRectangleF(),this.item.transform=new o.Transform(1,1,0,0,t.angle)},e.prototype.getOrderedItems=function(){return this.item.layoutSettings instanceof i.f&&null!=this._layoutHandler?this._layoutHandler.getOrderedItems():t.prototype.getOrderedItems.call(this)},e.prototype.generateAndApplyAutolayoutSettings=function(t,e,n,r){this.item.layoutSettings=i.R.generateAutoLayoutSettings(this.itemHandlers.toArray().map((function(t){return t.getTransformedRectangle(!1,!0).bounds})),t,e,n,r)},e.prototype._onItemAdded=function(e){return b(this,void 0,void 0,(function(){return v(this,(function(n){switch(n.label){case 0:return t.prototype._onItemAdded.call(this,e),e.item instanceof i.o?[4,c.a.waitForItemsUpdated([e.item],this.canvas)]:[3,2];case 1:n.sent(),n.label=2;case 2:return this._subscribeChildItemChanges(e.item),this.applyLayout(this.itemHandlers.first((function(t){return t.item===e.item}))),[2]}}))}))},e.prototype._onItemRemoved=function(e){t.prototype._onItemRemoved.call(this,e),this._unsubscribeChildItemChanges(e.item),this._layoutHandler?this._layoutHandler.onItemRemoved(e):this._resetSourceRectangle()},e.prototype._onItemHandlerAdded=function(e){return b(this,void 0,void 0,(function(){return v(this,(function(n){switch(n.label){case 0:return t.prototype._onItemHandlerAdded.call(this,e),this._layoutHandler instanceof m&&this._layoutHandler.onItemHandlersCollectionChanged(),[4,this.waitUpdate()];case 1:return n.sent(),this.applyLayout(),[2]}}))}))},e.prototype._updateVisibilityState=function(){var t=this.isVisible();t!==this._visibilityState&&(this._visibilityState=t,this._onVisibilityStateChanged())},e.prototype._onVisibilityStateChanged=function(){this.applyLayout(),this._visibilityStateChangedEvent.notify()},e.prototype._onItemHandlerRemoved=function(e){t.prototype._onItemHandlerRemoved.call(this,e),this._layoutHandler instanceof m&&this._layoutHandler.onItemHandlersCollectionChanged()},e.prototype._subscribeChildItemHandlers=function(){var t,e=this;null===(t=this.itemHandlers)||void 0===t||t.forEach((function(t){return e._subscribeChildItemHandler(t)}))},e.prototype._unsubscribeChildItemHandlers=function(){var t=this;this.itemHandlers.forEach((function(e){return t._unsubscribeChildItemHandler(e)}))},e.prototype._subscribeChildItemHandler=function(t){t.getChangingEvent().add(this._onChildItemHandlerChanging),t instanceof y.a&&(t.exitedEditModeEvent.add(this._onItemHandlerExitedEditMode),t.enteredEditModeEvent.add(this._onItemHandlerEnteredEditMode)),t instanceof e&&(t.getLayoutEvent().add(this._onChildItemHandlerLayout),t.getVisibilityStateChangedEvent().add(this._onChildItemHandlerVisibilityChanged))},e.prototype._unsubscribeChildItemHandler=function(t){t.getChangingEvent().remove(this._onChildItemHandlerChanging),t instanceof y.a&&(t.exitedEditModeEvent.remove(this._onItemHandlerExitedEditMode),t.enteredEditModeEvent.remove(this._onItemHandlerEnteredEditMode)),t instanceof e&&(t.getLayoutEvent().remove(this._onChildItemHandlerLayout),t.getVisibilityStateChangedEvent().remove(this._onChildItemHandlerVisibilityChanged))},e.prototype._unsubscribeChildItems=function(){var t=this;this.item.items.forEach((function(e){return t._unsubscribeChildItemChanges(e)}))},e.prototype._subscribeChildItems=function(){var t=this;this.item.items.forEach((function(e){return t._subscribeChildItemChanges(e)}))},e.prototype._unsubscribeChildItemChanges=function(t){var e=this;t instanceof i.G&&(t.applyToItems((function(t){return e._unsubscribeChildItemChanges(t)})),t.removePropertyChanged(this._onChildGroupItemsChanged)),t.getItemChangedEvent().remove(this._onChildItemChanged)},e.prototype._subscribeChildItemChanges=function(t){var e=this;t instanceof i.G&&(t.applyToItems((function(t){return e._subscribeChildItemChanges(t)})),t.addPropertyChanged(this._onChildGroupItemsChanged)),t.getItemChangedEvent().add(this._onChildItemChanged)},e.prototype._onRemovedFromCanvas=function(e){return b(this,void 0,void 0,(function(){return v(this,(function(n){return this._unsubscribeChildItems(),this._unsubscribeChildItemHandlers(),t.prototype._onRemovedFromCanvas.call(this,e),[2]}))}))},e.prototype._onAddedOnCanvas=function(e){return b(this,void 0,void 0,(function(){return v(this,(function(n){switch(n.label){case 0:return t.prototype._onAddedOnCanvas.call(this,e),this._subscribeChildItems(),this._initLayoutHandler(),[4,this._initSourceRectangle()];case 1:return n.sent(),[2]}}))}))},e.prototype.drawItemHandler=function(e){this.isEmpty()||t.prototype.drawItemHandler.call(this,e)},Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype.isChildVisible=function(t){return!(t instanceof u.a||t instanceof y.a)||!t.isEmpty()},e.prototype._calculateIsEmpty=function(){var t=this.itemHandlers.where((function(t){var n=!1;return((t instanceof u.a||t instanceof y.a)&&!t.isLocked()||t instanceof e)&&(n=!0),n}));return!!t.any()&&!t.any((function(t){return!t.isEmpty()}))},e.prototype._updateIsEmpty=function(t){t!==this._isEmpty&&(this._isEmpty=t,this._onEmptyStateChanged())},e.prototype._onEmptyStateChanged=function(){this.itemHandlers.forEach((function(t){return t.update()}))},e.typeName="LayoutItemHandler",e}(a.a)},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(26),i=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Object(r.a)(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(n(127).a)},,,,,function(t,e,n){var r,i;
/**
* Monet.js 0.9.3
*
* (c) 2012-2021 Chris Myers
* @license Monet.js may be freely distributed under the MIT license.
* For all details and documentation:
* https://monet.github.io/monet.js/
*/"undefined"!=typeof self&&self,r=function(){"use strict";var t={apply2:I,assign:v(Object.assign)?Object.assign:function(t,e){for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t[n]=e[n]);return t},compose:b,curry:_(S(_),[])([]),idFunction:w,isFunction:v,noop:y,swap:S},e="@@type",n="monet.js",r="Identity",i="Maybe",o="Either",a="Validation",s="List",l="NEL",u="IO",c="MonadT",h="Reader",p="Free";function f(t,r){t[e]=n+"/"+r}function d(t){return function(r){return(r[e]||r.constructor[e])===n+"/"+t}}function g(t){return function(n){var r=n[e]||n.constructor&&n.constructor[e];return Boolean(r)&&r.length>=t.length&&r.indexOf(t)===r.length-t.length}}function m(t){return null==t}function y(){}function _(t,e){return function(){var n=e.concat(function(t){return Array.prototype.slice.call(t)}(arguments));return n.length>=t.length?t.apply(null,n.slice(0,n.length)):_(t,n)}}function b(t,e){return function(n){return t(e(n))}}function v(t){return Boolean(t&&t.constructor&&t.call&&t.apply)}function w(t){return t}function C(t,e){return t===e||t!=t&&e!=e||!(!t||!e)&&!(!v(t.equals)||!v(e.equals))&&t.equals(e)}function P(t){return function(e){return C(t,e)}}function x(){return!1}function S(t){return function(e,n){return t(n,e)}}function I(t,e,n){return e.ap(t.map(_(n,[])))}function O(t,e){for(var n=t,r=e;!n.isNil&&!r.isNil;){if(!P(n.head())(r.head()))return!1;n=n.tail(),r=r.tail()}return n.isNil&&r.isNil}function T(t,e){return e.isNil?lt(e):st((function(){return T(t,e.tail())})).map(_(F,[])(t(e.head())))}function E(t,e){return T(t,e).run()}function L(t,e){return t.foldRight(M)((function(t,n){return e(t)?F(t,n):n}))}function R(t,e){if(t.isNil)return lt(K());var n=t.head();return e(n)?lt(X(n)):st((function(){return R(t.tail(),e)}))}function k(t,e){return R(t,e).run()}function j(t,e){return t.isNil?lt(!1):C(t.head(),e)?lt(!0):st((function(){return j(t.tail(),e)}))}function A(t,e){return j(t,e).run()}function F(t,e){return e.cons(t)}function B(){switch(arguments.length){case 0:return new B.fn.init;case 1:return new B.fn.init(arguments[0]);default:return new B.fn.init(arguments[0],arguments[1])}}t.List=B;var M,N=function(t,e){e.isNil||(t(e.head()),N(t,e.tail()))},z=function(t,e,n){return function e(n,r){return r.isNil?lt(n):st((function(){return e(t(n,r.head()),r.tail())}))}(e,n).run()},D=function(t,e,n){return function e(n,r){return n.isNil?lt(r):st((function(){return e(n.tail(),r)})).map((function(e){return t(n.head(),e)}))}(e,n).run()},H=function(t,e){return function t(e,n){return e.isNil?lt(n):st((function(){return t(e.tail(),n).map((function(t){return t.cons(e.head())}))}))}(t,e).run()},W=function(t,e){return t.foldRight(e.of(M))(e.map2(F))},U=function(t){return t.foldLeft(M)(S(F))},V=function(t,e){return t.bind((function(t){return e.map((function(e){return e(t)}))}))};function q(t){return new Error("Cannot create an empty Non-Empty List. Passed head is "+t+".")}function G(t,e){if(m(t))throw q(t);return new G.fn.init(t,e)}B.fn=B.prototype={init:function(){var t=arguments[0],e=arguments[1];0===arguments.length?(this.isNil=!0,this.size_=0):(this.isNil=!1,this.head_=t,this.tail_=e||M,this.size_=this.tail_.size()+1),f(this,s)},of:function(t){return new B(t)},size:function(){return this.size_},equals:function(t){return(B.isOfType(t)||G.isOfType(t))&&O(this,t)},cons:function(t){return B(t,this)},snoc:function(t){return this.concat(B(t))},map:function(t){return E(t,this)},toArray:function(){return z((function(t,e){return t.push(e),t}),[],this)},toSet:function(){return new Set(this)},foldLeft:function(t){var e=this;return function(n){return z(n,t,e)}},foldRight:function(t){var e=this;return function(n){return D(n,e,t)}},append:function(t){return H(this,t)},filter:function(t){return L(this,t)},find:function(t){return k(this,t)},flatten:function(){return D(H,this,M)},flattenMaybe:function(){return this.flatMap($.toList)},reverse:function(){return U(this)},bind:function(t){return this.map(t).flatten()},forEach:function(t){N(t,this)},contains:function(t){return A(this,t)},sequenceMaybe:function(){return W(this,$)},sequenceValidation:function(){return this.foldLeft(J(M))((function(t,e){return t.ap(e.map((function(t){return function(e){return F(t,e)}})))})).map(U)},sequenceEither:function(){return W(this,nt)},sequenceIO:function(){return W(this,et)},sequenceReader:function(){return W(this,ot)},sequence:function(t){return W(this,t)},head:function(){return this.head_},headMaybe:function(){return this.isNil?K():X(this.head_)},lookup:function(t){return this.isNil||t>=this.size()?K():$.fromNull(this.toArray()[t])},nth:function(t){return this.isNil||t>=this.size()?void 0:this.toArray()[t]},tail:function(){return this.isNil?M:this.tail_},tails:function(){return this.isNil?B(M,M):this.tail().tails().cons(this)},ap:function(t){return V(this,t)},apTo:function(t){return V(t,this)},isNEL:x,toString:function(){return this.isNil?"Nil":"List("+this.toArray().join(", ")+")"},inspect:function(){return this.toString()}},B.fn.init.prototype=B.fn,f(B,s),f(B.fn.init,s),B.isInstance=d(s),B.isOfType=g(s),B.prototype.empty=function(){return M},B.fromArray=function(t){return t.reduceRight((function(t,e){return t.cons(e)}),M)},B.from=function(t){return B.fromArray(Array.from(t))},B.of=function(t){return new B(t,M)},B.prototype.each=B.prototype.forEach,M=t.Nil=new B.fn.init,t.NEL=t.NonEmptyList=G,G.of=function(t){return G(t,M)},G.fn=G.prototype={init:function(t,e){if(m(t))throw q(t);this.isNil=!1,this.head_=t,this.tail_=m(e)?M:e,this.size_=this.tail_.size()+1,f(this,l)},equals:function(t){return B.isOfType(t)||G.isOfType(t)&&O(this,t)},cons:function(t){return G(t,this.toList())},snoc:function(t){return this.concat(G(t))},map:function(t){return G(t(this.head_),E(t,this.tail_))},bind:function(t){var e=t(this.head_);if(!e.isNEL())throw new Error("NEL.fn.bind: Passed function must return a NonEmptyList.");var n=this.tail().foldLeft(M.snoc(e.head()).append(e.tail()))((function(e,n){var r=t(n).toList();return e.snoc(r.head()).append(r.tail())}));return new G(n.head(),n.tail())},head:function(){return this.head_},lookup:function(t){return t>=this.size()?K():$.fromNull(this.toArray()[t])},nth:function(t){return t>=this.size()?void 0:this.toArray()[t]},tail:function(){return this.tail_},tails:function(){var t=this.toList().tails().map(G.fromList).flattenMaybe();return G(t.head(),t.tail())},toList:function(){return B(this.head_,this.tail_)},reverse:function(){if(this.tail().isNil)return this;var t=this.tail().reverse();return G(t.head(),t.tail().append(B(this.head())))},foldLeft:function(t){return this.toList().foldLeft(t)},foldRight:function(t){return this.toList().foldRight(t)},reduceLeft:function(t){return this.tail().foldLeft(this.head())(t)},filter:function(t){return L(this.toList(),t)},find:function(t){return k(this.toList(),t)},flatten:function(){return D(H,this.toList().map((function(t){return t.isNEL()?t.toList():t})),M)},flattenMaybe:function(){return this.toList().flatMap($.toList)},contains:function(t){return A(this.toList(),t)},append:function(t){return G.fromList(this.toList().append(t.toList())).some()},cobind:function(t){return this.cojoin().map(t)},size:function(){return this.size_},forEach:function(t){return this.toList().forEach(t)},isNEL:function(){return!0},toString:function(){return"NEL("+this.toArray().join(", ")+")"},inspect:function(){return this.toString()}},G.fromList=function(t){return t.isNil?K():X(G(t.head(),t.tail()))},G.fromArray=function(t){return G.fromList(B.fromArray(t))},G.from=function(t){return G.fromList(B.from(t))},G.fn.init.prototype=G.fn,f(G,l),f(G.fn.init,l),G.isInstance=d(l),G.isOfType=g(l),G.prototype.toArray=B.prototype.toArray,G.prototype.toSet=B.prototype.toSet,G.prototype.extract=G.prototype.copure=G.prototype.head,G.prototype.cojoin=G.prototype.tails,G.prototype.coflatMap=G.prototype.mapTails=G.prototype.cobind,G.prototype.ap=B.prototype.ap,G.prototype.apTo=B.prototype.apTo;var $=t.Maybe={};$.fromFalsy=function(t){return t?$.Some(t):$.None()},$.fromNull=function(t){return m(t)?$.None():$.Some(t)},$.fromUndefined=function(t){return void 0===t?$.None():$.Some(t)},$.fromEmpty=function(t){return m(e=t)||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length?$.None():$.Some(t);var e},$.of=function(t){return X(t)};var X=$.Just=$.Some=$.some=t.Some=t.Just=function(t){return new $.fn.init(!0,t)},K=$.Nothing=$.None=$.none=t.None=t.Nothing=function(){return new $.fn.init(!1,null)};$.toList=function(t){return t.toList()},$.fn=$.prototype={init:function(t,e){if(this.isValue=t,t&&m(e))throw new Error("Can not create Some with illegal value: "+e+".");this.val=e,f(this,i)},isSome:function(){return this.isValue},isNone:function(){return!this.isSome()},bind:function(t){return this.isValue?t(this.val):this},some:function(){if(this.isValue)return this.val;throw new Error("Cannot call .some() on a None.")},orSome:function(t){return this.isValue?this.val:t},orLazy:function(t){return this.cata(t,w)},orNull:function(){return this.orSome(null)},orUndefined:function(){return this.orSome(void 0)},orElse:function(t){return this.catchMap((function(){return t}))},ap:function(t){var e=this.val;return this.isValue?t.map((function(t){return t(e)})):this},apTo:function(t){return t.ap(this)},equals:function(t){return $.isOfType(t)&&this.cata((function(){return t.isNone()}),(function(e){return t.fold(!1)(P(e))}))},toArray:function(){return this.map((function(t){return[t]})).orLazy((function(){return[]}))},toSet:function(){return new Set(this)},toList:function(){return this.map(B).orLazy((function(){return M}))},toEither:function(t){return this.isSome()?rt(this.val):it(t)},toValidation:function(t){return this.isSome()?J(this.val):Z(t)},fold:function(t){var e=this;return function(n){return e.isSome()?n(e.val):t}},foldLeft:function(t){return this.toList().foldLeft(t)},foldRight:function(t){return this.toList().foldRight(t)},cata:function(t,e){return this.isSome()?e(this.val):t()},catchMap:function(t){return this.isSome()?this:t()},filter:function(t){var e=this;return e.flatMap((function(n){return t(n)?e:K()}))},orNoneIf:function(t){return t?K():this},contains:function(t){return!!this.isSome()&&C(this.val,t)},forEach:function(t){this.cata(y,t)},orElseRun:function(t){this.cata(t,y)},toString:function(){return this.isSome()?"Just("+this.val+")":"Nothing"},inspect:function(){return this.toString()}},$.prototype.orJust=$.prototype.getOrElse=$.prototype.orSome,$.prototype.just=$.prototype.some,$.prototype.isJust=$.prototype.isSome,$.prototype.isNothing=$.prototype.isNone,$.prototype.orNothingIf=$.prototype.orNoneIf,$.fn.init.prototype=$.fn,f($,i),f($.fn.init,i),$.isInstance=d(i),$.isOfType=g(i);var Y=t.Validation={},J=Y.Success=Y.success=t.Success=function(t){return new Y.fn.init(t,!0)},Z=Y.Fail=Y.fail=t.Fail=function(t){return new Y.fn.init(t,!1)};Y.of=function(t){return J(t)},Y.fn=Y.prototype={init:function(t,e){this.val=t,this.isSuccessValue=e,f(this,a)},success:function(){if(this.isSuccess())return this.val;throw new Error("Cannot call success() on a Fail.")},isSuccess:function(){return this.isSuccessValue},isFail:function(){return!this.isSuccessValue},fail:function(){if(this.isSuccess())throw new Error("Cannot call fail() on a Success.");return this.val},bind:function(t){return this.isSuccess()?t(this.val):this},ap:function(t){var e=this.val;return this.isSuccess()?t.map((function(t){return t(e)})):t.isFail()?Y.Fail(Q.append(e,t.fail())):this},apTo:function(t){return t.ap(this)},acc:function(){var t=function(){return t};return this.isSuccessValue?Y.success(t):this},foldLeft:function(t){return this.toMaybe().toList().foldLeft(t)},foldRight:function(t){return this.toMaybe().toList().foldRight(t)},cata:function(t,e){return this.isSuccessValue?e(this.val):t(this.val)},catchMap:function(t){return this.isSuccess()?this:t(this.val)},swap:function(){return this.isSuccess()?Z(this.val):J(this.val)},failMap:function(t){return this.isFail()?Z(t(this.val)):this},bimap:function(t,e){return this.isSuccessValue?this.map(e):this.failMap(t)},forEach:function(t){this.cata(y,t)},forEachFail:function(t){this.cata(t,y)},equals:function(t){return Y.isOfType(t)&&this.cata((function(e){return t.cata(P(e),x)}),(function(e){return t.cata(x,P(e))}))},toMaybe:function(){return this.isSuccess()?X(this.val):K()},toEither:function(){return(this.isSuccess()?rt:it)(this.val)},toString:function(){return(this.isSuccess()?"Success(":"Fail(")+this.val+")"},inspect:function(){return this.toString()}},Y.prototype.fold=Y.prototype.cata,Y.fn.init.prototype=Y.fn,f(Y,a),f(Y.fn.init,a),Y.isInstance=d(a),Y.isOfType=g(a);var Q=t.Semigroup={append:function(t,e){if(v(t.concat))return t.concat(e);throw new Error("Couldn't find a semigroup appender in the environment, please specify your own append function")}},tt=t.monadTransformer=t.MonadT=t.monadT=function(t){return new tt.fn.init(t)};tt.of=function(t){return tt(t)},tt.fn=tt.prototype={init:function(t){this.monad=t,f(Y,c)},map:function(t){return tt(this.monad.map((function(e){return e.map(t)})))},bind:function(t){return tt(this.monad.map((function(e){return e.flatMap(t)})))},ap:function(t){return tt(this.monad.flatMap((function(e){return t.perform().map((function(t){return e.ap(t)}))})))},perform:function(){return this.monad}},tt.fn.init.prototype=tt.fn;var et=t.IO=t.io=function(t){return new et.fn.init(t)};et.of=function(t){return et((function(){return t}))},et.fn=et.prototype={init:function(t){if(!v(t))throw new Error("IO requires a function.");this.effectFn=t,f(this,u)},map:function(t){var e=this;return et((function(){return t(e.effectFn())}))},bind:function(t){var e=this;return et((function(){return t(e.effectFn()).run()}))},ap:function(t){var e=this;return t.map((function(t){return t(e.effectFn())}))},apTo:function(t){return t.ap(this)},run:function(){return this.effectFn()}},et.fn.init.prototype=et.fn,f(et,u),f(et.fn.init,u),et.isInstance=d(u),et.isOfType=g(u),et.prototype.perform=et.prototype.performUnsafeIO=et.prototype.run;var nt=t.Either={};nt.of=function(t){return rt(t)},nt.fromTry=function(t){try{return nt.right(t())}catch(e){return nt.left(e)}},nt.fromPromise=function(t){return t.then(nt.Right,nt.Left)};var rt=nt.Right=nt.right=t.Right=function(t){return new nt.fn.init(t,!0)},it=nt.Left=nt.left=t.Left=function(t){return new nt.fn.init(t,!1)};nt.fn=nt.prototype={init:function(t,e){this.isRightValue=e,this.value=t,f(this,o)},bind:function(t){return this.isRightValue?t(this.value):this},ap:function(t){var e=this;return this.isRightValue?t.map((function(t){return t(e.value)})):this},apTo:function(t){return t.ap(this)},leftMap:function(t){return this.isLeft()?it(t(this.value)):this},isRight:function(){return this.isRightValue},isLeft:function(){return!this.isRight()},right:function(){if(this.isRightValue)return this.value;throw new Error("Cannot call right() on a Left.")},left:function(){if(this.isRightValue)throw new Error("Cannot call left() on a Right.");return this.value},foldLeft:function(t){return this.toMaybe().toList().foldLeft(t)},foldRight:function(t){return this.toMaybe().toList().foldRight(t)},cata:function(t,e){return this.isRightValue?e(this.value):t(this.value)},catchMap:function(t){return this.isRight()?this:t(this.value)},swap:function(){return this.isRight()?it(this.value):rt(this.value)},forEach:function(t){this.cata(y,t)},forEachLeft:function(t){this.cata(t,y)},equals:function(t){return nt.isOfType(t)&&this.cata((function(e){return t.cata(P(e),x)}),(function(e){return t.cata(x,P(e))}))},bimap:function(t,e){return this.isRightValue?this.map(e):this.leftMap(t)},toMaybe:function(){return this.isRight()?X(this.value):K()},toValidation:function(){return this.isRight()?J(this.value):Z(this.value)},toString:function(){return this.cata((function(t){return"Left("+t+")"}),(function(t){return"Right("+t+")"}))},toPromise:function(){return this.cata((function(t){return Promise.reject(t)}),(function(t){return Promise.resolve(t)}))},inspect:function(){return this.toString()}},nt.prototype.fold=nt.prototype.cata,nt.fn.init.prototype=nt.fn,f(nt,o),f(nt.fn.init,o),nt.isInstance=d(o),nt.isOfType=g(o);var ot=t.Reader=function(t){return new ot.fn.init(t)};ot.of=function(t){return ot((function(e){return t}))},ot.ask=function(){return ot(w)},ot.fn=ot.prototype={init:function(t){this.f=t,f(this,h)},run:function(t){return this.f(t)},bind:function(t){var e=this;return ot((function(n){return t(e.run(n)).run(n)}))},ap:function(t){var e=this;return t.bind((function(t){return ot((function(n){return t(e.run(n))}))}))},apTo:function(t){return t.ap(this)},map:function(t){var e=this;return ot((function(n){return t(e.run(n))}))},local:function(t){var e=this;return ot((function(n){return e.run(t(n))}))}},ot.fn.init.prototype=ot.fn,f(ot,h),f(ot.fn.init,h),ot.isInstance=d(h),ot.isOfType=g(h);var at=t.Free={},st=at.Suspend=t.Suspend=function(t){return new at.fn.init(t,!0)},lt=at.Return=t.Return=function(t){return new at.fn.init(t,!1)};function ut(t){return new ut.fn.init(t)}function ct(t){(function(t){t.prototype.flatMap=t.prototype.chain=t.prototype.bind,t.pure=t.unit=t.of,t.prototype.of=t.of,v(t.prototype.append)&&(t.prototype.concat=t.prototype.append),t.prototype.point=t.prototype.pure=t.prototype.unit=t.prototype.of})(t),function(t){v(t.prototype.filter)&&(t.prototype.filterNot=function(t){return this.filter((function(e){return!t(e)}))})}(t),function(t){t.prototype.join=function(){return this.flatMap(w)},t.map2=function(t){return function(e,n){return e.flatMap((function(e){return n.map((function(n){return t(e,n)}))}))}}}(t),function(t){v(t.prototype.map)||(t.prototype.map=function(t){return this.bind(b(this.of,t))})}(t),function(t){t.prototype.takeLeft=function(t){return I(this,t,(function(t,e){return t}))},t.prototype.takeRight=function(t){return I(this,t,(function(t,e){return e}))}}(t),function(t){v(t.prototype.toArray)&&(t.prototype.every=t.prototype.forall=function(t){return this.toArray().every(t)},t.prototype.exists=function(t){return this.toArray().some(t)})}(t),function(t){["equals","map","ap","chain"].filter((function(e){return v(t.prototype[e])})).forEach((function(e){t.prototype["fantasy-land/"+e]=t.prototype[e]}))}(t),function(t){v(t.prototype.toArray)&&(t.prototype[Symbol.iterator]=function(){return this.toArray()[Symbol.iterator]()})}(t),function(t){v(t.prototype.toArray)&&(t.prototype.to=function(t){return t(this)})}(t)}return at.of=function(t){return lt(t)},at.liftF=function(t){return v(t)?st(b(lt,t)):st(t.map(lt))},at.fn=at.prototype={init:function(t,e){this.isSuspend=e,e?this.functor=t:this.val=t,f(this,p)},run:function(){return this.go((function(t){return t()}))},bind:function(t){return this.isSuspend?v(this.functor)?st(b((function(e){return e.bind(t)}),this.functor)):st(this.functor.map((function(e){return e.bind(t)}))):t(this.val)},ap:function(t){return this.bind((function(e){return t.map((function(t){return t(e)}))}))},apTo:function(t){return t.ap(this)},resume:function(){return this.isSuspend?it(this.functor):rt(this.val)},go1:function(t){return function e(n){return n.resume().cata((function(n){return e(t(n))}),w)}(this)},go:function(t){for(var e=this.resume();e.isLeft();){var n=t(e.left());e=n.resume()}return e.right()}},at.fn.init.prototype=at.fn,f(at,p),f(at.fn.init,p),at.isInstance=d(p),at.isOfType=g(p),t.Identity=ut,ut.of=function(t){return new ut(t)},ut.fn=ut.prototype={init:function(t){this.val=t,f(this,r)},bind:function(t){return t(this.val)},get:function(){return this.val},forEach:function(t){t(this.val)},equals:function(t){return ut.isOfType(t)&&P(this.get())(t.get())},contains:function(t){return C(this.val,t)},toString:function(){return"Identity("+this.val+")"},inspect:function(){return this.toString()},ap:function(t){var e=this.val;return t.map((function(t){return t(e)}))},apTo:function(t){return t.ap(this)},toArray:function(){return[this.get()]},toList:function(){return B(this.get(),M)},toSet:function(){return new Set(this)}},ut.fn.init.prototype=ut.fn,f(ut,r),f(ut.fn.init,r),ut.isInstance=d(r),ut.isOfType=g(r),ct(tt),ct(nt),ct($),ct(et),ct(G),ct(B),ct(Y),ct(ot),ct(at),ct(ut),t},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},function(t,e,n){var r;!function(i,o){var a={Identity:function(t){return t},True:function(){return!0},Blank:function(){}},s="boolean",l="number",u="string",c=typeof o,h="function",p={"":a.Identity},f={createLambda:function(t){if(null==t)return a.Identity;if(typeof t===u){var e=p[t];if(null!=e)return e;if(-1===t.indexOf("=>")){for(var n,r=new RegExp("[$]+","g"),i=0;null!=(n=r.exec(t));){var o=n[0].length;o>i&&(i=o)}for(var s=[],l=1;l<=i;l++){for(var c="",h=0;h<l;h++)c+="$";s.push(c)}var f=Array.prototype.join.call(s,",");return e=new Function(f,"return "+t),p[t]=e,e}var d=t.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return e=new Function(d[1],"return "+d[2]),p[t]=e,e}return t},isIEnumerable:function(t){if(typeof Enumerator!==c)try{return new Enumerator(t),!0}catch(e){}return!1},defineProperty:null!=Object.defineProperties?function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(t,e,n){t[e]=n},compare:function(t,e){return t===e?0:t>e?1:-1},dispose:function(t){null!=t&&t.dispose()},hasNativeIteratorSupport:function(){return"undefined"!=typeof Symbol&&void 0!==Symbol.iterator}},d=function(t,e,n){var r=new g,i=0;this.current=r.current,this.moveNext=function(){try{switch(i){case 0:i=1,t();case 1:return!!e.apply(r)||(this.dispose(),!1);case 2:return!1}}catch(n){throw this.dispose(),n}},this.dispose=function(){if(1==i)try{n()}finally{i=2}}},g=function(){var t=null;this.current=function(){return t},this.yieldReturn=function(e){return t=e,!0},this.yieldBreak=function(){return!1}},m=function(t){this.getEnumerator=t};(m.Utils={}).createLambda=function(t){return f.createLambda(t)},m.Utils.createEnumerable=function(t){return new m(t)},m.Utils.createEnumerator=function(t,e,n){return new d(t,e,n)},m.Utils.extendTo=function(t){var e,n=t.prototype;for(var r in t===Array?(e=v.prototype,f.defineProperty(n,"getSource",(function(){return this}))):(e=m.prototype,f.defineProperty(n,"getEnumerator",(function(){return m.from(this).getEnumerator()}))),e){var i=e[r];n[r]!=i&&(null!=n[r]&&n[r+="ByLinq"]==i||i instanceof Function&&f.defineProperty(n,r,i))}},m.choice=function(){var t=arguments;return new m((function(){return new d((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return this.yieldReturn(t[Math.floor(Math.random()*t.length)])}),a.Blank)}))},m.cycle=function(){var t=arguments;return new m((function(){var e=0;return new d((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return e>=t.length&&(e=0),this.yieldReturn(t[e++])}),a.Blank)}))},m.empty=function(){return new m((function(){return new d(a.Blank,(function(){return!1}),a.Blank)}))},m.from=function(t){if(null==t)return m.empty();if(t instanceof m)return t;if(typeof t==l||typeof t==s)return m.repeat(t,1);if(typeof t==u)return new m((function(){var e=0;return new d(a.Blank,(function(){return e<t.length&&this.yieldReturn(t.charAt(e++))}),a.Blank)}));if(typeof t!=h){if(typeof t.length==l)return new v(t);if("undefined"!=typeof Symbol&&void 0!==t[Symbol.iterator])return new m((function(){return new d(a.Blank,(function(){var e=t.next();return!e.done&&this.yieldReturn(e.value)}),a.Blank)}));if(!(t instanceof Object)&&f.isIEnumerable(t))return new m((function(){var e,n=!0;return new d((function(){e=new Enumerator(t)}),(function(){return n?n=!1:e.moveNext(),!e.atEnd()&&this.yieldReturn(e.item())}),a.Blank)}));if("object"==typeof Windows&&typeof t.first===h)return new m((function(){var e,n=!0;return new d((function(){e=t.first()}),(function(){return n?n=!1:e.moveNext(),e.hasCurrent?this.yieldReturn(e.current):this.yieldBreak()}),a.Blank)}))}return new m((function(){var e=[],n=0;return new d((function(){for(var n in t){var r=t[n];r instanceof Function||!Object.prototype.hasOwnProperty.call(t,n)||e.push({key:n,value:r})}}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),a.Blank)}))},m.make=function(t){return m.repeat(t,1)},m.matches=function(t,e,n){return null==n&&(n=""),e instanceof RegExp&&(n+=e.ignoreCase?"i":"",n+=e.multiline?"m":"",e=e.source),-1===n.indexOf("g")&&(n+="g"),new m((function(){var r;return new d((function(){r=new RegExp(e,n)}),(function(){var e=r.exec(t);return!!e&&this.yieldReturn(e)}),a.Blank)}))},m.range=function(t,e,n){return null==n&&(n=1),new m((function(){var r,i=0;return new d((function(){r=t-n}),(function(){return i++<e?this.yieldReturn(r+=n):this.yieldBreak()}),a.Blank)}))},m.rangeDown=function(t,e,n){return null==n&&(n=1),new m((function(){var r,i=0;return new d((function(){r=t+n}),(function(){return i++<e?this.yieldReturn(r-=n):this.yieldBreak()}),a.Blank)}))},m.rangeTo=function(t,e,n){return null==n&&(n=1),new m(t<e?function(){var r;return new d((function(){r=t-n}),(function(){var t=r+=n;return t<=e?this.yieldReturn(t):this.yieldBreak()}),a.Blank)}:function(){var r;return new d((function(){r=t+n}),(function(){var t=r-=n;return t>=e?this.yieldReturn(t):this.yieldBreak()}),a.Blank)})},m.repeat=function(t,e){return null!=e?m.repeat(t).take(e):new m((function(){return new d(a.Blank,(function(){return this.yieldReturn(t)}),a.Blank)}))},m.repeatWithFinalize=function(t,e){return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var n;return new d((function(){n=t()}),(function(){return this.yieldReturn(n)}),(function(){null!=n&&(e(n),n=null)}))}))},m.generate=function(t,e){return null!=e?m.generate(t).take(e):(t=f.createLambda(t),new m((function(){return new d(a.Blank,(function(){return this.yieldReturn(t())}),a.Blank)})))},m.toInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new m((function(){var n;return new d((function(){n=t-e}),(function(){return this.yieldReturn(n+=e)}),a.Blank)}))},m.toNegativeInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new m((function(){var n;return new d((function(){n=t+e}),(function(){return this.yieldReturn(n-=e)}),a.Blank)}))},m.unfold=function(t,e){return e=f.createLambda(e),new m((function(){var n,r=!0;return new d(a.Blank,(function(){return r?(r=!1,n=t,this.yieldReturn(n)):(n=e(n),this.yieldReturn(n))}),a.Blank)}))},m.defer=function(t){return new m((function(){var e;return new d((function(){e=m.from(t()).getEnumerator()}),(function(){return e.moveNext()?this.yieldReturn(e.current()):this.yieldBreak()}),(function(){f.dispose(e)}))}))},m.prototype.traverseBreadthFirst=function(t,e){var n=this;return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var r,i=0,o=[];return new d((function(){r=n.getEnumerator()}),(function(){for(;;){if(r.moveNext())return o.push(r.current()),this.yieldReturn(e(r.current(),i));var n=m.from(o).selectMany((function(e){return t(e)}));if(!n.any())return!1;i++,o=[],f.dispose(r),r=n.getEnumerator()}}),(function(){f.dispose(r)}))}))},m.prototype.traverseDepthFirst=function(t,e){var n=this;return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var r,i=[];return new d((function(){r=n.getEnumerator()}),(function(){for(;;){if(r.moveNext()){var n=e(r.current(),i.length);return i.push(r),r=m.from(t(r.current())).getEnumerator(),this.yieldReturn(n)}if(i.length<=0)return!1;f.dispose(r),r=i.pop()}}),(function(){try{f.dispose(r)}finally{m.from(i).forEach((function(t){t.dispose()}))}}))}))},m.prototype.flatten=function(){var t=this;return new m((function(){var e,n=null;return new d((function(){e=t.getEnumerator()}),(function(){for(;;){if(null!=n){if(n.moveNext())return this.yieldReturn(n.current());n=null}if(e.moveNext()){if(e.current()instanceof Array){f.dispose(n),n=m.from(e.current()).selectMany(a.Identity).flatten().getEnumerator();continue}return this.yieldReturn(e.current())}return!1}}),(function(){try{f.dispose(e)}finally{f.dispose(n)}}))}))},m.prototype.pairwise=function(t){var e=this;return t=f.createLambda(t),new m((function(){var n;return new d((function(){(n=e.getEnumerator()).moveNext()}),(function(){var e=n.current();return!!n.moveNext()&&this.yieldReturn(t(e,n.current()))}),(function(){f.dispose(n)}))}))},m.prototype.scan=function(t,e){var n;null==e?(e=f.createLambda(t),n=!1):(e=f.createLambda(e),n=!0);var r=this;return new m((function(){var i,o,a=!0;return new d((function(){i=r.getEnumerator()}),(function(){if(a){if(a=!1,n)return this.yieldReturn(o=t);if(i.moveNext())return this.yieldReturn(o=i.current())}return!!i.moveNext()&&this.yieldReturn(o=e(o,i.current()))}),(function(){f.dispose(i)}))}))},m.prototype.select=function(t){if((t=f.createLambda(t)).length<=1)return new C(this,null,t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(t(n.current(),r++))}),(function(){f.dispose(n)}))}))},m.prototype.selectMany=function(t,e){var n=this;return t=f.createLambda(t),null==e&&(e=function(t,e){return e}),e=f.createLambda(e),new m((function(){var r,i=o,a=0;return new d((function(){r=n.getEnumerator()}),(function(){if(i===o&&!r.moveNext())return!1;do{if(null==i){var n=t(r.current(),a++);i=m.from(n).getEnumerator()}if(i.moveNext())return this.yieldReturn(e(r.current(),i.current()));f.dispose(i),i=null}while(r.moveNext());return!1}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.where=function(t){if((t=f.createLambda(t)).length<=1)return new w(this,t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();)if(t(n.current(),r++))return this.yieldReturn(n.current());return!1}),(function(){f.dispose(n)}))}))},m.prototype.choose=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.current(),r++);if(null!=e)return this.yieldReturn(e)}return this.yieldBreak()}),(function(){f.dispose(n)}))}))},m.prototype.ofType=function(t){var e;switch(t){case Number:e=l;break;case String:e=u;break;case Boolean:e=s;break;case Function:e=h;break;default:e=null}return null===e?this.where((function(e){return e instanceof t})):this.where((function(t){return typeof t===e}))},m.prototype.zip=function(){var t=arguments,e=f.createLambda(arguments[arguments.length-1]),n=this;if(2==arguments.length){var r=arguments[0];return new m((function(){var t,i,o=0;return new d((function(){t=n.getEnumerator(),i=m.from(r).getEnumerator()}),(function(){return!(!t.moveNext()||!i.moveNext())&&this.yieldReturn(e(t.current(),i.current(),o++))}),(function(){try{f.dispose(t)}finally{f.dispose(i)}}))}))}return new m((function(){var r,i=0;return new d((function(){var e=m.make(n).concat(m.from(t).takeExceptLast().select(m.from)).select((function(t){return t.getEnumerator()})).toArray();r=m.from(e)}),(function(){if(r.all((function(t){return t.moveNext()}))){var t=r.select((function(t){return t.current()})).toArray();return t.push(i++),this.yieldReturn(e.apply(null,t))}return this.yieldBreak()}),(function(){m.from(r).forEach(f.dispose)}))}))},m.prototype.merge=function(){var t=arguments,e=this;return new m((function(){var n,r=-1;return new d((function(){n=m.make(e).concat(m.from(t).select(m.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;n.length>0;){r=r>=n.length-1?0:r+1;var t=n[r];if(t.moveNext())return this.yieldReturn(t.current());t.dispose(),n.splice(r--,1)}return this.yieldBreak()}),(function(){m.from(n).forEach(f.dispose)}))}))},m.prototype.join=function(t,e,n,r,i){e=f.createLambda(e),n=f.createLambda(n),r=f.createLambda(r),i=f.createLambda(i);var s=this;return new m((function(){var l,u,c=null,h=0;return new d((function(){l=s.getEnumerator(),u=m.from(t).toLookup(n,a.Identity,i)}),(function(){for(;;){if(null!=c){var t=c[h++];if(t!==o)return this.yieldReturn(r(l.current(),t));t=null,h=0}if(!l.moveNext())return!1;var n=e(l.current());c=u.get(n).toArray()}}),(function(){f.dispose(l)}))}))},m.prototype.groupJoin=function(t,e,n,r,i){e=f.createLambda(e),n=f.createLambda(n),r=f.createLambda(r),i=f.createLambda(i);var o=this;return new m((function(){var s=o.getEnumerator(),l=null;return new d((function(){s=o.getEnumerator(),l=m.from(t).toLookup(n,a.Identity,i)}),(function(){if(s.moveNext()){var t=l.get(e(s.current()));return this.yieldReturn(r(s.current(),t))}return!1}),(function(){f.dispose(s)}))}))},m.prototype.all=function(t){t=f.createLambda(t);var e=!0;return this.forEach((function(n){if(!t(n))return e=!1,!1})),e},m.prototype.any=function(t){t=f.createLambda(t);var e=this.getEnumerator();try{if(0==arguments.length)return e.moveNext();for(;e.moveNext();)if(t(e.current()))return!0;return!1}finally{f.dispose(e)}},m.prototype.isEmpty=function(){return!this.any()},m.prototype.concat=function(){var t=this;if(1==arguments.length){var e=arguments[0];return new m((function(){var n,r;return new d((function(){n=t.getEnumerator()}),(function(){if(null==r){if(n.moveNext())return this.yieldReturn(n.current());r=m.from(e).getEnumerator()}return!!r.moveNext()&&this.yieldReturn(r.current())}),(function(){try{f.dispose(n)}finally{f.dispose(r)}}))}))}var n=arguments;return new m((function(){var e;return new d((function(){e=m.make(t).concat(m.from(n).select(m.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;e.length>0;){var t=e[0];if(t.moveNext())return this.yieldReturn(t.current());t.dispose(),e.splice(0,1)}return this.yieldBreak()}),(function(){m.from(e).forEach(f.dispose)}))}))},m.prototype.insert=function(t,e){var n=this;return new m((function(){var r,i,o=0,a=!1;return new d((function(){r=n.getEnumerator(),i=m.from(e).getEnumerator()}),(function(){return o==t&&i.moveNext()?(a=!0,this.yieldReturn(i.current())):r.moveNext()?(o++,this.yieldReturn(r.current())):!(a||!i.moveNext())&&this.yieldReturn(i.current())}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.alternate=function(t){var e=this;return new m((function(){var n,r,i,o;return new d((function(){i=t instanceof Array||null!=t.getEnumerator?m.from(m.from(t).toArray()):m.make(t),(r=e.getEnumerator()).moveNext()&&(n=r.current())}),(function(){for(;;){if(null!=o){if(o.moveNext())return this.yieldReturn(o.current());o=null}if(null!=n||!r.moveNext()){if(null!=n){var t=n;return n=null,this.yieldReturn(t)}return this.yieldBreak()}n=r.current(),o=i.getEnumerator()}}),(function(){try{f.dispose(r)}finally{f.dispose(o)}}))}))},m.prototype.contains=function(t,e){e=f.createLambda(e);var n=this.getEnumerator();try{for(;n.moveNext();)if(e(n.current())===t)return!0;return!1}finally{f.dispose(n)}},m.prototype.defaultIfEmpty=function(t){var e=this;return t===o&&(t=null),new m((function(){var n,r=!0;return new d((function(){n=e.getEnumerator()}),(function(){return n.moveNext()?(r=!1,this.yieldReturn(n.current())):!!r&&(r=!1,this.yieldReturn(t))}),(function(){f.dispose(n)}))}))},m.prototype.distinct=function(t){return this.except(m.empty(),t)},m.prototype.distinctUntilChanged=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r,i;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.current());if(i)return i=!1,r=e,this.yieldReturn(n.current());if(r!==e)return r=e,this.yieldReturn(n.current())}return this.yieldBreak()}),(function(){f.dispose(n)}))}))},m.prototype.except=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i;return new d((function(){r=n.getEnumerator(),i=new P(e),m.from(t).forEach((function(t){i.add(t)}))}),(function(){for(;r.moveNext();){var t=r.current();if(!i.contains(t))return i.add(t),this.yieldReturn(t)}return!1}),(function(){f.dispose(r)}))}))},m.prototype.intersect=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i,o;return new d((function(){r=n.getEnumerator(),i=new P(e),m.from(t).forEach((function(t){i.add(t)})),o=new P(e)}),(function(){for(;r.moveNext();){var t=r.current();if(!o.contains(t)&&i.contains(t))return o.add(t),this.yieldReturn(t)}return!1}),(function(){f.dispose(r)}))}))},m.prototype.sequenceEqual=function(t,e){e=f.createLambda(e);var n=this.getEnumerator();try{var r=m.from(t).getEnumerator();try{for(;n.moveNext();)if(!r.moveNext()||e(n.current())!==e(r.current()))return!1;return!r.moveNext()}finally{f.dispose(r)}}finally{f.dispose(n)}},m.prototype.union=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i,a;return new d((function(){r=n.getEnumerator(),a=new P(e)}),(function(){var e;if(i===o){for(;r.moveNext();)if(e=r.current(),!a.contains(e))return a.add(e),this.yieldReturn(e);i=m.from(t).getEnumerator()}for(;i.moveNext();)if(e=i.current(),!a.contains(e))return a.add(e),this.yieldReturn(e);return!1}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.orderBy=function(t){return new y(this,t,!1)},m.prototype.orderByDescending=function(t){return new y(this,t,!0)},m.prototype.reverse=function(){var t=this;return new m((function(){var e,n;return new d((function(){e=t.toArray(),n=e.length}),(function(){return n>0&&this.yieldReturn(e[--n])}),a.Blank)}))},m.prototype.shuffle=function(){var t=this;return new m((function(){var e;return new d((function(){e=t.toArray()}),(function(){if(e.length>0){var t=Math.floor(Math.random()*e.length);return this.yieldReturn(e.splice(t,1)[0])}return!1}),a.Blank)}))},m.prototype.weightedSample=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.choose((function(e){var n=t(e);return n<=0?null:{value:e,bound:r+=n}})).toArray()}),(function(){if(n.length>0){for(var t=Math.floor(Math.random()*r)+1,e=-1,i=n.length;i-e>1;){var o=Math.floor((e+i)/2);n[o].bound>=t?i=o:e=o}return this.yieldReturn(n[i].value)}return this.yieldBreak()}),a.Blank)}))},m.prototype.groupBy=function(t,e,n,r){var i=this;return t=f.createLambda(t),e=f.createLambda(e),null!=n&&(n=f.createLambda(n)),r=f.createLambda(r),new m((function(){var o;return new d((function(){o=i.toLookup(t,e,r).toEnumerable().getEnumerator()}),(function(){for(;o.moveNext();)return null==n?this.yieldReturn(o.current()):this.yieldReturn(n(o.current().key(),o.current()));return!1}),(function(){f.dispose(o)}))}))},m.prototype.partitionBy=function(t,e,n,r){var i,o=this;return t=f.createLambda(t),e=f.createLambda(e),r=f.createLambda(r),null==n?(i=!1,n=function(t,e){return new S(t,e)}):(i=!0,n=f.createLambda(n)),new m((function(){var a,s,l,u=[];return new d((function(){(a=o.getEnumerator()).moveNext()&&(s=t(a.current()),l=r(s),u.push(e(a.current())))}),(function(){for(var o;1==(o=a.moveNext())&&l===r(t(a.current()));)u.push(e(a.current()));if(u.length>0){var c=n(s,i?m.from(u):u);return o?(s=t(a.current()),l=r(s),u=[e(a.current())]):u=[],this.yieldReturn(c)}return!1}),(function(){f.dispose(a)}))}))},m.prototype.buffer=function(t){var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){for(var e=[],r=0;n.moveNext();)if(e.push(n.current()),++r>=t)return this.yieldReturn(e);return e.length>0&&this.yieldReturn(e)}),(function(){f.dispose(n)}))}))},m.prototype.aggregate=function(t,e,n){return(n=f.createLambda(n))(this.scan(t,e,n).last())},m.prototype.average=function(t){t=f.createLambda(t);var e=0,n=0;return this.forEach((function(r){e+=t(r),++n})),e/n},m.prototype.count=function(t){t=null==t?a.True:f.createLambda(t);var e=0;return this.forEach((function(n,r){t(n,r)&&++e})),e},m.prototype.max=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate((function(t,e){return t>e?t:e}))},m.prototype.min=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate((function(t,e){return t<e?t:e}))},m.prototype.maxBy=function(t){return t=f.createLambda(t),this.aggregate((function(e,n){return t(e)>t(n)?e:n}))},m.prototype.minBy=function(t){return t=f.createLambda(t),this.aggregate((function(e,n){return t(e)<t(n)?e:n}))},m.prototype.sum=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate(0,(function(t,e){return t+e}))},m.prototype.elementAt=function(t){var e,n=!1;if(this.forEach((function(r,i){if(i==t)return e=r,n=!0,!1})),!n)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return e},m.prototype.elementAtOrDefault=function(t,e){var n;e===o&&(e=null);var r=!1;return this.forEach((function(e,i){if(i==t)return n=e,r=!0,!1})),r?n:e},m.prototype.first=function(t){if(null!=t)return this.where(t).first();var e,n=!1;if(this.forEach((function(t){return e=t,n=!0,!1})),!n)throw new Error("first:No element satisfies the condition.");return e},m.prototype.firstOrDefault=function(t,e){if(t!==o){if(typeof t===h||typeof f.createLambda(t)===h)return this.where(t).firstOrDefault(o,e);e=t}var n,r=!1;return this.forEach((function(t){return n=t,r=!0,!1})),r?n:e},m.prototype.last=function(t){if(null!=t)return this.where(t).last();var e,n=!1;if(this.forEach((function(t){n=!0,e=t})),!n)throw new Error("last:No element satisfies the condition.");return e},m.prototype.lastOrDefault=function(t,e){if(t!==o){if(typeof t===h||typeof f.createLambda(t)===h)return this.where(t).lastOrDefault(o,e);e=t}var n,r=!1;return this.forEach((function(t){r=!0,n=t})),r?n:e},m.prototype.single=function(t){if(null!=t)return this.where(t).single();var e,n=!1;if(this.forEach((function(t){if(n)throw new Error("single:sequence contains more than one element.");n=!0,e=t})),!n)throw new Error("single:No element satisfies the condition.");return e},m.prototype.singleOrDefault=function(t,e){if(e===o&&(e=null),null!=t)return this.where(t).singleOrDefault(null,e);var n,r=!1;return this.forEach((function(t){if(r)throw new Error("single:sequence contains more than one element.");r=!0,n=t})),r?n:e},m.prototype.skip=function(t){var e=this;return new m((function(){var n,r=0;return new d((function(){for(n=e.getEnumerator();r++<t&&n.moveNext(););}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.skipWhile=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0,i=!1;return new d((function(){n=e.getEnumerator()}),(function(){for(;!i;){if(!n.moveNext())return!1;if(!t(n.current(),r++))return i=!0,this.yieldReturn(n.current())}return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.take=function(t){var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!(r++<t&&n.moveNext())&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.takeWhile=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!(!n.moveNext()||!t(n.current(),r++))&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.takeExceptLast=function(t){null==t&&(t=1);var e=this;return new m((function(){if(t<=0)return e.getEnumerator();var n,r=[];return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){if(r.length==t)return r.push(n.current()),this.yieldReturn(r.shift());r.push(n.current())}return!1}),(function(){f.dispose(n)}))}))},m.prototype.takeFromLast=function(t){if(t<=0||null==t)return m.empty();var e=this;return new m((function(){var n,r,i=[];return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();)i.length==t&&i.shift(),i.push(n.current());return null==r&&(r=m.from(i).getEnumerator()),!!r.moveNext()&&this.yieldReturn(r.current())}),(function(){f.dispose(r)}))}))},m.prototype.indexOf=function(t){var e=null;return typeof t===h?this.forEach((function(n,r){if(t(n,r))return e=r,!1})):this.forEach((function(n,r){if(n===t)return e=r,!1})),null!==e?e:-1},m.prototype.lastIndexOf=function(t){var e=-1;return typeof t===h?this.forEach((function(n,r){t(n,r)&&(e=r)})):this.forEach((function(n,r){n===t&&(e=r)})),e},m.prototype.cast=function(){return this},m.prototype.asEnumerable=function(){return m.from(this)},m.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},m.prototype.toLookup=function(t,e,n){t=f.createLambda(t),e=f.createLambda(e),n=f.createLambda(n);var r=new P(n);return this.forEach((function(n){var i=t(n),a=e(n),s=r.get(i);s!==o?s.push(a):r.add(i,[a])})),new x(r)},m.prototype.toObject=function(t,e){t=f.createLambda(t),e=f.createLambda(e);var n={};return this.forEach((function(r){n[t(r)]=e(r)})),n},m.prototype.toDictionary=function(t,e,n){t=f.createLambda(t),e=f.createLambda(e),n=f.createLambda(n);var r=new P(n);return this.forEach((function(n){r.add(t(n),e(n))})),r},m.prototype.toJSONString=function(t,e){if(typeof JSON===c||null==JSON.stringify)throw new Error("toJSONString can't find JSON.stringify. This works native JSON support Browser or include json2.js");return JSON.stringify(this.toArray(),t,e)},m.prototype.toJoinedString=function(t,e){return null==t&&(t=""),null==e&&(e=a.Identity),this.select(e).toArray().join(t)},m.prototype.doAction=function(t){var e=this;return t=f.createLambda(t),new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&(t(n.current(),r++),this.yieldReturn(n.current()))}),(function(){f.dispose(n)}))}))},m.prototype.forEach=function(t){t=f.createLambda(t);var e=0,n=this.getEnumerator();try{for(;n.moveNext()&&!1!==t(n.current(),e++););}finally{f.dispose(n)}},m.prototype.write=function(t,e){null==t&&(t=""),e=f.createLambda(e);var n=!0;this.forEach((function(r){n?n=!1:document.write(t),document.write(e(r))}))},m.prototype.writeLine=function(t){t=f.createLambda(t),this.forEach((function(e){document.writeln(t(e)+"<br />")}))},m.prototype.force=function(){var t=this.getEnumerator();try{for(;t.moveNext(););}finally{f.dispose(t)}},m.prototype.letBind=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=m.from(t(e)).getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.share=function(){var t,e=this,n=!1;return new b((function(){return new d((function(){null==t&&(t=e.getEnumerator())}),(function(){if(n)throw new Error("enumerator is disposed");return!!t.moveNext()&&this.yieldReturn(t.current())}),a.Blank)}),(function(){n=!0,f.dispose(t)}))},m.prototype.memoize=function(){var t,e,n=this,r=!1;return new b((function(){var i=-1;return new d((function(){null==e&&(e=n.getEnumerator(),t=[])}),(function(){if(r)throw new Error("enumerator is disposed");return i++,t.length<=i?!!e.moveNext()&&this.yieldReturn(t[i]=e.current()):this.yieldReturn(t[i])}),a.Blank)}),(function(){r=!0,f.dispose(e),t=null}))},f.hasNativeIteratorSupport()&&(m.prototype[Symbol.iterator]=function(){return{enumerator:this.getEnumerator(),next:function(){return this.enumerator.moveNext()?{done:!1,value:this.enumerator.current()}:{done:!0}}}}),m.prototype.catchError=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){try{return!!n.moveNext()&&this.yieldReturn(n.current())}catch(e){return t(e),!1}}),(function(){f.dispose(n)}))}))},m.prototype.finallyAction=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){try{f.dispose(n)}finally{t()}}))}))},m.prototype.log=function(t){return t=f.createLambda(t),this.doAction((function(e){typeof console!==c&&console.log(t(e))}))},m.prototype.trace=function(t,e){return null==t&&(t="Trace"),e=f.createLambda(e),this.doAction((function(n){typeof console!==c&&console.log(t,e(n))}))};var y=function(t,e,n,r){this.source=t,this.keySelector=f.createLambda(e),this.descending=n,this.parent=r};y.prototype=new m,y.prototype.createOrderedEnumerable=function(t,e){return new y(this.source,t,e,this)},y.prototype.thenBy=function(t){return this.createOrderedEnumerable(t,!1)},y.prototype.thenByDescending=function(t){return this.createOrderedEnumerable(t,!0)},y.prototype.getEnumerator=function(){var t,e,n=this,r=0;return new d((function(){t=[],e=[],n.source.forEach((function(n,r){t.push(n),e.push(r)}));var r=_.create(n,null);r.GenerateKeys(t),e.sort((function(t,e){return r.compare(t,e)}))}),(function(){return r<e.length&&this.yieldReturn(t[e[r++]])}),a.Blank)};var _=function(t,e,n){this.keySelector=t,this.descending=e,this.child=n,this.keys=null};_.create=function(t,e){var n=new _(t.keySelector,t.descending,e);return null!=t.parent?_.create(t.parent,n):n},_.prototype.GenerateKeys=function(t){for(var e=t.length,n=this.keySelector,r=new Array(e),i=0;i<e;i++)r[i]=n(t[i]);this.keys=r,null!=this.child&&this.child.GenerateKeys(t)},_.prototype.compare=function(t,e){var n=f.compare(this.keys[t],this.keys[e]);return 0==n?null!=this.child?this.child.compare(t,e):f.compare(t,e):this.descending?-n:n};var b=function(t,e){this.dispose=e,m.call(this,t)};b.prototype=new m;var v=function(t){this.getSource=function(){return t}};v.prototype=new m,v.prototype.any=function(t){return null==t?this.getSource().length>0:m.prototype.any.apply(this,arguments)},v.prototype.count=function(t){return null==t?this.getSource().length:m.prototype.count.apply(this,arguments)},v.prototype.elementAt=function(t){var e=this.getSource();return 0<=t&&t<e.length?e[t]:m.prototype.elementAt.apply(this,arguments)},v.prototype.elementAtOrDefault=function(t,e){e===o&&(e=null);var n=this.getSource();return 0<=t&&t<n.length?n[t]:e},v.prototype.first=function(t){var e=this.getSource();return null==t&&e.length>0?e[0]:m.prototype.first.apply(this,arguments)},v.prototype.firstOrDefault=function(t,e){if(t!==o)return m.prototype.firstOrDefault.apply(this,arguments);e=t;var n=this.getSource();return n.length>0?n[0]:e},v.prototype.last=function(t){var e=this.getSource();return null==t&&e.length>0?e[e.length-1]:m.prototype.last.apply(this,arguments)},v.prototype.lastOrDefault=function(t,e){if(t!==o)return m.prototype.lastOrDefault.apply(this,arguments);e=t;var n=this.getSource();return n.length>0?n[n.length-1]:e},v.prototype.skip=function(t){var e=this.getSource();return new m((function(){var n;return new d((function(){n=t<0?0:t}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),a.Blank)}))},v.prototype.takeExceptLast=function(t){return null==t&&(t=1),this.take(this.getSource().length-t)},v.prototype.takeFromLast=function(t){return this.skip(this.getSource().length-t)},v.prototype.reverse=function(){var t=this.getSource();return new m((function(){var e;return new d((function(){e=t.length}),(function(){return e>0&&this.yieldReturn(t[--e])}),a.Blank)}))},v.prototype.sequenceEqual=function(t,e){return(!(t instanceof v||t instanceof Array)||null!=e||m.from(t).count()==this.count())&&m.prototype.sequenceEqual.apply(this,arguments)},v.prototype.toJoinedString=function(t,e){var n=this.getSource();return null==e&&n instanceof Array?(null==t&&(t=""),n.join(t)):m.prototype.toJoinedString.apply(this,arguments)},v.prototype.getEnumerator=function(){var t=this.getSource(),e=-1;return{current:function(){return t[e]},moveNext:function(){return++e<t.length},dispose:a.Blank}};var w=function(t,e){this.prevSource=t,this.prevPredicate=e};w.prototype=new m,w.prototype.where=function(t){if((t=f.createLambda(t)).length<=1){var e=this.prevPredicate;return new w(this.prevSource,(function(n){return e(n)&&t(n)}))}return m.prototype.where.call(this,t)},w.prototype.select=function(t){return(t=f.createLambda(t)).length<=1?new C(this.prevSource,this.prevPredicate,t):m.prototype.select.call(this,t)},w.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSource;return new d((function(){t=n.getEnumerator()}),(function(){for(;t.moveNext();)if(e(t.current()))return this.yieldReturn(t.current());return!1}),(function(){f.dispose(t)}))};var C=function(t,e,n){this.prevSource=t,this.prevPredicate=e,this.prevSelector=n};C.prototype=new m,C.prototype.where=function(t){return(t=f.createLambda(t)).length<=1?new w(this,t):m.prototype.where.call(this,t)},C.prototype.select=function(t){if((t=f.createLambda(t)).length<=1){var e=this.prevSelector;return new C(this.prevSource,this.prevPredicate,(function(n){return t(e(n))}))}return m.prototype.select.call(this,t)},C.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSelector,r=this.prevSource;return new d((function(){t=r.getEnumerator()}),(function(){for(;t.moveNext();)if(null==e||e(t.current()))return this.yieldReturn(n(t.current()));return!1}),(function(){f.dispose(t)}))};var P=function(){var t=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e=function(t){return null===t?"null":t===o?"undefined":typeof t.toString===h?t.toString():Object.prototype.toString.call(t)},n=function(t,e){this.key=t,this.value=e,this.prev=null,this.next=null},r=function(){this.first=null,this.last=null};r.prototype={addLast:function(t){null!=this.last?(this.last.next=t,t.prev=this.last,this.last=t):this.first=this.last=t},replace:function(t,e){null!=t.prev?(t.prev.next=e,e.prev=t.prev):this.first=e,null!=t.next?(t.next.prev=e,e.next=t.next):this.last=e},remove:function(t){null!=t.prev?t.prev.next=t.next:this.first=t.next,null!=t.next?t.next.prev=t.prev:this.last=t.prev}};var i=function(t){this.countField=0,this.entryList=new r,this.buckets={},this.compareSelector=null==t?a.Identity:t};return i.prototype={add:function(r,i){var o=this.compareSelector(r),a=e(o),s=new n(r,i);if(t(this.buckets,a)){for(var l=this.buckets[a],u=0;u<l.length;u++)if(this.compareSelector(l[u].key)===o)return this.entryList.replace(l[u],s),void(l[u]=s);l.push(s)}else this.buckets[a]=[s];this.countField++,this.entryList.addLast(s)},get:function(n){var r=this.compareSelector(n),i=e(r);if(!t(this.buckets,i))return o;for(var a=this.buckets[i],s=0;s<a.length;s++){var l=a[s];if(this.compareSelector(l.key)===r)return l.value}return o},set:function(r,i){var o=this.compareSelector(r),a=e(o);if(t(this.buckets,a))for(var s=this.buckets[a],l=0;l<s.length;l++)if(this.compareSelector(s[l].key)===o){var u=new n(r,i);return this.entryList.replace(s[l],u),s[l]=u,!0}return!1},contains:function(n){var r=this.compareSelector(n),i=e(r);if(!t(this.buckets,i))return!1;for(var o=this.buckets[i],a=0;a<o.length;a++)if(this.compareSelector(o[a].key)===r)return!0;return!1},clear:function(){this.countField=0,this.buckets={},this.entryList=new r},remove:function(n){var r=this.compareSelector(n),i=e(r);if(t(this.buckets,i))for(var o=this.buckets[i],a=0;a<o.length;a++)if(this.compareSelector(o[a].key)===r)return this.entryList.remove(o[a]),o.splice(a,1),0==o.length&&delete this.buckets[i],void this.countField--},count:function(){return this.countField},toEnumerable:function(){var t=this;return new m((function(){var e;return new d((function(){e=t.entryList.first}),(function(){if(null!=e){var t={key:e.key,value:e.value};return e=e.next,this.yieldReturn(t)}return!1}),a.Blank)}))}},i}(),x=function(t){this.count=function(){return t.count()},this.get=function(e){return m.from(t.get(e))},this.contains=function(e){return t.contains(e)},this.toEnumerable=function(){return t.toEnumerable().select((function(t){return new S(t.key,t.value)}))}},S=function(t,e){this.key=function(){return t},v.call(this,e)};S.prototype=new v,n(861)?(r=function(){return m}.apply(e,[]))===o||(t.exports=r):typeof t!==c&&t.exports?t.exports=m:i.Enumerable=m}(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(424),o=n(449),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.equals=function(e){return!!t.prototype.equals.call(this,e)&&o.a.equals(this.color,e.color)},e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.color=null===(i=e.color)||void 0===i?void 0:i.clone()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(409),i=n(446),o=n(411),a=n(410),s=n(416),l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(e){var n=this;void 0===e&&(e=!0),this._allowRotateConstraint=null,this.propertyChanged=new r.a,this._firePropertyChanged=function(){return n.propertyChanged.notify()},this.type=t.type,this.allowDelete=e,this.allowMoveHorizontal=e,this.allowMoveVertical=e,this.allowRotate=e,this.allowDragAndDrop=e,this.resizeGrips=new i.a(e,e)}return Object.defineProperty(t.prototype,"allowDelete",{get:function(){return this._allowDelete},set:function(t){this._allowDelete!==t&&(this._allowDelete=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMoveHorizontal",{get:function(){return this._allowMoveHorizontal},set:function(t){this._allowMoveHorizontal!==t&&(this._allowMoveHorizontal=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMoveVertical",{get:function(){return this._allowMoveVertical},set:function(t){this._allowMoveVertical!==t&&(this._allowMoveVertical=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.allowMoveVertical||this.allowMoveHorizontal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRotateConstraint",{set:function(t){var e=this.allowRotate;this._allowRotateConstraint=t,this.allowRotate!==e&&this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRotate",{get:function(){return null!=this._allowRotateConstraint?this._allowRotateConstraint:this._allowRotate},set:function(t){this._allowRotate!==t&&(this._allowRotate=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowDragAndDrop",{get:function(){return this._allowDragAndDrop},set:function(t){this._allowDragAndDrop!==t&&(this._allowDragAndDrop=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizeGrips",{get:function(){return this._resizeGrips},set:function(t){null!=this.resizeGrips&&null!=this.resizeGrips.propertyChanged&&this.resizeGrips.propertyChanged.remove(this._firePropertyChanged),this._resizeGrips=t,null!=this.resizeGrips.propertyChanged&&this.resizeGrips.propertyChanged.add(this._firePropertyChanged),this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowResize",{get:function(){return this.resizeGrips.edge||this.resizeGrips.corner.length>0},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowDelete=this.allowDelete,e.allowDragAndDrop=this.allowDragAndDrop,e.allowMoveHorizontal=this.allowMoveHorizontal,e.allowMoveVertical=this.allowMoveVertical,e.allowRotate=this.allowRotate,e.allowRotateConstraint=this.allowRotateConstraint,e.resizeGrips=this.resizeGrips.clone(),e},t.prototype.equals=function(t){return this.allowDelete===t.allowDelete&&this.allowDragAndDrop===t.allowDragAndDrop&&this.allowMoveHorizontal===t.allowMoveHorizontal&&this.allowMoveVertical===t.allowMoveVertical&&this.allowRotate===t.allowRotate&&this.allowRotateConstraint===t.allowRotateConstraint&&Object(a.g)(this.resizeGrips,t.resizeGrips)},t.prototype.getSimplifiedObject=function(){var t={};return t.allowDelete=this.allowDelete,t.resizeGrips=this.resizeGrips.getSimplifiedObject(),t.allowMoveHorizontal=this.allowMoveHorizontal,t.allowMoveVertical=this.allowMoveVertical,t.allowRotate=this.allowRotate,t.allowDragAndDrop=this.allowDragAndDrop,t},t.CreateFromRaw=function(e){var n=o.extend(new i.a(!0,!0),e.resizeGrips),r=o.extend(new t,e);return r.resizeGrips=n,r},t.type="ManipulationPermissions",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(s.a)({ignore:!0}),l("design:type",Boolean),l("design:paramtypes",[Boolean])],t.prototype,"allowRotateConstraint",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){function t(){this.data={},this._typeDictionary={}}return t.prototype.getPropertyMetadata=function(t,e){var n=t.type;if(null==n)return null;if(null==this._typeDictionary[n]){this._typeDictionary[n]=[];for(var r=t;null!=r.constructor.type;)this._typeDictionary[n].push(r.constructor.type),r=Object.getPrototypeOf(r)}for(var i=0;i<this._typeDictionary[n].length;i++){var o=this._typeDictionary[n][i];if(null!=this.data[o]){var a=this.data[o][e];if(null!=a)return a}}return null},t}(),i=new r},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(){this._noPrint=!1,this._noShow=!1,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"noPrint",{get:function(){return this._noPrint},set:function(t){this._noPrint!==t&&(this._noPrint=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"noShow",{get:function(){return this._noShow},set:function(t){this._noShow!==t&&(this._noShow=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.noShow=this.noShow,e.noPrint=this.noPrint,e},t.prototype.equals=function(t){return this.noShow===t.noShow&&this.noPrint===t.noPrint},t.prototype.getSimplifiedObject=function(){var t={};return t.noPrint=this.noPrint,t.noShow=this.noShow,t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(409),i=n(553),o=n(410),a=function(){function t(t){var e=this;this._allowZOrderChange=!0,this._allowOpacityChange=!0,this._allowRemoveOnLayoutChange=!0,this._firePropertyChanged=function(){return e.propertyChanged.fire()},this.propertyChanged=new r.a,null==t&&(t=!0),this.allowZOrderChange=t,this.allowOpacityChange=t,this.allowRemoveOnLayoutChange=t,this.itemToolbarPermissions=new i.a(t)}return Object.defineProperty(t.prototype,"allowZOrderChange",{get:function(){return this._allowZOrderChange},set:function(t){this._allowZOrderChange!==t&&(this._allowZOrderChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowOpacityChange",{get:function(){return this._allowOpacityChange},set:function(t){this._allowOpacityChange!==t&&(this._allowOpacityChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRemoveOnLayoutChange",{get:function(){return this._allowRemoveOnLayoutChange},set:function(t){this._allowRemoveOnLayoutChange!==t&&(this._allowRemoveOnLayoutChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemToolbarPermissions",{get:function(){return this._itemToolbarPermissions},set:function(t){Object(o.g)(this,t)||(null!=this.itemToolbarPermissions&&null!=this.itemToolbarPermissions.propertyChanged&&this.itemToolbarPermissions.propertyChanged.remove(this._firePropertyChanged),this._itemToolbarPermissions=t,null!=this.itemToolbarPermissions.propertyChanged&&this.itemToolbarPermissions.propertyChanged.add(this._firePropertyChanged),this.propertyChanged.fire())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowZOrderChange=this.allowZOrderChange,t.allowOpacityChange=this.allowOpacityChange,t.allowRemoveOnLayoutChange=this.allowRemoveOnLayoutChange,t.itemToolbarPermissions=this.itemToolbarPermissions.getSimplifiedObject(),t},t.prototype.clone=function(){var e=new t;return e.allowZOrderChange=this.allowZOrderChange,e.allowOpacityChange=this.allowOpacityChange,e.allowRemoveOnLayoutChange=this.allowRemoveOnLayoutChange,e.itemToolbarPermissions=this.itemToolbarPermissions.clone(),e},t.prototype.equals=function(t){return this.allowZOrderChange===t.allowZOrderChange&&this.allowOpacityChange===t.allowOpacityChange&&this.allowRemoveOnLayoutChange===t.allowRemoveOnLayoutChange&&Object(o.g)(this.itemToolbarPermissions,t.itemToolbarPermissions)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(409),i=n(416),o=n(439),a=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(){function t(e){void 0===e&&(e=!0),this._showDeleteButton=!0,this._showEditButton=!0,this._showSelectButton=!0,this._showEditButtonConstraint=null,this._showHandleButton=!0,this.propertyChanged=new r.a,this.showSelectButtonConstraint=null,this.type=t.type,this.showDeleteButton=e,this.showEditButton=e,this.showSelectButton=e,this.showHandleButton=e}return Object.defineProperty(t.prototype,"showDeleteButton",{get:function(){return this._showDeleteButton},set:function(t){this._showDeleteButton!==t&&(this._showDeleteButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showEditButton",{get:function(){return null!=this.showEditButtonConstraint?this.showEditButtonConstraint:this._showEditButton},set:function(t){this._showEditButton!==t&&(this._showEditButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showEditButtonConstraint",{get:function(){return this._showEditButtonConstraint},set:function(t){this.showEditButtonConstraint!==t&&(this._showEditButtonConstraint=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showSelectButton",{get:function(){return null!=this.showSelectButtonConstraint?this.showSelectButtonConstraint:this._showSelectButton},set:function(t){this._showSelectButton!==t&&(this._showSelectButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.showDeleteButton=this.showDeleteButton,t.showEditButton=this.showEditButton,t.showSelectButton=this.showSelectButton,t.showEditButtonConstraint=this.showEditButtonConstraint,t.showSelectButtonConstraint=this.showSelectButtonConstraint,t.showHandleButton=this.showHandleButton,t},t.prototype.clone=function(){var e=new t;return e.showDeleteButton=this._showDeleteButton,e.showEditButton=this._showEditButton,e.showEditButtonConstraint=this.showEditButtonConstraint,e.showSelectButton=this._showSelectButton,e.showSelectButtonConstraint=this.showSelectButtonConstraint,e.showHandleButton=this._showHandleButton,e},t.prototype.equals=function(t){return this.showDeleteButton==t.showDeleteButton&&this.showEditButton===t.showEditButton&&this.showEditButtonConstraint===t.showEditButtonConstraint&&this.showSelectButton===t.showSelectButton&&this.showSelectButtonConstraint===t.showSelectButtonConstraint&&this.showHandleButton===t.showHandleButton},t.type="ItemToolbarPermissions",a([Object(i.a)({ignore:!0,type:"boolean"}),s("design:type",Boolean)],t.prototype,"showSelectButtonConstraint",void 0),a([Object(i.a)({ignore:!0}),s("design:type",Boolean),s("design:paramtypes",[Boolean])],t.prototype,"showEditButtonConstraint",null),a([Object(o.a)(),s("design:type",Boolean)],t.prototype,"showHandleButton",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(){this._displayInObjectInspector=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"displayInObjectInspector",{get:function(){return this._displayInObjectInspector},set:function(t){this._displayInObjectInspector!==t&&(this._displayInObjectInspector=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.displayInObjectInspector=this.displayInObjectInspector,t},t.prototype.clone=function(){var e=new t;return e.displayInObjectInspector=this.displayInObjectInspector,e},t.prototype.equals=function(t){return this.displayInObjectInspector===t.displayInObjectInspector},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(410),i=function(){function t(){this.styles=[],this.clipartColors=[]}return t.fromRaw=function(e){var n=new t;return n.text=e.text,n.stroke=e.stroke,n.shadow=e.shadow,n.img=e.img,n.border=e.border,n.fill=e.fill,n.textFill=e.textFill,n.line=e.line,n.altline=e.altline,n.horizontal=e.horizontal,n.vertical=e.vertical,n.barcode=e.barcode,n.styles=null!=e.styles?e.styles.slice(0):null,n.clipartColors=null!=e.clipartColors?e.clipartColors.slice(0):null,n},t.prototype.clone=function(){var e=new t;return e.text=this.text,e.stroke=this.stroke,e.shadow=this.shadow,e.img=this.img,e.border=this.border,e.fill=this.fill,e.textFill=this.textFill,e.line=this.line,e.altline=this.altline,e.horizontal=this.horizontal,e.vertical=this.vertical,e.barcode=this.barcode,e.styles=null!=this.styles?this.styles.slice(0):null,e.clipartColors=null!=this.clipartColors?this.clipartColors.slice(0):null,e},t.prototype.equals=function(t){return this.text===t.text&&this.stroke===t.stroke&&this.shadow===t.shadow&&this.img===t.img&&this.border===t.border&&this.fill===t.fill&&this.textFill===t.textFill&&this.line===t.line&&this.altline===t.altline&&this.horizontal===t.horizontal&&this.vertical===t.vertical&&this.barcode===t.barcode&&Object(r.c)(this.styles,t.styles)&&Object(r.c)(this.clipartColors,t.clipartColors)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(439),o=n(424),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t){function e(n){var r=t.call(this)||this;return r.type=e.type,null==n&&(n=!0),r._allowSafetyLines=n,r._allowRegion=n,r._allowBleedArea=n,r}return a(e,t),e.prototype.clone=function(t){void 0===t&&(t=null);var n=null!=t?t:new e;return n.allowSafetyLines=this.allowSafetyLines,n.allowRegion=this.allowRegion,n.allowBleedArea=this.allowBleedArea,n},e.prototype.equals=function(t){return this.type===t.type&&this.allowSafetyLines===t.allowSafetyLines&&this.allowRegion===t.allowRegion&&this.allowBleedArea===t.allowBleedArea},e.type="ViolationSettings",s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowSafetyLines",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowRegion",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowBleedArea",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(t){this._allowChangeBorderWidth=!0,this._allowChangeFillColor=!0,this._allowChangeBorderColor=!0,this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeBorderWidth=t,this.allowChangeFillColor=t,this.allowChangeBorderColor=t}return Object.defineProperty(t.prototype,"allowChangeBorderWidth",{get:function(){return this._allowChangeBorderWidth},set:function(t){this._allowChangeBorderWidth!==t&&(this._allowChangeBorderWidth=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeFillColor",{get:function(){return this._allowChangeFillColor},set:function(t){this._allowChangeFillColor!==t&&(this._allowChangeFillColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBorderColor",{get:function(){return this._allowChangeBorderColor},set:function(t){this._allowChangeBorderColor!==t&&(this._allowChangeBorderColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowChangeBorderColor=this.allowChangeBorderColor,e.allowChangeBorderWidth=this.allowChangeBorderWidth,e.allowChangeFillColor=this.allowChangeFillColor,e},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeBorderWidth=this.allowChangeBorderWidth,t.allowChangeFillColor=this.allowChangeFillColor,t.allowChangeBorderColor=this.allowChangeBorderColor,t},t.prototype.equals=function(t){return this.allowChangeBorderColor===t.allowChangeBorderColor&&this.allowChangeFillColor===t.allowChangeFillColor&&this.allowChangeBorderWidth===t.allowChangeBorderWidth},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(409),i=n(443),o=n(416),a=n(439),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(t){this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeText=t,this.allowChangeFont=t,this.allowChangeFontSize=t,this.allowChangeFontColor=t,this.allowChangeTextAlignment=t,this.allowChangeTextBIU=t,this.allowChangeShadow=t,this.allowChangeStroke=t,this.allowChangeLeading=t,this.allowTextFormatting=null,this.allowChangeStrokeColor=t}return t.prototype.clone=function(){var e=new t;return e.allowChangeFont=this.allowChangeFont,e.allowChangeFontColor=this.allowChangeFontColor,e.allowChangeFontSize=this.allowChangeFontSize,e.allowChangeShadow=this.allowChangeShadow,e.allowChangeStroke=this.allowChangeStroke,e.allowChangeText=this.allowChangeText,e.allowChangeTextAlignment=this.allowChangeTextAlignment,e.allowChangeTextBIU=this.allowChangeTextBIU,e.allowChangeLeading=this.allowChangeLeading,e.allowTextFormatting=this.allowTextFormatting,e.allowChangeStrokeColor=this.allowChangeStrokeColor,e},t.prototype.equals=function(t){return this.allowChangeFont===t.allowChangeFont&&this.allowChangeFontColor===t.allowChangeFontColor&&this.allowChangeFontSize===t.allowChangeFontSize&&this.allowChangeShadow===t.allowChangeShadow&&this.allowChangeStroke===t.allowChangeStroke&&this.allowChangeText===t.allowChangeText&&this.allowChangeTextAlignment===t.allowChangeTextAlignment&&this.allowChangeTextBIU===t.allowChangeTextBIU&&this.allowChangeLeading===t.allowChangeLeading&&this.allowTextFormatting===t.allowTextFormatting&&this.allowChangeStrokeColor===t.allowChangeStrokeColor},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeText=this.allowChangeText,t.allowChangeFont=this.allowChangeFont,t.allowChangeFontSize=this.allowChangeFontSize,t.allowChangeFontColor=this.allowChangeFontColor,t.allowChangeTextAlignment=this.allowChangeTextAlignment,t.allowChangeTextBIU=this.allowChangeTextBIU,t.allowChangeShadow=this.allowChangeShadow,t.allowChangeStroke=this.allowChangeStroke,t.allowChangeLeading=this.allowChangeLeading,t.allowTextFormatting=this.allowTextFormatting,t.allowChangeStrokeColor=this.allowChangeStrokeColor,t},s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeText",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFont",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFontSize",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFontColor",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeTextAlignment",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeTextBIU",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeShadow",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeStroke",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeStrokeColor",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeLeading",void 0),s([Object(a.a)(),Object(o.a)({factory:new i.d(!0)}),l("design:type",Boolean)],t.prototype,"allowTextFormatting",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(435),o=n(407),a=n(410),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._isVertical=!1,s.type=e.type,s._textRectangle=null!=r?r:new o.RectangleF,s}return s(e,t),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this._textRectangle},set:function(t){o.RectangleF.isEqual(this._textRectangle,t)||(this._textRectangle=t,this._propertyChanged.notify(this,"textRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),r instanceof e&&(r.textRectangle=n.textRectangle)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(a.g)(this._isVertical,e._isVertical)&&Object(a.g)(this._textRectangle,e._textRectangle)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="AutoScaledTextItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(435),o=n(407),a=n(477),s=n(475),l=n(410),u=n(416),c=n(443),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},f=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},d=function(t){function e(n,r,i,l){var u=t.call(this,n,i,l)||this;return u._textRectangle=new o.RectangleF,u._verticalAlignment=s.h.Top,u._isVertical=!1,u._paragraphSettings=new a.a,u._wrappingPath=null,u._wrappingMargin=7,u._scheduledFitMode=null,u._shrinkMode=s.f.Size,u._overflowStrategy=s.e.Clip,u._originalVerticalScale=1,u._originalHorizontalScale=1,u._firstBaselineOffset=s.c.Ascent,u._firstBaselineMinOffset=0,u.type=e.type,null!=r&&(u.textRectangle=r,u.sourcePath=o.Path.rectangle(r.left,r.top,r.width,r.height)),u}return h(e,t),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this._textRectangle},set:function(t){o.RectangleF.isEqual(this._textRectangle,t)||(this._textRectangle=t,this._propertyChanged.notify(this,"textRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(t){this._verticalAlignment!==t&&(this._verticalAlignment=t,this._propertyChanged.notify(this,"verticalAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this._paragraphSettings},set:function(t){this._paragraphSettings.equals(t)||(this._paragraphSettings=t,this._propertyChanged.notify(this,"paragraphSettings"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingPath",{get:function(){return this._wrappingPath},set:function(t){null==this._wrappingPath&&null==t||null!=this._wrappingPath&&this._wrappingPath.isEqual(t)||(this._wrappingPath=t,this._propertyChanged.notify(this,"wrappingPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this._wrappingMargin},set:function(t){this._wrappingMargin!==t&&(this._wrappingMargin=t,this._propertyChanged.notify(this,"wrappingMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scheduledFitMode",{get:function(){return this._scheduledFitMode},set:function(t){this._scheduledFitMode!==t&&(this._scheduledFitMode=t,null!=t&&this._propertyChanged.notify(this,"scheduledFitMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shrinkMode",{get:function(){return this._shrinkMode},set:function(t){this._shrinkMode!==t&&(this._shrinkMode=t,null!=t&&this._propertyChanged.notify(this,"shrinkMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowStrategy",{get:function(){return this._overflowStrategy},set:function(t){this._overflowStrategy!==t&&(this._overflowStrategy=t,null!=t&&this._propertyChanged.notify(this,"overflowStrategy"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalVerticalScale",{get:function(){return this._originalVerticalScale},set:function(t){this._originalVerticalScale!==t&&(this._originalVerticalScale=t,null!=t&&this._propertyChanged.notify(this,"originalVerticalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalHorizontalScale",{get:function(){return this._originalHorizontalScale},set:function(t){this._originalHorizontalScale!==t&&(this._originalHorizontalScale=t,null!=t&&this._propertyChanged.notify(this,"originalHorizontalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineOffset",{get:function(){return this._firstBaselineOffset},set:function(t){this._firstBaselineOffset!==t&&(this._firstBaselineOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineOffset"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineMinOffset",{get:function(){return this._firstBaselineMinOffset},set:function(t){Object(o.EqualsOfFloatNumbers)(this._firstBaselineMinOffset,t)||(this._firstBaselineMinOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineMinOffset"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type||(r.paragraphSettings=n.paragraphSettings.clone(),r.wrappingPath=null!=n.wrappingPath?n.wrappingPath.clone():null,r.wrappingMargin=n.wrappingMargin,r.firstBaselineOffset=n.firstBaselineOffset,r.firstBaselineMinOffset=n.firstBaselineMinOffset),r instanceof e&&(r.textRectangle=n.textRectangle.clone(),r.verticalAlignment=n.verticalAlignment,r.scheduledFitMode=n.scheduledFitMode,r.shrinkMode=n.shrinkMode,r.overflowStrategy=n.overflowStrategy,r.originalVerticalScale=n.originalVerticalScale,r.originalHorizontalScale=n.originalHorizontalScale)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(l.g)(this._isVertical,e._isVertical)&&Object(l.g)(this._textRectangle,e._textRectangle)&&Object(l.g)(this._verticalAlignment,e._verticalAlignment)&&Object(l.g)(this._paragraphSettings,e._paragraphSettings)&&Object(l.g)(this._wrappingPath,e._wrappingPath)&&Object(l.g)(this._wrappingMargin,e._wrappingMargin)&&Object(l.g)(this._scheduledFitMode,e._scheduledFitMode)&&Object(l.g)(this._shrinkMode,e._shrinkMode)&&Object(l.g)(this._overflowStrategy,e._overflowStrategy)&&Object(l.g)(this._originalVerticalScale,e._originalVerticalScale)&&Object(l.g)(this._originalHorizontalScale,e._originalHorizontalScale)&&Object(l.g)(this.firstBaselineOffset,e.firstBaselineOffset)&&Object(l.g)(this.firstBaselineMinOffset,e.firstBaselineMinOffset)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="BoundedTextItem",p([Object(u.a)({enumObject:s.h}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"verticalAlignment",null),p([Object(u.a)({factory:new c.c(o.Path),displayName:"Wrapping path"}),f("design:type",o.Path),f("design:paramtypes",[o.Path])],e.prototype,"wrappingPath",null),p([Object(u.a)({enumObject:s.d}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"scheduledFitMode",null),p([Object(u.a)({enumObject:s.f}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"shrinkMode",null),p([Object(u.a)({enumObject:s.e}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"overflowStrategy",null),p([Object(u.a)({enumObject:s.c}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"firstBaselineOffset",null),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(409),i=n(509),o=n(506),a=n(406),s=n(410),l=function(){function t(){var t=this;this._onPermissionsChanged=function(){t.propertyChanged.notify()},this.propertyChanged=new r.a,this._imagePermissions=new i.a,this._barcodePermissions=new o.a,this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged)}return Object.defineProperty(t.prototype,"barcodePermissions",{get:function(){return this._barcodePermissions},set:function(t){if(null==t)throw new a.a("barcodePermissions cannot be null");this._barcodePermissions.propertyChanged.remove(this._onPermissionsChanged),this._barcodePermissions=t,this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imagePermissions",{get:function(){return this._imagePermissions},set:function(t){if(null==t)throw new a.a("imagePermissions cannot be null");this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged),this._imagePermissions=t,this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged()},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){return{imagePermissions:this.imagePermissions.getSimplifiedObject(),barcodePermissions:this.barcodePermissions.getSimplifiedObject()}},t.prototype.clone=function(){var e=new t;return e.barcodePermissions=this.barcodePermissions.clone(),e.imagePermissions=this.imagePermissions.clone(),e},t.prototype.equals=function(t){return Object(s.g)(this.barcodePermissions,t.barcodePermissions)&&Object(s.g)(this.imagePermissions,t.imagePermissions)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(435),o=n(407),a=n(406),s=n(410),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._textPath=new o.Path,s._fitToPath=!1,s._stretch=!1,s._originalFontSize=0,s._fitToPathStep=1,s._start=0,s.type=e.type,null!=r&&(s.textPath=r),s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),s.manipulationPermissions.resizeGrips.edge=!1,s._ignorePermissionsChange=!1,s}return l(e,t),Object.defineProperty(e.prototype,"textPath",{get:function(){return this._textPath},set:function(t){this._textPath.equals(t)||(this._textPath=t,this._propertyChanged.notify(this,"textPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPath",{get:function(){return this._fitToPath},set:function(t){this._fitToPath!==t&&(this._fitToPath=t,this._propertyChanged.notify(this,"fitToPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this._stretch},set:function(t){this._stretch!==t&&(this._stretch=t,this._propertyChanged.notify(this,"stretch"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this._start},set:function(t){this._start!==t&&(this._start=t,this._propertyChanged.notify(this,"start"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},set:function(t){this._end!==t&&(this._end=t,this._propertyChanged.notify(this,"end"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalFontSize",{get:function(){return this._originalFontSize},set:function(t){Object(o.EqualsOfFloatNumbers)(this._originalFontSize,t)||(this._originalFontSize=t,this._propertyChanged.notify(this,"originalFontSize"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPathStep",{get:function(){return this._fitToPathStep},set:function(t){Object(o.EqualsOfFloatNumbers)(this._fitToPathStep,t)||(this._fitToPathStep=t,this._propertyChanged.notify(this,"fitToPathStep"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return 1},set:function(t){throw new a.d("Max Line Count of Curved Text can not be redefined!")},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){return t.prototype.getSimplifiedObject.call(this,["maxLineCount"].concat(e))},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&(this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),this.manipulationPermissions.resizeGrips.edge=!1)},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),r instanceof e&&(r.textPath=n.textPath.clone(),r.fitToPath=n.fitToPath,r.stretch=n.stretch,r.originalFontSize=n.originalFontSize,r.fitToPathStep=n.fitToPathStep,r.start=n.start,r.end=n.end)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._textPath,e._textPath)&&Object(s.g)(this._fitToPath,e._fitToPath)&&Object(s.g)(this._stretch,e._stretch)&&Object(s.g)(this._originalFontSize,e._originalFontSize)&&Object(s.g)(this._fitToPathStep,e._fitToPathStep)&&Object(s.g)(this._start,e._start)&&Object(s.g)(this._end,e._end)&&Object(s.g)(this._textPath,e._textPath)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="CurvedTextItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(439),o=n(501),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowImageQuality=n,r}return a(e,t),e.prototype.clone=function(){var n=new e;return n.allowImageQuality=this.allowImageQuality,t.prototype.clone.call(this,n)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowImageQuality===e.allowImageQuality},e.type="ImageViolationSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)(),s("design:type",Boolean)],e.prototype,"allowImageQuality",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(424),o=n(410),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},l=function(t){function e(e,n,r,i,o){var a=t.call(this)||this;return a.id=e,a._name=n,a._mask=r,a._value=i,a._values=o,a}return a(e,t),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){t!=this._mask&&(this._mask=t,this._propertyChanged.notify(this,"mask"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t!=this._value&&(this._value=t,this._propertyChanged.notify(this,"value"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(t){t!=this._values&&(this._values=t,this._propertyChanged.notify(this,"values"))},enumerable:!0,configurable:!0}),e.prototype.generateNewIds=function(){this._generateNewId()},e.prototype._copy=function(e,n,r){return t.prototype._copy.call(this,e,n,!1),n.mask=e.mask,n.value=e.value,n.values=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}(e.values),n},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(o.g)(this.mask,e.mask)&&Object(o.g)(this.value,e.value)&&Object(o.c)(this.values,e.values)},e.prototype.getSimplifiedObject=function(){return{id:this.id,mask:this.mask,value:this.value,values:this.values,name:this.name}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"g",(function(){return w})),n.d(e,"h",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"f",(function(){return C})),n.d(e,"e",(function(){return P}));var r,i,o,a,s,l,u=n(508),c=n(409),h=n(407),p=n(408),f=n(416),d=n(410),g=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(){return m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},m.apply(this,arguments)},y=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},b=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},v=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(b(arguments[e]));return t},w=function(t){function e(n,r){var i=t.call(this,n)||this;return i.type=e.type,i._onLayoutSettingsChanged=function(t){i._propertyChanged.notify(i,t)},i.layoutSettings=null!=r?r:new C,i}return g(e,t),e.prototype.getSimplifiedObject=function(e){var n,r;void 0===e&&(e=[]);var i=t.prototype.getSimplifiedObject.call(this,["layoutSettings"].concat(e));return i.layoutSettings=null===(n=this.layoutSettings)||void 0===n?void 0:n.getSimplifiedObject(),i.sourceRectangle=null===(r=this.sourceRectangle)||void 0===r?void 0:r.toJSON(),i},e.prototype._copy=function(e,n,r,i){var o;t.prototype._copy.call(this,e,n,r,i),r&&this._copyItemsOrder(e,n),n.layoutSettings=e.layoutSettings.clone(),n.sourceRectangle=null===(o=e.sourceRectangle)||void 0===o?void 0:o.clone()},e.prototype._copyItemsOrder=function(t,e){var n=t.getItemsOrder();if(n){var r=n.map((function(n){var r=t.items.indexOf((function(t){return t.id==n}));return e.items.get(r).id}));e.setItemsOrder(r)}},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},Object.defineProperty(e.prototype,"layoutSettings",{get:function(){return this._layoutSettings},set:function(t){if(null==t)throw new Error("LayoutSettings can't be null");null!=this._layoutSettings&&this._layoutSettings.propertyChanged.remove(this._onLayoutSettingsChanged),this._layoutSettings=t,this._layoutSettings.propertyChanged.add(this._onLayoutSettingsChanged),this._onLayoutSettingsChanged("layoutSettings")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceRectangle",{get:function(){return this._sourceRectangle},set:function(t){if(null!=this._sourceRectangle&&null==t)throw new Error("LayoutItem.sourceRectangle can't be null");null!=t&&t.equals(this._sourceRectangle)||(this._unsubscribeSourceRectangle(),this._sourceRectangle=t,this._subscribeSourceRectangle(),this._propertyChanged.notify(this,"sourceRectangle"))},enumerable:!0,configurable:!0}),e.prototype._subscribeSourceRectangle=function(){this._sourceRectangle},e.prototype._unsubscribeSourceRectangle=function(){this._sourceRectangle},e.prototype.addItems=function(n,r,i){var o=this.getItemsOrder();if(o){if(!Number.isInteger(i))throw new Error("orderIndex must not be null");o=e._insertToOrder(o,n.map((function(t){return t.id})),i),this.setItemsOrder(o)}t.prototype.addItems.call(this,n,r)},e.prototype.removeItems=function(e){var n=this.getItemsOrder();n&&(e.forEach((function(t){return n=n.filter((function(e){return e!==t.id}))})),this.setItemsOrder(n)),t.prototype.removeItems.call(this,e)},e.prototype.addItem=function(n,r,i){var o=this.getItemsOrder();null!=o&&(o=e._insertToOrder(o,[n.id],i),this.setItemsOrder(o)),t.prototype.addItem.call(this,n,r)},e._insertToOrder=function(t,e,n){var r=t.slice(0,n),i=t.slice(n);return r.concat(e,i)},e.prototype.setItemsOrder=function(t){this.tags[e._layoutItemsOrderTagKey]=t},e.prototype.getItemsOrder=function(){var t=this.tags[e._layoutItemsOrderTagKey];return null==t?null:t instanceof Array?t:null},e.prototype.getSortedItems=function(){var t=this.getItemsOrder(),e=this.getNestedItems(!0);return null!=t&&null!=e?t.map((function(t){return e.find((function(e){return e.id===t}))})):null},e.prototype.getItemOrderIndex=function(t){if(this.items.indexOf(t)<0)return-1;var e=this.getItemsOrder();return null==e?void 0:e.indexOf(t.id)},e.generateAutoLayoutSettings=function(t,e,n,r,i){var l=new P,u=t.map((function(t){return t.left})),c=t.map((function(t){return t.right})),p=t.map((function(t){return t.top})),f=t.map((function(t){return t.bottom})),d=t.map((function(t){return t.center.x})),g=t.map((function(t){return t.center.y}));if(null==n&&(n=Math.max.apply(Math,v(d))-Math.min.apply(Math,v(d))>Math.max.apply(Math,v(g))-Math.min.apply(Math,v(g))?a.horizontal:a.vertical),l.orientation=n,null==e)switch(l.orientation){case a.horizontal:e=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(p)),Math.min.apply(Math,v(p)),5)?o.start:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(g)),Math.min.apply(Math,v(g)),5)?o.center:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(f)),Math.min.apply(Math,v(f)),5)?o.end:o.none;break;case a.vertical:e=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(u)),Math.min.apply(Math,v(u)),5)?o.start:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(d)),Math.min.apply(Math,v(d)),5)?o.center:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(c)),Math.min.apply(Math,v(c)),5)?o.end:o.none}l.alignItems=e;for(var m=l.orientation===a.horizontal?t.sort((function(t,e){return t.left-e.left})):t.sort((function(t,e){return t.top-e.top})),y=[],_=1;_<m.length;_++){var b=m[_-1],w=m[_];y.push(l.orientation===a.horizontal?w.left-b.right:w.top-b.bottom)}return null==r&&(r=y.length>0?Math.max(0,Math.min.apply(Math,v(y.map(Math.round)))):0),l.margin=r,null==i&&(i=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,v(y)),Math.min.apply(Math,v(y)),2)?s.stretch:s.spaceBetween),l.justifyContent=i,l},e.prototype.isChildVisible=function(t){return!(t instanceof p.o&&t.isEmpty())},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(d.g)(this.sourceRectangle,e.sourceRectangle),i=Object(d.g)(this.layoutSettings,e.layoutSettings);return n&&r&&i},e._layoutItemsOrderTagKey="$layoutItemsOrder",e.type="LayoutItem",e}(u.a);!function(t){t[t.default=0]="default",t[t.auto=1]="auto"}(i||(i={})),function(t){t[t.none=0]="none",t[t.center=1]="center",t[t.start=2]="start",t[t.end=3]="end"}(o||(o={})),function(t){t[t.vertical=0]="vertical",t[t.horizontal=1]="horizontal"}(a||(a={})),function(t){t[t.stretch=0]="stretch",t[t.spaceBetween=1]="spaceBetween"}(s||(s={})),function(t){t[t.start=0]="start",t[t.center=1]="center",t[t.end=2]="end"}(l||(l={}));var C=function(){function t(){this.type=t.type,this.propertyChanged=new c.a}return t.prototype.clone=function(){return new t},t.prototype.getSimplifiedObject=function(){var e={};return e.type=t.type,e},t.prototype.equals=function(t){return Object(d.g)(this.type,t.type)},t.type="DefaultLayoutSettings",t}(),P=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._margin=0,n._orientation=a.vertical,n._alignItems=o.none,n._anchorPoint=l.start,n._justifyContent=s.stretch,n}return g(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this._margin},set:function(t){if(null==t)throw new Error("Margin can't be null");t!==this.margin&&(this._margin=t,this.propertyChanged.notify("margin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){if(null==t)throw Error("Orientation can't be null");t!==this.orientation&&(this._orientation=t,this.propertyChanged.notify("orientation"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignItems",{get:function(){return this._alignItems},set:function(t){if(null==t)throw new Error("alignItems can't be null");t!==this.alignItems&&(this._alignItems=t,this.propertyChanged.notify("alignItems"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"justifyContent",{get:function(){return this._justifyContent},set:function(t){if(null==t)throw new Error("JustifyContent can't be null");t!==this.justifyContent&&(this._justifyContent=t,this.propertyChanged.notify("justifyContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"anchorPoint",{get:function(){return this._anchorPoint},set:function(t){if(null==t)throw new Error("anchorPoint can't be null");t!==this._anchorPoint&&(this._anchorPoint=t,this.propertyChanged.notify("anchorPoint"))},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.orientation=this.orientation,t.alignItems=this.alignItems,t.justifyContent=this.justifyContent,t.margin=this.margin,t.anchorPoint=this.anchorPoint,t},e.prototype.getSimplifiedObject=function(){var n=t.prototype.getSimplifiedObject.call(this);return n.type=e.type,n.orientation=this.orientation,n.alignItems=this.alignItems,n.justifyContent=this.justifyContent,n.margin=this.margin,n.anchorPoint=this.anchorPoint,n},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(d.g)(this.orientation,e.orientation),i=Object(d.g)(this.alignItems,e.alignItems),o=Object(d.g)(this.margin,e.margin),a=Object(d.g)(this.anchorPoint,e.anchorPoint);return n&&r&&i&&o&&a},e.type="AutoLayoutSettings",y([Object(f.a)({ignore:!0}),_("design:type",Object)],e.prototype,"type",void 0),y([Object(f.a)({enumObject:m({},a)}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"orientation",null),y([Object(f.a)({enumObject:o}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"alignItems",null),y([Object(f.a)({enumObject:s}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"justifyContent",null),y([Object(f.a)({enumObject:l}),_("design:type",Number),_("design:paramtypes",[Number])],e.prototype,"anchorPoint",null),e}(C)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(409),i=n(443),o=n(416),a=n(439),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(){this._allowEditContent=!0,this.showSelectButtonConstraint=null,this._showSelectButton=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"allowEditContent",{get:function(){return this._allowEditContent},set:function(t){this._allowEditContent!==t&&(this._allowEditContent=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showSelectButton",{get:function(){return null!=this.showSelectButtonConstraint?this.showSelectButtonConstraint:this._showSelectButton},set:function(t){this._showSelectButton!==t&&(this._showSelectButton=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowEditContent=this.allowEditContent,t.showSelectButton=this.showSelectButton,t.showHandleButton=this.showHandleButton,t.showSelectButtonConstraint=this.showSelectButtonConstraint,t},t.prototype.clone=function(){var e=new t;return e.allowEditContent=this._allowEditContent,e.showSelectButton=this._showSelectButton,e.showSelectButtonConstraint=this.showSelectButtonConstraint,e.showHandleButton=this.showHandleButton,e},t.prototype.equals=function(t){return this.allowEditContent===t.allowEditContent&&this.showSelectButton===t.showSelectButton&&this.showSelectButtonConstraint===t.showSelectButtonConstraint&&this.showHandleButton===t.showHandleButton},s([Object(o.a)({ignore:!0,type:"boolean"}),l("design:type",Boolean)],t.prototype,"showSelectButtonConstraint",void 0),s([Object(a.a)(),Object(o.a)({factory:new i.d(!0)}),l("design:type",Boolean)],t.prototype,"showHandleButton",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(435),o=n(434),a=n(410),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._baselineLocation=new o.a,s._isVertical=!1,s.type=e.type,null!=r&&(s.baselineLocation=r),s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),s.manipulationPermissions.resizeGrips.edge=!1,s._ignorePermissionsChange=!1,s}return s(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineLocation",{get:function(){return this._baselineLocation},set:function(t){o.a.isEqual(this._baselineLocation,t)||(this._baselineLocation=t,this._propertyChanged.notify(this,"baselineLocation"))},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&null!=this.manipulationPermissions.resizeGrips&&(this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),this.manipulationPermissions.resizeGrips.edgeConstraint=!1)},e.prototype.getSimplifiedObject=function(e){void 0===e&&(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["_placeholders","currentTextImage","sourcePath","sourceRectangle"].concat(e));return n.placeholders=this.placeholders.toArray(),n},e.prototype._copy=function(n,r,i,o){return t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),r instanceof e&&(r.baselineLocation=n.baselineLocation),r},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(a.g)(this._isVertical,e._isVertical)&&Object(a.g)(this._baselineLocation,e._baselineLocation)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PlainTextItem",e}(i.a)},function(t,e,n){"use strict";var r=n(550);n.d(e,"a",(function(){return r.a})),n.d(e,"e",(function(){return r.b}));var i=n(416);n.d(e,"b",(function(){return i.a})),n.d(e,"d",(function(){return i.b}));var o=n(439);n.d(e,"c",(function(){return o.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(741),i=n(409),o=n(742),a=n(407),s=n(517),l=n(408),u=n(518),c=n(406),h=n(444),p=n(419),f=n(576),d=n(743),g=n(426),m=n(411),y=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},_=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},b=function(){function t(t){var e=this;this._afterUpdateCallbacks=[],this._modelItem=null,this._skipPropertyChanged=!1,this._skippedPropertyName=null,this._visible=!0,this._locked=!1,this._updating=!1,this._isCurrentWebServiceCallForAll=null,this._readyEvent=new i.c,this._changedEvent=new i.a,this._changingEvent=new i.a,this._itemPropertyChangedEvent=new i.c,this._isDisposed=!1,this._tag=null,this._transformOperation=null,this._baseOnItemPropertyChanged=function(t,n){e._skipPropertyChanged?e._skippedPropertyName=n:e._onItemPropertyChanged(t,n)},this._setItem(t),this._controlPoints=[],this._layer=null,this._tag=null,this._uniqueId=this._createUniqueID(),this._callbacks=[],this._renderState=f.a.Hidden,this._throttleSizeChanging=m.throttle((function(){this.raiseChanging()}),100)}return Object.defineProperty(t.prototype,"item",{get:function(){return this._modelItem},set:function(t){this._setItem(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoadingImage",{get:function(){return this._isLoadingImage()},set:function(t){this.isLoadingImage!==t&&this._setIsLoadingImage(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uniqueId",{get:function(){return this._uniqueId},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderState",{get:function(){return this._renderState},set:function(t){this._renderState=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentGroupItemHandler",{get:function(){return null!=this.item.parentGroupItem&&null!=this.canvas?this.canvas.handlerFactory.get(this.item.parentGroupItem):null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.item.blendMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controlPoints",{get:function(){return this._controlPoints},set:function(t){this._controlPoints=t,this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tag",{get:function(){return this._tag},set:function(t){this._tag=t,this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},set:function(t){if(t!==this._canvas){var e=this._canvas;this._canvas=t,null!=this._canvas?this._onAddedOnCanvas(t):this._onRemovedFromCanvas(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layer},set:function(t){this._layer=t,this.quickUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return null!=this._layer&&null!=this._canvas?this._canvas.flatGroupItemsInLayer(this._layer).indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new a.RectangleF(0,0,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.item.name},set:function(t){this.item.name=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._isIgnorePermissionsMode()?this._visible:this.item.visible},set:function(t){this._visible!==t&&(this._visible=t,this._refreshState(),t&&this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locked",{get:function(){return this._isIgnorePermissionsMode()?this._locked:this.item.locked},set:function(t){this._locked!==t&&(this._locked=t,this._refreshState())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNormalRenderingType",{get:function(){return null==this.layer||this.layer.renderingType===h.RenderingType.Normal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isUpdating",{get:function(){return this._updating},enumerable:!0,configurable:!0}),t.isGroupHandler=function(t){return t._isGroupHandler()},t.prototype.isHighlightNeeded=function(){return!1},t.prototype.hasBlendMode=function(){return null!=this.item.blendMode&&this.item.blendMode!=l.p.None&&this.item.blendMode!=l.p.Normal},t.prototype.getPermissions=function(){return null==this._permissions&&(this._permissions=this._createItemHandlerPermissions()),this._permissions},t.prototype.resetPermissions=function(){this._permissions=null},t.prototype.getTypeName=function(){return this.constructor.typeName},t.prototype.getData=function(t){var e=this._createDataInstance(this);return"asObject"===t?e:JSON.stringify(e)},t.prototype.updateItem=function(t){this._skippedPropertyName=null,this._modifyItem((function(e){e.update(t)})),null!=this._skippedPropertyName&&(this._onItemPropertyChanged(this.item,this._skippedPropertyName),null!=this.canvas&&this.canvas.updateSelection())},t.prototype.setData=function(t){var e;t&&""!==t&&(e="string"==typeof t?JSON.parse(t):t,this._createDataInstance().applyState(e,this))},t.prototype.isVisible=function(){var e=this,n=function(r){var i,o=r.parentGroupItem;if(null==o)return!1;if(!o.visible||o.visualizationPermissions.noShow)return!0;var a=null===(i=e.canvas)||void 0===i?void 0:i.handlerFactory.get(o);return!(!a||a.isVisible())||!(!a||!t.isGroupHandler(a)||a.isChildVisible(e))||n(o)};return this.visible&&!this.getPermissions().noShow&&(null==this.layer||this.layer.visible)&&!n(this.item)},t.prototype.isEmpty=function(){return!1},t.prototype.isLocked=function(){return this.locked||null!=this.layer&&this.layer.locked},t.prototype.processEvent=function(t){},t.prototype.hitTest=function(t){throw new Error("Not implemented")},t.prototype.draw=function(t,e,n,r,i,o,s){if(null!=t&&null!=this.canvas&&null!=this.layer){var l=this.canvas,u=t.globalCompositeOperation,c=this.hasBlendMode()?this._convertBlendModeToGlobalOperation(this.blendMode):u,h=null!=l.maskedLayers&&l.maskedLayers.includes(this.layer);t.globalAlpha=h?.2:1;var f=g.b.screenDpi*l.zoom/72,d=g.b.screenDpi*l.zoom/72,m=t.canvas.width,y=t.canvas.height;if(null!=e&&(t.save(),p.a.clipPath(t,e)),this.isNormalRenderingType)this.hasBlendMode()&&(t.globalCompositeOperation=c),this.drawItemHandler(t),this.hasBlendMode()&&(t.globalCompositeOperation=u);else{var _=this.layer.textureImage;if(null==_)return void l.drawWaitClock(t,this.bounds.center);var b=new a.RotatedRectangleF(l.workspaceWidth/2,l.workspaceHeight/2,l.workspaceWidth,l.workspaceHeight);p.a.drawImage(r,_,b,f,d,l.disableSmoothing),this.drawItemHandler(o,t),r.restore(),r.globalCompositeOperation="destination-in",r.drawImage(i,0,0,m,y),t.restore(),t.globalAlpha=h?.2:1,t.drawImage(n,0,0,m,y),s.applyContextScale(t)}null!=e&&t.restore()}},t.prototype.drawItemHandler=function(t,e){},t.prototype.quickUpdate=function(){},t.prototype.update=function(t,e){this._updateImpl(t,e)},t.prototype.updateAsync=function(t,e){return y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this._updateImpl(t,e)];case 1:return n.sent(),[2]}}))}))},t.prototype.updateForExternalCanvas=function(t){this._serverSideUpdate(null,null,null,t)},t.prototype.updateActiveColorWebServiceCall=function(t,e){return y(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return null==this._activeWebServiceCall?[3,2]:[4,this._activeWebServiceCall];case 1:n.sent(),n.label=2;case 2:return null!=this._activeColorWebServiceCall&&(this._activeColorWebServiceCall.cancel(),this._isCurrentWebServiceCallForAll&&!e)?(t.cancel(),this._isCurrentWebServiceCallForAll=e,this._activeColorWebServiceCall=null,[2]):(null==this._handlerUpdated&&(this._handlerUpdated=new d.a),this._activeColorWebServiceCall=t,this._isCurrentWebServiceCallForAll=e,[2])}}))}))},t.prototype.startTransform=function(t){this._transformOperation=t,this._cancelWebServiceCall()},t.prototype.endTransform=function(t,e,n){void 0===n&&(n=!1),this._transformOperation=null},t.prototype.waitUpdate=function(){return y(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return null==this._handlerUpdated?[3,2]:[4,this._handlerUpdated.promise];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.beginUpdate=function(){this._updating=!0},t.prototype.endUpdate=function(){this._updating=!1,this.updated();for(var t=!1;this._callbacks.length>0;){var e=this._callbacks.shift();"function"==typeof e&&(e(),t=!0)}t&&this.update()},t.prototype.updated=function(){this.raiseChanged()},t.prototype.addReady=function(t){this._readyEvent.add(t)},t.prototype.removeReady=function(t){this._readyEvent.remove(t)},t.prototype.addChanging=function(t){this._changingEvent.add(t)},t.prototype.removeChanging=function(t){this._changingEvent.remove(t)},t.prototype.raiseChanging=function(t){var e;t=null!=t?t:this.item,this._changingEvent.notify(t),this.item.getItemChangingEvent().notify(this.item),null===(e=this._canvas)||void 0===e||e.redraw()},t.prototype.getChangingEvent=function(){return this._changingEvent},t.prototype.addChanged=function(t){this._changedEvent.add(t)},t.prototype.removeChanged=function(t){this._changedEvent.remove(t)},t.prototype.raiseChanged=function(){this.isUpdating||this._changedEvent.notify(this)},t.prototype.getChangedEvent=function(){return this._changedEvent},t.prototype.addItemPropertyChanged=function(t){this._itemPropertyChangedEvent.add(t)},t.prototype.removeItemPropertyChanged=function(t){this._itemPropertyChangedEvent.remove(t)},t.prototype.initialize=function(){},t.prototype.onSuccessResponse=function(t){void 0===t&&(t=r.b.Item),t==r.b.Item?this._activeWebServiceCall=null:t==r.b.Color&&(this._activeColorWebServiceCall=null),null==this._activeWebServiceCall&&null==this._activeColorWebServiceCall&&null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null)},t.prototype.onErrorResponse=function(t,e){void 0===e&&(e=r.b.Item),e==r.b.Item?this._activeWebServiceCall=null:e==r.b.Color&&(this._activeColorWebServiceCall=null),this._afterUpdateCallbacks=[],null==this._activeWebServiceCall&&null==this._activeColorWebServiceCall&&null!=this._handlerUpdated&&(this._handlerUpdated.reject(t),this._handlerUpdated=null)},t.prototype.validateActiveColorWebServiceCall=function(){null!=this._activeColorWebServiceCall?(this._activeColorWebServiceCall=null,null==this._activeWebServiceCall&&(this._handlerUpdated=null)):null==this._activeWebServiceCall&&(this._handlerUpdated=null)},t.prototype.dispose=function(){var t;this._unsubscribeItemEvents(),this._cancelWebServiceCall(),null===(t=this._activeColorWebServiceCall)||void 0===t||t.cancel(),this._activeColorWebServiceCall=null,this._isDisposed=!0},t.prototype._updateImpl=function(t,e){return y(this,void 0,void 0,(function(){return _(this,(function(t){return[2]}))}))},t.prototype.transformChanged=function(){this.raiseChanged()},t.prototype._createDataInstance=function(t){return new s.a(t)},t.prototype._getDataItem=function(){return(new u.a).serializeModelComponent(this.item)},t.prototype._applyDataItem=function(t,e){var n=this,r=(new u.a).productParser.parseItem(t);this._modifyItem((function(){n._setDataItem(r,e)}))},t.prototype._setDataItem=function(t,e){this.item.transform=t.transform.clone(),this.setData(e)},t.prototype._modifyItem=function(t){if("function"==typeof t){this._skipPropertyChanged=!0;try{t(this.item)}finally{this._skipPropertyChanged=!1}}},t.prototype._refreshState=function(){},t.prototype._onAddedOnCanvas=function(t,e){null!=t&&(t.updateTexts(),e||this.update())},t.prototype._onRemovedFromCanvas=function(t){this._canvas=null},t.prototype._validateBeforeCallService=function(){return!0},t.prototype._update=function(t,e,n){this._serverSideUpdate(t,e,n,null)},t.prototype._callService=function(t,e,n,r,i){var o=null!=i?i:this.canvas;if(null!=o&&o.isInitialized&&!o.initialization){var a=this.isNormalRenderingType||null==this.layer?null:this.layer.uniqueId,s=o.getCallService(t,e,n,r,a);this._updateActiveWebServiceCall(s)}else this._handlerUpdated=null},t.prototype._updateActiveWebServiceCall=function(t){return y(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return this._cancelWebServiceCall(),this._activeWebServiceCall=t,null==this._activeColorWebServiceCall?[2]:(this._activeColorWebServiceCall.cancel(),this._activeColorWebServiceCall=null,[4,this._handlerUpdated.promise]);case 1:return e.sent(),[2]}}))}))},t.prototype._getDefaultPermissions=function(){return{manipulation:new l.W,visualization:new l.vb,item:new l.P,placeholder:new l.db}},t.prototype._getItemPermissions=function(){return{manipulation:this.item.manipulationPermissions,visualization:this.item.visualizationPermissions,item:this.item.itemPermissions,placeholder:new l.db}},t.prototype._isIgnorePermissionsMode=function(){var t,e;return null!==(e=null===(t=this.canvas)||void 0===t?void 0:t.ignorePermissionsMode)&&void 0!==e&&e},t.prototype._isLoadingImage=function(){return!1},t.prototype._setIsLoadingImage=function(t){throw new c.e},t.prototype._dispatchReadyEvent=function(){this._readyEvent.notify(this)},t.prototype._updateVisibility=function(){},t.prototype._subscribeItemEvents=function(){null!=this._modelItem&&this._modelItem.addPropertyChanged(this._baseOnItemPropertyChanged)},t.prototype._unsubscribeItemEvents=function(){null!=this._modelItem&&this._modelItem.removePropertyChanged(this._baseOnItemPropertyChanged)},t.prototype._onItemPropertyChanged=function(t,e){switch(e){case"locked":case"opacity":case"blendMode":null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.raiseChanged();break;case"transform":null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.transformChanged();break;case"visible":this._onItemVisibilityChanged();break;case"manipulationPermissions":case"visualizationPermissions":case"itemPermissions":case"permissions":this._permissions=null,this.quickUpdate(),this.canvas&&this.canvas.redraw(),this.raiseChanged(),this._updateVisibility()}this._itemPropertyChangedEvent.notify(this,e)},t.prototype._onItemVisibilityChanged=function(){this.quickUpdate(),null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.raiseChanged()},t.prototype._getItem=function(){return this._modelItem},t.prototype._setItem=function(t){this._unsubscribeItemEvents(),this._modelItem=t,this._subscribeItemEvents()},t.prototype._onValidateBeforeCallServiceFailed=function(){this._handlerUpdated.resolve(),this._handlerUpdated=null},t.prototype._isGroupHandler=function(){return!0},t.prototype._serverSideUpdate=function(t,e,n,r){var i=this;if(this.isUpdating)this._callbacks.push(e);else{"function"==typeof e&&e(),null!=n&&this._afterUpdateCallbacks.push(n);var o=this._createDataInstance(this),a=[JSON.stringify(o),JSON.parse(this._getDataItem())];null!=t&&(a=a.concat(t)),null==this._handlerUpdated&&(this._handlerUpdated=new d.a),this._validateBeforeCallService()?this._callService("Update"+this.getTypeName(),a,(function(t){if(null!=i.item){var e=null;"object"==typeof t&&(e=t.item,t=t.itemHandlerData),null!=e&&i._applyDataItem(e,t),i.setData(t),0===i._afterUpdateCallbacks.length?i.quickUpdate():(i._afterUpdateCallbacks.forEach((function(t){return t.apply(i)})),i._afterUpdateCallbacks=[],i.quickUpdate(),i.raiseChanged()),i.onSuccessResponse(),i.item.getItemChangedEvent().notify()}}),(function(t){i.onErrorResponse(t)}),r):this._onValidateBeforeCallServiceFailed()}},t.prototype._convertBlendModeToGlobalOperation=function(t){var e=null;switch(t){case l.p.Normal:e="normal";break;case l.p.Multiply:e="multiply";break;case l.p.Screen:e="screen";break;case l.p.Overlay:e="overlay";break;case l.p.Darken:e="darken";break;case l.p.Lighten:e="lighten";break;case l.p.ColorDodge:e="color-dodge";break;case l.p.ColorBurn:e="color-burn";break;case l.p.HardLight:e="hard-light";break;case l.p.SoftLight:e="soft-light";break;case l.p.Difference:e="difference";break;case l.p.Exclusion:e="exclusion";break;case l.p.None:default:e="none"}return e},t.prototype._cancelWebServiceCall=function(){null!=this._activeWebServiceCall&&(this._activeWebServiceCall.cancel(),this._activeWebServiceCall=null)},t.prototype._createItemHandlerPermissions=function(){var t=this._isIgnorePermissionsMode()?this._getDefaultPermissions():this._getItemPermissions(),e={AllowDelete:t.manipulation.allowDelete,AllowMoveHorizontal:t.manipulation.allowMoveHorizontal,AllowMoveVertical:t.manipulation.allowMoveVertical,AllowRotate:t.manipulation.allowRotate,ResizeGrips:null!=t.manipulation.resizeGrips?{Edge:t.manipulation.resizeGrips.edge,Corner:t.manipulation.resizeGrips.corner}:null,AllowDragAndDrop:t.manipulation.allowDragAndDrop,NoPrint:t.visualization.noPrint,NoShow:t.visualization.noShow,ShowDeleteToolbarButton:t.item.itemToolbarPermissions.showDeleteButton,ShowEditToolbarButton:t.item.itemToolbarPermissions.showEditButton,ShowHandleToolbarButton:t.item.itemToolbarPermissions.showHandleButton,ShowSelectToolbarButton:t.item.itemToolbarPermissions.showSelectButton,AllowEditContent:t.placeholder.allowEditContent,ShowSelectButton:t.placeholder.showSelectButton,ShowHandleButton:t.placeholder.showHandleButton};return new o.a(e,!0)},t.prototype._createUniqueID=function(){return"vo"+(new Date).getTime()+Math.round(1e3*Math.random())},t.typeName="ItemHandler",t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(407),o=n(510);!function(t){t[t.Point=0]="Point",t[t.Percent=1]="Percent",t[t.Pixel=2]="Pixel"}(r||(r={}));var a=function(){function t(t,e){this._rectangle=t,this._dpi=e}return t.prototype.convert=function(t){if(-1===t.indexOf("/"))return this._normalize(this._combineRadiuses(this._getRadiuses(t,!0),this._getRadiuses(t,!1)));var e=t.split("/");return this._normalize(this._combineRadiuses(this._getRadiuses(e[0].trim(),!0),this._getRadiuses(e[1].trim(),!1)))},t.prototype._normalize=function(t){if(null==t)return t;var e=t,n=(e[0].width+e[1].width)/this._rectangle.width,r=(e[2].width+e[3].width)/this._rectangle.width,i=(e[0].height+e[3].height)/this._rectangle.height,o=(e[1].height+e[2].height)/this._rectangle.height;return n>1&&(e[0].width=e[0].width/n,e[1].width=e[1].width/n),r>1&&(e[2].width=e[2].width/r,e[3].width=e[3].width/r),o>1&&(e[1].height=e[1].height/o,e[2].height=e[2].height/o),i>1&&(e[3].height=e[3].height/i,e[0].height=e[0].height/i),t},t.prototype._combineRadiuses=function(t,e){return null==t||4!==t.length||null==e||4!==e.length?null:[new i.SizeF(t[0],e[0]),new i.SizeF(t[1],e[1]),new i.SizeF(t[2],e[2]),new i.SizeF(t[3],e[3])]},t.prototype._getRadiuses=function(t,e){if(null==t)return null;var n=t.split(" ").filter((function(t){return null!=t&&t.length>0}));if(n.length<1)return null;if(n.length>4)return null;for(var r=[],i=0;i<n.length;i++){var o=this._tryParseNumberPart(n[i]);if(null==o)return null;r.push(this._toPoints(o,e))}switch(r.length){case 1:return[r[0],r[0],r[0],r[0]];case 2:return[r[0],r[1],r[0],r[1]];case 3:return[r[0],r[1],r[2],r[1]];default:return r}},t.prototype._tryParseNumberPart=function(t){if(t.endsWith("%")){var e=parseFloat(t);return NaN!==e?{value:e,measureType:r.Percent}:null}if(t.toLowerCase().endsWith("px")){var n=parseFloat(t);return NaN!==n?{value:n,measureType:r.Pixel}:null}var i=parseFloat(t);return isNaN(i)?null:{value:i,measureType:r.Point}},t.prototype._toPoints=function(t,e){switch(t.measureType){case r.Percent:return(e?this._rectangle.width:this._rectangle.height)*t.value/100;case r.Pixel:return o.a(t.value,this._dpi);default:return t.value}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return a}));var r,i=n(413),o=function(){function t(){this.name="cropmark",this.margin=10,this.color=new i.RgbColor(0,0,0,255),this.widthPx=1,this.length=8,this.leftNotes=null,this.topNotes=null,this.rightNotes=null,this.bottomNotes=null}return Object.defineProperty(t.prototype,"margins",{get:function(){return"number"==typeof this.margin?{horizontal:this.margin,vertical:this.margin}:this.margin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lengths",{get:function(){return"number"==typeof this.length?{horizontal:this.length,vertical:this.length}:this.length},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.name=this.name,e.margin=this.margin,e.color=this.color,e.widthPx=this.widthPx,e.length=this.length,e.leftNotes=null!=this.leftNotes?this.leftNotes.map((function(t){return t.clone()})):null,e.topNotes=null!=this.topNotes?this.topNotes.map((function(t){return t.clone()})):null,e.rightNotes=null!=this.rightNotes?this.rightNotes.map((function(t){return t.clone()})):null,e.bottomNotes=null!=this.bottomNotes?this.bottomNotes.map((function(t){return t.clone()})):null,e},t}();!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(r||(r={}));var a=function(){function t(){this.alignment=r.Left,this.fontSize=3,this.edgeMargin=.3,this.markMargin=.3}return t.prototype.clone=function(){var e=new t;return e.alignment=this.alignment,e.fontSize=this.fontSize,e.text=this.text,e.edgeMargin=this.edgeMargin,e.markMargin=this.markMargin,e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i=n(424),o=n(430),a=n(425),s=n(573),l=n(464),u=n(406),c=n(410),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parentSurface=null,i._safetyLines=new a.a,i._cropMarks=new a.a,i._onBoundsPropertyChanged=function(t,e){i._propertyChanged.notify(i,"bounds")},i._onBleedPropertyChanged=function(t,e){i._validateMargin(i.bleed,"bleed"),i._propertyChanged.notify(i,"bleed")},i._onSlugPropertyChanged=function(t,e){i._validateMargin(i.slug,"slug"),i._propertyChanged.notify(i,"slug")},i._validateMargin(n,"bleed"),i._validateMargin(r,"slug"),i._bounds=null!=e?e:new o.a,i.bleed=null!=n?n:new s.a,i.slug=null!=r?r:new s.a,i}return h(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this._bounds},set:function(t){this._bounds.equals(t)||(this._unsubscribeBoundsPropertyChanged(),this._bounds=t,this._subscribeBoundsPropertyChanged(),this._propertyChanged.notify(this,"bounds"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"safetyLines",{get:function(){return this._safetyLines},set:function(t){this._safetyLines!==t&&(this._safetyLines=t,this._propertyChanged.notify(this,"safetyLines"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cropMarks",{get:function(){return this._cropMarks},set:function(t){this._cropMarks!==t&&(this._cropMarks=t,this._propertyChanged.notify(this,"cropMarks"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bleed",{get:function(){return this._bleed},set:function(t){Object(c.g)(t,this._bleed)||(this._validateMargin(t,"bleed"),this._unsubscribeBleedPropertyChanged(),this._bleed=t,this._subscribeBleedPropertyChanged(),this._propertyChanged.notify(this,"bleed"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"slug",{get:function(){return this._slug},set:function(t){Object(c.g)(t,this._slug)||(this._validateMargin(t,"slug"),this._unsubscribeSlugPropertyChanged(),this._slug=t,this._subscribeSlugPropertyChanged(),this._propertyChanged.notify(this,"slug"))},enumerable:!0,configurable:!0}),e.prototype.getBounds=function(t){switch(t){case l.a.Bleed:return this.bounds.getExpanded(this.bleed);case l.a.Total:return this.bounds.getExpanded(new s.a({left:this.bleed.left+this.slug.left,top:this.bleed.top+this.slug.top,right:this.bleed.right+this.slug.right,bottom:this.bleed.bottom+this.slug.bottom}));default:return this.bounds.clone()}},e.prototype._subscribeBoundsPropertyChanged=function(){null!=this._bounds&&this._bounds.addPropertyChanged(this._onBoundsPropertyChanged)},e.prototype._unsubscribeBoundsPropertyChanged=function(){null!=this._bounds&&this._bounds.removePropertyChanged(this._onBoundsPropertyChanged)},e.prototype._subscribeBleedPropertyChanged=function(){null!=this._bleed&&this._bleed.addPropertyChanged(this._onBleedPropertyChanged)},e.prototype._unsubscribeBleedPropertyChanged=function(){null!=this._bleed&&this._bleed.removePropertyChanged(this._onBleedPropertyChanged)},e.prototype._subscribeSlugPropertyChanged=function(){null!=this._slug&&this._slug.addPropertyChanged(this._onSlugPropertyChanged)},e.prototype._unsubscribeSlugPropertyChanged=function(){null!=this._slug&&this._slug.removePropertyChanged(this._onSlugPropertyChanged)},e.prototype._validateMargin=function(t,e){if(null!=t&&(t.left<0||t.top<0||t.right<0||t.bottom<0))throw new u.a("PrintArea.ts: "+e+" margin members cannot be negative!")},e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentSurface","boundsWithMargins","boundsWithBleed"])},e.prototype._copy=function(e,n,r){var i,o;t.prototype._copy.call(this,e,n,r),n.bounds=null!=e.bounds?e.bounds.clone():null,n.safetyLines.addRange(e.safetyLines.toArray().map((function(t){return t.clone()}))),n.cropMarks.addRange(e.cropMarks.toArray().map((function(t){return t.clone()}))),n.bleed=null===(i=e.bleed)||void 0===i?void 0:i.clone(),n.slug=null===(o=e.slug)||void 0===o?void 0:o.clone()},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(422),o=n(409),a=n(424),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n,r,i,a,s,l,u,c,h,p,f,d,g=t.call(this)||this;g._propertyChanged=new o.c;var m=e;return g._left=null!==(i=null!==(r=null!==(n=null==m?void 0:m.left)&&void 0!==n?n:null==m?void 0:m.horizontal)&&void 0!==r?r:m)&&void 0!==i?i:0,g._top=null!==(l=null!==(s=null!==(a=null==m?void 0:m.top)&&void 0!==a?a:null==m?void 0:m.vertical)&&void 0!==s?s:m)&&void 0!==l?l:0,g._right=null!==(h=null!==(c=null!==(u=null==m?void 0:m.right)&&void 0!==u?u:null==m?void 0:m.horizontal)&&void 0!==c?c:m)&&void 0!==h?h:0,g._bottom=null!==(d=null!==(f=null!==(p=null==m?void 0:m.bottom)&&void 0!==p?p:null==m?void 0:m.vertical)&&void 0!==f?f:m)&&void 0!==d?d:0,g}return s(e,t),Object.defineProperty(e.prototype,"left",{get:function(){return this._left},set:function(t){Object(i.e)(t,this._left)||(this._left=t,this._propertyChanged.notify(this,"left"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this._top},set:function(t){Object(i.e)(t,this._top)||(this._top=t,this._propertyChanged.notify(this,"top"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this._right},set:function(t){Object(i.e)(t,this._right)||(this._right=t,this._propertyChanged.notify(this,"right"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this._bottom},set:function(t){Object(i.e)(t,this._bottom)||(this._bottom=t,this._propertyChanged.notify(this,"bottom"))},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e({left:this.left,top:this.top,right:this.right,bottom:this.bottom})},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._left&&0===this._top&&0===this._right&&0===this._bottom},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this.left===t.left&&this.top===t.top&&this.right===t.right&&this.bottom===t.bottom},e.prototype.getSimplifiedObject=function(){return{left:this.left,top:this.top,right:this.right,bottom:this.bottom}},e.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},e.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r,i=n(424),o=n(514),a=n(411),s=n(425),l=n(407),u=n(496),c=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){void 0===e&&(e=[]);var n=t.call(this)||this;return n.defaultDesignLocation=new l.PointF,n._defaultSafetyLines=new s.a,n._defaultCropMarks=new s.a,n._surfaces=new s.a,n._preferredFonts=[],n._onSurfacesAdd=function(t){t.item.parentProduct=n},n.surfaces.add_collectionChanged(n._onSurfacesAdd),n.surfaces.setRange(e),n.palette=new u.a,n}return c(e,t),Object.defineProperty(e.prototype,"surfaces",{get:function(){return this._surfaces},set:function(t){this.surfaces.setRange(t)},enumerable:!0,configurable:!0}),e.prototype.serialize=function(t,e){return t.serialize(this,e)},Object.defineProperty(e.prototype,"defaultSafetyLines",{get:function(){return this._defaultSafetyLines},set:function(t){this._defaultSafetyLines!==t&&(this._defaultSafetyLines=t,this._propertyChanged.notify(this,"defaultSafetyLines"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCropMarks",{get:function(){return this._defaultCropMarks},set:function(t){this._defaultCropMarks!==t&&(this._defaultCropMarks=t,this._propertyChanged.notify(this,"defaultCropMarks"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredFonts",{get:function(){return this._preferredFonts},set:function(t){this._preferredFonts=t,this._propertyChanged.notify(this,"preferredFonts")},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.surfaces.addRange(e.surfaces.toArray().map((function(t){return t.clone(r)}))),n.watermarkConfig=null!=e.watermarkConfig?e.watermarkConfig.clone():null,n.defaultCropMarks.addRange(e.defaultCropMarks.toArray().map((function(t){return t.clone()}))),n.defaultSafetyLines.addRange(e.defaultSafetyLines.toArray().map((function(t){return t.clone()}))),n.defaultDesignLocation=e.defaultDesignLocation.clone(),n.palette.addRange(e.palette.select((function(t){return t.clone(r)}))),n.preferredFonts=null===(i=e.preferredFonts)||void 0===i?void 0:i.slice()},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.getAllItems=function(t){return void 0===t&&(t={ignoreMockups:!1}),o.a.getItems(this.surfaces,t)},e.prototype.generateNewIds=function(){this._generateNewId(),this._surfaces.forEach((function(t){return t.generateNewIds()}))},e.prototype.getSurface=function(t){var e=this.surfaces.toArray(),n=parseInt(t);return!Number.isNaN(n)&&n>=0&&e.length>n?e[n]:a.find(e,(function(e){return e.name===t}))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(413),o=n(406),a=function(){function t(){}return t.parse=function(e){if(null==e)return null;if(null==e.colorSpace)throw new o.c("Unable to parse color, data colorSpace is not set");var n=i.ColorSpace[e.colorSpace.toString()];if(null==n)throw new o.c("Unable to parse color, unknown data colorSpace: '"+e.colorSpace+"'");var r=t._mappedParsers[i.ColorSpace[n]];if(null==r)throw new o.c("Unable to parse color, color space '"+n+"' is not supported");return r(e)},t.parseRgbColor=function(t){return new i.RgbColor(t.r,t.g,t.b,t.alpha,t.profile)},t._parseCmykColor=function(t){return new i.CmykColor(t.c,t.m,t.y,t.k,t.alpha,t.profile)},t._parseGrayscaleColor=function(t){return new i.GrayscaleColor(t.l,t.alpha,t.profile)},t._parseLabColor=function(t){return new i.LabColor(t.l,t.a,t.b,t.alpha,t.profile)},t._parseSpotColor=function(e){var n=t._parseInk(e.ink);return new i.SpotColor(n,e.tint,e.alpha)},t._parseInk=function(e){var n=t.parse(e.alternativeColor);return new i.Ink(e.name,n,e.solidity)},t._mappedParsers=((r={})[i.ColorSpace.Rgb]=t.parseRgbColor,r[i.ColorSpace.Cmyk]=t._parseCmykColor,r[i.ColorSpace.Grayscale]=t._parseGrayscaleColor,r[i.ColorSpace.Lab]=t._parseLabColor,r[i.ColorSpace.Spot]=t._parseSpotColor,r),t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Hidden=0]="Hidden",t[t.Bottom=1]="Bottom",t[t.Active=2]="Active",t[t.Top=3]="Top"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(407),i=n(470),o=function(){function t(){}return Object.defineProperty(t,"textWhizz",{set:function(t){this._textWhizz=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"designAtomsApiClient",{set:function(t){this._designAtomsApiClient=t},enumerable:!0,configurable:!0}),t.getBounds=function(t){var e,n,r,i,o,a;return r=this,i=void 0,a=function(){var r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:return null===(e=this.getBoundsSync(t))||void 0===e?[3,1]:(r=e,[3,3]);case 1:return[4,null===(n=this._designAtomsApiClient)||void 0===n?void 0:n.getPathBoundsFromServer(t)];case 2:r=i.sent(),i.label=3;case 3:return[2,r]}}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}))},t.getBoundsSync=function(t){if(null!=this._textWhizz){var e=Object(i.b)(this._textWhizz,t).getBounds();return new r.RectangleF(e.x,e.y,e.width,e.height)}return this._isDomBoundsEnabled?this._getDOMBounds(t):null},Object.defineProperty(t,"_isDomBoundsEnabled",{get:function(){return!this._getDOMBounds(this._testRectangle).isEmpty()},enumerable:!0,configurable:!0}),t._getDOMBounds=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.position="absolute",e.style.visibility="hidden";var n=document.createElementNS("http://www.w3.org/2000/svg","path");e.appendChild(n),n.setAttribute("d",t.toString());var i=document.querySelector("body");i.appendChild(e);var o=n.getBBox(),a=new r.RectangleF(o.x,o.y,o.width,o.height);return i.removeChild(e),a},t._testRectangle=r.Path.rectangle(0,0,10,10),t._textWhizz=null,t._designAtomsApiClient=null,t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(459),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="ImageHandlerData",e&&(n.DI=e.needToDownloadImage,n.SAS=e.takeIntoAccountImageDpi,n.HR=e.sourceImageHorizontalResolution,n.VR=e.sourceImageVerticalResolution),n}return o(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),n.sourceImageHorizontalResolution=e.HR,n.sourceImageVerticalResolution=e.VR,n.needToDownloadImage=e.DI,n.takeIntoAccountImageDpi=e.SAS,t.prototype.applyState.call(this,e,n))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(459),o=n(607),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=this,r=e._editing;if(r&&(e._editing=!1),n=t.call(this,e)||this,e._editing=r,n.__type="PlaceholderHandlerData",e){e.isEmptyContent()?n.CT=null:n.CT=e.getTypeName();var i=e.topFrames;if(null!=i){n.TFCT=[],n.TFCD=[];for(var o=0;o<i.length;o++)n.TFCD.push(i[o].getData()),n.TFCT.push(i[o].getTypeName())}var a=e.bottomFrames;if(null!=a)for(n.BFCT=[],n.BFCD=[],o=0;o<a.length;o++)n.BFCD.push(a[o].getData()),n.BFCT.push(a[o].getTypeName());n.SMC=e.showMaskedContent}return n}return a(e,t),e.prototype.applyState=function(e,n){if(n){if(n.beginUpdate(),null!=e.TFCD&&0!==e.TFCD.length){for(var r=[],i=0;i<e.TFCD.length;i++)if(null!=e.TFCT[i]){var a=(new o.a).create(e.TFCT[i]);a.setData(e.TFCD[i]),r.push(a)}n.topFrames=r}if(null!=e.BFCD&&0!==e.BFCD.length){var s=[];for(i=0;i<e.BFCD.length;i++)if(null!=e.BFCT[i]){var l=(new o.a).create(e.BFCT[i]);l.setData(e.BFCD[i]),s.push(l)}n.bottomFrames=s}n.showMaskedContent=e.SMC,t.prototype.applyState.call(this,e,n)}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}));var r,i=n(407);!function(t){t.point="pt",t.pixel="px"}(r||(r={}));class o{constructor(t,e){this.value=null!=t?t:0,this.unit=null!=e?e:r.point}equals(t,e){if(null==t)return!1;const n=Object(i.EqualsOfFloatNumbers)(this.value,t.value,e),r=this.unit===t.unit;return n&&r}static equals(t,e,n){return null==t&&null==e||null!=t&&null!=e&&t.equals(e,n)}toString(){return`${this.value}${this.unit}`}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var r,i=n(482);!function(t){t.left="left",t.center="center",t.right="right",t.justification="justification",t.lastLeft="justification-last-left",t.lastCenter="justification-last-center",t.lastRight="justification-last-right"}(r||(r={}));class o{}class a extends i.a{constructor(){super(...arguments),this.inlineElements=[]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(580);class i{isMatch(t){const e=r.a.equals(this.leftIndent,t.leftIndent),n=r.a.equals(this.firstLineIndent,t.firstLineIndent),i=r.a.equals(this.levelIndent,t.levelIndent),o=r.a.equals(this.textIndent,t.textIndent);return e&&n&&i&&o}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}));class r{}r.levelIndent="level-indent",r.textIndent="text-indent",r.leftIndent="left-indent",r.firstLineIndent="first-line-indent";class i{}i.fontSize="font-size";class o extends r{}o.start="start",o.type="type";class a extends r{}a.type="type"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(433);class i{static serialize(t){return`#${t}`}static parse(t){if(!t)return null;const e=t.trim();if(e.match(/^#(\d+)$/))return parseInt(e.substring(1));throw new r.b(`Unable to parse bullet-char value from string '${e}'`)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(433),i=n(420),o=n(427);class a{static serialize(t){switch(t){case i.ListStyleType.bullets:return"bullets";case i.ListStyleType.numbers:return"numbers";case i.ListStyleType.none:return"none";default:throw new r.b(`Unable to serialize list style type from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"bullets":return i.ListStyleType.bullets;case"numbers":return i.ListStyleType.numbers;case"none":return i.ListStyleType.none;default:throw new r.b(`Unable to parse list-type value from string '${t}'`)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(433),i=n(420),o=n(427),a=n(460);class s{static serialize(t){switch(t){case i.NumberFormatType.lowerLetter:return"lower-letter";case i.NumberFormatType.lowerRoman:return"lower-roman";case i.NumberFormatType.none:return"none";case i.NumberFormatType.number:return"number";case i.NumberFormatType.upperLetter:return"upper-letter";case i.NumberFormatType.upperRoman:return"upper-roman";default:throw new r.b(`Unable to serialize format-type value from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"lower-letter":return i.NumberFormatType.lowerLetter;case"lower-roman":return i.NumberFormatType.lowerRoman;case"none":return i.NumberFormatType.none;case"number":return i.NumberFormatType.number;case"upper-letter":return i.NumberFormatType.upperLetter;case"upper-roman":return i.NumberFormatType.upperRoman;default:throw new r.b(`Unable to parse format-type value from string '${t}'`)}}static fromListType(t){switch(t){case a.c.lowerLetter:return i.NumberFormatType.lowerLetter;case a.c.lowerRoman:return i.NumberFormatType.lowerRoman;case a.c.numbers:return i.NumberFormatType.number;case a.c.upperLetter:return i.NumberFormatType.upperLetter;case a.c.upperRoman:return i.NumberFormatType.upperRoman}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(433),i=n(420),o=n(427);class a{static serialize(t){switch(t){case i.NumberMode.startAt:return"start-at";case i.NumberMode.continueFromPrevious:return"continue-from-previous";default:throw new r.b(`Unable to serialize number-mode value from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"start-at":return i.NumberMode.startAt;case"continue-from-previous":return i.NumberMode.continueFromPrevious;default:throw new r.b(`Unable to parse number-mode value from string '${t}'`)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(433),i=n(420),o=n(460),a=n(472),s=n(427);class l{static serializeComplex(t,e,n){let o=null;switch(t){case i.ListStyleType.numbers:switch(e){case i.NumberFormatType.number:case i.NumberFormatType.none:case null:o="decimal";break;case i.NumberFormatType.lowerRoman:o="lower-roman";break;case i.NumberFormatType.upperRoman:o="upper-roman";break;case i.NumberFormatType.lowerLetter:o="lower-alpha";break;case i.NumberFormatType.upperLetter:o="upper-alpha";break;default:o="decimal"}break;case i.ListStyleType.bullets:if(n)if("number"==typeof n)switch(n){case i.NumberFormatType.number:case 8226:o="disc";break;case 9642:o="square";break;default:o=`'${String.fromCharCode(n)}'`}else"string"==typeof n&&(o="•"==n?"disc":"▪"==n?"square":1==n.length?`'${n}'`:3==n.length&&n.match(/('|").('|")/g)?`'${n[1]}'`:"disc");else o="disc";break;case i.ListStyleType.none:o="none";break;default:throw new r.b(`Unable to serialize list style type from value '${t}'`)}return o}static parseNumberModeStartAt(t){return Number.isInteger(t)?{numberMode:i.NumberMode.startAt,startAt:t}:{numberMode:i.NumberMode.continueFromPrevious,startAt:null}}static parseComplex(t){var e,n;if(Object(s.a)(t))return null;const o=t.toLowerCase();switch(o){case"disc":case"circle":return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:8226};case"square":return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:9642};case null===(e=o.match(/('|").('|")/))||void 0===e?void 0:e.input:return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:o.charCodeAt(1)};case null===(n=o.match(/&#\d+/))||void 0===n?void 0:n.input:return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:parseInt(o.replace(/[^0-9]/g,""))};case"decimal":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.number,bulletChar:null};case"lower-alpha":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.lowerLetter,bulletChar:null};case"upper-alpha":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.upperLetter,bulletChar:null};case"lower-roman":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.lowerRoman,bulletChar:null};case"upper-roman":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.upperRoman,bulletChar:null};case"none":return{listStyleType:i.ListStyleType.none,numberFormatType:null,bulletChar:null};default:throw new r.b(` parseComplex Unable to parse list-type value from string '${t}'`)}}static parseOltype(t){if(Object(s.a)(t))return null;switch(t.toLowerCase()){case"decimal":return o.c.numbers;case"lower-alpha":return o.c.lowerLetter;case"upper-alpha":return o.c.upperLetter;case"lower-roman":return o.c.lowerRoman;case"upper-roman":return o.c.upperRoman;default:throw new r.b(` parseOltype Unable to parse list-type value from string '${t}'`)}}static parseUltype(t){if(Object(s.a)(t))return null;let e=new a.d;if(1==t.length)return e.value=t,e;switch(t.toLowerCase()){case"disc":case"circle":return a.c.bullet;case"-":case"—":return a.c.minus;case"none":return a.c.none;case"square":return e.value="▪",e;default:if(t.match(/('|").('|")/g))return e.value=String.fromCharCode(t.replace(/('|")/g,"").charCodeAt(0)),e;if(t.match(/&#\d+/g))return e.value=String.fromCharCode(parseInt(t.replace(/[^0-9]/g,""))),e;throw new r.b(`parseUltype Unable to parse list-type value from string '${t}'`)}}}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.dblclick=0]="dblclick",t[t.mousedown=1]="mousedown",t[t.mousemove=2]="mousemove",t[t.mouseup=3]="mouseup"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(407),i=n(408),o=n(429),a=n(536),s=n(409),l=n(490);class u{constructor(t,e,n,r){this._commandFactory=t,this._currentTextInfo=e,this._clipboard=n,this._inputTextValidator=r,this._isMouseSelectionActive=!1,this._mouseSelectionStart=null,this._mouseSelectionEnd=null,this._textLimitsViolationEvent=new s.a,this._limitsInputValidator=new l.b(e)}initialize(t,e,n=null){this._isTextFormattingEnabled=t,this._isNewLineEnabled=e,this._limitsInputValidator.setLimits(n),this._clipboard.init()}processMouseEvent(t){const e=new r.PointF(t.x,t.y),n=this._getMouseInputCommandType(t,e);if(null==n)return[];switch(n){case o.b.setCursor:return[this._createCmd(o.a.setCursor,new a.o(e))];case o.b.setSelection:{let t=this._mouseSelectionStart.toIPoint(),e=this._mouseSelectionEnd.toIPoint();return[this._createCmd(o.a.setSelection,new a.p(t,e))]}case o.b.selectCurrentParagraph:return[this._createCmd(o.a.selectParagraph,new a.l(e))];case o.b.selectCurrentWord:return[this._createCmd(o.a.selectWord,new a.m(e))];default:return[]}}async processKeyboardEvent(t){const e=await this._getKeyboardInputCommandType(t);if(null==e)return[];if(!await this._validateKeyboardCommand(e))return[];switch(e.type){case o.b.moveCursor:return[this._createCmd(o.a.moveCursor,new a.k(this._convertKeyEventToDirection(t),!1))];case o.b.moveCursorWithSelection:return[this._createCmd(o.a.moveCursor,new a.k(this._convertKeyEventToDirection(t),!0))];case o.b.insertNewLine:return[this._createCmd(o.a.insertNewLine,new a.h(this._isNewLineEnabled))];case o.b.insertLineBreak:return[this._createCmd(o.a.insertLineBrake,new a.g(this._isNewLineEnabled))];case o.b.insertTab:return[this._createCmd(o.a.insertTab)];case o.b.deleteToLeft:return[this._createCmd(o.a.deleteText,new a.f(o.f.left))];case o.b.deleteLeftWord:return[this._createCmd(o.a.deleteText,new a.f(o.f.leftWord))];case o.b.deleteToRight:return[this._createCmd(o.a.deleteText,new a.f(o.f.right))];case o.b.deleteRightWord:return[this._createCmd(o.a.deleteText,new a.f(o.f.rightWord))];case o.b.insertChar:return this._processInsertChar(t);case o.b.undo:return[this._createCmd(o.a.undo)];case o.b.redo:return[this._createCmd(o.a.redo)];case o.b.clearFormatting:return[this._createCmd(o.a.clearFormatting)];case o.b.selectAll:return[this._createCmd(o.a.selectAllText)];case o.b.copyToClipboard:return[this._createCmd(o.a.copyToClipboard)];case o.b.pasteFromClipboard:{const t={text:e.initData,isNewLineEnabled:this._isNewLineEnabled};return[this._createCmd(o.a.insertText,t)]}case o.b.setCapitalLetters:return[this._createCmd(o.a.setCapitalLetters)];case o.b.setFontBold:return[this._createCmd(o.a.setFontBold)];case o.b.setFontItalic:return[this._createCmd(o.a.setFontItalic)];case o.b.setSuperscriptLetters:return[this._createCmd(o.a.setSuperscriptLetters)];case o.b.setSubscriptLetters:return[this._createCmd(o.a.setSubscriptLetters)];case o.b.setFontUnderline:return[this._createCmd(o.a.setFontUnderline)];case o.b.increaseFontSize:return[this._createCmd(o.a.increaseFontSize)];case o.b.decreaseFontSize:return[this._createCmd(o.a.decreaseFontSize)];case o.b.setLeftAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Left))];case o.b.setRightAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Right))];case o.b.setCenterAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Center))];case o.b.createBulletedListItem:return[this._createCmd(o.a.creteBulletedListItem,e.initData)];case o.b.createNumberedListItem:return[this._createCmd(o.a.creteNumberedListItem,e.initData)];case o.b.createBulletedListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.creteBulletedListItem,e.initData)];case o.b.createNumberedListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.creteNumberedListItem,e.initData)];case o.b.addListItemWithNewLine:return[this._createCmd(o.a.insertNewLine,new a.h(this._isNewLineEnabled)),this._createCmd(o.a.addListItem,e.initData)];case o.b.addListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.addListItem,e.initData)];case o.b.deleteListItem:return[this._createCmd(o.a.deleteListItem)];case o.b.increaseListItemIndent:return[this._createCmd(o.a.increaseListItemIndent)];case o.b.decreaseListItemIndent:return[this._createCmd(o.a.decreaseListItemIndent)];default:return[]}}get textLimitsViolationEvent(){return this._textLimitsViolationEvent}async _processInsertChar(t){const e=t.key;if(await this._validateInputText(e)){const t={text:e,isNewLineEnabled:this._isNewLineEnabled};return[this._createCmd(o.a.insertText,t)]}return[]}_createCmd(t,e){return this._commandFactory.create(t,e)}_getMouseInputCommandType(t,e){const n=t.type===o.e.mousedown,r=t.type===o.e.mouseup,i=t.type===o.e.mousemove&&!0===this._isMouseSelectionActive;if(n)return this._isMouseSelectionActive=!0,this._mouseSelectionStart=e,this._mouseSelectionEnd=null,o.b.setCursor;if(r){if(this._isMouseSelectionActive=!1,t.isClick)return 1==t.clickCount?o.b.setCursor:t.clickCount%2==1?o.b.selectCurrentParagraph:o.b.selectCurrentWord;this._mouseSelectionEnd=e,this._isMouseSelectionChanged()?o.b.setSelection:o.b.setCursor}return i&&this._isMouseSelectionActive?(this._mouseSelectionEnd=e,o.b.setSelection):null}async _validateKeyboardCommand(t){const e=this._limitsInputValidator.validateInput(t);if(e.limitsViolated||e.pastedLimitsViolated){const t={isLimitsBroken:e.limitsViolated,isPastePrevented:e.pastedLimitsViolated};return this._textLimitsViolationEvent.notify(t),!1}return t.type!=o.b.pasteFromClipboard||await this._validateInputText(t.initData)}async _getKeyboardInputCommandType(t){const e=t.code===o.c.Tab,n=t.code===o.c.Space,r=t.code===o.c.Enter,i=!0===t.shiftKey,a=!0===t.ctrlKey||!0===t.metaKey,s=t.code===o.c.Backspace,l=t.code===o.c.Delete;return null!=this._convertKeyEventToDirection(t)?i?{type:o.b.moveCursorWithSelection}:{type:o.b.moveCursor}:n&&!a?this._handlePressSpace():s?this._handlePressBackspace(a):l?a?{type:o.b.deleteRightWord}:{type:o.b.deleteToRight}:a?await this._getHotkeyInputCommandType(t):r?this._handlePressEnter(i):e?this._handlePressTab(i):1===t.key.length?{type:o.b.insertChar}:null}_handlePressEnter(t){if(!t&&this._currentTextInfo.isParagraphAListItem){if(this._currentTextInfo.isParagraphEmpty)return 0===this._currentTextInfo.getListItemLevel()?{type:o.b.deleteListItem}:{type:o.b.decreaseListItemIndent};let t;const e=this._currentTextInfo.getSelection();t=null==e||e.isEmpty?this._currentTextInfo.getParagraphIndex():e.getParagraphIndexes()[0];const n={previousListItemIndex:t};return{type:o.b.addListItemWithNewLine,initData:n}}return t?{type:o.b.insertLineBreak}:{type:o.b.insertNewLine}}_handlePressBackspace(t){return this._currentTextInfo.isParagraphAListItem&&this._currentTextInfo.isCursorAtTheBeginningOfParagraph&&null==this._currentTextInfo.getSelection()?{type:o.b.deleteListItem}:t?{type:o.b.deleteLeftWord}:{type:o.b.deleteToLeft}}_handlePressTab(t){let e;const n=this._currentTextInfo.getSelection();return e=null!=n?n.getParagraphIndexes().length>1?t?o.b.decreaseListItemIndent:o.b.increaseListItemIndent:o.b.insertTab:this._currentTextInfo.isParagraphAListItem&&this._currentTextInfo.isCursorAtTheBeginningOfParagraph?t?o.b.decreaseListItemIndent:o.b.increaseListItemIndent:o.b.insertTab,{type:e}}_handlePressSpace(){var t;if(!this._currentTextInfo.isParagraphAListItem){const e=null!==(t=this._tryToGetCreationBulletedListItemType())&&void 0!==t?t:this._tryToGetCreationNumberedListItemType();if(e)return e}return{type:o.b.insertChar}}async _getHotkeyInputCommandType(t){const e=t.shiftKey,n=t.code;if(n===o.c.Space)return{type:o.b.clearFormatting};if(n===o.c.KeyA&&!e)return{type:o.b.selectAll};if(n===o.c.KeyC)return{type:o.b.copyToClipboard};if(n===o.c.KeyV){const t=await this._clipboard.read();return{type:o.b.pasteFromClipboard,initData:t}}return n===o.c.KeyZ?{type:o.b.undo}:n===o.c.KeyY?{type:o.b.redo}:this._isTextFormattingEnabled?n===o.c.KeyA&&e?{type:o.b.setCapitalLetters}:n===o.c.KeyB?{type:o.b.setFontBold}:n===o.c.KeyI?{type:o.b.setFontItalic}:n===o.c.KeyU?{type:o.b.setFontUnderline}:n===o.c.KeyPeriod&&e?{type:o.b.increaseFontSize}:n===o.c.KeyComma&&e?{type:o.b.decreaseFontSize}:n===o.c.KeyEqual&&e||n===o.c.KeyPeriod?{type:o.b.setSuperscriptLetters}:n===o.c.KeyEqual||n===o.c.KeyComma?{type:o.b.setSubscriptLetters}:n===o.c.KeyL?{type:o.b.setLeftAlignment}:n===o.c.KeyR?{type:o.b.setRightAlignment}:n===o.c.KeyE?{type:o.b.setCenterAlignment}:null:null}_isMouseSelectionChanged(){const t=this._mouseSelectionStart,e=this._mouseSelectionEnd;return!Object(r.EqualsOfFloatNumbers)(t.x,e.x)||!Object(r.EqualsOfFloatNumbers)(t.y,e.y)}_tryToGetCreationBulletedListItemType(){let t,e;const n=this._getBulletedListInfo();if(null==n)return null;const r=this._currentTextInfo.findItemToContinueBulletedList(n.charCode);return null!=r?(t=o.b.addListItemWithSpace,e=new a.a(r)):(t=o.b.createBulletedListItemWithSpace,e=new a.d(this._currentTextInfo.getParagraphIndex(),n.charCode)),{type:t,initData:e}}_tryToGetCreationNumberedListItemType(){let t,e,n;const r=this._getNumberedListInfo();if(null===r)return null;if(1===r.itemNumber)t=!0,e=o.b.createNumberedListItemWithSpace,n=new a.e(this._currentTextInfo.getParagraphIndex(),r.format);else{const i=this._currentTextInfo.findItemToContinueNumberedList(r.format,r.itemNumber);null==i?t=!1:(t=!0,e=o.b.addListItemWithSpace,n=new a.a(i))}return t?{type:e,initData:n}:null}_getBulletedListInfo(){if(1!==this._currentTextInfo.getCursorPosition().getOffset())return null;const t=this._currentTextInfo.getTextFromStartOfParagraph().getPlainText();return"*"!==t&&"-"!==t&&"+"!==t?null:{charCode:"*"===t?8226:t.charCodeAt(0)}}_getNumberedListInfo(){if(this._currentTextInfo.getCursorPosition().getOffset()>8)return null;const t=this._currentTextInfo.getTextFromStartOfParagraph().getPlainText();return this._tryToGetNumberingFormat(t)}_tryToGetNumberingFormat(t){var e,n;if("."!==t.slice(-1))return null;const r=t.slice(0,-1);return null!==(n=null!==(e=this._tryToGetNumericFormat(r))&&void 0!==e?e:this._tryToGetRomanFormat(r))&&void 0!==n?n:this._tryToGetLetterFormat(r)}_tryToGetNumericFormat(t){if(!/^\d+$/.test(t))return null;const e=parseInt(t);return isNaN(e)?null:{itemNumber:e,format:o.h.number}}_tryToGetRomanFormat(t){const e=this._parseRomanToNumber(t);return isNaN(e)?null:this._isUpperCase(t)?{itemNumber:e,format:o.h.upperRoman}:this._isLowerCase(t)?{itemNumber:e,format:o.h.lowerRoman}:null}_tryToGetLetterFormat(t){const e=this._parseLetterToNumber(t);return isNaN(e)||e>100?null:this._isUpperCase(t)?{itemNumber:e,format:o.h.upperLetter}:this._isLowerCase(t)?{itemNumber:e,format:o.h.lowerLetter}:null}_parseRomanToNumber(t){const e=new Map([["I",1],["V",5],["X",10],["i",1],["v",5],["x",10]]);let n=0,r=0,i=0;for(const o of t.split("").reverse())r=e.get(o),r>=i?n+=r:n-=r,i=r;return n>0?n:NaN}_parseLetterToNumber(t){let e=t.toUpperCase(),n=0,r=e.length;for(let i=0;i<r;i++)n+=(e.charCodeAt(i)-64)*Math.pow(26,r-i-1);return n}_isUpperCase(t){return t===t.toUpperCase()}_isLowerCase(t){return t===t.toLowerCase()}_convertKeyEventToDirection(t){const e=t.ctrlKey||t.metaKey;switch(t.code){case o.c.Left:return e?o.f.leftWord:o.f.left;case o.c.Right:return e?o.f.rightWord:o.f.right;case o.c.Up:return o.f.up;case o.c.Down:return o.f.down;case o.c.Home:return e?o.f.textStart:o.f.lineStart;case o.c.End:return e?o.f.textEnd:o.f.lineEnd}return null}async _validateInputText(t){const e=await this._inputTextValidator.validateWithConfirmation(t);return e.isTextValid||e.isInputConfirmed}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(409),i=n(408),o=n(407),a=n(429),s=n(592),l=n(590),u=n(593),c=n(536),h=n(490);class p{constructor(t,e,n,i){this._clipboard=t,this._inputTextValidator=e,this._fontRegistry=n,this._renderer=i,this._textMetrics=null,this._textLimits=null,this._onCursorChanged=()=>{this._updateCharStyle(),this._updateParagraphStyle(),this._drawCursor(!0),this._updateTextMetrics()},this._onTextChanged=async()=>{this._checkInvalidSymbols()&&(await this._checkFrameChanged(),this._renderManager.drawText(),this._updateTextMetrics())},this._onStyleChanged=async()=>{this._updateParagraphStyle(),this._updateCharStyle(),await this._checkFrameChanged(),this._drawSelection(this._textManager.getSelectedTextRange()),this._styleChangedEvent.notify()},this._onSelectionChanged=async t=>{this._drawCursor(!0),this._drawSelection(t),await this._checkFrameChanged(),this._updateTextMetrics()},this._checkInvalidSymbols=()=>{const t=this._inputTextValidator.validate(this._textManager.getFormattedText());return t||this._invalidCharEntered.notify(),t},this._updateLimitsEvent=t=>{null==this||this._textLimitsViolationEvent.notify(t)},this._textManager=new s.a,this._currentTextInfo=new h.a(this._textManager),this._renderManager=new u.a,this._commandHistory=new c.c,this._commandFactory=new c.b(this._textManager,this._fontRegistry,this._clipboard),this._inputManager=new l.a(this._commandFactory,this._currentTextInfo,this._clipboard,e),this._frameChangedEvent=new r.a,this._styleChangedEvent=new r.a,this._initializedEvent=new r.a,this._invalidCharEntered=new r.a,this._textLimitsViolationEvent=new r.a,this._textMetricsChangedEvent=new r.a,this._isReady=!1,this._isActive=!1,this._charStyle=null,this._paragraphStyle=null}get isReady(){return this._isReady}get renderer(){return this._renderer}get editorInitialized(){return this._initializedEvent}get highlightInEditingModeEnabled(){return!0}get redrawActiveTextInEditMode(){return!0}get isActive(){return this._isActive}get frameChanged(){return this._frameChangedEvent}get invalidCharEntered(){return this._invalidCharEntered}get styleChanged(){return this._styleChangedEvent}get canUndo(){return this._textManager.canUndo}get canRedo(){return this._textManager.canRedo}get textMetrics(){return this._textMetrics}get textLimits(){return this._textLimits}get textMetricsChangedEvent(){return this._textMetricsChangedEvent}get textLimitsViolationEvent(){return this._textLimitsViolationEvent}initialize(t,e,n){this._rectangle=e.rectangle,this._previewScale=e.previewScale,this._overflowStrategy=e.overflowStrategy,this._isBoundedText=e.isBoundedText,this._isEmptyTextPlaceholder=e.isEmptyTextPlaceholder,this._isNewLineEnabled=e.isNewLineEnabled,this._isTextFormattingEnabled=e.isTextFormattingEnabled,this._charStyle=null,this._paragraphStyle=null,this._textLimits=e.limits,this._inputManager.initialize(this._isTextFormattingEnabled,this._isNewLineEnabled,e.limits),this._textManager.initialize({textEngineWrapper:t,listStyleSheetManager:n}),this._renderManager.initialize(t,this._renderer,this._previewScale),this._isReady=!0,this._initializedEvent.fire()}enterEditMode(t){this._isReady&&(this._isActive=!0,this._charStyle=null,this._paragraphStyle=null,this._bindToManager(),this._textManager.setCursorToPoint(t),this._commandHistory.clearHistory(),this._isEmptyTextPlaceholder&&this._textManager.deleteAllText())}exitEditMode(){this._isActive=!1,this._charStyle=null,this._paragraphStyle=null,this._renderManager.clearCursor(),this._unbindFromManager(),this._textManager.detach()}executeCommand(t,e){if(!this._isReady)return;const n=this._commandFactory.create(t,e);this._executeCommand(n)}processMouseEvent(t){if(!this._isReady)return!1;let e=!1;const n=this._inputManager.processMouseEvent(t);for(let r of n)this._executeCommand(r)&&(e=!0);return e}async processKeyEvent(t){if(!this._isReady)return!1;let e=!1;const n=await this._inputManager.processKeyboardEvent(t);for(let r of n)this._executeCommand(r)&&(e=!0);return e}async processZoomChangedEvent(){return this.redraw(),!0}redraw(){if(!this._isReady)return!1;this._renderManager.drawText(),this._drawCursor(!0),this._drawSelection(this._textManager.getSelectedTextRange())}async getFormattedText(){return this._textManager.getFormattedText()}getTextModel(){return this._textManager.getTextModel()}getInlineStyle(){return this.isReady?(this._charStyle||this._updateCharStyle(),this._charStyle):null}async setInlineStyle(t){const e={style:t};this.executeCommand(a.a.setCharStyle,e)}getParagraphStyle(){return this.isReady?(this._paragraphStyle||this._updateParagraphStyle(),this._paragraphStyle):null}async setParagraphStyle(t){const e={style:t};this.executeCommand(a.a.setParagraphStyle,e)}isBulletedList(){return this._textManager.getSelectedParagraphIndexes().every((t=>{var e;return(null===(e=this._textManager.getListItemStyle(t))||void 0===e?void 0:e.type)===a.d.bullets}))}isNumberedList(){return this._textManager.getSelectedParagraphIndexes().every((t=>{var e;return(null===(e=this._textManager.getListItemStyle(t))||void 0===e?void 0:e.type)===a.d.numbers}))}isIndentationEnabled(){return this._textManager.isParagraphsTheSameList(this._textManager.getSelectedParagraphIndexes())}isIndentationHidden(){return!1}isApplyingListsEnabled(){return this._isNewLineEnabled}undo(){this.executeCommand(a.a.undo)}redo(){this.executeCommand(a.a.redo)}dispose(){}async _checkFrameChanged(){const t=this._rectangle;let e=null;if(!1===this._isBoundedText)e=await this._textManager.measureText(this._previewScale);else if(this._overflowStrategy===i.X.ExpandBox){const n=await this._textManager.measureTextFrame(!0);n.height>t.height&&(e=t.clone(),e.height=n.height)}null!=e&&(!Object(o.EqualsOfFloatNumbers)(t.width,e.width)||!Object(o.EqualsOfFloatNumbers)(t.height,e.height))&&(this._frameChangedEvent.notify(e),this._rectangle=e)}_drawCursor(t=!1){if(!this._isActive)return;const e=null!=this._textManager.getSelectedTextRange();this._renderManager.drawCursor(e,t)}_drawSelection(t){(null==t?void 0:t.isValid)?this._renderManager.drawSelection(t):this._renderManager.drawText()}_updateCharStyle(){const t=this._textManager.getCurrentCharStyle();t&&(this._charStyle=t)}_updateParagraphStyle(){this._paragraphStyle=this._textManager.getCurrentParagraphStyle()}_updateTextMetrics(){this._textMetrics=this._currentTextInfo.getTextMetrics(),this._textMetricsChangedEvent.notify(this._textMetrics)}_executeCommand(t){let e=!1;const n=t instanceof c.j;n&&this._textManager.pauseUndoRedo();try{e=t.execute(),this._commandHistory.addCommand(t)}finally{n&&this._textManager.resumeUndoRedo()}return e}_bindToManager(){this._textManager.cursorChangedEvent.add(this._onCursorChanged),this._textManager.textChangedEvent.add(this._onTextChanged),this._textManager.styleChangedEvent.add(this._onStyleChanged),this._textManager.selectionChangedEvent.add(this._onSelectionChanged),this._inputManager.textLimitsViolationEvent.add(this._updateLimitsEvent)}_unbindFromManager(){this._textManager.cursorChangedEvent.remove(this._onCursorChanged),this._textManager.textChangedEvent.remove(this._onTextChanged),this._textManager.styleChangedEvent.remove(this._onStyleChanged),this._textManager.selectionChangedEvent.remove(this._onSelectionChanged),this._inputManager.textLimitsViolationEvent.remove(this._updateLimitsEvent)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(409),i=n(490);class o{constructor(){this._cursorHandler=null,this._textHandler=null,this._styleHandler=null,this._selectionHandler=null,this._undoRedoHandler=null,this._metadataHandler=null,this._textMeasurer=null,this._onTextChanged=()=>{this._textChangedEvent.notify()},this._onCursorChanged=t=>{this._cursorChangedEvent.notify(t)},this._onStyleChanged=()=>{this._styleChangedEvent.notify(),this._updateCursor()},this._onSelectionChanged=t=>{this._selectionChangedEvent.notify(t),this._updateCursor()},this._cursorChangedEvent=new r.a,this._textChangedEvent=new r.a,this._styleChangedEvent=new r.a,this._selectionChangedEvent=new r.a,this._listService=new i.c,this._isInitialized=!1}get isInitialized(){return this._isInitialized}initialize(t){const e=t.textEngineWrapper;this._cursorHandler=e.cursorHandler,this._textHandler=e.textHandler,this._styleHandler=e.styleHandler,this._selectionHandler=e.selectionHandler,this._undoRedoHandler=e.undoRedoHandler,this._metadataHandler=e.metadataHandler,this._textMeasurer=e.textMeasurer,this._listService.initialize({textEngineWrapper:t.textEngineWrapper,styleManager:t.listStyleSheetManager}),this._bindToHandlers(),this._isInitialized=!0}detach(){this._unbindFromHandlers(),this._listService.actualizeStyleManager()}get cursorChangedEvent(){return this._cursorChangedEvent}getFirstPosition(){return this._cursorHandler.getFirstPosition()}getCurrentPosition(){return this._cursorHandler.getCurrentPosition()}getCurrentParagraphIndex(){return this._cursorHandler.getCurrentParagraphIndex()}isSelectionCollapsed(){const t=this.getSelectedTextRange();return!t||t.isEmpty}isCaretOnTheBeginingOfParagraph(){return this.isSelectionCollapsed()&&0==this._cursorHandler.getCurrentPosition().getOffset()}isCaretOnEndOfParagraph(){return this.isSelectionCollapsed()&&this._cursorHandler.getCurrentPosition().getOffset()==this.getCurrentParagraphLength()}setCursorToPosition(t){this._cursorHandler.setToPosition(t),this._resetSelection(t)}setCursorToPoint(t){this._cursorHandler.setToPoint(t),this._resetSelection(this._cursorHandler.getPositionByPoint(t))}moveCursorToDirection(t,e){this._cursorHandler.moveToDirection(t),e?this._updateSelection():this._resetSelection()}get textChangedEvent(){return this._textChangedEvent}getParagraphCount(){return this._textHandler.getParagraphCount()}getParagraphText(t){return this._textHandler.getParagraphText(t)}getTextRangeByPositions(t,e){return this._textHandler.getTextRangeByPositions(t,e)}getTextModel(){return this._textHandler.getTextModel()}setTextModel(t){this._textHandler.setTextModel(t);const e=this._cursorHandler.getFirstPosition();this._cursorHandler.setToPosition(e),this._resetSelection(e)}getFormattedText(){return this._textHandler.getFormattedText()}insertPlainText(t){this._deleteSelection(),this._textHandler.insertPlainText(t),this._updateCursor(),this._resetSelection()}insertFormattedText(t){this._deleteSelection(),this._textHandler.insertFormattedText(t),this._updateCursor(),this._resetSelection()}insertNewLine(){this._deleteSelection(),this._textHandler.insertNewLine(),this._resetSelection(),this._updateCursor()}deleteTextToDirection(t){const e=null==this._selectionHandler.getSelectionRange()?this._deleteTextToDirection(t):this._deleteSelection();e&&this._cursorHandler.setToPosition(e),this.resetSelection()}deleteTextByRange(t){return this._textHandler.deleteTextByRange(t)}deleteAllText(){this._textHandler.deleteAllText()}setWrappingPath(t){this._textHandler.setWrappingPath(t)}async measureText(t,e=!1){return await this._textMeasurer.measureText(t,e)}async measureTextFrame(t){return await this._textMeasurer.measureTextFrame(t)}getTextLength(){return this._textHandler.getAllText().getPlainText().replace(/\n/g,"").length}getCurrentParagraphLength(){const t=this.getCurrentParagraphIndex();return this.getParagraphLength(t)}getParagraphLength(t){return t<0||t>=this.getParagraphCount()?0:this.getParagraphText(t).getPlainText().length}get styleChangedEvent(){return this._styleChangedEvent}clearCurrentFormatting(){const t=this._selectionHandler.getSelectionRange();null!=t?this._styleHandler.clearFormatForRange(t):this._styleHandler.clearFormatForCurrentPosition()}getCharStyleForPosition(t){return this._styleHandler.getCharStyleForPosition(t)}setCharStyleForPosition(t,e){this._styleHandler.setCharStyleForPosition(t,e)}getCurrentCharStyle(){const t=this._selectionHandler.getSelectionRange();return null!=t?this._styleHandler.getCharStyleForRange(t):this._styleHandler.getCharStyleForCurrentPosition()}setCurrentCharStyle(t){const e=this._selectionHandler.getSelectionRange();null!=e?this._styleHandler.setCharStyleForRange(t,e):this._styleHandler.setCharStyleForCurrentPosition(t)}getCurrentParagraphStyle(){const t=this._selectionHandler.getSelectionRange();return null!=t?this._styleHandler.getParagraphStyleForRange(t):this._styleHandler.getParagraphStyleForCurrentPosition()}getParagraphStyleByIndex(t){return this._styleHandler.getParagraphStyleByIndex(t)}setCurrentParagraphStyle(t){const e=this._selectionHandler.getSelectionRange();null!=e?this._styleHandler.setParagraphStyleForRange(t,e):this._styleHandler.setParagraphStyleForCurrentPosition(t)}setParagraphStyleByIndex(t,e){this._styleHandler.setParagraphStyleByIndex(t,e)}get selectionChangedEvent(){return this._selectionChangedEvent}getSelectedParagraphIndexes(){var t,e;return null!==(e=null===(t=this.getSelectedTextRange())||void 0===t?void 0:t.getParagraphIndexes())&&void 0!==e?e:[this.getCurrentParagraphIndex()]}getSelectedTextRange(){return this._selectionHandler.getSelectionRange()}setSelection(t,e){this._selectionHandler.setSelectionByPoints(t,e),this._cursorHandler.setToPoint(e)}selectCurrentWord(){const t=this._cursorHandler.getCurrentWord();this._selectionHandler.setSelectionByRange(t),this._cursorHandler.setToPosition(t.getEndPosition())}selectCurrentParagraph(){const t=this._cursorHandler.getCurrentParagraphIndex(),e=this._textHandler.getParagraphText(t);this._selectionHandler.setSelectionByRange(e)}selectAllText(){const t=this._textHandler.getAllText();this._selectionHandler.setSelectionByRange(t)}resetSelection(){this._resetSelection()}isParagraphAListItem(t){return this._listService.isParagraphAListItem(t)}isParagraphsTheSameList(t){return this._listService.isParagraphsTheSameList(t)}actualizeStyleManager(){this._listService.actualizeStyleManager()}applyListType(t,e){this._listService.applyListType(t,e)}findItemToContinueBulletedList(t,e){return this._listService.findItemToContinueBulletedList(t,e)}findItemToContinueNumberedList(t,e,n){return this._listService.findItemToContinueNumberedList(t,e,n)}getListItemStyle(t){return this._listService.getListItemStyle(t)}createBulletedListItem(t,e){this._listService.createBulletedListItem(t,e)}createNumberedListItem(t,e){this._listService.createNumberedListItem(t,e)}addListItem(t,e){this._listService.addListItem(t,e)}deleteListItem(t){this._listService.deleteListItem(t)}increaseListItemIndent(t){this._listService.increaseListItemIndent(t)}decreaseListItemIndent(t){this._listService.decreaseListItemIndent(t)}get canRedo(){return this._undoRedoHandler.canRedo}get canUndo(){return this._undoRedoHandler.canUndo}redo(){this._undoRedoHandler.redo(),this._updateUndoRedoSelection(),this._textChangedEvent.notify()}undo(){this._undoRedoHandler.undo(),this._updateUndoRedoSelection(),this._textChangedEvent.notify()}pauseUndoRedo(){this._undoRedoHandler.pause()}resumeUndoRedo(){this._undoRedoHandler.resume()}_updateCursor(){const t=this._cursorHandler.getCurrentPosition();this._cursorChangedEvent.notify(t)}_bindToHandlers(){this._cursorHandler.cursorChangeEvent.add(this._onCursorChanged),this._textHandler.textChangeEvent.add(this._onTextChanged),this._styleHandler.styleChangeEvent.add(this._onStyleChanged),this._selectionHandler.selectionChangeEvent.add(this._onSelectionChanged)}_unbindFromHandlers(){this._cursorHandler.cursorChangeEvent.remove(this._onCursorChanged),this._textHandler.textChangeEvent.remove(this._onTextChanged),this._styleHandler.styleChangeEvent.remove(this._onStyleChanged),this._selectionHandler.selectionChangeEvent.remove(this._onSelectionChanged)}_resetSelection(t){this._selectionHandler.resetSelection(null!=t?t:this._cursorHandler.getCurrentPosition())}_updateSelection(){const t=this._cursorHandler.getCurrentPosition();this._selectionHandler.setSelectionToPosition(t)}_deleteSelection(){const t=this._selectionHandler.getSelectionRange();if(null==t)return null;const e=this._deleteTextRange(t);return e&&this._cursorHandler.setToPosition(e),e}_isTextRangeContainsListItems(t){return t.getParagraphIndexes().some((t=>this.isParagraphAListItem(t)))}_deleteTextRange(t){return this._isTextRangeContainsListItems(t)?this._deleteTextRangeWithLists(t):this._deletePlainTextRange(t)}_deletePlainTextRange(t){return this._textHandler.deleteTextByRange(t)}_deleteTextRangeWithLists(t){const e=t.getParagraphIndexes(),n=e[0],r=this._styleHandler.getCharStyleForPosition(t.getLeftPosition());for(let o of e)o!==n&&this._listService.isParagraphAListItem(o)&&this._listService.deleteListItem(o);const i=this._deletePlainTextRange(t);return this._textHandler.getParagraphText(n).isEmpty&&(this._cursorHandler.setToPosition(i),this._styleHandler.setCharStyleForCurrentPosition(r)),i}_deleteTextToDirection(t){return this.isParagraphAListItem(this.getCurrentParagraphIndex())?this._deleteTextToDirectionInListItem(t):this._textHandler.deleteTextToDirection(t)}_deleteTextToDirectionInListItem(t){const e=this._styleHandler.getCharStyleForCurrentPosition(),n=this._deletePlainTextToDirection(t);return this._textHandler.getParagraphText(this.getCurrentParagraphIndex()).isEmpty&&this.setCurrentCharStyle(e),n}_deletePlainTextToDirection(t){return this._textHandler.deleteTextToDirection(t)}_updateUndoRedoSelection(){const t=this._undoRedoHandler.getSelection();if(t.isValid){const e=t.getStartPosition(),n=t.getEndPosition();e.isEqualTo(n)?this._cursorHandler.setToPosition(e):this._selectionHandler.setSelectionByRange(t)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(407),i=n(438);class o{constructor(){this._isCursorBlink=!0,this._previewScale=null,this._tw=null}initialize(t,e,n){this._tw=i.i.getEngine(t),this._textRenderer=e,this._previewScale=n}drawCursor(t,e=!1){this._isCursorBlink=e||!this._isCursorBlink,this._isCursorBlink&&!t?this._textRenderer.drawCursor((t=>{this._addContextToPath(t,this._previewScale)})):this._textRenderer.clearCursor()}clearCursor(){this._textRenderer.clearCursor()}drawSelection(t){this._textRenderer.drawSelection(this._tw.engineHandler,i.i.getTextRange(t).getEntry())}drawText(){this._textRenderer.drawText(this._tw.engineHandler)}_addContextToPath(t,e){const n=this._tw.engineHandler.getCursor().getPath();Object(r.EqualsOfFloatNumbers)(e,1)||n.scale(e,e),n.addToContext(t)}}},function(t,e,n){"use strict";var r,i,o,a;n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return a})),function(t){t[t.MouseDown=0]="MouseDown",t[t.MouseUp=1]="MouseUp",t[t.MouseMove=2]="MouseMove",t[t.TouchStart=3]="TouchStart",t[t.TouchEnd=4]="TouchEnd",t[t.TouchMove=5]="TouchMove",t[t.KeyDown=6]="KeyDown",t[t.KeyUp=7]="KeyUp",t[t.Wheel=8]="Wheel"}(r||(r={})),function(t){t.Click="Click",t.Transform="Transform",t.PointerDown="PointerDown",t.Move="Move",t.LongTap="LongTap",t.Key="Key",t.Wheel="Wheel",t.Hover="Hover"}(i||(i={})),function(t){t.None="None",t.Primary="Primary",t.Secondary="Secondary",t.Tertiary="Tertiary"}(o||(o={})),function(t){t.Started="Started",t.InProgress="InProgress",t.Finished="Finished"}(a||(a={}))},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"e",(function(){return p})),n.d(e,"f",(function(){return m})),n.d(e,"g",(function(){return y})),n.d(e,"b",(function(){return _}));var r=n(409),i=n(438);class o{constructor(t){this._tw=t,this._converter=new i.c(this._tw.engine),this._cursorChangeEvent=new r.a}get cursorChangeEvent(){return this._cursorChangeEvent}getFirstPosition(){return new i.g(this._tw.engineHandler.getFirstPosition())}getPositionByPoint(t){return this._getPositionByPoint(t)}getCurrentPosition(){return new i.g(this._getCurrentPosition())}getCurrentParagraphIndex(){return this._getCurrentPosition().getParagraphIndex()}getCurrentWord(){return new i.h(this._getCurrentPosition().getWord())}setToPoint(t){const e=this._getPositionByPoint(t);this._setPosition(e)}setToPosition(t){const e=i.i.getPosition(t);this._setPosition(e)}moveToDirection(t){const e=this._converter.convertMoveDirectionToTextWhizz(t);return!!this._cursor.move(e,!1)&&(this._cursorChangeEvent.notify(this.getCurrentPosition()),!0)}get _cursor(){return this._tw.engineHandler.getCursor()}_getCurrentPosition(){return this._cursor.getPosition()}_getPositionByPoint(t){const e=this._tw.engineHandler.getPosition(t.x,t.y,!1);return new i.g(e)}_setPosition(t){this._cursor.set(t.getEntry()),this._cursorChangeEvent.notify(t)}}var a=n(487);class s{constructor(t){this._tw=t,this._selection=null,this._anchor=null,this._selectionChangeEvent=new r.a}get selectionChangeEvent(){return this._selectionChangeEvent}getSelectionRange(){return this._selection}setSelectionByRange(t){this._setSelectionByRange(a.a.getTextRange(t))}setSelectionByPoints(t,e){const n=this._getPositionByPoint(t),r=this._getPositionByPoint(e),i=this._createRange(n,r);this._setSelectionByRange(i)}setSelectionByPositions(t,e){const n=this._createRange(a.a.getPosition(t),a.a.getPosition(e));this._setSelectionByRange(n)}setSelectionToPosition(t){const e=this._anchor,n=a.a.getPosition(t),r=this._createRange(e,n);this._setSelectionByRange(r)}resetSelection(t){this._setSelection(null),this._setAnchor(t)}_createRange(t,e){return i.h.createEntry(this._tw.engine,t.getEntry(),e.getEntry())}_setSelectionByRange(t){const e=this._selection;(null==e||!t.isEqualTo(e))&&this._setSelection(t)}_setSelection(t){const e=this._selection;null!=t?(this._setAnchor(t.getStartPosition()),this._selection=new i.h(t.getEntry()),this._selectionChangeEvent.notify(t)):null!=e&&(this._selection=null,this._selectionChangeEvent.notify(null))}_setAnchor(t){this._anchor=t?a.a.getPosition(t):null}_getPositionByPoint(t){const e=this._tw.engineHandler.getPosition(t.x,t.y,!1);return new i.g(e)}}class l{constructor(t,e){this._tw=t,this._styleChangeEvent=new r.a,this._isInitialized=!1,this._colorPalette=null,this._colorPreviewService=e}get colorPalette(){return this._colorPalette}get isInitialized(){return this._isInitialized}initialize(t){this._colorPalette=new i.b(this._tw,t),this._isInitialized=!0}get styleChangeEvent(){return this._styleChangeEvent}getDefaultCharStyle(){if(!this.isInitialized)return null;const t=new i.a(this._tw.engine,this._colorPalette);return t.setEntry(this._getDefaultCharStyle()),t}setDefaultCharStyle(t){if(!this.isInitialized)return;const e=this._getDefaultCharStyle(),n=new i.a(this._tw.engine,this._colorPalette,t);this._tw.engineHandler.setDefaultCharStyle(n.patchToEntry(e))}clearFormatForRange(t){const e=this.getDefaultCharStyle();this.setCharStyleForRange(e,t),this._styleChangeEvent.notify()}clearFormatForCurrentPosition(){const t=this.getDefaultCharStyle();this.setCharStyleForCurrentPosition(t),this._styleChangeEvent.notify()}getCharStyleForPosition(t){const e=i.i.getPosition(t).getEntry().getCharStyle();return this._convertCharStyleFromTw(e)}setCharStyleForPosition(t,e){const n=i.i.getPosition(t).getEntry(),r=i.h.createEntry(this._tw.engine,n,n);this.setCharStyleForRange(e,r)}getCharStyleForCurrentPosition(){if(!this.isInitialized)return null;const t=this._getCharStyleForCurrentPosition();return this._convertCharStyleFromTw(t)}getCharStyleForRange(t){if(!this.isInitialized||!t.isValid)return null;const e=i.i.getTextRange(t).getEntry().getStart().getCharStyle();if(e){const t=new i.a(this._tw.engine,this._colorPalette);return t.setEntry(e),t}return null}setCharStyleForCurrentPosition(t){if(!this.isInitialized)return;const e=new i.a(this._tw.engine,this._colorPalette,t),n=this._getCharStyleForCurrentPosition();this._tw.engineHandler.getCursor().setCharStyle(e.patchToEntry(n)),this._styleChangeEvent.notify()}setCharStyleForRange(t,e){if(!this.isInitialized||!e.isValid)return;const n=new i.a(this._tw.engine,this._colorPalette,t);i.i.getTextRange(e).getEntry().updateCharStyles((t=>n.patchToEntry(t))),this._styleChangeEvent.notify()}getDefaultParagraphStyle(){if(!this.isInitialized)return null;const t=new i.f(this._tw.engine);return t.setEntry(this._getDefaultParagraphStyle()),t}setDefaultParagraphStyle(t){if(!this.isInitialized)return;const e=this._getDefaultParagraphStyle(),n=new i.f(this._tw.engine,t);this._tw.engineHandler.setDefaultParagraphStyle(n.patchToEntry(e))}getParagraphStyleForCurrentPosition(){if(!this.isInitialized)return null;const t=new i.f(this._tw.engine);return t.setEntry(this._getParagraphStyleForCurrentPosition()),t}setParagraphStyleForCurrentPosition(t){if(!this.isInitialized)return;const e=new i.f(this._tw.engine,t),n=this._getParagraphStyleForCurrentPosition();this._tw.engineHandler.getCursor().setParagraphStyle(e.patchToEntry(n)),this._styleChangeEvent.notify()}getParagraphStyleByIndex(t){if(!this.isInitialized||!this._isParagraphIndexValid(t))return null;const e=new i.f(this._tw.engine);return e.setEntry(this._tw.engineHandler.getParagraphStyle(t)),e}setParagraphStyleByIndex(t,e){if(!this.isInitialized||!this._isParagraphIndexValid(t))return null;const n=new i.f(this._tw.engine,e),r=this._tw.engineHandler.getParagraphStyle(t);this._tw.engineHandler.setParagraphStyle(t,n.patchToEntry(r)),this._styleChangeEvent.notify()}getParagraphStyleForRange(t){if(!this.isInitialized||!t.isValid)return null;const e=i.i.getTextRange(t).getEntry().getParagraphStyles();if(e.size()>0){const t=e.get(0),n=new i.f(this._tw.engine);return n.setEntry(t),n}return null}setParagraphStyleForRange(t,e){if(!e.isValid)return;const n=new i.f(this._tw.engine,t);i.i.getTextRange(e).getEntry().updateParagraphStyles((t=>n.patchToEntry(t))),this._styleChangeEvent.notify()}_convertCharStyleFromTw(t){const e=new i.a(this._tw.engine,this._colorPalette);return e.setEntry(t),e}_getDefaultCharStyle(){return this._tw.engineHandler.getDefaultCharStyle()}_getCharStyleForCurrentPosition(){return this._tw.engineHandler.getCursor().getCharStyle()}_getDefaultParagraphStyle(){return this._tw.engineHandler.getDefaultParagraphStyle()}_getParagraphStyleForCurrentPosition(){return this._tw.engineHandler.getCursor().getParagraphStyle()}_isParagraphIndexValid(t){return t<=this._tw.engineHandler.getParagraphCount()-1}}var u=n(470),c=n(754),h=n(429);class p{constructor(t,e,n){this._tw=t,this._textMeasurerHolder=e,this._converter=new i.c(this._tw.engine),this._textParser=new c.GmXmlParser(n),this._textSerializer=new c.GmXmlSerializer(n),this._textChangeEvent=new r.a}get textChangeEvent(){return this._textChangeEvent}setTextFrames(t,e){const n=this._tw.engineHandler.getFrameCount(),r=t.frames.length,o=t.frames,a=t.type;let s=0;for(;s<r;s++){const t=new i.d(this._tw,this._textMeasurerHolder,a,o[s],e);s<n?this._tw.engineHandler.replaceFrame(t.get(),s):this._tw.engineHandler.addFrame(t.get())}if(n>r){const t=s;for(;s<n;s++)this._tw.engineHandler.removeFrame(t)}}setWrappingPath(t){if(!t)return;let e=null;t.isEmptyPath?e=new this._tw.engine.Path:t.path&&(e=Object(u.b)(this._tw.engine,t.path)),e&&(t.wrappingMargin&&e.offsetContour(t.wrappingMargin),this._tw.engineHandler.setWrappingPath(e))}getTextRangeByPositions(t,e){const n=i.i.getPosition(t),r=i.i.getPosition(e);return this._createRange(n,r)}getTextModel(){return this._textParser.parse(this._getFormattedText(),null,0,null)}setTextModel(t){this.deleteAllText();const e=this._textSerializer.serialize(t,null);this.insertFormattedText(e)}getParagraphCount(){return this._tw.engineHandler.getParagraphCount()}getParagraphText(t){return new i.h(this._tw.engineHandler.getParagraphTextRange(t))}getAllText(){return new i.h(this._getAllText())}deleteAllText(){const t=new i.h(this._getAllText());return this._deleteTextByRange(t)}deleteTextByRange(t){const e=i.i.getTextRange(t);return this._deleteTextByRange(e)}deleteTextToDirection(t){const e=this._cursor.getPosition();if(!this._cursor.move(this._converter.convertMoveDirectionToTextWhizz(t),!1))return null;const n=this._cursor.getPosition(),r=this._getMovementSide(t),o=r===h.g.toTheLeft,a=o?n:e,s=o?e:n,l=i.h.createEntry(this._tw.engine,a,s),u=this._deleteTextByRange(l,r);return this._textChangeEvent.notify(),u}getFormattedText(){return this._getFormattedText()}insertPlainText(t){this._cursor.insertPlainText(t),this._textChangeEvent.notify()}insertFormattedText(t){this._cursor.insertText(t),this._textChangeEvent.notify()}insertNewLine(){this._cursor.insertLine(),this._textChangeEvent.notify()}get _cursor(){return this._tw.engineHandler.getCursor()}_createRange(t,e){return i.h.createEntry(this._tw.engine,t.getEntry(),e.getEntry())}_getFormattedText(){return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults()}_getAllText(){return this._tw.engineHandler.getTextRange()}_deleteTextByRange(t,e){let n;n=null!=e&&e===h.g.toTheLeft?this._tw.engine.RangeCursorPos.right:this._tw.engine.RangeCursorPos.left;const r=t.getEntry().delete(n);return this._textChangeEvent.notify(),new i.g(r)}_getMovementSide(t){return t===h.f.left||t===h.f.leftWord||t===h.f.textStart||t===h.f.lineStart||t===h.f.up?h.g.toTheLeft:h.g.toTheRight}}var f=n(407),d=n(752);class g{static isTextEmpty(t){return"<p></p>"===t||"<p><span></span></p>"===t||""===t}}class m{constructor(t){this._tw=t}isTextCropped(){if(g.isTextEmpty(this._getFormattedText()))return!1;const t=new i.h(this._getAllText()),e=new i.h(this._tw.engineHandler.getVisibleTextRange());if(!t.isEqualTo(e))return!0;const n=this._getTextBounds(),r=Object(f.EqualsOfFloatNumbers)(0,n.width),o=Object(f.EqualsOfFloatNumbers)(0,n.height);return r||o}measureText(t,e=!1){let n=this._getTextBounds();const r=this._tw.engineHandler.getFrameCount()>0&&this._tw.engineHandler.getFrame(0)instanceof this._tw.engine.ShapeTextFrame,i=Object(f.EqualsOfFloatNumbers)(0,n.width)&&Object(f.EqualsOfFloatNumbers)(0,n.height)&&g.isTextEmpty(this._getFormattedText());if(r){let t=this._getFrameShape(0);for(let e=1;e<this._tw.engineHandler.getFrameCount();e++)t=this._tw.engine.Path.union(t,this._getFrameShape(e));if(e){const e=new this._tw.engine.Path;e.rect(n.x,n.y,n.width,n.height),t=this._tw.engine.Path.union(t,e)}n=t.getBounds()}else i&&(n=this._tw.clone("X").engineHandler.getBounds());return new f.RectangleF(n.x*t,n.y*t,n.width*t,n.height*t)}measureTextFrame(t){const e=this._tw.initData.text,n=t?this._getFormattedText():this._getTextForFrameMeasure(e),r=this._tw.clone(n).engineHandler.getBounds();return new f.RectangleF(r.x,r.y,r.width,r.height)}_getFormattedText(){return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults()}_getAllText(){return this._tw.engineHandler.getTextRange()}_getTextBounds(){return this._tw.engineHandler.getBounds()}_getFrameShape(t){const e=this._tw.engineHandler.getFrame(t);if(e instanceof this._tw.engine.ShapeTextFrame)return e.shape}_getTextForFrameMeasure(t){return""===t||null==t?"X":(this._isEmptyFirstLine(t)&&(t=this._insertIntoFirstLine(t,"X")),this._isEmptyLastLine(t)&&(t=this._insertIntoLastLine(t,"X")),t)}_isEmptyFirstLine(t){return!!(t=this._normalizeTags(t)).startsWith("<p></p>")||!!t.startsWith("<p><span><br/>")||!!t.startsWith("<p><br/>")}_insertIntoFirstLine(t,e){return t.startsWith("<p></p>")||t.startsWith("<p><br/>")?d.a.insert(t,3,"X"):t.startsWith("<p><span>")?d.a.insert(t,9,"X"):t}_isEmptyLastLine(t){return!!(t=this._normalizeTags(t)).endsWith("<p></p>")||!!t.endsWith("<p><span><br/></span></p>")||!!t.endsWith("<p><br/></p>")}_insertIntoLastLine(t,e){const n=t.lastIndexOf("<p>");return t.substring(0,n)+"<p><span>X</span></p>"}_normalizeTags(t){return t.replace("<br />","<br/>").replace("<br>","<br/>").replace("<br >","<br/>")}}class y{constructor(t){this._tw=t}get canRedo(){const t=this._tw.engineHandler.getUndoInfo();return t.count>1&&t.index<t.count-1}get canUndo(){const t=this._tw.engineHandler.getUndoInfo();return t.count>1&&t.index>0}redo(){this._executeWithTry("redo",(()=>this._tw.engineHandler.redo()))}undo(){this._executeWithTry("undo",(()=>this._tw.engineHandler.undo()))}pause(){this._executeWithTry("pause",(()=>this._tw.engineHandler.pauseUndoRedo()))}resume(){this._executeWithTry("resume",(()=>this._tw.engineHandler.resumeUndoRedo()))}clear(){this._executeWithTry("clear",(()=>this._tw.engineHandler.clearUndoRedo()))}getSelection(){const t=this._tw.engineHandler.getUndoInfo(),e=this._tw.engineHandler.getUndoRedoCursorOrSelection(t.index);return new i.h(e)}_executeWithTry(t,e){try{e()}catch(n){throw console.log(`UndoRedoHandler. Failed to call ${t}().`),i.j.createException(this._tw.engine,n)}}}class _{constructor(t){this._tw=t}isMetadataExists(t){return null!=this.getMetadata(t)}createMetadata(t){return new i.e(this._tw.engine,t)}getMetadata(t){if(!this._isParagraphIndexValid(t))return null;const e=new i.e(this._tw.engine);return e.setEntry(this._getTwMetadata(t)),0===e.getPropertiesCount()?null:e}setMetadata(t,e){if(this._isParagraphIndexValid(t))if(e instanceof i.e)this._setTwMetadata(t,e.getEntry());else{const n=new i.e(this._tw.engine,e.getProperties());this._setTwMetadata(t,n.getEntry())}}deleteMetadata(t){const e=new i.e(this._tw.engine);this.setMetadata(t,e)}_isParagraphIndexValid(t){return t<=this._tw.engineHandler.getParagraphCount()-1}_getTwMetadata(t){return this._tw.engineHandler.getParagraphMetadata(t)}_setTwMetadata(t,e){this._tw.engineHandler.setParagraphMetadata(t,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"e",(function(){return i.a})),n.d(e,"f",(function(){return o.a})),n.d(e,"g",(function(){return a.a})),n.d(e,"h",(function(){return c})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return m})),n.d(e,"c",(function(){return y.a})),n.d(e,"d",(function(){return _})),n.d(e,"b",(function(){return b.a}));var r=n(584),i=n(585),o=n(586),a=n(587),s=n(433),l=n(420),u=n(427);class c{static serialize(t){if(null==t)throw new s.b("NumericValue must not be null.")}static parse(t){if(Object(u.a)(t))return null;if((t=t.trim()).length<3)throw new s.b(`Unable to parse NumericValue from string '${t}'`);var e=t.substr(0,t.length-2),n=t.substr(t.length-2);const r=c.parseNumber(e),i=c._parseUnit(n);return new l.NumericValue(r,i)}static parseNumber(t){try{t=t.trim();var e=parseFloat(t);if(isNaN(e))throw new s.b(`Unable to parse number value from string '${t}'`);return e}catch(n){throw new s.b(`Unable to parse number value from string '${t}'`)}}static _parseUnit(t){switch(t.toLowerCase()){case"pt":return l.Units.point;case"px":return l.Units.pixel;default:throw new s.b(`Wrong unit type '${t}'`)}}}class h{static capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}static parse(t){if(Object(u.a)(t))return null;const e=[];return t.split(";").forEach((t=>{if(Object(u.a)(t))return;const n=t.split(","),r=this.capitalizeFirstLetter(n[0]),i=2===n.length?n[1]:"1",o=c.parseNumber(i),a=new l.OpenTypeFeature(r,o);e.push(a)})),e}static parseHtml(t){if(Object(u.a)(t))return null;const e=[];return t.split(",").forEach((t=>{var n;if(Object(u.a)(t))return;const r=t.split(" ");""===r[0]&&(r[0]=r[1],r[1]=null!==(n=r[2])&&void 0!==n?n:"1");const i=this.capitalizeFirstLetter(r[0]),o=2===r.length?r[1]:"1",a=c.parseNumber(o),s=new l.OpenTypeFeature(i,a);e.push(s)})),e}}var p=n(460);class f{static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"number":return p.c.numbers;case"lowerletter":return p.c.lowerLetter;case"upperletter":return p.c.upperLetter;case"lowerroman":return p.c.lowerRoman;case"upperroman":return p.c.upperRoman;default:throw new s.b(`Unable to parse ordered list type: ${t}`)}}}class d{static serialize(t){return`${t}`}static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justification":return l.ParagraphAlignment.justification;case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}}var g=n(472);class m{static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"none":return g.c.none;case"bullet":return g.c.bullet;case"minus":return g.c.minus;default:let e=new g.d;return e.value=t,e}}}n(583),n(485),n(484);var y=n(588);class _{static serialize(t){return`${t}`}static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justify":case"justify-all":case"justification":case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}static serializexml(t){return`${t}`}static parsexml(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justification":return l.ParagraphAlignment.justification;case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}}var b=n(486)},function(t,e,n){"use strict";var r=n(602),i=n(209),o=function(t,e){return!(null==t||!t.length)&&Object(i.a)(t,e,0)>-1},a=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1},s=n(205),l=n(198),u=n(542),c=n(207),h=n(203),p=Object(c.a)((function(t,e){return Object(h.a)(t)?function(t,e,n,i){var c=-1,h=o,p=!0,f=t.length,d=[],g=e.length;if(!f)return d;n&&(e=Object(s.a)(e,Object(l.a)(n))),i?(h=a,p=!1):e.length>=200&&(h=u.a,p=!1,e=new r.a(e));t:for(;++c<f;){var m=t[c],y=null==n?m:n(m);if(m=i||0!==m?m:0,p&&y==y){for(var _=g;_--;)if(e[_]===y)continue t;d.push(m)}else h(e,y,i)||d.push(m)}return d}(t,e):[]}));e.a=p},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=new(n(161).a)((function(t){return t.complete()})),i=n(122),o=n(123);function a(t){return t<=0?function(){return r}:Object(i.a)((function(e,n){var r=0;e.subscribe(new o.a(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i,o=n(406),a=n(426),s=n(468),l=n(428),u=n(413),c=n(463),h=function(){function t(){}return t.toUriComponent=function(t){if(null==t)throw new c.b("color");var e=this._mappedConverters[t.colorSpace];if(null==e)throw new c.a("Could not convert recieved color, colorSpace "+t.colorSpace+" is not supproted");return e(t)},t._rgbToUriComponent=function(t){return t.toString()},t._cmykToUriComponent=function(e){return("cmyk("+t._prepareColorComponent(e.c)+",").concat(t._prepareColorComponent(e.m)+",").concat(t._prepareColorComponent(e.y)+",").concat(t._prepareColorComponent(e.k)+",").concat(t._prepareColorComponent(e.alpha)+")")},t._grayscaleToUriComponent=function(t){if(255===t.alpha)return"rgb("+t.l+","+t.l+","+t.l+")";var e=this._prepareColorComponent(t.alpha);return"rgba("+t.l+","+t.l+","+t.l+","+e+")"},t._labToUriComponent=function(t){return"lab("+t.l+","+t.a+","+t.b+","+this._convertByteToPercent(t.alpha)},t._spotToUriComponent=function(t){var e=t.ink;return"spot('"+e.name+"',"+this.toUriComponent(e.alternativeColor)+","+e.solidity+","+this._convertByteToPercent(t.tint)+")"},t._prepareColorComponent=function(t){return l.j(t,0,255,0,1).toFixed(7)},t._convertByteToPercent=function(t){return(t/255*100).toFixed(0)+"%"},t._mappedConverters=((r={})[u.ColorSpace.Rgb]=t._rgbToUriComponent,r[u.ColorSpace.Cmyk]=t._cmykToUriComponent,r[u.ColorSpace.Grayscale]=t._grayscaleToUriComponent,r[u.ColorSpace.Lab]=t._labToUriComponent,r[u.ColorSpace.Spot]=t._spotToUriComponent,r),t}();!function(t){t[t.none=0]="none",t[t.anonymous=1]="anonymous"}(i||(i={}));var p=function(){function t(){}return t.getImageUrl=function(t,e,n,r,i,l,u,c,p,f,d){if(!Number.isInteger(n)||!Number.isInteger(r))throw new o.a('Wrong "'+(Number.isInteger(n)?r:n)+'" type!');var g="/img";!e.endsWith(".svg")||i||a.b.IsFirefox()||a.b.IsIE()||(g="/svg");var m=t.viewer.designAtomsApiClient.serviceEndpoint+g+"?f="+encodeURIComponent(e)+"&w="+encodeURIComponent(n.toString())+"&h="+encodeURIComponent(r.toString());if(null!=t.cmykColorProfileFileId&&(m+="&cmyk="+encodeURIComponent(t.cmykColorProfileFileId)),null!=t.rgbColorProfileFileId&&(m+="&rgb="+encodeURIComponent(t.rgbColorProfileFileId)),null!=t.grayscaleColorProfileFileId&&(m+="&grayscale="+encodeURIComponent(t.grayscaleColorProfileFileId)),null!=i&&i&&(m+="&sq=true"),null!=l&&(l!==s.a.None&&(m+="&effect="+encodeURIComponent(l.toString())),l===s.a.Colorize&&null!=d&&(m+="&colorizeColor="+encodeURIComponent(h.toUriComponent(d)))),null!=u&&u&&(m+="&kp="+encodeURIComponent(u.toString())),null!=c){var y=c.color,_=c.blendMode,b=c.opacity;null!=y&&(m+="&color="+encodeURIComponent(h.toUriComponent(y))),null!=_&&(m+="&obm="+encodeURIComponent(_.toString())),null!=b&&(m+="&oo="+encodeURIComponent(b.toString()))}return null!=p&&parseInt(p.toString())>0&&(m+="&page="+encodeURIComponent(p.toString())),null!=f&&f&&(m+="&alphaMask="+encodeURIComponent(f.toString())),m},t.getImageSizeByUrl=function(t,e){return n=this,r=void 0,a=function(){var n;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){switch(r.label){case 0:return[4,(o=t,new Promise((function(t,n){var r=new Image;return e==i.anonymous&&(r.crossOrigin="anonymous"),r.src=o,r.onload=function(){return t(r)},r.onerror=function(e){return t(null)},r})))];case 1:return[2,{width:(n=r.sent()).width,height:n.height}]}var o}))},new((o=void 0)||(o=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(i,s)}l((a=a.apply(n,r||[])).next())}));var n,r,o,a},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return z}));var r=n(574),i=n(514),o=n(515),a=n(411),s=n(457),l=n(407),u=n(516),c=n(571),h=n(572),p=n(500),f=n(408),d=n(406),g=n(456),m=n(477),y=n(504),_=n(505),b=n(738),v=n(425),w=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.name=this.name,e.storageId=this.storageId,e.staticStorageId=this.staticStorageId,e.repeat=this.repeat,e.opacity=this.opacity,e},t}(),C=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.text=this.text,e.fontSettings=null!=this.fontSettings?this.fontSettings.clone():null,e.scale=this.scale,e.opacity=this.opacity,e},t}(),P=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.canvas=this.canvas,e.proof=this.proof,e},t}(),x=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.text=null!=this.text?this.text.clone():null,e.image=null!=this.image?this.image.clone():null,e.visibility=null!=this.visibility?this.visibility.clone():null,e},t}(),S=n(444),I=n(740),O=n(507),T=n(573),E=n(565),L=n(556),R=n(501),k=n(563),j=n(739),A=n(496),F=n(548),B=n(575),M=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},N=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(M(arguments[e]));return t},z=function(){function t(t){var e=this;this.parsePalette=function(t){var n=new A.a;return e.parseCollection(t,e.parseSwatch,n),n},this.parseSwatch=function(t){var n=new F.a;return e._parseModelComponent(t,n,[new D("color",e.parseColor)]),n},this.parseSurface=function(t){var n=new i.a;return e._parseModelComponent(t,n,[new D("mockup",e.parseMockup.bind(e)),new D("printAreas",(function(t){return e.parseCollection(t,e.parsePrintArea,n.printAreas)}),!0),new D("containers",(function(t){return e.parseCollection(t,e.parseSurfaceContainer,n.containers)}),!0),new D("previewMockups",(function(t){return e.parseCollection(t,e.parseMockup.bind(e),n.previewMockups)}),!0),new D("watermark",e.parseWatermark.bind(e))]),n},this.parseMockupContainer=function(t){var n=new s.b;return e.parseContainer(t,n),n},this.parseSurfaceContainer=function(t){var n,r=t.type;switch(delete t.type,r){case"SpotColorContainer":n=new s.c,e.parseContainer(t,n,[new D("previewColor",(function(t){return e.parseRgbColor(t).toString()}))]),delete t.previewColor,delete t.version,delete t.items,Object.assign(n,t);break;case"TextureContainer":n=new s.e,e.parseContainer(t,n),n.previewTextureSource=e.parseImageSource(t.previewTextureSource),delete t.previewTextureSource,delete t.version,delete t.items,Object.assign(n,t);break;default:n=new s.d,e.parseContainer(t,n)}return n},this.parseContainer=function(t,n,r){return void 0===n&&(n=new s.a),void 0===r&&(r=[]),e._parseModelComponent(t,n,N([new D("region",e.parseRectangleF.bind(e)),new D("size",e.parseSizeF.bind(e)),new D("items",(function(t){return e.parseCollection(t,e.parseItem,n.items)}),!0)],r)),n},this.parseSafetyLine=function(t){var n=new u.b,r=[new D("color",e.parseColor.bind(e)),new D("altColor",e.parseColor.bind(e)),new D("margin",e._parseMargin)];return e._parseObject(t,n,r),n},this.parseCropMark=function(t){var n=new c.a,r=[new D("color",e.parseColor.bind(e)),new D("leftNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.leftNotes=t})),!0),new D("rightNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.rightNotes=t})),!0),new D("topNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.topNotes=t})),!0),new D("bottomNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.bottomNotes=t})),!0)];return e._parseObject(t,n,r),n},this.parseCropMarkText=function(t){var n=new c.b;return e._parseObject(t,n,[]),n},this.parsePrintArea=function(t){var n=new h.a;return e._parseModelComponent(t,n,[new D("bounds",e.parseRectangleF.bind(e)),new D("safetyLines",(function(t){return e.parseCollection(t,e.parseSafetyLine,n.safetyLines)}),!0),new D("cropMarks",(function(t){return new v.a(t.map(e.parseCropMark))})),new D("slug",e._parseMargin),new D("bleed",e._parseMargin)]),n},this._parseMargin=function(t){return null==t?new T.a(0):new T.a({left:t.left,top:t.top,right:t.right,bottom:t.bottom})},this.parseItem=function(t){if(null==t)return null;var n=t.$type;delete t.$type;var r=[new D("pathBoundedTextPermissions",e.parsePathBoundedTextPermissions.bind(e)),new D("manipulationPermissions",e.parseManipulationPermissions.bind(e)),new D("frontendPermissions",e.parseFrontendPermissions.bind(e)),new D("visualizationPermissions",e.parseVisualizationPermissions.bind(e)),new D("violationSettings",e.parseViolationSettings),new D("itemPermissions",e.parseItemPermissions.bind(e)),new D("transform",e.parseTransform.bind(e)),new D("color",e.parseColor.bind(e)),new D("themeBinding",e.parseThemeBinding.bind(e)),new D("mask",e.parseMask.bind(e))],i=null,o=r.concat([new D("textPermissions",e.parseTextPermissions.bind(e)),new D("font",e.parseFontSettings.bind(e),!0),new D("stroke",e.parseStrokeSettings.bind(e)),new D("shadow",e.parseShadowSettings.bind(e))]);if(null==n)throw new d.c("Serialized data seems to be corrupted.");switch(n){case f.ob.type:i=e.parseSmartItem(t);break;case f.gb.type:i=e.parseRectangleItem(t,r);break;case f.kb.type:i=e.parseShapeItem(t,r);break;case f.T.type:i=e.parseLineItem(t,r);break;case f.y.type:i=e.parseDashedLineItem(t,r);break;case f.A.type:i=e.parseEllipseItem(t,r);break;case f.J.type:i=e.parseImageItem(t,r);break;case f.k.type:i=e.parseBarcodeItem(t,r);break;case f.eb.type:i=e.parsePlainTextItem(t,o);break;case f.q.type:i=e.parseBoundedTextItem(t,o);break;case f.ab.type:i=e.parsePathBoundedTextItem(t,o);break;case f.x.type:i=e.parseCurvedTextItem(t,o);break;case f.g.type:i=e.parseAutoScaledTextItem(t,o);break;case f.a.type:i=e.parseArchedTextItem(t,o);break;case f.cb.type:i=e.parsePlaceholderItem(t,r);break;case f.G.type:i=e.parseGroupItem(t,r);break;case O.a.type:i=e.parseClipartItem(t,r);break;case f.R.type:i=e.parseLayoutItem(t,r);break;default:throw new d.e("Deserializing of item with type - "+n+" is not implemented")}return i},this.parseEncodingOptions=function(t){var n=new f.B;return e._parseModelComponent(t,n,[]),n},this.parseLineItem=function(t,n){var r=new f.T,i=N(n,e._getLineConverters());return e._parseModelComponent(t,r,i),r},this.parseRotatedRectangle=function(t){return new l.RotatedRectangleF(t.centerX,t.centerY,t.width,t.height,t.angle)},this.parseViolationSettings=function(t){switch(delete t.version,t.type){case L.a.type:return Object.assign(new L.a,t);case R.a.type:return Object.assign(new R.a,t);case k.a.type:return Object.assign(new k.a,t);case j.a.type:return Object.assign(new j.a,t);default:throw new d.e("Deserializing of item with type - "+t.type+" is not implemented")}},this.parsePlaceholderPermissions=function(t){return Object.assign(new f.db,t)},this.parseLayoutSettings=function(t){var e;return e=t.type===E.e.type?new E.e:new E.f,Object.assign(e,t)},this.parseGroupItemPermissions=function(t){return Object.assign(new I.a,t)},this.parseLinePermissions=function(t){return Object.assign(new f.V,t)},this.parseBarcodePermissions=function(t){return Object.assign(new f.l,t)},this._parseOverlayEffect=function(t){if(null!=t)return new f.Y({color:null!=t.color?e.parseColor(t.color):null,opacity:null!=t.opacity?t.opacity:null,blendMode:null!=t.blendMode?t.blendMode:null})},this._parseImageItemValue=function(t){return new f.J.ImageItemValue(t.name,new f.J.ImageMetaData(t.value),e.parseRotatedRectangle(t.transformedRectangle))},this._parseTextItemValue=function(t){return new f.o.BaseTextValue(t.name,t.text)},this._parseObject=function(t,n,r){for(var i in t)if(t.hasOwnProperty(i)){var o=r.find((function(t){return t.property===i})),s=t[i];if(null==o){if(a.isObject(s)){var l=s.$type;if(delete s.$type,a.isString(l)){var u=a.find(e._additionalConverters,(function(t){return t.type===l}));if(null!=u){n[i]=u.parseRawValue(s);continue}console.warn("Unknown type "+l)}}n[i]=s;continue}if(o.setByConverter)try{o.convert(s,n)}catch(c){throw console.error("Error while parsing property "+i+" with converter ",o,c),c}else{if("manipulationPermissions"===i&&n instanceof f.G){n.groupManipulationPermissions=o.convert(s);continue}n[i]=o.convert(s)}}},this._additionalConverters=null!=t?t:[]}return t.prototype.parseProduct=function(t){var e=this,n=new r.a,i=[new D("surfaces",(function(t){return e.parseCollection(t,e.parseSurface,n.surfaces)}),!0),new D("watermarkConfig",this.parseWatermarkConfig.bind(this)),new D("defaultSafetyLines",(function(t){return e.parseCollection(t,e.parseSafetyLine,n.defaultSafetyLines)}),!0),new D("defaultCropMarks",(function(t){return e.parseCollection(t,e.parseCropMark,n.defaultCropMarks)}),!0),new D("defaultDesignLocation",this.parsePointF.bind(this)),new D("palette",(function(t){return e.parsePalette(t)}))];return this._parseModelComponent(t,n,i),n},t.prototype.parseColor=function(t){return B.a.parse(t)},t.prototype.parseRgbColor=function(t){return B.a.parseRgbColor(t)},t.prototype.parseWatermarkConfig=function(t){var e=this;if(null==t)return null;var n=new x,r=new D("fontSettings",(function(t){if(null==t)return null;var n=new f.o.FontSettings(null);return e._parseObject(t,n,[]),n})),i=new D("text",(function(t){if(null==t)return null;var n=new C;return e._parseObject(t,n,[r]),n})),o=new D("image",(function(t){if(null==t)return null;var n=new w;return e._parseObject(t,n,[]),n})),a=new D("visibility",(function(t){if(null==t)return null;var n=new P;return e._parseObject(t,n,[]),n}));return this._parseObject(t,n,[i,o,a]),n},t.prototype.parseWatermark=function(t){if(null==t)return null;var e=new S.Watermark;return this._parseObject(t,e,[]),e},t.prototype.parseMockup=function(t){var e=this,n=new o.a;return this._parseModelComponent(t,n,[new D("underContainers",(function(t){return e.parseCollection(t,e.parseMockupContainer,n.underContainers)}),!0),new D("overContainers",(function(t){return e.parseCollection(t,e.parseMockupContainer,n.overContainers)}),!0)]),n},t.prototype.parseCollection=function(t,e,n){null!=t&&n.setRange(t.map((function(t){return e(t)})))},t.prototype.parseRectangleF=function(t){return null==t?null:new l.RectangleF(t.left,t.top,t.width,t.height)},t.prototype.parsePointF=function(t){if(null==t)return null;var e=new l.PointF;return Object.assign(e,t),e},t.prototype.parseSizeF=function(t){if(null==t)return null;if(a.isString(t)){var e=t.split(",");return new l.SizeF(parseFloat(e[0].trim()),parseFloat(e[1].trim()))}return a.extend(new l.SizeF,t)},t.prototype.parsePath=function(t){return null==t?null:"string"==typeof t?new l.Path(t):new l.Path(t.path)},t.prototype.parsePaths=function(t){var e=this;if(null==t||!a.isArray(t))return null;var n=[];return a.toArray(t).forEach((function(t){n.push(e.parsePath(t))})),n},t.prototype.parseSmartItem=function(t){var e=new f.ob;return this._parseModelComponent(t,e,[]),e},t.prototype.parsePlainTextItem=function(t,e){var n=new f.eb,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("baselineLocation",this.parsePointF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseArchedTextItem=function(t,e){var n=new f.a,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("center",this.parsePointF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseAutoScaledTextItem=function(t,e){var n=new f.g,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("textRectangle",this.parseRectangleF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseBoundedTextItem=function(t,e){var n=new f.q,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("paragraphSettings",this.parseParagraphSettings.bind(this)),new D("textRectangle",this.parseRectangleF.bind(this)),new D("wrappingPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parsePathBoundedTextItem=function(t,e){var n=new f.ab,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("pathBoundedTextPermissions",this.parsePathBoundedTextPermissions.bind(this)),new D("boundingPaths",this.parsePaths.bind(this)),new D("paragraphSettings",this.parseParagraphSettings.bind(this)),new D("wrappingPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseCurvedTextItem=function(t,e){var n=new f.x,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new D("textPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype._getBaseTextItemConverters=function(t){var e=this;return[new D("values",this._setConvertedArray.bind(this,this._parseTextItemValue,(function(e){t.values=e})),!0),new D("placeholders",(function(n){return e.parseCollection(n,e.parseInStringPlaceholder,t.placeholders)}),!0),new D("colorPalette",(function(n){return e.parseCollection(n,e.parseColor,t.colorPalette)}),!0)]},t.prototype.parseImageItem=function(t,e){var n=new f.J,r=e.concat(this._getShapeConverters(),this._getImageConverters(n));return this._parseModelComponent(t,n,r),n},t.prototype.parseBarcodeItem=function(t,e){var n=new f.k,r=e.concat(this._getShapeConverters(),this._getImageConverters(n),[new D("barcodePermissions",this.parseBarcodePermissions.bind(this)),new D("color",this.parseColor.bind(this)),new D("barcodeOptions",this.parseEncodingOptions)]);return this._parseModelComponent(t,n,r),n},t.prototype.parsePlaceholderItem=function(t,e){var n=this,r=new f.cb,i=N(e,this._getShapeConverters(),[new D("placeholderPermissions",this.parsePlaceholderPermissions),new D("contentPermissions",this.parseContentPermissions.bind(this)),new D("content",this.parseItem),new D("topFrames",o),new D("bottomFrames",o),new D("stubStorageMeta",(function(t){return new f.K(t)})),new D("contentFillColor",this.parseColor.bind(this)),new D("contentOverlayEffect",this._parseOverlayEffect.bind(this))]);return this._parseModelComponent(t,r,i),r;function o(t){return t.map(n.parseItem)}},t.prototype.parseGroupItem=function(t,e){var n=new f.G,r=N(e,this._getShapeConverters(),this._getGroupConverters(n));return this._parseModelComponent(t,n,r),n},t.prototype.parseClipartItem=function(t,e){var n=new O.a,r=N(e,this._getShapeConverters(),this._getGroupConverters(n),[new D("colorGroups",this._setConvertedArray.bind(this,this.parseColorGroup.bind(this),(function(t){return n.colorGroups=t})),!0)]);return this._parseModelComponent(t,n,r),n},t.prototype.parseLayoutItem=function(t,e){var n=new f.R,r=N(e,this._getShapeConverters(),this._getGroupConverters(n),[new D("layoutSettings",this.parseLayoutSettings),new D("sourceRectangle",this.parseRotatedRectangle)]);return this._parseModelComponent(t,n,r),n},t.prototype.parseContentPermissions=function(t,e){var n=new f.v;return n.barcodePermissions=this.parseBarcodePermissions(t.barcodePermissions),n.imagePermissions=this.parseImagePermissions(t.imagePermissions),n},t.prototype.parseEllipseItem=function(t,e){var n=new f.A,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseRectangleItem=function(t,e){var n=new f.gb,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseShapeItem=function(t,e){var n=new f.kb,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseDashedLineItem=function(t,e){var n=new f.y,r=N(e,this._getLineConverters(),this._getDashedLineConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseThemeBinding=function(t){return null!=t?f.tb.fromRaw(t):null},t.prototype.parseMask=function(t){if(null==t)return null;var e=new p.a;return null!=t.vectorMask&&(e.vectorMask=this.parsePath(t.vectorMask)),e},t.prototype.parseTransform=function(t){return new g.a(t.scaleX,t.scaleY,t.translateX,t.translateY,t.angle)},t.prototype.parseFontSettings=function(t,e){var n=new f.o.FontSettings(null);return Object.assign(n,t),e.font=n,e.font},t.prototype.parseManipulationPermissions=function(t){var e=Object.assign(new f.W,t);return e.resizeGrips=Object.assign(new f.hb(!1,!1),t.resizeGrips),e},t.prototype.parseFrontendPermissions=function(t){return Object.assign(new f.E,t)},t.prototype.parseVisualizationPermissions=function(t){return Object.assign(new f.vb,t)},t.prototype.parseColorGroup=function(t){return new O.b(this.parseColor(t.color),t.targets)},t.prototype.parseItemPermissions=function(t){var e=Object.assign(new f.P,t);return e.itemToolbarPermissions=Object.assign(new f.Q(!1),t.itemToolbarPermissions),e},t.prototype.parseTextPermissions=function(t){return Object.assign(new f.rb,t)},t.prototype.parsePathBoundedTextPermissions=function(t){return Object.assign(new f.bb,t)},t.prototype.parseShapePermissions=function(t){return Object.assign(new f.lb,t)},t.prototype.parseImagePermissions=function(t){return Object.assign(new f.L,t)},t.prototype.parseImageSource=function(t){var e=null;return null!=t.origin&&(e=new f.J.ImageSource.Origin(t.origin)),void 0!==t.origin&&delete t.origin,Object.assign(new f.J.ImageSource(t.id,t.url,0,!1,!0,e),t)},t.prototype.parseParagraphSettings=function(t){return new m.a(t)},t.prototype.parseStrokeSettings=function(t){return null==t?null:new y.b({color:B.a.parse(t.color),size:"number"==typeof t.size?t.size:0,lineJoin:"string"==typeof t.lineJoin?y.a[t.lineJoin]:y.a.Miter})},t.prototype.parseShadowSettings=function(t){return null==t?null:new _.a({color:B.a.parse(t.color),angle:"number"==typeof t.angle?t.angle:0,distance:"number"==typeof t.distance?t.distance:0,size:"number"==typeof t.size?t.size:0})},t.prototype.parseInStringPlaceholder=function(t){return new f.M(t.id,t.name,t.mask,t.value,t.values)},t.prototype._setConvertedArray=function(t,e,n){a.isArray(n)&&e(a.map(n,(function(e){return t(e)})))},t.prototype._getImageConverters=function(t){return[new D("source",this.parseImageSource.bind(this)),new D("imagePermissions",this.parseImagePermissions.bind(this)),new D("values",this._setConvertedArray.bind(this,this._parseImageItemValue,(function(e){t.values=e})),!0),new D("overlayEffect",this._parseOverlayEffect.bind(this))]},t.prototype._getShapeConverters=function(){return[new D("fillColor",this.parseColor.bind(this)),new D("borderColor",this.parseColor.bind(this)),new D("altBorderColor",this.parseColor.bind(this)),new D("sourceRectangle",this.parseRectangleF.bind(this)),new D("sourcePath",this.parsePath.bind(this)),new D("shapePermissions",this.parseShapePermissions.bind(this))]},t.prototype._getGroupConverters=function(t){return[new D("items",this._setConvertedArray.bind(this,this.parseItem,(function(e){return t.items.addRange(e)})),!0),new D("groupItemPermissions",this.parseGroupItemPermissions)]},t.prototype._getLineConverters=function(){return[new D("color",this.parseColor.bind(this)),new D("sourcePoint0",this.parsePointF.bind(this)),new D("sourcePoint1",this.parsePointF.bind(this)),new D("linePermissions",this.parseLinePermissions)]},t.prototype._getDashedLineConverters=function(){return[new D("altColor",this.parseColor.bind(this))]},t.prototype._parseModelComponent=function(t,e,n){if(t.version!==b.a)throw new d.c("Version of serialized model component ("+t.version+") does not match the editor's version ("+b.a+").");n=n.concat([new D("tags",(function(t,e){e._tags=t}),!0),new D("version",(function(t,e){}),!0)]),this._parseObject(t,e,n)},t}(),D=function(t,e,n){void 0===n&&(n=!1),this.property=t,this.convert=e,this.setByConverter=n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(451),o=n(469),a=n(458),s=n(440),l=n(521),u=n(523),c=n(524),h=n(406),p=function(){function t(t){var e=t.map((function(t){return[t.typeName,t]}));this._dict=new Map(e)}return t.prototype.create=function(t){var e=this._dict.get(t);if(null!=e)return new e;throw new h.e("Unknown vo type "+t)},t}(),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return t.call(this,[i.a,o.a,a.b,s.a,l.a,c.a,u.a])||this}return f(e,t),e}(p)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(406),i=n(529),o=n(530),a=n(487);class s{constructor(t){if(!t)throw new r.c("Text range cannot be null or undefined");this._textRange=t}get isValid(){return this._textRange.isValid()}get isEmpty(){return this.getStartPosition().isEqualTo(this.getEndPosition())}isEqualTo(t){const e=this.getEntry();return Object(i.b)(e,a.a.getTextRange(t).getEntry())}getStartPosition(){return new o.a(this.getEntry().getStart())}getEndPosition(){return new o.a(this.getEntry().getEnd())}getLeftPosition(){const t=this._textRange.getStart(),e=t.getParagraphIndex(),n=this._textRange.getEnd(),r=e<=n.getParagraphIndex()?t:n;return new o.a(r)}getRightPosition(){const t=this._textRange.getStart(),e=t.getParagraphIndex(),n=this._textRange.getEnd(),r=n.getParagraphIndex()>=e?n:t;return new o.a(r)}getFormattedText(){return this.getEntry().getFormattedTextForDefaults()}getPlainText(){return this.getEntry().getChars()}getParagraphIndexes(){const t=this._textRange.getStart().getParagraphIndex(),e=this._textRange.getEnd().getParagraphIndex();return function(t,e){for(var n=[],r=t;r<=e;r++)n.push(r);return n}(t<=e?t:e,e>=t?e:t)}getEntry(){return this._textRange}static createEntry(t,e,n){const r=new t.TextRange(e,n);return new s(r)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="6.6.1"},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(439),o=n(501),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowTextCrop=n,r._allowInPlaceText=n,r}return a(e,t),e.prototype.clone=function(){var n=new e;return n.allowTextCrop=this.allowTextCrop,n.allowInPlaceText=this.allowInPlaceText,t.prototype.clone.call(this,n)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowTextCrop===e.allowTextCrop&&this.allowInPlaceText===e.allowInPlaceText},e.type="TextViolationSettings",s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowTextCrop",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowInPlaceText",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(409),i=n(416),o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=function(){function t(){this.propertyChanged=new r.a,this.allowReplaceContentConstraint=null,this._allowReplaceContent=!0,this.allowUngroupContraint=null,this._allowUngroup=!0,this.allowSelectNestedItemsContraint=null,this._allowSelectNestedItems=!0}return Object.defineProperty(t.prototype,"allowReplaceContent",{get:function(){return null!=this.allowReplaceContentConstraint?this.allowReplaceContentConstraint:this._allowReplaceContent},set:function(t){this._allowReplaceContent!==t&&(this._allowReplaceContent=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowUngroup",{get:function(){return null!=this.allowUngroupContraint?this.allowUngroupContraint:this._allowUngroup},set:function(t){this._allowUngroup!==t&&(this._allowUngroup=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowSelectNestedItems",{get:function(){return null!=this.allowSelectNestedItemsContraint?this.allowSelectNestedItemsContraint:this._allowSelectNestedItems},set:function(t){this._allowSelectNestedItems!==t&&(this._allowSelectNestedItems=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t=this;return{allowReplaceContent:t._allowReplaceContent,allowSelectNestedItems:t._allowSelectNestedItems,allowUngroup:t._allowUngroup}},t.prototype.clone=function(){var e=new t;return e.allowReplaceContent=this._allowReplaceContent,e.allowReplaceContentConstraint=this.allowReplaceContentConstraint,e.allowSelectNestedItems=this._allowSelectNestedItems,e.allowSelectNestedItemsContraint=this.allowSelectNestedItemsContraint,e.allowUngroup=this._allowUngroup,e.allowUngroupContraint=this.allowUngroupContraint,e},t.prototype.equals=function(t){return this.allowReplaceContent===t.allowReplaceContent&&this.allowReplaceContentConstraint===t.allowReplaceContentConstraint&&this.allowSelectNestedItems===t.allowSelectNestedItems&&this.allowSelectNestedItemsContraint===t.allowSelectNestedItemsContraint&&this.allowUngroup===t.allowUngroup&&this.allowUngroupContraint===t.allowUngroupContraint},function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)({ignore:!0}),o("design:type",Boolean)],t.prototype,"allowReplaceContentConstraint",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return a}));var r,i,o,a,s=n(444),l=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};!function(t){var e;t.round3=function(t){return Math.round(1e3*t)/1e3},t.createBoundedWrapper=function(t,e,n){return null==n?e.bind(t):Function.prototype.bind.apply(e,[t].concat(n))},t.cursorToCss=function(t){var n=e;return null==n&&(e=n=["default","nw-resize","ne-resize","sw-resize","se-resize","n-resize","s-resize","w-resize","e-resize","move","crosshair","pointer","ew-resize","ns-resize","nesw-resize","nwse-resize","text"]),n[t]},t.makeSingle=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}(this,void 0,void 0,(function(){var r,i,o,a;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:r=e=new Object,i=t.apply(void 0,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}(n)),s.label=1;case 1:return(a=i.next(o)).done?[2,a.value]:[4,a.value];case 2:if(o=s.sent(),r!==e)return[2];s.label=3;case 3:return[3,1];case 4:return[2]}}))}))}},t.makeCancelable=function(t){var e=!1;return{promise:new Promise((function(n,r){t.then((function(t){return e?r({isCanceled:!0}):n(t)})),t.catch((function(t){return r(e?{isCanceled:!0}:t)}))})),id:(new s.Uuid).toString(),cancel:function(){e=!0}}},t.getEventPath=function(t){if(null==t.view||!(t instanceof t.view.UIEvent))throw new Error("Unexpected event type");if(null!=t.path)return(Array.isArray(t.path)?t.path:Array.prototype.slice.call(t.path)).filter((function(t){return t instanceof Element}));var e=[],n=t.target;n instanceof t.view.Element||null==console||console.log("unexpected event target",n);do{e.push(n),n=n.parentElement}while(null!=n&&n!==t.currentTarget);return e},t.isEventPathContainsClass=function(e,n){var r;if(e instanceof UIEvent)r=e;else{if(!(e.originalEvent instanceof UIEvent))throw new Error("Unexpected event type");r=e.originalEvent}return!!t.getEventPath(r).some((function(t){return t.classList.contains(n)}))}}(r||(r={})),function(t){t[t.defaultCursor=0]="defaultCursor",t[t.sizeNW=1]="sizeNW",t[t.sizeNE=2]="sizeNE",t[t.sizeSW=3]="sizeSW",t[t.sizeSE=4]="sizeSE",t[t.sizeN=5]="sizeN",t[t.sizeS=6]="sizeS",t[t.sizeW=7]="sizeW",t[t.sizeE=8]="sizeE",t[t.move=9]="move",t[t.cross=10]="cross",t[t.pointer=11]="pointer",t[t.sizeEW=12]="sizeEW",t[t.sizeNS=13]="sizeNS",t[t.sizeNESW=14]="sizeNESW",t[t.sizeNWSE=15]="sizeNWSE",t[t.text=16]="text"}(i||(i={})),function(t){t[t.rgb=16777216]="rgb",t[t.cmyk=335544320]="cmyk",t[t.grayScale=301989888]="grayScale",t[t.unknown=0]="unknown"}(o||(o={})),function(t){t[t.Item=0]="Item",t[t.Color=1]="Color"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(446),i=function(){function t(t,e){var n,i,o,a,s,l,u,c,h,p,f,d,g,m;null==t&&(t={}),null==e&&(e=!0),this.noPrint=null!==(n=t.NoPrint)&&void 0!==n?n:e,this.noShow=null!==(i=t.NoShow)&&void 0!==i?i:e,this.allowDelete=null!==(o=t.AllowDelete)&&void 0!==o?o:e,this.allowMoveHorizontal=null!==(a=t.AllowMoveHorizontal)&&void 0!==a?a:e,this.allowMoveVertical=null!==(s=t.AllowMoveVertical)&&void 0!==s?s:e,this.allowRotate=null!==(l=t.AllowRotate)&&void 0!==l?l:e,this.resizeGrips=null==t.ResizeGrips?new r.a(e,e):r.a._fromData(t.ResizeGrips),this.allowEditContent=null!==(u=t.AllowEditContent)&&void 0!==u?u:e,this.showSelectButton=null!==(c=t.ShowSelectButton)&&void 0!==c?c:e,this.showHandleButton=null!==(h=t.ShowHandleButton)&&void 0!==h?h:e,this.showDoneButton=null!==(p=t.ShowDoneButton)&&void 0!==p?p:e,this.showDeleteToolbarButton=null!==(f=t.ShowDeleteToolbarButton)&&void 0!==f?f:e,this.showEditToolbarButton=null!==(d=t.ShowEditToolbarButton)&&void 0!==d?d:e,this.showSelectToolbarButton=null!==(g=t.ShowSelectToolbarButton)&&void 0!==g?g:e,this.showHandleToolbarButton=null!==(m=t.ShowHandleToolbarButton)&&void 0!==m?m:e,this.allowDragAndDrop=null==t.AllowDragAndDrop?e:!!t.AllowDragAndDrop}return t.prototype.clone=function(){var e=new t;for(var n in this)this.hasOwnProperty(n)&&("resizeGrips"!==n?e[n]=this[n]:e.resizeGrips=null!=this.resizeGrips?this.resizeGrips.clone():null);return e},Object.defineProperty(t.prototype,"allowProportionalResize",{get:function(){return this.resizeGrips.getCornerProportional()},set:function(t){this.resizeGrips.setCornerProportional(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowArbitraryResize",{get:function(){return!!this.resizeGrips&&(this.resizeGrips.getCornerArbitrary()||this.resizeGrips.edge)},set:function(t){this.resizeGrips.setCornerArbitrary(t),this.resizeGrips.edge=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowResize",{get:function(){return this.allowProportionalResize||this.allowArbitraryResize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowFreeMove",{get:function(){return this.allowMoveHorizontal&&this.allowMoveVertical},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.allowMoveHorizontal||this.allowMoveVertical},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){var t=this;this._promise=new Promise((function(e,n){t._resolve=e,t._reject=n}))}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!0,configurable:!0}),t.prototype.resolve=function(t){null==this||this._resolve(t)},t.prototype.reject=function(t){null==this||this._reject(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(407),i=n(436),o=n(419),a=n(426),s=function(){function t(t,e,n,r,i,o,a,s){this._staticCanvas=t,this._activeCanvas=e,this._textWhizz=n,this._zoom=r,this._offset=i,this._viewportHandler=o,this._selectionStyle=a,this._rgbColorParser=s,this._workspaceWidth=null,this._workspaceHeight=null}return t.prototype.setWorkspaceSize=function(t,e){this._workspaceWidth=t,this._workspaceHeight=e},t.prototype.setZoom=function(t){this._zoom=t},Object.defineProperty(t.prototype,"offset",{get:function(){return this._offset},set:function(t){this._offset=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scale",{get:function(){return a.b.screenDpi*this._zoom/72},enumerable:!0,configurable:!0}),t.prototype._getScaledBounds=function(t){var e=this._scale,n=Math.floor(t.left*e),i=Math.floor(t.top*e),o=Math.ceil(t.width*e),a=Math.ceil(t.height*e);return new r.RectangleF(n,i,o,a)},t.prototype._getScaledBoundsWithoutRound=function(t){var e=this._scale,n=t.left*e,i=t.top*e,o=t.width*e,a=t.height*e;return new r.RectangleF(n,i,o,a)},t.prototype._getBase64Url=function(){return this._staticCanvas.toDataURL()},t.prototype._colorToTextWhizz=function(t){return new this._textWhizz.Color(this._textWhizz.ColorType.rgb,[t.b,t.g,t.r,t.alpha])},t.renderTextImage=function(t,e,n,r,i,o){e.isLoaded?this._drawImage(t,e,n,r,i,o):!e.isLoading&&t.ready||this._drawWaitClock(t,r)},t._drawWaitClock=function(t,e){var n=t.rectangle;t.canvas.drawWaitClock(e,new r.PointF(n.centerX,n.centerY))},t._isUpdatingAfterResize=function(t){return t instanceof i.a&&("BoundedTextItemHandler"===t.getTypeName()||"PathBoundedTextItemHandler"===t.getTypeName())&&t.isUpdatingAfterResize},t._drawImage=function(t,e,n,r,i,s){var l=t.canvas,u=t.item,c=l.disableSmoothing,h=a.b.screenDpi*l.zoom/72;this._isUpdatingAfterResize(t)||o.a.drawImage(r,e.image,t.drawingRectangle,h,h,c,null,u.opacity*i,n,s)},t.staticCanvasMargin=10,t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(526);class i extends r.a{constructor(){super(...arguments),this.__type="InlineText"}}class o extends r.a{constructor(){super(...arguments),this.__type="<br>"}}},function(t,e,n){"use strict";var r,i,o;n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return s})),function(t){t[t.none=0]="none",t[t.bullets=1]="bullets",t[t.numbers=2]="numbers"}(r||(r={})),function(t){t[t.none=0]="none",t[t.number=1]="number",t[t.lowerLetter=2]="lowerLetter",t[t.upperLetter=3]="upperLetter",t[t.lowerRoman=4]="lowerRoman",t[t.upperRoman=5]="upperRoman"}(i||(i={})),function(t){t[t.continueFromPrevious=0]="continueFromPrevious",t[t.startAt=1]="startAt"}(o||(o={}));class a{}class s extends Map{}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{constructor(){this.blocks=[]}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(582);class i extends r.a{}class o{constructor(){this.content=[]}}},function(t,e,n){function r(t){this.options=t||{locator:{}}}function i(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function s(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function l(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}r.prototype.parseFromString=function(t,e){var n=this.options,r=new u,o=n.domBuilder||new i,s=n.errorHandler,l=n.locator,c=n.xmlns||{},h={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return l&&o.setDocumentLocator(l),r.errorHandler=function(t,e,n){if(!t){if(e instanceof i)return e;t=e}var r={},o=t instanceof Function;function s(e){var i=t[e];!i&&o&&(i=2==t.length?function(n){t(e,n)}:t),r[e]=i&&function(t){i("[xmldom "+e+"]\t"+t+a(n))}||function(){}}return n=n||{},s("warning"),s("error"),s("fatalError"),r}(s,o,l),r.domBuilder=n.domBuilder||o,/\/x?html?$/.test(e)&&(h.nbsp=" ",h.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?r.parse(t,c,h):r.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new c).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,a=i.createElementNS(t,n||e),s=r.length;l(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var u=0;u<s;u++){t=r.getURI(u);var c=r.getValue(u),h=(n=r.getQName(u),i.createAttributeNS(t,n));this.locator&&o(r.getLocator(u),h),h.value=h.nodeValue=c,a.setAttributeNode(h)}},endElement:function(t,e,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&o(this.locator,n),l(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=s.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&o(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=s.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&o(this.locator,r),l(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&o(this.locator,i),l(this,i)}},warning:function(t){console.warn("[xmldom warning]\t"+t,a(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,a(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,a(this.locator)),t}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){i.prototype[t]=function(){return null}}));var u=n(864).XMLReader,c=e.DOMImplementation=n(751).DOMImplementation;e.XMLSerializer=n(751).XMLSerializer,e.DOMParser=r},function(t,e){function n(t,e){for(var n in t)e[n]=t[n]}function r(t,e){var r=t.prototype;if(Object.create){var i=Object.create(e.prototype);r.__proto__=i}if(!(r instanceof e)){function o(){}o.prototype=e.prototype,n(r,o=new o),t.prototype=r=o}r.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),r.constructor=t)}var i={},o=i.ELEMENT_NODE=1,a=i.ATTRIBUTE_NODE=2,s=i.TEXT_NODE=3,l=i.CDATA_SECTION_NODE=4,u=i.ENTITY_REFERENCE_NODE=5,c=i.ENTITY_NODE=6,h=i.PROCESSING_INSTRUCTION_NODE=7,p=i.COMMENT_NODE=8,f=i.DOCUMENT_NODE=9,d=i.DOCUMENT_TYPE_NODE=10,g=i.DOCUMENT_FRAGMENT_NODE=11,m=i.NOTATION_NODE=12,y={},_={},b=(y.INDEX_SIZE_ERR=(_[1]="Index size error",1),y.DOMSTRING_SIZE_ERR=(_[2]="DOMString size error",2),y.HIERARCHY_REQUEST_ERR=(_[3]="Hierarchy request error",3)),v=(y.WRONG_DOCUMENT_ERR=(_[4]="Wrong document",4),y.INVALID_CHARACTER_ERR=(_[5]="Invalid character",5),y.NO_DATA_ALLOWED_ERR=(_[6]="No data allowed",6),y.NO_MODIFICATION_ALLOWED_ERR=(_[7]="No modification allowed",7),y.NOT_FOUND_ERR=(_[8]="Not found",8)),w=(y.NOT_SUPPORTED_ERR=(_[9]="Not supported",9),y.INUSE_ATTRIBUTE_ERR=(_[10]="Attribute in use",10));function C(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,_[t]),this.message=_[t],Error.captureStackTrace&&Error.captureStackTrace(this,C);return n.code=t,e&&(this.message=this.message+": "+e),n}function P(){}function x(t,e){this._node=t,this._refresh=e,S(this)}function S(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var r=t._refresh(t._node);rt(t,"length",r.length),n(r,t),t._inc=e}}function I(){}function O(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function T(t,e,n,r){if(r?e[O(e,r)]=n:e[e.length++]=n,t){n.ownerElement=t;var i=t.ownerDocument;i&&(r&&F(i,t,r),function(t,e,n){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(e._nsMap[n.prefix?n.localName:""]=n.value)}(i,t,n))}}function E(t,e,n){var r=O(e,n);if(!(r>=0))throw C(v,new Error(t.tagName+"@"+n));for(var i=e.length-1;r<i;)e[r]=e[++r];if(e.length=i,t){var o=t.ownerDocument;o&&(F(o,t,n),n.ownerElement=null)}}function L(t){if(this._features={},t)for(var e in t)this._features=t[e]}function R(){}function k(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function j(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(j(t,e))return!0}while(t=t.nextSibling)}function A(){}function F(t,e,n,r){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete e._nsMap[n.prefix?n.localName:""]}function B(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var i=e.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function M(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,B(t.ownerDocument,t),e}function N(t,e,n){var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===g){var i=e.firstChild;if(null==i)return e;var o=e.lastChild}else i=o=e;var a=n?n.previousSibling:t.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:t.firstChild=i,null==n?t.lastChild=o:n.previousSibling=o;do{i.parentNode=t}while(i!==o&&(i=i.nextSibling));return B(t.ownerDocument||t,t),e.nodeType==g&&(e.firstChild=e.lastChild=null),e}function z(){this._nsMap={}}function D(){}function H(){}function W(){}function U(){}function V(){}function q(){}function G(){}function $(){}function X(){}function K(){}function Y(){}function J(){}function Z(t,e){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i&&null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return tt(this,n,t,e,a),n.join("")}function Q(t,e,n){var r=t.prefix||"",i=t.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var a=n[o];if(a.prefix==r)return a.namespace!=i}return!0}function tt(t,e,n,r,i){if(r){if(!(t=r(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case o:i||(i=[]),i.length;var c=t.attributes,m=c.length,y=t.firstChild,_=t.tagName;n="http://www.w3.org/1999/xhtml"===t.namespaceURI||n,e.push("<",_);for(var b=0;b<m;b++)"xmlns"==(v=c.item(b)).prefix?i.push({prefix:v.localName,namespace:v.value}):"xmlns"==v.nodeName&&i.push({prefix:"",namespace:v.value});for(b=0;b<m;b++){var v;if(Q(v=c.item(b),0,i)){var w=v.prefix||"",C=v.namespaceURI,P=w?" xmlns:"+w:" xmlns";e.push(P,'="',C,'"'),i.push({prefix:w,namespace:C})}tt(v,e,n,r,i)}if(Q(t,0,i)&&(w=t.prefix||"",C=t.namespaceURI,P=w?" xmlns:"+w:" xmlns",e.push(P,'="',C,'"'),i.push({prefix:w,namespace:C})),y||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(_)){if(e.push(">"),n&&/^script$/i.test(_))for(;y;)y.data?e.push(y.data):tt(y,e,n,r,i),y=y.nextSibling;else for(;y;)tt(y,e,n,r,i),y=y.nextSibling;e.push("</",_,">")}else e.push("/>");return;case f:case g:for(y=t.firstChild;y;)tt(y,e,n,r,i),y=y.nextSibling;return;case a:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,k),'"');case s:return e.push(t.data.replace(/[<&]/g,k));case l:return e.push("<![CDATA[",t.data,"]]>");case p:return e.push("\x3c!--",t.data,"--\x3e");case d:var x=t.publicId,S=t.systemId;if(e.push("<!DOCTYPE ",t.name),x)e.push(' PUBLIC "',x),S&&"."!=S&&e.push('" "',S),e.push('">');else if(S&&"."!=S)e.push(' SYSTEM "',S,'">');else{var I=t.internalSubset;I&&e.push(" [",I,"]"),e.push(">")}return;case h:return e.push("<?",t.target," ",t.data,"?>");case u:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function et(t,e,n){var r;switch(e.nodeType){case o:(r=e.cloneNode(!1)).ownerDocument=t;case g:break;case a:n=!0}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var i=e.firstChild;i;)r.appendChild(et(t,i,n)),i=i.nextSibling;return r}function nt(t,e,n){var r=new e.constructor;for(var i in e){var s=e[i];"object"!=typeof s&&s!=r[i]&&(r[i]=s)}switch(e.childNodes&&(r.childNodes=new P),r.ownerDocument=t,r.nodeType){case o:var l=e.attributes,u=r.attributes=new I,c=l.length;u._ownerElement=r;for(var h=0;h<c;h++)r.setAttributeNode(nt(t,l.item(h),!0));break;case a:n=!0}if(n)for(var p=e.firstChild;p;)r.appendChild(nt(t,p,n)),p=p.nextSibling;return r}function rt(t,e,n){t[e]=n}y.INVALID_STATE_ERR=(_[11]="Invalid state",11),y.SYNTAX_ERR=(_[12]="Syntax error",12),y.INVALID_MODIFICATION_ERR=(_[13]="Invalid modification",13),y.NAMESPACE_ERR=(_[14]="Invalid namespace",14),y.INVALID_ACCESS_ERR=(_[15]="Invalid access",15),C.prototype=Error.prototype,n(y,C),P.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r<this.length;r++)tt(this[r],n,t,e);return n.join("")}},x.prototype.item=function(t){return S(this),this[t]},r(x,P),I.prototype={length:0,item:P.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new C(w);var n=this.getNamedItem(t.nodeName);return T(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new C(w);return e=this.getNamedItemNS(t.namespaceURI,t.localName),T(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return E(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return E(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var r=this[n];if(r.localName==e&&r.namespaceURI==t)return r}return null}},L.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!(!n||e&&!(e in n))},createDocument:function(t,e,n){var r=new A;if(r.implementation=this,r.childNodes=new P,r.doctype=n,n&&r.appendChild(n),e){var i=r.createElementNS(t,e);r.appendChild(i)}return r},createDocumentType:function(t,e,n){var r=new q;return r.name=t,r.nodeName=t,r.publicId=e,r.systemId=n,r}},R.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return N(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return M(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return nt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==s&&t.nodeType==s?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var r in n)if(n[r]==t)return r;e=e.nodeType==a?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==a?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},n(i,R),n(i,R.prototype),A.prototype={nodeName:"#document",nodeType:f,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==g){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return null==this.documentElement&&t.nodeType==o&&(this.documentElement=t),N(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),M(this,t)},importNode:function(t,e){return et(this,t,e)},getElementById:function(t){var e=null;return j(this.documentElement,(function(n){if(n.nodeType==o&&n.getAttribute("id")==t)return e=n,!0})),e},createElement:function(t){var e=new z;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new P,(e.attributes=new I)._ownerElement=e,e},createDocumentFragment:function(){var t=new K;return t.ownerDocument=this,t.childNodes=new P,t},createTextNode:function(t){var e=new W;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new U;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new V;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new Y;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new D;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new X;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new z,r=e.split(":"),i=n.attributes=new I;return n.childNodes=new P,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,i._ownerElement=n,n},createAttributeNS:function(t,e){var n=new D,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}},r(A,R),z.prototype={nodeType:o,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===g?this.insertBefore(t,null):function(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e),r=t.lastChild}return r=t.lastChild,e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,B(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new x(this,(function(e){var n=[];return j(e,(function(r){r===e||r.nodeType!=o||"*"!==t&&r.tagName!=t||n.push(r)})),n}))},getElementsByTagNameNS:function(t,e){return new x(this,(function(n){var r=[];return j(n,(function(i){i===n||i.nodeType!==o||"*"!==t&&i.namespaceURI!==t||"*"!==e&&i.localName!=e||r.push(i)})),r}))}},A.prototype.getElementsByTagName=z.prototype.getElementsByTagName,A.prototype.getElementsByTagNameNS=z.prototype.getElementsByTagNameNS,r(z,R),D.prototype.nodeType=a,r(D,R),H.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(_[b])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){n=this.data.substring(0,t)+n+this.data.substring(t+e),this.nodeValue=this.data=n,this.length=n.length}},r(H,R),W.prototype={nodeName:"#text",nodeType:s,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(W,H),U.prototype={nodeName:"#comment",nodeType:p},r(U,H),V.prototype={nodeName:"#cdata-section",nodeType:l},r(V,H),q.prototype.nodeType=d,r(q,R),G.prototype.nodeType=m,r(G,R),$.prototype.nodeType=c,r($,R),X.prototype.nodeType=u,r(X,R),K.prototype.nodeName="#document-fragment",K.prototype.nodeType=g,r(K,R),Y.prototype.nodeType=h,r(Y,R),J.prototype.serializeToString=function(t,e,n){return Z.call(t,e,n)},R.prototype.toString=Z;try{if(Object.defineProperty){function it(t){switch(t.nodeType){case o:case g:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(it(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(x.prototype,"length",{get:function(){return S(this),this.$$length}}),Object.defineProperty(R.prototype,"textContent",{get:function(){return it(this)},set:function(t){switch(this.nodeType){case o:case g:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),rt=function(t,e,n){t["$$"+e]=n}}}catch(ot){}e.DOMImplementation=L,e.XMLSerializer=J},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{static containsRtlChars(t){return new RegExp("^[^"+this._rtlChars+"]*?["+this._rtlChars+"]").test(t)}static insert(t,e,n){if(null==t)throw new Error("input string must not be null");if(e<0)throw new Error("index must be positive number");if(e>t.length)throw new console.error("index must not be greater than string length");return t.substring(0,e)+n+t.substring(e)}}r._rtlChars="֑-߿יִ-﷽ﹰ-ﻼ"},function(t,e,n){"use strict";n(536);var r=n(429);n.d(e,"InputCommandType",(function(){return r.b})),n.d(e,"Keys",(function(){return r.c})),n(599),n(762),n(438),n(590),n(591),n(592),n(593)},function(t,e,n){"use strict";var r=n(525);n.d(e,"GmXmlParser",(function(){return r.a}));var i=n(528);n.d(e,"GmXmlSerializer",(function(){return i.a})),n(755)},function(t,e,n){"use strict";n(756),n(757),n(758),n(759),n(760)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(406);class i{constructor(t){this._colors=null!=t?[...t]:[]}getPaletteColors(){return this._colors}getColorByIndex(t){return this.containsColorWithIndex(t)?this._colors[t]:null}getPaletteColorAt(t){return this.getColorByIndex(t)}containsColor(t){return-1!==this.getIndex(t)}containsColorWithIndex(t){return this._colors.length>t}getIndex(t){if(null==t)throw new r.b("Color must not be null");if(0==this._colors.length)return-1;for(let e=0;e<this._colors.length;e++){let n=this._colors[e];if(t.equals(n.color))return e}return-1}addColor(t){if(null==t)throw new r.b("Color must not be null");const e=this.getIndex(t.color);return-1!==e?e:(this._colors.push(t),this._colors.length-1)}addColorToPaletteReturnIndex(t){return this.addColor(t)}}},function(t,e,n){"use strict";n(763),n(764),n(765),n(766),n(767),n(768),n(769),n(770),n(771),n(772),n(773),n(774),n(775),n(776),n(777),n(778),n(779),n(780),n(781),n(782),n(783),n(784),n(785),n(786),n(787),n(788),n(789),n(790),n(791),n(792),n(793),n(794),n(795),n(796),n(797),n(798),n(799),n(800),n(801),n(802),n(803),n(804),n(805),n(806),n(807),n(808),n(809),n(810),n(811)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return t.insert=function(t,e,n){if(null==t)throw new Error("input string must not be null");if(e<0)throw new Error("index must be positive number");if(e>t.length)throw new console.error("index must not be greater than string length");return t.substring(0,e)+n+t.substring(e)},t.containsRtlChars=function(t){return new RegExp("^[^"+this._rtlChars+"]*?["+this._rtlChars+"]").test(t)},t.removeRtlChars=function(t){var e=new RegExp("["+this._rtlChars+"]","g");return t.replace(e,"")},t._rtlChars="֑-߿יִ-﷽ﹰ-ﻼ",t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i}));var r,i,o,a=function(){function t(){}return Object.defineProperty(t,"debug",{set:function(t){if(this._debug=t,t&&null==document.getElementById("deLogger")){var e=document.createElement("div");e.id="deLogger",e.style.position="fixed",e.style.border="solid 1px black",e.style.width="800px",e.style.height="100px",e.style.top="calc(100% - 200px)",e.style.left="0",e.style.display="flex",e.style.zIndex="100",e.style.flexDirection="column",e.style.userSelect="none";var n=document.createElement("div");n.id="deLoggerWindow",n.style.flex="1",n.style.backgroundColor="rgba(0, 0, 0, 0.5)",n.style.border="solid 1px black",n.style.overflow="auto",n.style.display="flex",n.style.fontSize="14px",n.style.fontWeight="500",n.style.flexDirection="column";var r=document.createElement("div");r.id="loggerHeader",r.style.height="40px",r.style.width="100%",r.style.backgroundColor="white",r.style.height="auto",r.style.padding="4px";var i=document.createElement("input");i.type="button",i.value="Clear",i.onclick=function(){n.innerHTML=""},r.appendChild(i),e.appendChild(r),e.appendChild(n),document.documentElement.appendChild(e),this._debugTimeStart=Date.now()}},enumerable:!0,configurable:!0}),t.debugLog=function(e,n,i){if(void 0===i&&(i=r.Log),this._debug&&(null==t.sources||null==n||t.sources.includes(n))){var o='<span style="color: rgb(255, 0, 255)">'+(Date.now()-this._debugTimeStart)+":</span> "+e,a=document.createElement("span");a.innerHTML=o,a.style.color=t._getMessageColor(i);var s=document.getElementById("deLoggerWindow");s.appendChild(a),s.scrollTop=s.scrollHeight}},t.extendNativeLog=function(e){var n=console[e];console[e]=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var a=r.join(" ");n(a),t.debugLog(a,i.System,e)}},t._getMessageColor=function(t){return t===r.Error?"#dc3545":t===r.Warning?"#ffc107":t===r.Trace?"#17a2b8":"black"},t._debug=!1,t.init=function(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.debug=e,t.sources=r,e&&(null==n?void 0:n.length)>0&&n.forEach((function(e){t.extendNativeLog(e)}))},t}();window.___$setDaLoggerEnabled=a.init,function(t){t.Trace="trace",t.Log="log",t.Warning="warn",t.Error="error"}(r||(r={})),function(t){t.ViolationService="ViolationService",t.InputManager="InputManager",t.System="System",t.Common="Common",t.SelectionHandler="SelectionHandler",t.CommandManager="CommandManager"}(i||(i={})),function(t){t.red=function(t){return'<span style="color: rgb(255, 0, 0)">'+t+"</span>"},t.green=function(t){return'<span style="color: rgb(0, 255, 0)">'+t+"</span>"},t.blue=function(t){return'<span style="color: rgb(0, 0, 255)">'+t+"</span>"},t.white=function(t){return'<span style="color: rgb(255, 255, 255)">'+t+"</span>"},t.cyan=function(t){return'<span style="color: rgb(0, 255, 255)">'+t+"</span>"},t.magenta=function(t){return'<span style="color: rgb(255, 0, 255)">'+t+"</span>"},t.yellow=function(t){return'<span style="color: rgb(0, 255, 255)">'+t+"</span>"}}(o||(o={}))},function(t,e,n){"use strict";function r(t,e){return function(){return t.apply(e,arguments)}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";e.a=null},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){var r=n(547);r.prototype[Symbol.iterator]||(r.prototype[Symbol.iterator]=function(){var t=this.getEnumerator();return{next:function(){return t.moveNext()?{done:!1,value:t.current()}:{done:!0}}}});var i=!0;r.extendArray=function(){i&&(i=!1,Object.keys(r.prototype).forEach((function(t){Array.prototype[t]||(Array.prototype[t]=function(){var e=r.from(this);return e[t].apply(e,arguments)})})))},t.exports=r},function(t,e){var n="BEGIN:VCARD",r="END:VCARD",i=/[^\\];|^;/,o=/[^\\],|^,/;function a(t){return t.match(i)?s(t=t.replace(/\\,/g,","),";"):t.match(o)?s(t=t.replace(/\\;/g,";"),","):t.replace(/\\,/g,",").replace(/\\;/g,";")}function s(t,e){var n=new RegExp(e),r=new RegExp("\\\\"+e,"g");return(t=t.replace(r,"ΩΩΩ")).match(n)?(t=t.split(e)).map((function(t){return t.replace(/ΩΩΩ/g,e)})):t.replace(/ΩΩΩ/g,e)}var l=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}(),u=["nickname","related","categories","pid"],c=["fn"];t.exports={parse:function(t){for(var e,i,o,s,l,u={},c=t.split(/\r\n|\r|\n/),h=c.length,p=0;p<h;p++)if(""!==c[p]&&c[p].toUpperCase()!==n&&c[p].toUpperCase()!==r){var f=c[p],d=function(t){return t+1<h&&(" "===c[t+1][0]||"\t"===c[t+1][0])};if(d(p))for(;d(p);)f+=c[p+1].trim(),p++;if(i=(e=f.split(":")).shift(),o=e.join(":"),l=!1,s={},i.match(/;/)){var g=(i=i.replace(/\\;/g,"ΩΩΩ").replace(/\\,/,",")).split(";").map((function(t){return t.replace(/ΩΩΩ/g,";")}));i=g.shift(),g.forEach((function(t){var e=t.split("=");e[0]=e[0].toLowerCase(),0!==e[0].length&&(s[e[0]]?s[e[0]].push(e[1]):s[e[0]]=[e[1]])}))}if(o=a(o=o.replace(/\\n/g,"\n")),i.match(/\./)){var m=i.split(".");i=m[1],l=m[0]}var y={value:o};Object.keys(s).length&&(y.meta=s),l&&(y.namespace=l),0!==i.indexOf("X-")&&(i=i.toLowerCase()),void 0===u[i]?u[i]=[y]:u[i].push(y)}return u},generate:function(t,e){var i=[n],o="";e&&!t.version&&(t.version=[{value:"3.0"}]),e&&!t.uid&&(t.uid=[{value:l()}]);var a=function(t){return void 0===t?"":t.replace(/\n/g,"\\n").replace(/;/g,"\\;").replace(/,/g,"\\,")};return Object.keys(t).forEach((function(e){t[e]&&"function"==typeof t[e].forEach&&t[e].forEach((function(t){if(void 0!==t.value&&(""!==t.value||-1!==c.indexOf(e))){if(t.value instanceof Array){for(var n=!0,r=0;r<t.value.length;r++)if(void 0!==t.value[r]&&""!==t.value[r]){n=!1;break}if(n)return}if(o="",t.namespace&&(o+=t.namespace+"."),o+=0===e.indexOf("X-")?e:e.toUpperCase(),"object"==typeof t.meta&&Object.keys(t.meta).forEach((function(e){"function"==typeof t.meta[e].forEach&&t.meta[e].forEach((function(t){var n;e.length>0&&("TYPE"===e.toUpperCase()?o+=";"+a(e.toUpperCase())+"="+(void 0===(n=t)?"":n.replace(/\n/g,"\\n").replace(/;/g,"\\;")):o+=";"+a(e.toUpperCase())+"="+a(t))}))})),o+=":","string"==typeof t.value)o+=a(t.value);else{var s=-1!==u.indexOf(e)?",":";";o+=t.value.map((function(t){return a(t)})).join(s)}if(o.length>75){var l=o.substr(0,75),h=o.substr(75).match(/.{1,74}/g);i.push(l),h.forEach((function(t){i.push(" "+t)}))}else i.push(o)}}))})),i.push(r),i.join("\r\n")}}},function(t,e){var n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+n.source+r.source+"*(?::"+n.source+r.source+"*)?$");function o(){}function a(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function s(t,e,n,r,i,o){for(var a,s=++e,l=0;;){var u=t.charAt(s);switch(u){case"=":if(1===l)a=t.slice(e,s),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(o.warning('attribute value must after "="'),a=t.slice(e,s)),e=s+1,!((s=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");c=t.slice(e,s).replace(/&#?\w+;/g,i),n.add(a,c,e-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');c=t.slice(e,s).replace(/&#?\w+;/g,i),n.add(a,c,e),o.warning('attribute "'+a+'" missed start quot('+u+")!!"),e=s+1,l=5}break;case"/":switch(l){case 0:n.setTagName(t.slice(e,s));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==l&&n.setTagName(t.slice(e,s)),s;case">":switch(l){case 0:n.setTagName(t.slice(e,s));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,s)).slice(-1)&&(n.closed=!0,c=c.slice(0,-1));case 2:2===l&&(c=a),4==l?(o.warning('attribute "'+c+'" missed quot(")!!'),n.add(a,c.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===r[""]&&c.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),n.add(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return s;case"":u=" ";default:if(u<=" ")switch(l){case 0:n.setTagName(t.slice(e,s)),l=6;break;case 1:a=t.slice(e,s),l=2;break;case 4:var c=t.slice(e,s).replace(/&#?\w+;/g,i);o.warning('attribute "'+c+'" missed quot(")!!'),n.add(a,c,e);case 5:l=6}else switch(l){case 2:n.tagName,"http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,e),e=s,l=1;break;case 5:o.warning('attribute space is required"'+a+'"!!');case 6:l=1,e=s;break;case 3:l=4,e=s;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}s++}}function l(t,e,n){for(var r=t.tagName,i=null,o=t.length;o--;){var a=t[o],s=a.qName,l=a.value;if((f=s.indexOf(":"))>0)var u=a.prefix=s.slice(0,f),c=s.slice(f+1),p="xmlns"===u&&c;else c=s,u=null,p="xmlns"===s&&"";a.localName=c,!1!==p&&(null==i&&(i={},h(n,n={})),n[p]=i[p]=l,a.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(p,l))}for(o=t.length;o--;)(u=(a=t[o]).prefix)&&("xml"===u&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(a.uri=n[u||""]));var f;(f=r.indexOf(":"))>0?(u=t.prefix=r.slice(0,f),c=t.localName=r.slice(f+1)):(u=null,c=t.localName=r);var d=t.uri=n[u||""];if(e.startElement(d,c,r,t),!t.closed)return t.currentNSMap=n,t.localNSMap=i,!0;if(e.endElement(d,c,r),i)for(u in i)e.endPrefixMapping(u)}function u(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),a=t.substring(e+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return e+1}function c(t,e,n,r){var i=r[n];return null==i&&((i=t.lastIndexOf("</"+n+">"))<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function h(t,e){for(var n in t)e[n]=t[n]}function p(t,e,n,r){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(i=t.indexOf("--\x3e",e+4))>e?(n.comment(t,e+4,i-e-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var i=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,i-e-9),n.endCDATA(),i+3}var o=function(t,e){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}(t,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],l=a>3&&/^public$/i.test(o[2][0])&&o[3][0],u=a>4&&o[4][0],c=o[a-1];return n.startDTD(s,l&&l.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),c.index+c[0].length}return-1}function f(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function d(t){}function g(t,e){return t.__proto__=e,t}o.prototype={parse:function(t,e,n){var r=this.domBuilder;r.startDocument(),h(e,e={}),function(t,e,n,r,i){function o(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(i.error("entity not found:"+t),t)}function h(e){if(e>C){var n=t.substring(C,e).replace(/&#?\w+;/g,o);b&&g(C),r.characters(n,0,e-C),C=e}}function g(e,n){for(;e>=y&&(n=_.exec(t));)m=n.index,y=m+n[0].length,b.lineNumber++;b.columnNumber=e-m+1}for(var m=0,y=0,_=/.*(?:\r\n?|\n)|.*$/g,b=r.locator,v=[{currentNSMap:e}],w={},C=0;;){try{var P=t.indexOf("<",C);if(P<0){if(!t.substr(C).match(/^\s*$/)){var x=r.doc,S=x.createTextNode(t.substr(C));x.appendChild(S),r.currentElement=S}return}switch(P>C&&h(P),t.charAt(P+1)){case"/":var I=t.indexOf(">",P+3),O=t.substring(P+2,I),T=v.pop();I<0?(O=t.substring(P+2).replace(/[\s<].*/,""),i.error("end tag name: "+O+" is not complete:"+T.tagName),I=P+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),i.error("end tag name: "+O+" maybe not complete"),I=P+1+O.length);var E=T.localNSMap,L=T.tagName==O;if(L||T.tagName&&T.tagName.toLowerCase()==O.toLowerCase()){if(r.endElement(T.uri,T.localName,O),E)for(var R in E)r.endPrefixMapping(R);L||i.fatalError("end tag name: "+O+" is not match the current start tagName:"+T.tagName)}else v.push(T);I++;break;case"?":b&&g(P),I=f(t,P,r);break;case"!":b&&g(P),I=p(t,P,r,i);break;default:b&&g(P);var k=new d,j=v[v.length-1].currentNSMap,A=(I=s(t,P,k,j,o,i),k.length);if(!k.closed&&c(t,I,k.tagName,w)&&(k.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),b&&A){for(var F=a(b,{}),B=0;B<A;B++){var M=k[B];g(M.offset),M.locator=a(b,{})}r.locator=F,l(k,r,j)&&v.push(k),r.locator=b}else l(k,r,j)&&v.push(k);"http://www.w3.org/1999/xhtml"!==k.uri||k.closed?I++:I=u(t,I,k.tagName,o,r)}}catch(N){i.error("element parse error: "+N),I=-1}I>C?C=I:h(Math.max(P,C)+1)}}(t,e,n,r,this.errorHandler),r.endDocument()}},d.prototype={setTagName:function(t){if(!i.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!i.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},g({},g.prototype)instanceof g||(g=function(t,e){function n(){}for(e in n.prototype=e,n=new n,t)n[e]=t[e];return n}),e.XMLReader=o},,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function r(){let t=0,e=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(15&n)<<28,e=(112&n)>>4,!(128&n))return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function i(t,e,n){for(let o=0;o<28;o+=7){const r=t>>>o,i=!(r>>>7==0&&0==e),a=255&(i?128|r:r);if(n.push(a),!i)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}n.d(e,"a",(function(){return be}));const o=4294967296;function a(t){let e="-"==t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function a(e,a){const s=Number(t.slice(e,a));i*=n,r=r*n+s,r>=o&&(i+=r/o|0,r%=o)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[e,r,i]}function s(t,e){if(e<=2097151)return""+(o*e+t);let n=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,i=(16777215&t)+6777216*n+6710656*r,a=n+8147497*r,s=2*r,l=1e7;function u(t,e){let n=t?String(t):"";return e?"0000000".slice(n.length)+n:n}return i>=l&&(a+=Math.floor(i/l),i%=l),a>=l&&(s+=Math.floor(a/l),a%=l),u(s,0)+u(a,s)+u(i,1)}function l(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}function u(){let t=this.buf[this.pos++],e=127&t;if(!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<7,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<14,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<21,!(128&t))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(15&t)<<28;for(let n=5;128&t&&n<10;n++)t=this.buf[this.pos++];if(128&t)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const c=function(){const t=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:t}:void 0}();function h(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const p=/^-?[0-9]+$/,f=4294967296;class d{constructor(t,e){this.lo=0|t,this.hi=0|e}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let t=this.hi*f+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class g extends d{static from(t){if(c)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=c.C(t);case"number":if(0===t)return this.ZERO;t=c.C(t);case"bigint":if(!t)return this.ZERO;if(t<c.UMIN)throw new Error("signed value for ulong");if(t>c.UMAX)throw new Error("ulong too large");return c.V.setBigUint64(0,t,!0),new g(c.V.getInt32(0,!0),c.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!p.test(t))throw new Error("string is no integer");let[e,n,r]=a(t);if(e)throw new Error("signed value");return new g(n,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new g(t,t/f)}throw new Error("unknown value "+typeof t)}toString(){return c?this.toBigInt().toString():s(this.lo,this.hi)}toBigInt(){return h(c),c.V.setInt32(0,this.lo,!0),c.V.setInt32(4,this.hi,!0),c.V.getBigUint64(0,!0)}}g.ZERO=new g(0,0);class m extends d{static from(t){if(c)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=c.C(t);case"number":if(0===t)return this.ZERO;t=c.C(t);case"bigint":if(!t)return this.ZERO;if(t<c.MIN)throw new Error("ulong too small");if(t>c.MAX)throw new Error("ulong too large");return c.V.setBigInt64(0,t,!0),new m(c.V.getInt32(0,!0),c.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!p.test(t))throw new Error("string is no integer");let[e,n,r]=a(t),i=new m(n,r);return e?i.negate():i;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new m(t,t/f):new m(-t,-t/f).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return!!(2147483648&this.hi)}negate(){let t=~this.hi,e=this.lo;return e?e=1+~e:t+=1,new m(e,t)}toString(){if(c)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+s(t.lo,t.hi)}return s(this.lo,this.hi)}toBigInt(){return h(c),c.V.setInt32(0,this.lo,!0),c.V.setInt32(4,this.hi,!0),c.V.getBigInt64(0,!0)}}m.ZERO=new m(0,0);const y=t=>String.fromCharCode.apply(String,t);class _{constructor(t){this.varint64=r,this.uint32=u,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),e=t>>>3,n=7&t;if(e<=0||n<0||n>5)throw new Error("illegal tag: field no "+e+" wire type "+n);return[e,n]}skip(t){let e=this.pos;switch(t){case O.Bit64:this.pos+=4;case O.Bit32:this.pos+=4;break;case O.LengthDelimited:let t=this.uint32();this.pos+=t;break;case O.Varint:for(;128&this.buf[this.pos++];);}return this.assertBounds(),this.buf.slice(e,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let t=this.uint32();return t>>>1^-(1&t)}int64(){return new m(...this.varint64())}uint64(){return new g(...this.varint64())}sint64(){let[t,e]=this.varint64(),n=-(1&t);return t=(t>>>1|(1&e)<<31)^n,e=e>>>1^n,new m(t,e)}bool(){let[t,e]=this.varint64();return 0!==t||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new g(this.sfixed32(),this.sfixed32())}sfixed64(){return new m(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.pos;return this.pos+=t,this.assertBounds(),this.buf.slice(e,this.pos)}string(){return function(t){if(t.length<1)return"";let e,n=0,r=[],i=[],o=0,a=t.length;for(;n<a;)e=t[n++],e<128?i[o++]=e:e>191&&e<224?i[o++]=(31&e)<<6|63&t[n++]:e>239&&e<365?(e=((7&e)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,i[o++]=55296+(e>>10),i[o++]=56320+(1023&e)):i[o++]=(15&e)<<12|(63&t[n++])<<6|63&t[n++],o>8191&&(r.push(y(i)),o=0);return r.length?(o&&r.push(y(i.slice(0,o))),r.join("")):y(i.slice(0,o))}(this.bytes())}}function b(t,e){if(!t)throw new Error(e)}function v(t){if("number"!=typeof t)throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int 32: "+t)}function w(t){if("number"!=typeof t)throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint 32: "+t)}function C(t){if("number"!=typeof t)throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>34028234663852886e22||t<-34028234663852886e22))throw new Error("invalid float 32: "+t)}class P{constructor(t){this.stack=[],this.textEncoder=null!=t?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let r=0;r<this.chunks.length;r++)t+=this.chunks[r].length;let e=new Uint8Array(t),n=0;for(let r=0;r<this.chunks.length;r++)e.set(this.chunks[r],n),n+=this.chunks[r].length;return this.chunks=[],e}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.chunks=e.chunks,this.buf=e.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(w(t);t>127;)this.buf.push(127&t|128),t>>>=7;return this.buf.push(t),this}int32(t){return v(t),l(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.textEncoder.encode(t);return this.uint32(e.byteLength),this.raw(e)}float(t){C(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}double(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}fixed32(t){w(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}sfixed32(t){v(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}sint32(t){return v(t),l(t=(t<<1^t>>31)>>>0,this.buf),this}sfixed64(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=m.from(t);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(e)}fixed64(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=g.from(t);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(e)}int64(t){let e=m.from(t);return i(e.lo,e.hi,this.buf),this}sint64(t){let e=m.from(t),n=e.hi>>31;return i(e.lo<<1^n,(e.hi<<1|e.lo>>>31)^n,this.buf),this}uint64(t){let e=g.from(t);return i(e.lo,e.hi,this.buf),this}}var x;!function(t){t.symbol=Symbol("protobuf-ts/unknown"),t.onRead=(n,r,i,o,a)=>{(e(r)?r[t.symbol]:r[t.symbol]=[]).push({no:i,wireType:o,data:a})},t.onWrite=(e,n,r)=>{for(let{no:i,wireType:o,data:a}of t.list(n))r.tag(i,o).raw(a)},t.list=(n,r)=>{if(e(n)){let e=n[t.symbol];return r?e.filter((t=>t.no==r)):e}return[]},t.last=(e,n)=>t.list(e,n).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.symbol])}(x||(x={}));const S={readUnknownField:!0,readerFactory:t=>new _(t)},I={writeUnknownFields:!0,writerFactory:()=>new P};var O,T,E,L;function R(t,e,n){let r,i,o=n;for(let a of t.fields){let t=a.localName;if(a.oneof){const n=o[a.oneof];if(void 0===n)continue;if(r=n[t],i=e[a.oneof],i.oneofKind=n.oneofKind,void 0===r){delete i[t];continue}}else if(r=o[t],i=e,void 0===r)continue;switch(a.kind){case"scalar":case"enum":a.repeat?i[t]=r.concat():i[t]=r;break;case"message":let e=a.T();if(a.repeat)for(let n=0;n<r.length;n++)i[t][n]=e.create(r[n]);else void 0===i[t]?i[t]=e.create(r):e.mergePartial(i[t],r);break;case"map":switch(a.V.kind){case"scalar":case"enum":Object.assign(i[t],r);break;case"message":let e=a.V.T();for(let n of Object.keys(r))i[t][n]=e.create(r[n])}}}}function k(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);"_"==i?e=!0:/\d/.test(i)?(n.push(i),e=!0):e?(n.push(i.toUpperCase()),e=!1):0==r?n.push(i.toLowerCase()):n.push(i)}return n.join("")}function j(t){var e,n,r,i;return t.localName=null!==(e=t.localName)&&void 0!==e?e:k(t.name),t.jsonName=null!==(n=t.jsonName)&&void 0!==n?n:k(t.name),t.repeat=null!==(r=t.repeat)&&void 0!==r?r:L.NO,t.opt=null!==(i=t.opt)&&void 0!==i?i:!t.repeat&&!t.oneof&&"message"==t.kind,t}function A(t){if("object"!=typeof t||null===t||!t.hasOwnProperty("oneofKind"))return!1;switch(typeof t.oneofKind){case"string":return void 0!==t[t.oneofKind]&&2==Object.keys(t).length;case"undefined":return 1==Object.keys(t).length;default:return!1}}!function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"}(O||(O={})),function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"}(T||(T={})),function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER"}(E||(E={})),function(t){t[t.NO=0]="NO",t[t.PACKED=1]="PACKED",t[t.UNPACKED=2]="UNPACKED"}(L||(L={}));class F{constructor(t){this.info=t}prepare(){if(this.data)return;const t=[],e=[],n=[];for(let r of this.info.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),t.push(r.oneof),e.push(r.oneof));else switch(e.push(r.localName),r.kind){case"scalar":case"enum":r.opt&&!r.repeat||t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName)}this.data={req:t,known:e,oneofs:Object.values(n)}}is(t,e,n=!1){if(e<0)return!0;if(null==t||"object"!=typeof t)return!1;this.prepare();let r=Object.keys(t),i=this.data;if(r.length<i.req.length||i.req.some((t=>!r.includes(t))))return!1;if(!n&&r.some((t=>!i.known.includes(t))))return!1;if(e<1)return!0;for(const o of i.oneofs){const r=t[o];if(!A(r))return!1;if(void 0===r.oneofKind)continue;const i=this.info.fields.find((t=>t.localName===r.oneofKind));if(!i)return!1;if(!this.field(r[r.oneofKind],i,n,e))return!1}for(const o of this.info.fields)if(void 0===o.oneof&&!this.field(t[o.localName],o,n,e))return!1;return!0}field(t,e,n,r){let i=e.repeat;switch(e.kind){case"scalar":return void 0===t?e.opt:i?this.scalars(t,e.T,r,e.L):this.scalar(t,e.T,e.L);case"enum":return void 0===t?e.opt:i?this.scalars(t,T.INT32,r):this.scalar(t,T.INT32);case"message":return void 0===t||(i?this.messages(t,e.T(),n,r):this.message(t,e.T(),n,r));case"map":if("object"!=typeof t||null===t)return!1;if(r<2)return!0;if(!this.mapKeys(t,e.K,r))return!1;switch(e.V.kind){case"scalar":return this.scalars(Object.values(t),e.V.T,r,e.V.L);case"enum":return this.scalars(Object.values(t),T.INT32,r);case"message":return this.messages(Object.values(t),e.V.T(),n,r)}}return!0}message(t,e,n,r){return n?e.isAssignable(t,r):e.is(t,r)}messages(t,e,n,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(n){for(let i=0;i<t.length&&i<r;i++)if(!e.isAssignable(t[i],r-1))return!1}else for(let i=0;i<t.length&&i<r;i++)if(!e.is(t[i],r-1))return!1;return!0}scalar(t,e,n){let r=typeof t;switch(e){case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:switch(n){case E.BIGINT:return"bigint"==r;case E.NUMBER:return"number"==r&&!isNaN(t);default:return"string"==r}case T.BOOL:return"boolean"==r;case T.STRING:return"string"==r;case T.BYTES:return t instanceof Uint8Array;case T.DOUBLE:case T.FLOAT:return"number"==r&&!isNaN(t);default:return"number"==r&&Number.isInteger(t)}}scalars(t,e,n,r){if(!Array.isArray(t))return!1;if(n<2)return!0;if(Array.isArray(t))for(let i=0;i<t.length&&i<n;i++)if(!this.scalar(t[i],e,r))return!1;return!0}mapKeys(t,e,n){let r=Object.keys(t);switch(e){case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:return this.scalars(r.slice(0,n).map((t=>parseInt(t))),e,n);case T.BOOL:return this.scalars(r.slice(0,n).map((t=>"true"==t||"false"!=t&&t)),e,n);default:return this.scalars(r,e,n,E.STRING)}}}function B(t){let e=typeof t;if("object"==e){if(Array.isArray(t))return"array";if(null===t)return"null"}return e}let M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),N=[];for(let Pe=0;Pe<M.length;Pe++)N[M[Pe].charCodeAt(0)]=Pe;function z(t,e){switch(e){case E.BIGINT:return t.toBigInt();case E.NUMBER:return t.toNumber();default:return t.toString()}}N["-".charCodeAt(0)]=M.indexOf("+"),N["_".charCodeAt(0)]=M.indexOf("/");class D{constructor(t){this.info=t}prepare(){if(void 0===this.fMap){this.fMap={};for(const t of this.info.fields)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(t,e,n){if(!t){let t=B(n);throw"number"!=t&&"boolean"!=t||(t=n.toString()),new Error(`Cannot parse JSON ${t} for ${this.info.typeName}#${e}`)}}read(t,e,n){this.prepare();const r=[];for(const[o,a]of Object.entries(t)){const t=this.fMap[o];if(!t){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const s=t.localName;let l;if(t.oneof){if(r.includes(t.oneof))throw new Error(`Multiple members of the oneof group "${t.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(t.oneof),l=e[t.oneof]={oneofKind:s}}else l=e;if("map"==t.kind){if(null===a)continue;this.assert(null!==(i=a)&&"object"==typeof i&&!Array.isArray(i),t.name,a);const e=l[s];for(const[r,i]of Object.entries(a)){let o;switch(this.assert(null!==i,t.name+" map value",null),t.V.kind){case"message":o=t.V.T().internalJsonRead(i,n);break;case"enum":o=this.enum(t.V.T(),i,t.name);break;case"scalar":o=this.scalar(i,t.V.T,t.V.L,t.name)}this.assert(void 0!==o,t.name+" map value",i);let a=r;t.K==T.BOOL&&(a="true"==a||"false"!=a&&a),a=this.scalar(a,t.K,E.STRING,t.name).toString(),e[a]=o}}else if(t.repeat){if(null===a)continue;this.assert(Array.isArray(a),t.name,a);const e=l[s];for(const r of a){let i;switch(this.assert(null!==r,t.name,null),t.kind){case"message":i=t.T().internalJsonRead(r,n);break;case"enum":i=this.enum(t.T(),r,t.name);break;case"scalar":i=this.scalar(r,t.T,t.L,t.name)}this.assert(void 0!==i,t.name,a),e.push(i)}}else switch(t.kind){case"message":if(null===a&&"google.protobuf.Value"!=t.T().typeName){this.assert(void 0===t.oneof,t.name+" (oneof member)",null);continue}l[s]=t.T().internalJsonRead(a,n,l[s]);break;case"enum":l[s]=this.enum(t.T(),a,t.name);break;case"scalar":l[s]=this.scalar(a,t.T,t.L,t.name)}}var i}enum(t,e,n){if("google.protobuf.NullValue"==t[0]&&b(null===e,`Unable to parse field ${this.info.typeName}#${n}, enum ${t[0]} only accepts null.`),null===e)return 0;switch(typeof e){case"number":return b(Number.isInteger(e),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${e}.`),e;case"string":let r=e;t[2]&&e.substring(0,t[2].length)===t[2]&&(r=e.substring(t[2].length));let i=t[1][r];return b("number"==typeof i,`Unable to parse field ${this.info.typeName}#${n}, enum ${t[0]} has no value for "${e}".`),i}b(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof e}".`)}scalar(t,e,n,r){let i;try{switch(e){case T.DOUBLE:case T.FLOAT:if(null===t)return 0;if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t){i="empty string";break}if("string"==typeof t&&t.trim().length!==t.length){i="extra whitespace";break}if("string"!=typeof t&&"number"!=typeof t)break;let r=Number(t);if(Number.isNaN(r)){i="not a number";break}if(!Number.isFinite(r)){i="too large or small";break}return e==T.FLOAT&&C(r),r;case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:if(null===t)return 0;let o;if("number"==typeof t?o=t:""===t?i="empty string":"string"==typeof t&&(t.trim().length!==t.length?i="extra whitespace":o=Number(t)),void 0===o)break;return e==T.UINT32?w(o):v(o),o;case T.INT64:case T.SFIXED64:case T.SINT64:if(null===t)return z(m.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return z(m.from(t),n);case T.FIXED64:case T.UINT64:if(null===t)return z(g.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return z(g.from(t),n);case T.BOOL:if(null===t)return!1;if("boolean"!=typeof t)break;return t;case T.STRING:if(null===t)return"";if("string"!=typeof t){i="extra whitespace";break}try{encodeURIComponent(t)}catch(i){i="invalid UTF8";break}return t;case T.BYTES:if(null===t||""===t)return new Uint8Array(0);if("string"!=typeof t)break;return function(t){let e=3*t.length/4;"="==t[t.length-2]?e-=2:"="==t[t.length-1]&&(e-=1);let n,r=new Uint8Array(e),i=0,o=0,a=0;for(let s=0;s<t.length;s++){if(n=N[t.charCodeAt(s)],void 0===n)switch(t[s]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:a=n,o=1;break;case 1:r[i++]=a<<2|(48&n)>>4,a=n,o=2;break;case 2:r[i++]=(15&a)<<4|(60&n)>>2,a=n,o=3;break;case 3:r[i++]=(3&a)<<6|n,o=0}}if(1==o)throw Error("invalid base64 string.");return r.subarray(0,i)}(t)}}catch(o){i=o.message}this.assert(!1,r+(i?" - "+i:""),t)}}class H{constructor(t){this.info=t}write(t,e){const n={},r=t;for(const i of this.info.fields.filter((t=>!t.oneof))){let t=this.field(i,r[i.localName],e);void 0!==t&&(n[e.useProtoFieldName?i.name:i.jsonName]=t)}for(const i of this.info.fields){if(!i.oneof)continue;const t=r[i.oneof];if(t.oneofKind!==i.localName)continue;let o;o="scalar"==i.kind||"enum"==i.kind?this.field(i,t[i.localName],{enumAsInteger:e.enumAsInteger,useProtoFieldName:e.useProtoFieldName,emitDefaultValues:!0}):this.field(i,t[i.localName],e),b(void 0!==o),n[e.useProtoFieldName?i.name:i.jsonName]=o}return n}field(t,e,n){let r;if("map"==t.kind){b("object"==typeof e&&null!==e);const i={};switch(t.V.kind){case"scalar":for(const[n,a]of Object.entries(e)){const e=this.scalar(t.V.T,a,t.name,!1,!0);b(void 0!==e),i[n.toString()]=e}break;case"message":const r=t.V.T();for(const[a,s]of Object.entries(e)){const e=this.message(r,s,t.name,n);b(void 0!==e),i[a.toString()]=e}break;case"enum":const o=t.V.T();for(const[a,s]of Object.entries(e)){b(void 0===s||"number"==typeof s);const e=this.enum(o,s,t.name,!1,!0,n.enumAsInteger);b(void 0!==e),i[a.toString()]=e}}(n.emitDefaultValues||Object.keys(i).length>0)&&(r=i)}else if(t.repeat){b(Array.isArray(e));const i=[];switch(t.kind){case"scalar":for(let n=0;n<e.length;n++){const r=this.scalar(t.T,e[n],t.name,t.opt,!0);b(void 0!==r),i.push(r)}break;case"enum":const r=t.T();for(let a=0;a<e.length;a++){b(void 0===e[a]||"number"==typeof e[a]);const o=this.enum(r,e[a],t.name,t.opt,!0,n.enumAsInteger);b(void 0!==o),i.push(o)}break;case"message":const o=t.T();for(let a=0;a<e.length;a++){const r=this.message(o,e[a],t.name,n);b(void 0!==r),i.push(r)}}(n.emitDefaultValues||i.length>0||n.emitDefaultValues)&&(r=i)}else switch(t.kind){case"scalar":r=this.scalar(t.T,e,t.name,t.opt,n.emitDefaultValues);break;case"enum":r=this.enum(t.T(),e,t.name,t.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":r=this.message(t.T(),e,t.name,n)}return r}enum(t,e,n,r,i,o){if("google.protobuf.NullValue"==t[0])return null;if(void 0!==e){if(0!==e||i||r)return b("number"==typeof e),b(Number.isInteger(e)),o||!t[1].hasOwnProperty(e)?e:t[2]?t[2]+t[1][e]:t[1][e]}else b(r)}message(t,e,n,r){return void 0===e?r.emitDefaultValues?null:void 0:t.internalJsonWrite(e,r)}scalar(t,e,n,r,i){if(void 0===e)return void b(r);const o=i||r;switch(t){case T.INT32:case T.SFIXED32:case T.SINT32:return 0===e?o?0:void 0:(v(e),e);case T.FIXED32:case T.UINT32:return 0===e?o?0:void 0:(w(e),e);case T.FLOAT:C(e);case T.DOUBLE:return 0===e?o?0:void 0:(b("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e);case T.STRING:return""===e?o?"":void 0:(b("string"==typeof e),e);case T.BOOL:return!1===e?!o&&void 0:(b("boolean"==typeof e),e);case T.UINT64:case T.FIXED64:b("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let t=g.from(e);if(t.isZero()&&!o)return;return t.toString();case T.INT64:case T.SFIXED64:case T.SINT64:b("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let n=m.from(e);if(n.isZero()&&!o)return;return n.toString();case T.BYTES:return b(e instanceof Uint8Array),e.byteLength?function(t){let e,n="",r=0,i=0;for(let o=0;o<t.length;o++)switch(e=t[o],r){case 0:n+=M[e>>2],i=(3&e)<<4,r=1;break;case 1:n+=M[i|e>>4],i=(15&e)<<2,r=2;break;case 2:n+=M[i|e>>6],n+=M[63&e],r=0}return r&&(n+=M[i],n+="=",1==r&&(n+="=")),n}(e):o?"":void 0}}}function W(t,e=E.STRING){switch(t){case T.BOOL:return!1;case T.UINT64:case T.FIXED64:return z(g.ZERO,e);case T.INT64:case T.SFIXED64:case T.SINT64:return z(m.ZERO,e);case T.DOUBLE:case T.FLOAT:return 0;case T.BYTES:return new Uint8Array(0);case T.STRING:return"";default:return 0}}class U{constructor(t){this.info=t}prepare(){this.fieldNoToField||(this.fieldNoToField=new Map(this.info.fields.map((t=>[t.no,t]))))}read(t,e,n,r){this.prepare();const i=void 0===r?t.len:t.pos+r;for(;t.pos<i;){const[r,i]=t.tag(),o=this.fieldNoToField.get(r);if(!o){let o=n.readUnknownField;if("throw"==o)throw new Error(`Unknown field ${r} (wire type ${i}) for ${this.info.typeName}`);let a=t.skip(i);!1!==o&&(!0===o?x.onRead:o)(this.info.typeName,e,r,i,a);continue}let a=e,s=o.repeat,l=o.localName;switch(o.oneof&&(a=a[o.oneof],a.oneofKind!==l&&(a=e[o.oneof]={oneofKind:l})),o.kind){case"scalar":case"enum":let e="enum"==o.kind?T.INT32:o.T,r="scalar"==o.kind?o.L:void 0;if(s){let n=a[l];if(i==O.LengthDelimited&&e!=T.STRING&&e!=T.BYTES){let i=t.uint32()+t.pos;for(;t.pos<i;)n.push(this.scalar(t,e,r))}else n.push(this.scalar(t,e,r))}else a[l]=this.scalar(t,e,r);break;case"message":if(s){let e=a[l],r=o.T().internalBinaryRead(t,t.uint32(),n);e.push(r)}else a[l]=o.T().internalBinaryRead(t,t.uint32(),n,a[l]);break;case"map":let[u,c]=this.mapEntry(o,t,n);a[l][u]=c}}}mapEntry(t,e,n){let r,i,o=e.uint32(),a=e.pos+o;for(;e.pos<a;){let[o,a]=e.tag();switch(o){case 1:r=t.K==T.BOOL?e.bool().toString():this.scalar(e,t.K,E.STRING);break;case 2:switch(t.V.kind){case"scalar":i=this.scalar(e,t.V.T,t.V.L);break;case"enum":i=e.int32();break;case"message":i=t.V.T().internalBinaryRead(e,e.uint32(),n)}break;default:throw new Error(`Unknown field ${o} (wire type ${a}) in map entry for ${this.info.typeName}#${t.name}`)}}if(void 0===r){let e=W(t.K);r=t.K==T.BOOL?e.toString():e}if(void 0===i)switch(t.V.kind){case"scalar":i=W(t.V.T,t.V.L);break;case"enum":i=0;break;case"message":i=t.V.T().create()}return[r,i]}scalar(t,e,n){switch(e){case T.INT32:return t.int32();case T.STRING:return t.string();case T.BOOL:return t.bool();case T.DOUBLE:return t.double();case T.FLOAT:return t.float();case T.INT64:return z(t.int64(),n);case T.UINT64:return z(t.uint64(),n);case T.FIXED64:return z(t.fixed64(),n);case T.FIXED32:return t.fixed32();case T.BYTES:return t.bytes();case T.UINT32:return t.uint32();case T.SFIXED32:return t.sfixed32();case T.SFIXED64:return z(t.sfixed64(),n);case T.SINT32:return t.sint32();case T.SINT64:return z(t.sint64(),n)}}}class V{constructor(t){this.info=t}prepare(){this.fields||(this.fields=this.info.fields.concat().sort(((t,e)=>t.no-e.no)))}write(t,e,n){this.prepare();for(const i of this.fields){let r,o,a=i.repeat,s=i.localName;if(i.oneof){const e=t[i.oneof];if(e.oneofKind!==s)continue;r=e[s],o=!0}else r=t[s],o=!1;switch(i.kind){case"scalar":case"enum":let t="enum"==i.kind?T.INT32:i.T;if(a)if(b(Array.isArray(r)),a==L.PACKED)this.packed(e,t,i.no,r);else for(const n of r)this.scalar(e,t,i.no,n,!0);else void 0===r?b(i.opt):this.scalar(e,t,i.no,r,o||i.opt);break;case"message":if(a){b(Array.isArray(r));for(const t of r)this.message(e,n,i.T(),i.no,t)}else this.message(e,n,i.T(),i.no,r);break;case"map":b("object"==typeof r&&null!==r);for(const[o,a]of Object.entries(r))this.mapEntry(e,n,i,o,a)}}let r=n.writeUnknownFields;!1!==r&&(!0===r?x.onWrite:r)(this.info.typeName,t,e)}mapEntry(t,e,n,r,i){t.tag(n.no,O.LengthDelimited),t.fork();let o=r;switch(n.K){case T.INT32:case T.FIXED32:case T.UINT32:case T.SFIXED32:case T.SINT32:o=Number.parseInt(r);break;case T.BOOL:b("true"==r||"false"==r),o="true"==r}switch(this.scalar(t,n.K,1,o,!0),n.V.kind){case"scalar":this.scalar(t,n.V.T,2,i,!0);break;case"enum":this.scalar(t,T.INT32,2,i,!0);break;case"message":this.message(t,e,n.V.T(),2,i)}t.join()}message(t,e,n,r,i){void 0!==i&&(n.internalBinaryWrite(i,t.tag(r,O.LengthDelimited).fork(),e),t.join())}scalar(t,e,n,r,i){let[o,a,s]=this.scalarInfo(e,r);s&&!i||(t.tag(n,o),t[a](r))}packed(t,e,n,r){if(!r.length)return;b(e!==T.BYTES&&e!==T.STRING),t.tag(n,O.LengthDelimited),t.fork();let[,i]=this.scalarInfo(e);for(let o=0;o<r.length;o++)t[i](r[o]);t.join()}scalarInfo(t,e){let n,r=O.Varint,i=void 0===e,o=0===e;switch(t){case T.INT32:n="int32";break;case T.STRING:o=i||!e.length,r=O.LengthDelimited,n="string";break;case T.BOOL:o=!1===e,n="bool";break;case T.UINT32:n="uint32";break;case T.DOUBLE:r=O.Bit64,n="double";break;case T.FLOAT:r=O.Bit32,n="float";break;case T.INT64:o=i||m.from(e).isZero(),n="int64";break;case T.UINT64:o=i||g.from(e).isZero(),n="uint64";break;case T.FIXED64:o=i||g.from(e).isZero(),r=O.Bit64,n="fixed64";break;case T.BYTES:o=i||!e.byteLength,r=O.LengthDelimited,n="bytes";break;case T.FIXED32:r=O.Bit32,n="fixed32";break;case T.SFIXED32:r=O.Bit32,n="sfixed32";break;case T.SFIXED64:o=i||m.from(e).isZero(),r=O.Bit64,n="sfixed64";break;case T.SINT32:n="sint32";break;case T.SINT64:o=i||m.from(e).isZero(),n="sint64"}return[r,n,i||o]}}const q={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},G={ignoreUnknownFields:!1},$=Object.values;function X(t,e,n){if(e===n)return!0;if(t!==T.BYTES)return!1;let r=e,i=n;if(r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!=i[o])return!1;return!0}function K(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!X(t,e[r],n[r]))return!1;return!0}function Y(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t.equals(e[r],n[r]))return!1;return!0}class J{constructor(t,e){this.defaultCheckDepth=16,this.typeName=t,this.fields=e.map(j),this.refTypeCheck=new F(this),this.refJsonReader=new D(this),this.refJsonWriter=new H(this),this.refBinReader=new U(this),this.refBinWriter=new V(this)}create(t){let e=function(t){let e={};for(let n of t.fields){let t=n.localName;if(!n.opt)if(n.oneof)e[n.oneof]={oneofKind:void 0};else if(n.repeat)e[t]=[];else switch(n.kind){case"scalar":e[t]=W(n.T,n.L);break;case"enum":e[t]=0;break;case"map":e[t]={}}}return e}(this);return void 0!==t&&R(this,e,t),e}clone(t){let e=this.create();return R(this,e,t),e}equals(t,e){return function(t,e,n){if(e===n)return!0;if(!e||!n)return!1;for(let r of t.fields){let t=r.localName,i=r.oneof?e[r.oneof][t]:e[t],o=r.oneof?n[r.oneof][t]:n[t];switch(r.kind){case"enum":case"scalar":let t="enum"==r.kind?T.INT32:r.T;if(!(r.repeat?K(t,i,o):X(t,i,o)))return!1;break;case"map":if(!("message"==r.V.kind?Y(r.V.T(),$(i),$(o)):K("enum"==r.V.kind?T.INT32:r.V.T,$(i),$(o))))return!1;break;case"message":let e=r.T();if(!(r.repeat?Y(e,i,o):e.equals(i,o)))return!1}}return!0}(this,t,e)}is(t,e=this.defaultCheckDepth){return this.refTypeCheck.is(t,e,!1)}isAssignable(t,e=this.defaultCheckDepth){return this.refTypeCheck.is(t,e,!0)}mergePartial(t,e){R(this,t,e)}fromBinary(t,e){let n=function(t){return t?Object.assign(Object.assign({},S),t):S}(e);return this.internalBinaryRead(n.readerFactory(t),t.byteLength,n)}fromJson(t,e){return this.internalJsonRead(t,function(t){return t?Object.assign(Object.assign({},G),t):G}(e))}fromJsonString(t,e){let n=JSON.parse(t);return this.fromJson(n,e)}toJson(t,e){return this.internalJsonWrite(t,function(t){return t?Object.assign(Object.assign({},q),t):q}(e))}toJsonString(t,e){var n;let r=this.toJson(t,e);return JSON.stringify(r,null,null!==(n=null==e?void 0:e.prettySpaces)&&void 0!==n?n:0)}toBinary(t,e){let n=function(t){return t?Object.assign(Object.assign({},I),t):I}(e);return this.internalBinaryWrite(t,n.writerFactory(),n).finish()}internalJsonRead(t,e,n){if(null!==t&&"object"==typeof t&&!Array.isArray(t)){let r=null!=n?n:this.create();return this.refJsonReader.read(t,r,e),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${B(t)}.`)}internalJsonWrite(t,e){return this.refJsonWriter.write(t,e)}internalBinaryWrite(t,e,n){return this.refBinWriter.write(t,e,n),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create();return this.refBinReader.read(t,i,n,e),i}}var Z;!function(t){t[t.ID_00=0]="ID_00",t[t.ID_01=1]="ID_01",t[t.ID_10=10]="ID_10",t[t.ID_13=13]="ID_13",t[t.ID_90=90]="ID_90"}(Z||(Z={}));const Q=new class extends J{constructor(){super("GS1Config",[{no:1,name:"ais",kind:"message",repeat:1,T:()=>tt},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}create(t){const e={ais:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.ais.push(tt.internalBinaryRead(t,t.uint32(),n));break;case 2:i.reason=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.ais.length;i++)tt.internalBinaryWrite(t.ais[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},tt=new class extends J{constructor(){super("ApplicationIdentifier",[{no:1,name:"id",kind:"enum",T:()=>["ApplicationIdentifier.ID",Z]},{no:2,name:"maxLength",kind:"scalar",opt:!0,T:13},{no:3,name:"readOnly",kind:"scalar",opt:!0,T:8}])}create(t){const e={id:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.int32();break;case 2:i.maxLength=t.uint32();break;case 3:i.readOnly=t.bool();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.id&&e.tag(1,O.Varint).int32(t.id),void 0!==t.maxLength&&e.tag(2,O.Varint).uint32(t.maxLength),void 0!==t.readOnly&&e.tag(3,O.Varint).bool(t.readOnly);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}};var et;!function(t){t[t.ASSETS=0]="ASSETS",t[t.UPLOADS=1]="UPLOADS",t[t.ANY=2]="ANY"}(et||(et={}));const nt=new class extends J{constructor(){super("ImageConfig",[{no:1,name:"root",kind:"scalar",opt:!0,T:9},{no:2,name:"reason",kind:"scalar",opt:!0,T:9},{no:3,name:"sources",kind:"enum",opt:!0,T:()=>["ImageConfig.Sources",et]}])}create(t){const e={};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.root=t.string();break;case 2:i.reason=t.string();break;case 3:i.sources=t.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.root&&e.tag(1,O.LengthDelimited).string(t.root),void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason),void 0!==t.sources&&e.tag(3,O.Varint).int32(t.sources);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},rt=new class extends J{constructor(){super("NumberConfig",[{no:1,name:"constraints",kind:"message",repeat:1,T:()=>it},{no:2,name:"format",kind:"scalar",opt:!0,T:9}])}create(t){const e={constraints:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.constraints.push(it.internalBinaryRead(t,t.uint32(),n));break;case 2:i.format=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.constraints.length;i++)it.internalBinaryWrite(t.constraints[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.format&&e.tag(2,O.LengthDelimited).string(t.format);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},it=new class extends J{constructor(){super("NumberConstraint",[{no:1,name:"reason",kind:"scalar",opt:!0,T:9},{no:2,name:"min",kind:"message",oneof:"rule",T:()=>ot},{no:3,name:"max",kind:"message",oneof:"rule",T:()=>at},{no:4,name:"isInteger",kind:"message",oneof:"rule",T:()=>st}])}create(t){const e={rule:{oneofKind:void 0}};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.reason=t.string();break;case 2:i.rule={oneofKind:"min",min:ot.internalBinaryRead(t,t.uint32(),n,i.rule.min)};break;case 3:i.rule={oneofKind:"max",max:at.internalBinaryRead(t,t.uint32(),n,i.rule.max)};break;case 4:i.rule={oneofKind:"isInteger",isInteger:st.internalBinaryRead(t,t.uint32(),n,i.rule.isInteger)};break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.reason&&e.tag(1,O.LengthDelimited).string(t.reason),"min"===t.rule.oneofKind&&ot.internalBinaryWrite(t.rule.min,e.tag(2,O.LengthDelimited).fork(),n).join(),"max"===t.rule.oneofKind&&at.internalBinaryWrite(t.rule.max,e.tag(3,O.LengthDelimited).fork(),n).join(),"isInteger"===t.rule.oneofKind&&st.internalBinaryWrite(t.rule.isInteger,e.tag(4,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},ot=new class extends J{constructor(){super("NumberMinRule",[{no:1,name:"value",kind:"scalar",T:1}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.double();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Bit64).double(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},at=new class extends J{constructor(){super("NumberMaxRule",[{no:1,name:"value",kind:"scalar",T:1}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.double();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Bit64).double(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},st=new class extends J{constructor(){super("NumberIsIntegerRule",[{no:1,name:"value",kind:"scalar",T:8}])}create(t){const e={value:!1};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.bool();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){!1!==t.value&&e.tag(1,O.Varint).bool(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},lt=new class extends J{constructor(){super("StringConfig",[{no:1,name:"constraints",kind:"message",repeat:1,T:()=>ut}])}create(t){const e={constraints:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.constraints.push(ut.internalBinaryRead(t,t.uint32(),n));else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.constraints.length;i++)ut.internalBinaryWrite(t.constraints[i],e.tag(1,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},ut=new class extends J{constructor(){super("StringConstraint",[{no:1,name:"reason",kind:"scalar",opt:!0,T:9},{no:2,name:"pattern",kind:"message",oneof:"rule",T:()=>ct},{no:3,name:"minLength",kind:"message",oneof:"rule",T:()=>ht},{no:4,name:"maxLength",kind:"message",oneof:"rule",T:()=>pt},{no:5,name:"minLines",kind:"message",oneof:"rule",T:()=>ft},{no:6,name:"maxLines",kind:"message",oneof:"rule",T:()=>dt},{no:7,name:"minLengthPerLine",kind:"message",oneof:"rule",T:()=>gt},{no:8,name:"maxLengthPerLine",kind:"message",oneof:"rule",T:()=>mt}])}create(t){const e={rule:{oneofKind:void 0}};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.reason=t.string();break;case 2:i.rule={oneofKind:"pattern",pattern:ct.internalBinaryRead(t,t.uint32(),n,i.rule.pattern)};break;case 3:i.rule={oneofKind:"minLength",minLength:ht.internalBinaryRead(t,t.uint32(),n,i.rule.minLength)};break;case 4:i.rule={oneofKind:"maxLength",maxLength:pt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLength)};break;case 5:i.rule={oneofKind:"minLines",minLines:ft.internalBinaryRead(t,t.uint32(),n,i.rule.minLines)};break;case 6:i.rule={oneofKind:"maxLines",maxLines:dt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLines)};break;case 7:i.rule={oneofKind:"minLengthPerLine",minLengthPerLine:gt.internalBinaryRead(t,t.uint32(),n,i.rule.minLengthPerLine)};break;case 8:i.rule={oneofKind:"maxLengthPerLine",maxLengthPerLine:mt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLengthPerLine)};break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.reason&&e.tag(1,O.LengthDelimited).string(t.reason),"pattern"===t.rule.oneofKind&&ct.internalBinaryWrite(t.rule.pattern,e.tag(2,O.LengthDelimited).fork(),n).join(),"minLength"===t.rule.oneofKind&&ht.internalBinaryWrite(t.rule.minLength,e.tag(3,O.LengthDelimited).fork(),n).join(),"maxLength"===t.rule.oneofKind&&pt.internalBinaryWrite(t.rule.maxLength,e.tag(4,O.LengthDelimited).fork(),n).join(),"minLines"===t.rule.oneofKind&&ft.internalBinaryWrite(t.rule.minLines,e.tag(5,O.LengthDelimited).fork(),n).join(),"maxLines"===t.rule.oneofKind&&dt.internalBinaryWrite(t.rule.maxLines,e.tag(6,O.LengthDelimited).fork(),n).join(),"minLengthPerLine"===t.rule.oneofKind&>.internalBinaryWrite(t.rule.minLengthPerLine,e.tag(7,O.LengthDelimited).fork(),n).join(),"maxLengthPerLine"===t.rule.oneofKind&&mt.internalBinaryWrite(t.rule.maxLengthPerLine,e.tag(8,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},ct=new class extends J{constructor(){super("StringPatternRule",[{no:1,name:"value",kind:"scalar",T:9}])}create(t){const e={value:""};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.value&&e.tag(1,O.LengthDelimited).string(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},ht=new class extends J{constructor(){super("StringMinLengthRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},pt=new class extends J{constructor(){super("StringMaxLengthRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},ft=new class extends J{constructor(){super("StringMinLinesRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},dt=new class extends J{constructor(){super("StringMaxLinesRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},gt=new class extends J{constructor(){super("StringMinLengthPerLineRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},mt=new class extends J{constructor(){super("StringMaxLengthPerLineRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},yt=new class extends J{constructor(){super("VariantConfig",[{no:1,name:"variants",kind:"message",repeat:1,T:()=>_t},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}create(t){const e={variants:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.variants.push(_t.internalBinaryRead(t,t.uint32(),n));break;case 2:i.reason=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.variants.length;i++)_t.internalBinaryWrite(t.variants[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},_t=new class extends J{constructor(){super("Variant",[{no:1,name:"value",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}create(t){const e={value:""};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.value=t.string();break;case 2:i.title=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.value&&e.tag(1,O.LengthDelimited).string(t.value),void 0!==t.title&&e.tag(2,O.LengthDelimited).string(t.title);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}};class bt{static getFieldConfig(t){if(null==t.config)return null;switch(t.config.oneofKind){case"string":return t.config.string;case"number":return t.config.number;case"variant":return t.config.variant;case"image":return t.config.image;case"gs1":return t.config.gs1;default:throw new Error(`The field config type ${t.config.oneofKind} is not supported.`)}}static getStringConfig(t){return"string"==t.config.oneofKind?t.config.string:null}static getNumberConfig(t){return"number"==t.config.oneofKind?t.config.number:null}static getVariantConfig(t){return"variant"==t.config.oneofKind?t.config.variant:null}static getImageConfig(t){return"image"==t.config.oneofKind?t.config.image:null}static getGS1Config(t){return"gs1"==t.config.oneofKind?t.config.gs1:null}static getStringRule(t){if(null==t.rule)return null;switch(t.rule.oneofKind){case"pattern":return t.rule.pattern;case"minLength":return t.rule.minLength;case"maxLength":return t.rule.maxLength;case"minLines":return t.rule.minLines;case"maxLines":return t.rule.maxLines;case"minLengthPerLine":return t.rule.minLengthPerLine;case"maxLengthPerLine":return t.rule.maxLengthPerLine;default:throw new Error(`The string rule type ${t.rule.oneofKind} is not supported.`)}}static getNumberRule(t){if(null==t.rule)return null;switch(t.rule.oneofKind){case"min":return t.rule.min;case"max":return t.rule.max;case"isInteger":return t.rule.isInteger;default:throw new Error(`The number rule type ${t.rule.oneofKind} is not supported.`)}}static getConstraintRuleDisplayName(t){if(null==(null==t?void 0:t.rule))return null;switch(t.rule.oneofKind){case"pattern":return"Pattern";case"minLength":return"Min characters";case"maxLength":return"Max characters";case"minLines":return"Min number of lines";case"maxLines":return"Max number of lines";case"minLengthPerLine":return"Min characters per line";case"maxLengthPerLine":return"Max characters per line";case"min":return"Min value";case"max":return"Max value";case"isInteger":return"Only integer";default:throw new Error(`The rule type ${t.rule.oneofKind} is not supported.`)}}static getSupportedRuleTypes(t){if(null==t)return;const e="string"==typeof t?t:t.oneofKind;return"string"==e?this.supportedStringRuleTypes.slice():"number"==e?this.supportedNumberRuleTypes.slice():"variant"==e?["variants"]:"image"==e?["root"]:"gs1"==e?["gs1"]:void 0}static createConfig(t,e){switch(t){case"number":return this._buildOneofItem(t,rt.create({constraints:this._createNumberConstraints(e)}));case"variant":return this._buildOneofItem(t,yt.create(this._createVariantConfig(e[0])));case"string":return this._buildOneofItem(t,lt.create({constraints:this._createStringConstraints(e)}));case"image":return this._buildOneofItem(t,nt.create(this._createImageConfig(e[0])));case"gs1":return this._buildOneofItem(t,Q.create(this._createGS1Config(e[0])));case void 0:return;default:throw new Error(`Unknown config type: ${t}`)}}static _buildOneofItem(t,e){const n={oneofKind:t};return n[t]=e,n}static _createNumberConstraints(t){const e=[];for(let n of t){let t={};switch(n.ruleType){case"isInteger":t.rule=this._buildOneofItem(n.ruleType,st.create({value:this.toBool(n.value)}));break;case"min":t.rule=this._buildOneofItem(n.ruleType,ot.create({value:this.toNumber(n.value)}));break;case"max":t.rule=this._buildOneofItem(n.ruleType,at.create({value:this.toNumber(n.value)}));break;default:continue}null!=n.reason&&(t.reason=n.reason),e.push(t)}return e}static _createVariantConfig(t){return null==t?{}:{variants:t.variants,reason:t.reason}}static _createImageConfig(t){return null==t?{}:{root:t.value,reason:t.reason,sources:(()=>{switch(t.sources){case"Assets":case 0:return et.ASSETS;case"Uploads":case 1:return et.UPLOADS;default:return et.ANY}})()}}static _createGS1Config(t){if(null==(null==t?void 0:t.ais)||0==t.ais.length)return{};const e=t=>{switch(t){case"01":case"ID_01":case 1:return Z.ID_01;case"10":case"ID_10":case 10:return Z.ID_10;case"13":case"ID_13":case 13:return Z.ID_13;case"90":case"ID_90":case 90:return Z.ID_90;default:throw new Error(`The GS1 application identifier ${t} is not supported.`)}},n=[];for(let r of t.ais)n.push({id:e(r.id),maxLength:r.maxLength,readOnly:r.readOnly});return{ais:n}}static _createStringConstraints(t){const e=[];for(let n of t){const t={};switch(n.ruleType){case"minLength":t.rule=this._buildOneofItem(n.ruleType,ht.create({value:this.toNumber(n.value)}));break;case"maxLength":t.rule=this._buildOneofItem(n.ruleType,pt.create({value:this.toNumber(n.value)}));break;case"minLengthPerLine":t.rule=this._buildOneofItem(n.ruleType,gt.create({value:this.toNumber(n.value)}));break;case"maxLengthPerLine":t.rule=this._buildOneofItem(n.ruleType,mt.create({value:this.toNumber(n.value)}));break;case"minLines":t.rule=this._buildOneofItem(n.ruleType,ft.create({value:this.toNumber(n.value)}));break;case"maxLines":t.rule=this._buildOneofItem(n.ruleType,dt.create({value:this.toNumber(n.value)}));break;case"pattern":t.rule=this._buildOneofItem(n.ruleType,ct.create({value:n.value}));break;default:continue}null!=n.reason&&(t.reason=n.reason),e.push(t)}return e}static toNumber(t){if(void 0!==t){const e=Number(t);if(isNaN(e))throw new Error(`A ${t} is not a number. Ensure that you did not mistype in a feature file.`);return e}return t}static toBool(t){return void 0!==t?"boolean"==typeof t?t:"true"===t.toLowerCase():t}}bt.supportedStringRuleTypes=["pattern","minLength","maxLength","minLines","maxLines","minLengthPerLine","maxLengthPerLine"],bt.supportedNumberRuleTypes=["min","max","isInteger"];var vt,wt=n(546);!function(t){t.ok="ok",t.missing="missing",t.required="required",t.stringPattern="stringPattern",t.stringMinLength="stringMinLength",t.stringMaxLength="stringMaxLength",t.stringMinLengthPerLine="stringMinLengthPerLine",t.stringMaxLengthPerLine="stringMaxLengthPerLine",t.stringMinLines="stringMinLines",t.stringMaxLines="stringMaxLines",t.variantNotInList="variantNotInList",t.numberIsNumber="numberIsNumber",t.numberMin="numberMin",t.numberMax="numberMax",t.numberIsInteger="numberIsInteger",t.imageRoot="imageRoot",t.noSuchField="noSuchField",t.gs1Invalid="gs1Invalid"}(vt||(vt={}));class Ct{static fromField(t,e,n,r,i){var o,a;switch(null===(o=t.config)||void 0===o?void 0:o.oneofKind){case"number":return new St(t,e,n,r);case"string":return new xt(t,e,n,r);case"variant":return new It(t,e,n);case"image":return new Ot(t,e,n);case"gs1":return new Tt(t,e,n,null!=i?i:[]);default:throw new Error(`Cannot create validation problem for the field of type ${null===(a=t.config)||void 0===a?void 0:a.oneofKind} because it is not supported.`)}}}class Pt{constructor(t,e,n){this.fieldName=t,this.reason=n,this.rule=e}static processReason(t,e,n){let r=t.replace("{value}",e);return void 0!==n&&(r=r.replace("{constraint}",n)),r}}class xt extends Pt{static getRuleByConstraint(t){switch(t.rule.oneofKind){case"maxLength":return vt.stringMaxLength;case"minLength":return vt.stringMinLength;case"maxLengthPerLine":return vt.stringMaxLengthPerLine;case"minLengthPerLine":return vt.stringMinLengthPerLine;case"maxLines":return vt.stringMaxLines;case"minLines":return vt.stringMinLines;case"pattern":return vt.stringPattern;default:throw new Error(`String validation problem rule for ${t.rule.oneofKind} is not defined.`)}}static getDefaultReason(t,e,n){switch(e.rule.oneofKind){case"maxLength":return`The ${t.name} field length is greater than ${e.rule.maxLength.value}`;case"minLength":return`The ${t.name} field length is less than ${e.rule.minLength.value}`;case"maxLengthPerLine":return`The length of the longest line in ${t.name} field is greater than ${e.rule.maxLengthPerLine.value}`;case"minLengthPerLine":return`The length of the shortest line in ${t.name} field is less than ${e.rule.minLengthPerLine.value}`;case"maxLines":return`The number of lines in ${t.name} is greater than ${e.rule.maxLines.value}`;case"minLines":return`The number of lines in ${t.name} is less than ${e.rule.minLines.value}`;case"pattern":return`The ${t.name} field is ${n} but it does not match a specified pattern /${e.rule.pattern.value}/`;default:throw new Error(`String validation problem rule for ${e.rule.oneofKind} is not defined.`)}}constructor(t,e,n,r){var i;super(t.name,xt.getRuleByConstraint(e),Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:xt.getDefaultReason(t,e,n),n,r))}}class St extends Pt{static getRuleByConstraint(t){switch(t.rule.oneofKind){case"isInteger":return vt.numberIsInteger;case"min":return vt.numberMin;case"max":return vt.numberMax;default:throw new Error(`Number validation problem rule for ${t.rule.oneofKind} is not defined.`)}}static getDefaultReason(t,e,n){switch(e.rule.oneofKind){case"max":return`The ${t.name} field is ${n} but it should be not greater than ${e.rule.max.value}.`;case"min":return`The ${t.name} field is ${n} but it should be not less than ${e.rule.min.value}.`;case"isInteger":return`The ${t.name} field is ${n} but it must be an integer number.`;default:throw new Error(`Number validation problem rule for ${e.rule.oneofKind} is not defined.`)}}constructor(t,e,n,r){var i;super(t.name,St.getRuleByConstraint(e),Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:St.getDefaultReason(t,e,n),n,r))}}class It extends Pt{constructor(t,e,n){var r;super(t.name,vt.variantNotInList,Pt.processReason(null!==(r=e.reason)&&void 0!==r?r:`The value ${n} of ${t.name} must be one of ${e.variants.map((t=>t.value)).join(", ")}`,n))}}class Ot extends Pt{constructor(t,e,n){var r;super(t.name,vt.imageRoot,Pt.processReason(null!==(r=e.reason)&&void 0!==r?r:`The image ${n} in the ${t.name} field must be located in the ${e.root} folder`,n))}}class Tt extends Pt{constructor(t,e,n,r){var i;super(t.name,vt.gs1Invalid,Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:`The GS1 ${n} in the ${t.name} doesn't meet GS1 Standard: ${r.join(", ")}`,n))}}class Et extends Pt{constructor(t){super(t,vt.ok,"")}}function Lt(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function Rt(t){return function e(n){return 0===arguments.length||Lt(n)?e:t.apply(this,arguments)}}var kt=Rt((function(t){return null==t}));function jt(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var At=Object.prototype.toString,Ft=function(){return"[object Arguments]"===At.call(arguments)?function(t){return"[object Arguments]"===At.call(t)}:function(t){return jt("callee",t)}}(),Bt=Ft,Mt=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},Nt=Rt((function(t){return null!=t&&"function"==typeof t["fantasy-land/empty"]?t["fantasy-land/empty"]():null!=t&&null!=t.constructor&&"function"==typeof t.constructor["fantasy-land/empty"]?t.constructor["fantasy-land/empty"]():null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():Mt(t)?[]:function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)?"":function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)?{}:Bt(t)?function(){return arguments}():void 0})),zt=Nt;function Dt(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return Lt(n)?e:Rt((function(e){return t(n,e)}));default:return Lt(n)&&Lt(r)?e:Lt(n)?Rt((function(e){return t(e,r)})):Lt(r)?Rt((function(e){return t(n,e)})):t(n,r)}}}function Ht(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function Wt(t,e,n){for(var r=0,i=n.length;r<i;){if(t(e,n[r]))return!0;r+=1}return!1}var Ut="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},Vt=!{toString:null}.propertyIsEnumerable("toString"),qt=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Gt=function(){return arguments.propertyIsEnumerable("length")}(),$t=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},Xt="function"!=typeof Object.keys||Gt?Rt((function(t){if(Object(t)!==t)return[];var e,n,r=[],i=Gt&&Bt(t);for(e in t)!jt(e,t)||i&&"length"===e||(r[r.length]=e);if(Vt)for(n=qt.length-1;n>=0;)jt(e=qt[n],t)&&!$t(r,e)&&(r[r.length]=e),n-=1;return r})):Rt((function(t){return Object(t)!==t?[]:Object.keys(t)})),Kt=Rt((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function Yt(t,e,n,r){var i=Ht(t);function o(t,e){return Jt(t,e,n.slice(),r.slice())}return!Wt((function(t,e){return!Wt(o,e,t)}),Ht(e),i)}function Jt(t,e,n,r){if(Ut(t,e))return!0;var i,o,a=Kt(t);if(a!==Kt(e))return!1;if(null==t||null==e)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof e["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e)&&"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof e.equals)return"function"==typeof t.equals&&t.equals(e)&&"function"==typeof e.equals&&e.equals(t);switch(a){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(o=String(i).match(/^function (\w*)/))?"":o[1]))return t===e;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof e||!Ut(t.valueOf(),e.valueOf()))return!1;break;case"Date":if(!Ut(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(t.source!==e.source||t.global!==e.global||t.ignoreCase!==e.ignoreCase||t.multiline!==e.multiline||t.sticky!==e.sticky||t.unicode!==e.unicode)return!1}for(var s=n.length-1;s>=0;){if(n[s]===t)return r[s]===e;s-=1}switch(a){case"Map":return t.size===e.size&&Yt(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size===e.size&&Yt(t.values(),e.values(),n.concat([t]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Xt(t);if(l.length!==Xt(e).length)return!1;var u=n.concat([t]),c=r.concat([e]);for(s=l.length-1;s>=0;){var h=l[s];if(!jt(h,e)||!Jt(e[h],t[h],u,c))return!1;s-=1}return!0}var Zt=Dt((function(t,e){return Jt(t,e,[],[])})),Qt=Rt((function(t){return null!=t&&Zt(t,zt(t))}));function te(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,i){return e.apply(this,arguments)};case 5:return function(t,n,r,i,o){return e.apply(this,arguments)};case 6:return function(t,n,r,i,o,a){return e.apply(this,arguments)};case 7:return function(t,n,r,i,o,a,s){return e.apply(this,arguments)};case 8:return function(t,n,r,i,o,a,s,l){return e.apply(this,arguments)};case 9:return function(t,n,r,i,o,a,s,l,u){return e.apply(this,arguments)};case 10:return function(t,n,r,i,o,a,s,l,u,c){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function ee(t,e,n){return function(){for(var r=[],i=0,o=t,a=0;a<e.length||i<arguments.length;){var s;a<e.length&&(!Lt(e[a])||i>=arguments.length)?s=e[a]:(s=arguments[i],i+=1),r[a]=s,Lt(s)||(o-=1),a+=1}return o<=0?n.apply(this,r):te(o,ee(t,r,n))}}var ne=Dt((function(t,e){return 1===t?Rt(e):te(t,ee(t,[],e))})),re=Rt((function(t){return ne(t.length,t)})),ie=Dt((function(t,e){return e<t?e:t})),oe=Dt((function(t,e){return e>t?e:t})),ae=Dt((function(t,e){return t<e})),se=Dt((function(t,e){return t>e}));class le{static getAITitle(t){switch(t){case 1:return"GTIN";case 13:return"Packaging date";case 10:return"Batch or lot number";case 90:return"Information mutually agreed between trading partners";default:throw new Error(this.getAINotSupportedMessage(t))}}static getAIValueLengthLimits(t){switch(t){case 1:return{min:14,max:14};case 13:return{min:6,max:6};case 10:return{min:1,max:20};case 90:return{min:1,max:30};default:throw new Error(this.getAINotSupportedMessage(t))}}static getAIValueType(t){return 13===t?"date":"string"}static getAIValueRegex(t){switch(t){case 1:case 13:return this._numberRegex;case 10:case 90:return this._iso646Regex;default:throw new Error(this.getAINotSupportedMessage(t))}}static getMinDate(){const t=(new Date).getFullYear(),e=new Date;return e.setFullYear(t-49),e}static getMaxDate(){const t=(new Date).getFullYear(),e=new Date;return e.setFullYear(t+50),e}static dateToGs1(t){const e=new Date(t),n=e.getFullYear().toString().slice(2,4),r=e.getMonth();return`${n}${Number(r+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`}static gs1DateToDate(t){var e;if(null==t||0==t.length)throw Error("GS1 date parsing error: date cannot be null or empty string");const[n,r,i]=null!==(e=t.match(/.{1,2}/g))&&void 0!==e?e:[],o=new Date;o.setDate(Number(i)),o.setMonth(Number(r)-1);const a=o.getFullYear(),s=Number((a-49).toString().slice(2,4));if(Number(n)<s?o.setFullYear(Number(`20${n}`)):o.setFullYear(Number(`19${n}`)),isNaN(o.getTime()))throw Error("GS1 date parsing error: date is invalid");return o}}le._numberRegex=/^\d+$/,le._iso646Regex=/^[\x21-\x22\x25-\x2F\x30-\x39\x3A-\x3F\x41-\x5A\x5F\x61-\x7A]+$/,le.supportedAIs=[1,13,10,90],le.getAINotSupportedMessage=t=>`Application Identifier ${t} is not supported`,le.idToString=t=>t.toString().padStart(2,"0");class ue{constructor(t){this.ais=null!=t?t:[]}static parse(t){if(null==t||0==t.length)throw Error("GS1 data parsing error: value cannot be null or empty");if(!t.startsWith("["))throw Error("GS1 data parsing error: value must start with application identifier");if(!this._gs1Regex.test(t))throw Error("GS1 data parsing error: value doesn't match the GS1 regex");this._gs1Regex.lastIndex=0;const e=new ue;let n;for(;null!==(n=this._gs1Regex.exec(t));){if(3!=n.length)throw Error("GS1 data parsing error: value doesn't match the GS1 regex");const t=+n[1],r=n[2];if(e.ais.find((e=>e.id==t)))throw Error("GS1 data parsing error: value must not contain duplicate application identifiers");e.ais.push({id:t,value:r})}return e}encode(){let t="";for(let e=0;e<this.ais.length;e++){const n=this.ais[e];t+=`[${n.id.toString().padStart(2,"0")}]${n.value}`}return t}validate(t){const e=this.ais.map((e=>ue.validateAI(e,t))).map((t=>t.cata((t=>t),(t=>"")))).filter((t=>""!=t));return 0==e.length?Object(wt.Right)(""):Object(wt.Left)(e)}getAIValue(t){const e=this.ais.find((e=>e.id===t));return null==e?void 0:e.value}setAIValue(t,e){const n=this.ais.find((e=>e.id===t));n&&("date"===le.getAIValueType(n.id)?n.value=e instanceof Date?le.dateToGs1(e):e:n.value=e)}static validateAI(t,e){return new ce(e).validate(t)}}ue._gs1Regex=/\[(\d{2,4})\]([^\[\]]+)/g;class ce{constructor(t){this._config=t}validate(t){return this._checkIsSupported(t).chain(this._checkIsDataValid.bind(this))}_checkIsSupported(t){return le.supportedAIs.includes(t.id)?Object(wt.Right)(t):Object(wt.Left)(le.getAINotSupportedMessage(t.id))}_checkIsDataValid(t){var e;const n=null===(e=this._config)||void 0===e?void 0:e.ais.find((e=>e.id==t.id));let r=null==n?void 0:n.maxLength;const i=t.id,o=t.value,a=le.getAIValueLengthLimits(i),s=le.getAIValueRegex(i);return null!=r&&(r<a.min||r>a.max)&&(r=void 0),o.length<a.min||o.length>(null!=r?r:a.max)?Object(wt.Left)(`Invalid data length for Application Identifier ${le.idToString(i)}`):s.test(o)?Object(wt.Right)(t):Object(wt.Left)(`Invalid Application Identifier ${le.idToString(i)} value`)}}class he{constructor(t){this.checkMissing=t=>t.hasOwnProperty(this.field.name)?Object(wt.Right)(t[this.field.name]):Object(wt.Left)(new Pt(this.field.name,vt.missing,`Data must contain ${he.getFieldDisplayName(this.field)} field.`)),this.checkRequired=t=>this.field.required&&this.isOmitted(t)?Object(wt.Left)(new Pt(this.field.name,vt.required,`The ${he.getFieldDisplayName(this.field)} field cannot be empty.`)):this.getOptionalFieldResult(t),this.getOptionalFieldResult=t=>this.isOmitted(t)?Object(wt.Left)(new Et(this.field.name)):Object(wt.Right)(t),this.checkConfig=t=>wt.Maybe.fromUndefined(pe.Build(this.field)).map((e=>e.validate(t))).getOrElse(Object(wt.Right)(t)),this.field=t}validate(t){return this.checkMissing(t).chain(this.checkRequired).chain(this.checkConfig)}isOmitted(t){return kt(t)||Qt(t)}static getFieldDisplayName(t){return null!=t.title&&""!=t.title.trim()?t.title:t.name}}class pe{static Build(t){switch(t.config.oneofKind){case"string":return new de(t);case"number":return new ge(t);case"variant":return new me(t);case"image":return new ye(t);case"gs1":return new _e(t);default:return}}}class fe{constructor(t){this._field=t}validate(t){return Object(wt.Right)(t)}checkConstraint(t,e){return re(this.checkIfRuleIsSet)(t,wt.Maybe.fromUndefined(this.findConstraintByRuleName(t)),e,((e,n)=>Ct.fromField(this._field,this.findConstraintByRuleName(t),n,e)))}checkIfRuleIsSet(t,e,n,r,i){return e.cata((()=>Object(wt.Right)(i)),(e=>n(i,e.rule[t].value)?Object(wt.Left)(r(e.rule[t].value,i)):Object(wt.Right)(i)))}}class de extends fe{constructor(t){super(t),this._config=bt.getStringConfig(t)}findConstraintByRuleName(t){var e,n;return(null!==(n=null===(e=this._config)||void 0===e?void 0:e.constraints)&&void 0!==n?n:[]).find((e=>e.rule.oneofKind==t))}validate(t){return super.validate(t).chain(this.checkConstraint("pattern",((t,e)=>!RegExp(e).test(t)))).chain(this.checkConstraint("minLength",((t,e)=>t.length<e))).chain(this.checkConstraint("maxLength",((t,e)=>t.length>e))).chain(this.checkConstraint("minLines",((t,e)=>de.getLines(t).length<e))).chain(this.checkConstraint("maxLines",((t,e)=>de.getLines(t).length>e))).chain(this.checkConstraint("minLengthPerLine",((t,e)=>de.getLineLengthBy(ie,t)<e))).chain(this.checkConstraint("maxLengthPerLine",((t,e)=>de.getLineLengthBy(oe,t)>e)))}}de.getLines=t=>t.split(/(\r\n|\r|\n)/).filter((t=>"\n"!==t)),de.getLineLengthBy=(t,e)=>de.getLines(e).map((t=>t.length)).reduce(t);class ge extends fe{constructor(t){super(t),this.validate=t=>super.validate(t).chain(this.checkIsNumber).chain(this.checkConstraint("isInteger",((t,e)=>e&&!Number.isInteger(t)))).chain(this.checkConstraint("min",ae)).chain(this.checkConstraint("max",se)),this.checkIsNumber=t=>isNaN(Number(t))?Object(wt.Left)(new Pt(this._field.name,vt.numberIsNumber,`The ${he.getFieldDisplayName(this._field)} field value ${t} is not a number.`)):Object(wt.Right)(Number(t)),this._config=bt.getNumberConfig(t)}findConstraintByRuleName(t){var e,n;return(null!==(n=null===(e=this._config)||void 0===e?void 0:e.constraints)&&void 0!==n?n:[]).find((e=>e.rule.oneofKind==t))}}class me{constructor(t){this._config=bt.getVariantConfig(t),this._field=t}validate(t){var e;return(null===(e=this._config)||void 0===e?void 0:e.variants.every((e=>e.value!=t)))?Object(wt.Left)(Ct.fromField(this._field,this._config,t,null)):Object(wt.Right)(t)}}class ye{constructor(t){this._config=bt.getImageConfig(t),this._field=t}validate(t){var e,n;let r=null!==(n=null===(e=this._config)||void 0===e?void 0:e.root)&&void 0!==n?n:"/";return r.startsWith("/")||(r=`/${r}`),t.startsWith(r)?Object(wt.Right)(t):Object(wt.Left)(Ct.fromField(this._field,this._config,t,null))}}class _e{constructor(t){this._config=bt.getGS1Config(t),this._field=t}validate(t){try{return ue.parse(t).validate(this._config).cata((e=>Object(wt.Left)(Ct.fromField(this._field,this._config,t,null,e))),(e=>Object(wt.Right)(t)))}catch(e){return Object(wt.Left)(Ct.fromField(this._field,this._config,t,null,[e]))}}}class be{constructor(t){this.interpolateString=(t,e)=>t.replace(/{([^}]+)}/g,((t,n)=>{var r;return null!==(r=e[n])&&void 0!==r?r:""})),this.schema=t}validateValue(t,e){return this.findFieldByName(t).map((t=>new he(t))).toEither(new Pt(t,vt.noSuchField,`The ${t} field does not exist in a schema.`)).bind((n=>n.validate({[t]:e}))).cata((t=>t),(e=>new Et(t)))}validate(t){var e;return(null!==(e=this.schema.fields)&&void 0!==e?e:[]).map((e=>new he(e).validate(t))).map((t=>t.cata((t=>t),(t=>new Et(t)))))}buildTitle(t){return this.interpolateString(this.schema.titleTemplate,t)}findFieldByName(t){return wt.Maybe.fromNull(this.schema.fields.find((e=>e.name===t)))}}const ve=new class extends J{constructor(){super("Schema",[{no:2,name:"titleTemplate",kind:"scalar",T:9},{no:3,name:"fields",kind:"message",repeat:1,T:()=>we}])}create(t){const e={titleTemplate:"",fields:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 2:i.titleTemplate=t.string();break;case 3:i.fields.push(we.internalBinaryRead(t,t.uint32(),n));break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.titleTemplate&&e.tag(2,O.LengthDelimited).string(t.titleTemplate);for(let i=0;i<t.fields.length;i++)we.internalBinaryWrite(t.fields[i],e.tag(3,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}},we=new class extends J{constructor(){super("Field",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"required",kind:"scalar",opt:!0,T:8},{no:3,name:"string",kind:"message",oneof:"config",T:()=>lt},{no:4,name:"variant",kind:"message",oneof:"config",T:()=>yt},{no:5,name:"number",kind:"message",oneof:"config",T:()=>rt},{no:9,name:"image",kind:"message",oneof:"config",T:()=>nt},{no:10,name:"gs1",kind:"message",oneof:"config",T:()=>Q},{no:6,name:"title",kind:"scalar",opt:!0,T:9},{no:7,name:"prompt",kind:"scalar",opt:!0,T:9},{no:8,name:"description",kind:"scalar",opt:!0,T:9}])}create(t){const e={name:"",config:{oneofKind:void 0}};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.name=t.string();break;case 2:i.required=t.bool();break;case 3:i.config={oneofKind:"string",string:lt.internalBinaryRead(t,t.uint32(),n,i.config.string)};break;case 4:i.config={oneofKind:"variant",variant:yt.internalBinaryRead(t,t.uint32(),n,i.config.variant)};break;case 5:i.config={oneofKind:"number",number:rt.internalBinaryRead(t,t.uint32(),n,i.config.number)};break;case 9:i.config={oneofKind:"image",image:nt.internalBinaryRead(t,t.uint32(),n,i.config.image)};break;case 10:i.config={oneofKind:"gs1",gs1:Q.internalBinaryRead(t,t.uint32(),n,i.config.gs1)};break;case 6:i.title=t.string();break;case 7:i.prompt=t.string();break;case 8:i.description=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.name&&e.tag(1,O.LengthDelimited).string(t.name),void 0!==t.required&&e.tag(2,O.Varint).bool(t.required),"string"===t.config.oneofKind&<.internalBinaryWrite(t.config.string,e.tag(3,O.LengthDelimited).fork(),n).join(),"variant"===t.config.oneofKind&&yt.internalBinaryWrite(t.config.variant,e.tag(4,O.LengthDelimited).fork(),n).join(),"number"===t.config.oneofKind&&rt.internalBinaryWrite(t.config.number,e.tag(5,O.LengthDelimited).fork(),n).join(),"image"===t.config.oneofKind&&nt.internalBinaryWrite(t.config.image,e.tag(9,O.LengthDelimited).fork(),n).join(),"gs1"===t.config.oneofKind&&Q.internalBinaryWrite(t.config.gs1,e.tag(10,O.LengthDelimited).fork(),n).join(),void 0!==t.title&&e.tag(6,O.LengthDelimited).string(t.title),void 0!==t.prompt&&e.tag(7,O.LengthDelimited).string(t.prompt),void 0!==t.description&&e.tag(8,O.LengthDelimited).string(t.description);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}};new class extends J{constructor(){super("DataSet",[{no:1,name:"embedded",kind:"message",oneof:"schema",T:()=>ve},{no:3,name:"linked",kind:"scalar",oneof:"schema",T:9},{no:2,name:"rows",kind:"message",repeat:1,T:()=>Ce},{no:4,name:"schemaName",kind:"scalar",opt:!0,T:9}])}create(t){const e={schema:{oneofKind:void 0},rows:[]};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.schema={oneofKind:"embedded",embedded:ve.internalBinaryRead(t,t.uint32(),n,i.schema.embedded)};break;case 3:i.schema={oneofKind:"linked",linked:t.string()};break;case 2:i.rows.push(Ce.internalBinaryRead(t,t.uint32(),n));break;case 4:i.schemaName=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){"embedded"===t.schema.oneofKind&&ve.internalBinaryWrite(t.schema.embedded,e.tag(1,O.LengthDelimited).fork(),n).join(),"linked"===t.schema.oneofKind&&e.tag(3,O.LengthDelimited).string(t.schema.linked);for(let i=0;i<t.rows.length;i++)Ce.internalBinaryWrite(t.rows[i],e.tag(2,O.LengthDelimited).fork(),n).join();void 0!==t.schemaName&&e.tag(4,O.LengthDelimited).string(t.schemaName);let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}};const Ce=new class extends J{constructor(){super("Row",[{no:1,name:"cells",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(t){const e={cells:{}};return void 0!==t&&R(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)this.binaryReadMap1(i.cells,t,n);else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?x.onRead:o)(this.typeName,i,e,r,a)}}return i}binaryReadMap1(t,e,n){let r,i,o=e.uint32(),a=e.pos+o;for(;e.pos<a;){let[t,n]=e.tag();switch(t){case 1:r=e.string();break;case 2:i=e.string();break;default:throw new globalThis.Error("unknown map entry field for field Row.cells")}}t[null!=r?r:""]=null!=i?i:""}internalBinaryWrite(t,e,n){for(let i of Object.keys(t.cells))e.tag(1,O.LengthDelimited).fork().tag(1,O.LengthDelimited).string(i).tag(2,O.LengthDelimited).string(t.cells[i]).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?x.onWrite:r)(this.typeName,t,e),e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Ht})),n.d(e,"b",(function(){return Ut}));var r=n(417),i=n(814),o=n(532);function a(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function s(t,e){this._pairs=[],t&&Object(o.a)(t,this,e)}const l=s.prototype;l.append=function(t,e){this._pairs.push([t,e])},l.toString=function(t){const e=t?function(e){return t.call(this,e,a)}:a;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var u=s;function c(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function h(t,e,n){if(!e)return t;const i=n&&n.encode||c,o=n&&n.serialize;let a;if(a=o?o(e,n):r.a.isURLSearchParams(e)?e.toString():new u(e,n).toString(i),a){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}var p=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){r.a.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},f=n(453),d={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},g={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:u,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},m=function(t){function e(t,n,i,o){let a=t[o++];const s=Number.isFinite(+a),l=o>=t.length;return a=!a&&r.a.isArray(i)?i.length:a,l?(r.a.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!s):(i[a]&&r.a.isObject(i[a])||(i[a]=[]),e(t,n,i[a],o)&&r.a.isArray(i[a])&&(i[a]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}(i[a])),!s)}if(r.a.isFormData(t)&&r.a.isFunction(t.entries)){const n={};return r.a.forEachEntry(t,((t,i)=>{e(function(t){return r.a.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),i,n,0)})),n}return null};const y={"Content-Type":void 0},_={transitional:d,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,a=r.a.isObject(t);if(a&&r.a.isHTMLForm(t)&&(t=new FormData(t)),r.a.isFormData(t))return i&&i?JSON.stringify(m(t)):t;if(r.a.isArrayBuffer(t)||r.a.isBuffer(t)||r.a.isStream(t)||r.a.isFile(t)||r.a.isBlob(t))return t;if(r.a.isArrayBufferView(t))return t.buffer;if(r.a.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Object(o.a)(t,new g.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,i){return g.isNode&&r.a.isBuffer(t)?(this.append(e,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=r.a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Object(o.a)(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return a||i?(e.setContentType("application/json",!1),function(t){if(r.a.isString(t))try{return(0,JSON.parse)(t),r.a.trim(t)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||_.transitional,n=e&&e.forcedJSONParsing,i="json"===this.responseType;if(t&&r.a.isString(t)&&(n&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(n){if("SyntaxError"===o.name)throw f.a.from(o,f.a.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:g.classes.FormData,Blob:g.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.a.forEach(["delete","get","head"],(function(t){_.headers[t]={}})),r.a.forEach(["post","put","patch"],(function(t){_.headers[t]=r.a.merge(y)}));var b=_;const v=r.a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),w=Symbol("internals");function C(t){return t&&String(t).trim().toLowerCase()}function P(t){return!1===t||null==t?t:r.a.isArray(t)?t.map(P):String(t)}function x(t,e,n,i,o){return r.a.isFunction(i)?i.call(this,e,n):(o&&(e=n),r.a.isString(e)?r.a.isString(i)?-1!==e.indexOf(i):r.a.isRegExp(i)?i.test(e):void 0:void 0)}class S{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function o(t,e,n){const o=C(e);if(!o)throw new Error("header name must be a non-empty string");const a=r.a.findKey(i,o);(!a||void 0===i[a]||!0===n||void 0===n&&!1!==i[a])&&(i[a||e]=P(t))}const a=(t,e)=>r.a.forEach(t,((t,n)=>o(t,n,e)));return r.a.isPlainObject(t)||t instanceof this.constructor?a(t,e):r.a.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?a((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&v[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&o(e,t,n),this}get(t,e){if(t=C(t)){const n=r.a.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(r.a.isFunction(e))return e.call(this,t,n);if(r.a.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=C(t)){const n=r.a.findKey(this,t);return!(!n||void 0===this[n]||e&&!x(0,this[n],n,e))}return!1}delete(t,e){const n=this;let i=!1;function o(t){if(t=C(t)){const o=r.a.findKey(n,t);!o||e&&!x(0,n[o],o,e)||(delete n[o],i=!0)}}return r.a.isArray(t)?t.forEach(o):o(t),i}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!x(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return r.a.forEach(this,((i,o)=>{const a=r.a.findKey(n,o);if(a)return e[a]=P(i),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete e[o],e[s]=P(i),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return r.a.forEach(this,((n,i)=>{null!=n&&!1!==n&&(e[i]=t&&r.a.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[w]=this[w]={accessors:{}}).accessors,n=this.prototype;function i(t){const i=C(t);e[i]||(function(t,e){const n=r.a.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[i]=!0)}return r.a.isArray(t)?t.forEach(i):i(t),this}}S.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),r.a.freezeMethods(S.prototype),r.a.freezeMethods(S);var I=S;function O(t,e){const n=this||b,i=e||n,o=I.from(i.headers);let a=i.data;return r.a.forEach(t,(function(t){a=t.call(n,a,o.normalize(),e?e.status:void 0)})),o.normalize(),a}function T(t){return!(!t||!t.__CANCEL__)}function E(t,e,n){f.a.call(this,null==t?"canceled":t,f.a.ERR_CANCELED,e,n),this.name="CanceledError"}r.a.inherits(E,f.a,{__CANCEL__:!0});var L=E,R=n(815),k=g.isStandardBrowserEnv?function(){return{write:function(t,e,n,i,o,a){const s=[];s.push(t+"="+encodeURIComponent(e)),r.a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.a.isString(i)&&s.push("path="+i),r.a.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function j(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var A=g.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function i(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=i(window.location.href),function(t){const e=r.a.isString(t)?i(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return function(){return!0}}();function F(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,o=0,a=0;return e=void 0!==e?e:1e3,function(s){const l=Date.now(),u=r[a];i||(i=l),n[o]=s,r[o]=l;let c=a,h=0;for(;c!==o;)h+=n[c++],c%=t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),l-i<e)return;const p=u&&l-u;return p?Math.round(1e3*h/p):void 0}}(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}var B="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let i=t.data;const o=I.from(t.headers).normalize(),a=t.responseType;let s;function l(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}r.a.isFormData(i)&&(g.isStandardBrowserEnv||g.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+n))}const c=j(t.baseURL,t.url);function p(){if(!u)return;const r=I.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new f.a("Request failed with status code "+n.status,[f.a.ERR_BAD_REQUEST,f.a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),l()}),(function(t){n(t),l()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:t,request:u}),u=null}if(u.open(t.method.toUpperCase(),h(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(n(new f.a("Request aborted",f.a.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new f.a("Network Error",f.a.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||d;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new f.a(e,r.clarifyTimeoutError?f.a.ETIMEDOUT:f.a.ECONNABORTED,t,u)),u=null},g.isStandardBrowserEnv){const e=(t.withCredentials||A(c))&&t.xsrfCookieName&&k.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===i&&o.setContentType(null),"setRequestHeader"in u&&r.a.forEach(o.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),r.a.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),a&&"json"!==a&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",F(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",F(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=e=>{u&&(n(!e||e.type?new L(null,t,u):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(c);m&&-1===g.protocols.indexOf(m)?n(new f.a("Unsupported protocol "+m+":",f.a.ERR_BAD_REQUEST,t)):u.send(i||null)}))};const M={http:R.a,xhr:B};r.a.forEach(M,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}}));function N(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new L(null,t)}function z(t){return N(t),t.headers=I.from(t.headers),t.data=O.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=r.a.isArray(t)?t:[t];const{length:e}=t;let n,i;for(let o=0;o<e&&(n=t[o],!(i=r.a.isString(n)?M[n.toLowerCase()]:n));o++);if(!i){if(!1===i)throw new f.a(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(r.a.hasOwnProp(M,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!r.a.isFunction(i))throw new TypeError("adapter is not a function");return i})(t.adapter||b.adapter)(t).then((function(e){return N(t),e.data=O.call(t,t.transformResponse,e),e.headers=I.from(e.headers),e}),(function(e){return T(e)||(N(t),e&&e.response&&(e.response.data=O.call(t,t.transformResponse,e.response),e.response.headers=I.from(e.response.headers))),Promise.reject(e)}))}const D=t=>t instanceof I?t.toJSON():t;function H(t,e){e=e||{};const n={};function i(t,e,n){return r.a.isPlainObject(t)&&r.a.isPlainObject(e)?r.a.merge.call({caseless:n},t,e):r.a.isPlainObject(e)?r.a.merge({},e):r.a.isArray(e)?e.slice():e}function o(t,e,n){return r.a.isUndefined(e)?r.a.isUndefined(t)?void 0:i(void 0,t,n):i(t,e,n)}function a(t,e){if(!r.a.isUndefined(e))return i(void 0,e)}function s(t,e){return r.a.isUndefined(e)?r.a.isUndefined(t)?void 0:i(void 0,t):i(void 0,e)}function l(n,r,o){return o in e?i(n,r):o in t?i(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(t,e)=>o(D(t),D(e),!0)};return r.a.forEach(Object.keys(t).concat(Object.keys(e)),(function(i){const a=u[i]||o,s=a(t[i],e[i],i);r.a.isUndefined(s)&&a!==l||(n[i]=s)})),n}const W={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{W[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const U={};W.transitional=function(t,e,n){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,o)=>{if(!1===t)throw new f.a(r(i," has been removed"+(e?" in "+e:"")),f.a.ERR_DEPRECATED);return e&&!U[i]&&(U[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}};var V={assertOptions:function(t,e,n){if("object"!=typeof t)throw new f.a("options must be an object",f.a.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],a=e[o];if(a){const e=t[o],n=void 0===e||a(e,o,t);if(!0!==n)throw new f.a("option "+o+" must be "+n,f.a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new f.a("Unknown option "+o,f.a.ERR_BAD_OPTION)}},validators:W};const q=V.validators;class G{constructor(t){this.defaults=t,this.interceptors={request:new p,response:new p}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=H(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:o}=e;let a;void 0!==n&&V.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),void 0!==i&&V.assertOptions(i,{encode:q.function,serialize:q.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),a=o&&r.a.merge(o.common,o[e.method]),a&&r.a.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=I.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(l=l&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let h,p=0;if(!l){const t=[z.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,u),h=t.length,c=Promise.resolve(e);p<h;)c=c.then(t[p++],t[p++]);return c}h=s.length;let f=e;for(p=0;p<h;){const t=s[p++],e=s[p++];try{f=t(f)}catch(d){e.call(this,d);break}}try{c=z.call(this,f)}catch(d){return Promise.reject(d)}for(p=0,h=u.length;p<h;)c=c.then(u[p++],u[p++]);return c}getUri(t){return h(j((t=H(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}r.a.forEach(["delete","get","head","options"],(function(t){G.prototype[t]=function(e,n){return this.request(H(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.a.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(H(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}G.prototype[t]=e(),G.prototype[t+"Form"]=e(!0)}));var $=G;class X{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new L(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new X((function(e){t=e})),cancel:t}}}var K=X;const Y={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Y).forEach((([t,e])=>{Y[e]=t}));var J=Y;const Z=function t(e){const n=new $(e),o=Object(i.a)($.prototype.request,n);return r.a.extend(o,$.prototype,n,{allOwnKeys:!0}),r.a.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(H(e,n))},o}(b);Z.Axios=$,Z.CanceledError=L,Z.CancelToken=K,Z.isCancel=T,Z.VERSION="1.3.4",Z.toFormData=o.a,Z.AxiosError=f.a,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=function(t){return function(e){return t.apply(null,e)}},Z.isAxiosError=function(t){return r.a.isObject(t)&&!0===t.isAxiosError},Z.mergeConfig=H,Z.AxiosHeaders=I,Z.formToJSON=t=>m(r.a.isHTMLForm(t)?new FormData(t):t),Z.HttpStatusCode=J,Z.default=Z;var Q,tt,et,nt,rt,it,ot,at,st,lt,ut,ct,ht,pt,ft,dt,gt,mt,yt,_t,bt,vt,wt,Ct,Pt,xt,St,It,Ot,Tt,Et=Z,Lt=Object.defineProperty,Rt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,Bt=(t,e,n)=>e in t?Lt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mt=(t,e)=>{for(var n in e||(e={}))At.call(e,n)&&Bt(t,n,e[n]);if(jt)for(var n of jt(e))Ft.call(e,n)&&Bt(t,n,e[n]);return t},Nt=(t,e)=>Rt(t,kt(e)),zt=(t,e,n)=>Bt(t,"symbol"!=typeof e?e+"":e,n),Dt=(t,e,n)=>new Promise(((r,i)=>{var o=t=>{try{s(n.next(t))}catch(e){i(e)}},a=t=>{try{s(n.throw(t))}catch(e){i(e)}},s=t=>t.done?r(t.value):Promise.resolve(t.value).then(o,a);s((n=n.apply(t,e)).next())}));class Ht{constructor(){zt(this,"apiUrl"),zt(this,"apiKey",""),zt(this,"authorizationToken",null)}getAuthorizationToken(){return Dt(this,null,(function*(){return this.authorizationToken}))}setAuthorizationToken(t){this.authorizationToken=t}}class Wt{constructor(t){zt(this,"configuration"),this.configuration=t}transformOptions(t){return Dt(this,null,(function*(){const e=yield this.configuration.getAuthorizationToken();return t.headers=Nt(Mt({},t.headers),null!=e?{authorization:" Bearer "+e}:{"X-API-Key":this.configuration.apiKey}),(t=Nt(Mt({},t),{transformResponse:t=>t})).responseType||(t.responseType="json"),"blob"==t.responseType&&(t.responseType="arraybuffer"),t}))}getBaseUrl(t){return this.configuration.apiUrl.endsWith("/")?this.configuration.apiUrl.slice(0,-1):this.configuration.apiUrl}transformResult(t,e,n){return n(e)}}class Ut extends Wt{constructor(t,e,n){super(t),zt(this,"instance"),zt(this,"baseUrl"),zt(this,"jsonParseReviver"),this.instance=n||Et.create(),this.baseUrl=null!=e?e:this.getBaseUrl("")}check(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/check?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCheck(t)))))}processCheck(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}getDepositPhotos(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/depositphotos?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processGetDepositPhotos(t)))))}processGetDepositPhotos(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}exportDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/export?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"GET",url:i,headers:{},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processExportDesign(t)))))}processExportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e)return t.data,Promise.resolve(null);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}preparePreview(t,e,n,r,i,o,a,s,l,u,c,h){let p=this.baseUrl+"/api/processor/v1/private-designs/{id}/preview/{namespace}/{name}/{width}x{height}?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(p=p.replace("{id}",encodeURIComponent(""+t)),null==e)throw new Error("The parameter 'namespace' must be defined.");if(p=p.replace("{namespace}",encodeURIComponent(""+e)),null==n)throw new Error("The parameter 'name' must be defined.");if(p=p.replace("{name}",encodeURIComponent(""+n)),null==r)throw new Error("The parameter 'width' must be defined.");if(p=p.replace("{width}",encodeURIComponent(""+r)),null==i)throw new Error("The parameter 'height' must be defined.");if(p=p.replace("{height}",encodeURIComponent(""+i)),null!=o&&(p+="surfaceIndex="+encodeURIComponent(""+o)+"&"),null!=a&&(p+="stub="+encodeURIComponent(""+a)+"&"),null!=s&&(p+="format="+encodeURIComponent(""+s)+"&"),null===l)throw new Error("The parameter 'force' cannot be null.");if(void 0!==l&&(p+="force="+encodeURIComponent(""+l)+"&"),null===u)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==u&&(p+="tenantId="+encodeURIComponent(""+u)+"&"),null!=c&&(p+="ownerId="+encodeURIComponent(""+c)+"&"),p=p.replace(/[?&]$/,"");let f={responseType:"blob",method:"GET",url:p,headers:{Accept:"application/octet-stream"},cancelToken:h};return this.transformOptions(f).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(p,t,(t=>this.processPreparePreview(t)))))}processPreparePreview(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e||206===e){const r=t.headers?t.headers["content-disposition"]:void 0,i=r?/filename="?([^"]*?)"?(;|$)/g.exec(r):void 0,o=i&&i.length>1?i[1]:void 0;return Promise.resolve({fileName:o,status:e,data:new Blob([t.data]),headers:n})}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}preparePreviewUrl(t,e,n,r,i,o,a,s,l,u,c,h){let p=this.baseUrl+"/api/processor/v1/private-designs/{id}/preview/{namespace}/{name}/{width}x{height}/url?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(p=p.replace("{id}",encodeURIComponent(""+t)),null==e)throw new Error("The parameter 'namespace' must be defined.");if(p=p.replace("{namespace}",encodeURIComponent(""+e)),null==n)throw new Error("The parameter 'name' must be defined.");if(p=p.replace("{name}",encodeURIComponent(""+n)),null==r)throw new Error("The parameter 'width' must be defined.");if(p=p.replace("{width}",encodeURIComponent(""+r)),null==i)throw new Error("The parameter 'height' must be defined.");if(p=p.replace("{height}",encodeURIComponent(""+i)),null!=o&&(p+="surfaceIndex="+encodeURIComponent(""+o)+"&"),null!=a&&(p+="stub="+encodeURIComponent(""+a)+"&"),null!=s&&(p+="format="+encodeURIComponent(""+s)+"&"),null===l)throw new Error("The parameter 'force' cannot be null.");if(void 0!==l&&(p+="force="+encodeURIComponent(""+l)+"&"),null===u)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==u&&(p+="tenantId="+encodeURIComponent(""+u)+"&"),null!=c&&(p+="ownerId="+encodeURIComponent(""+c)+"&"),p=p.replace(/[?&]$/,"");let f={method:"GET",url:p,headers:{Accept:"application/json"},cancelToken:h};return this.transformOptions(f).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(p,t,(t=>this.processPreparePreviewUrl(t)))))}processPreparePreviewUrl(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}reimportDesign(t,e,n,r,i,o){let a=this.baseUrl+"/api/processor/v1/private-designs/{id}/re-import?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(a=a.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(a+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(a+="ownerId="+encodeURIComponent(""+n)+"&"),a=a.replace(/[?&]$/,"");const s=new FormData;if(null==r)throw new Error("The parameter 'sourceFile' cannot be null.");s.append("sourceFile",r.data,r.fileName?r.fileName:"sourceFile"),null!=i&&s.append("markerShortcutsFile",i.data,i.fileName?i.fileName:"markerShortcutsFile");let l={data:s,method:"POST",url:a,headers:{},cancelToken:o};return this.transformOptions(l).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(a,t,(t=>this.processReimportDesign(t)))))}processReimportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}embedDataSchema(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/embed?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processEmbedDataSchema(t)))))}processEmbedDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}extractDataSchema(t,e,n,r,i){let o=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/extract?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(o=o.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(o+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(o+="ownerId="+encodeURIComponent(""+n)+"&"),o=o.replace(/[?&]$/,"");let a={data:JSON.stringify(r),method:"POST",url:o,headers:{"Content-Type":"application/json"},cancelToken:i};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(o,t,(t=>this.processExtractDataSchema(t)))))}processExtractDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e)return t.data,Promise.resolve(null);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}linkDataSchema(t,e,n,r,i){let o=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/link?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(o=o.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(o+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(o+="ownerId="+encodeURIComponent(""+n)+"&"),o=o.replace(/[?&]$/,"");let a={data:JSON.stringify(r),method:"POST",url:o,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:i};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(o,t,(t=>this.processLinkDataSchema(t)))))}processLinkDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}removeDataSchema(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/remove?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processRemoveDataSchema(t)))))}processRemoveDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}update(t,e,n,r,i,o,a,s){let l=this.baseUrl+"/api/processor/v1/private-designs/{id}/update?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(l=l.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(l+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(l+="ownerId="+encodeURIComponent(""+n)+"&"),l=l.replace(/[?&]$/,"");const u=new FormData;null!=r&&u.append("designParams.name",r.toString()),null!=i&&u.append("designParams.path",i.toString()),null!=o&&u.append("designParams.customFields",JSON.stringify(o)),null!=a&&u.append("file",a.data,a.fileName?a.fileName:"file");let c={data:u,method:"POST",url:l,headers:{Accept:"application/json"},cancelToken:s};return this.transformOptions(c).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(l,t,(t=>this.processUpdate(t)))))}processUpdate(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}createBlankDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/blank?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCreateBlankDesign(t)))))}processCreateBlankDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}copyDesignFromPublicDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/from-design?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCopyDesignFromPublicDesign(t)))))}processCopyDesignFromPublicDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}copyDesignFromPublicResource(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/from-resource?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCopyDesignFromPublicResource(t)))))}processCopyDesignFromPublicResource(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(422===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Client Error",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}importDesign(t,e,n,r,i,o,a,s,l,u,c,h,p,f,d){let g=this.baseUrl+"/api/processor/v1/private-designs/import?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(g+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(g+="ownerId="+encodeURIComponent(""+e)+"&"),g=g.replace(/[?&]$/,"");const m=new FormData;if(null!=n&&m.append("designParams.name",n.toString()),null!=r&&m.append("designParams.path",r.toString()),null!=i&&m.append("designParams.customFields",JSON.stringify(i)),null!=o&&m.append("previewSettings.makePreview",o.toString()),null!=a&&m.append("previewSettings.namespace",a.toString()),null!=s&&m.append("previewSettings.name",s.toString()),null!=l&&m.append("previewSettings.width",l.toString()),null!=u&&m.append("previewSettings.height",u.toString()),null!=c&&m.append("previewSettings.stub",c.toString()),null!=h&&m.append("previewSettings.format",h.toString()),null==p)throw new Error("The parameter 'sourceFile' cannot be null.");m.append("sourceFile",p.data,p.fileName?p.fileName:"sourceFile"),null!=f&&m.append("markerShortcutsFile",f.data,f.fileName?f.fileName:"markerShortcutsFile");let y={data:m,method:"POST",url:g,headers:{Accept:"application/json"},cancelToken:d};return this.transformOptions(y).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(g,t,(t=>this.processImportDesign(t)))))}processImportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}validateDesignImportSettings(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/validate-import-settings?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");const o=new FormData;null!=n&&o.append("markerShortcutsFile",n.data,n.fileName?n.fileName:"markerShortcutsFile");let a={data:o,method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processValidateDesignImportSettings(t)))))}processValidateDesignImportSettings(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}}(tt=Q||(Q={})).Unknown="Unknown",tt.Rgb="Rgb",tt.Grayscale="Grayscale",tt.Cmyk="Cmyk",tt.Lab="Lab",tt.Spot="Spot",(nt=et||(et={})).Unknown="Unknown",nt.Abstract="Abstract",nt.Link="Link",nt.Display="Display",nt.NamedColor="NamedColor",nt.Output="Output",nt.Input="Input",nt.ColorSpace="ColorSpace",(it=rt||(rt={})).Name="Name",it.FolderOverwrite="FolderOverwrite",(at=ot||(ot={})).Ok="Ok",at.Missing="Missing",at.Required="Required",at.NoSuchField="NoSuchField",at.StringPattern="StringPattern",at.StringMinLength="StringMinLength",at.StringMaxLength="StringMaxLength",at.StringMinLengthPerLine="StringMinLengthPerLine",at.StringMaxLengthPerLine="StringMaxLengthPerLine",at.StringMinLines="StringMinLines",at.StringMaxLines="StringMaxLines",at.NumberIsNumber="NumberIsNumber",at.NumberMin="NumberMin",at.NumberMax="NumberMax",at.NumberIsInteger="NumberIsInteger",at.VariantNotInList="VariantNotInList",at.ImageRoot="ImageRoot",at.ImageNotFound="ImageNotFound",(lt=st||(st={})).Jpeg="Jpeg",lt.Png="Png",(ct=ut||(ut={})).Png="Png",ct.Svg="Svg",(pt=ht||(ht={})).None="None",pt.Left="Left",pt.Center="Center",pt.Right="Right",pt.JustifyAll="JustifyAll",pt.JustifyLeft="JustifyLeft",pt.JustifyCenter="JustifyCenter",pt.JustifyRight="JustifyRight",(dt=ft||(ft={})).Top="Top",dt.Center="Center",dt.Baseline="Baseline",dt.Bottom="Bottom",(mt=gt||(gt={})).Fit="Fit",mt.Shrink="Shrink",mt.Resize="Resize",mt.Fill="Fill",(_t=yt||(yt={})).High="High",_t.Medium="Medium",_t.Low="Low",_t.NearestNeighbour="NearestNeighbour",_t.Linear="Linear",_t.Cubic="Cubic",_t.Supersampling="Supersampling",_t.Lanczos="Lanczos",_t.Anisotropic4="Anisotropic4",_t.Anisotropic9="Anisotropic9",_t.Lanczos3="Lanczos3",(vt=bt||(bt={})).Fit="Fit",vt.Shrink="Shrink",vt.Resize="Resize",vt.Fill="Fill",(Ct=wt||(wt={})).High="High",Ct.Medium="Medium",Ct.Low="Low",Ct.NearestNeighbour="NearestNeighbour",Ct.Linear="Linear",Ct.Cubic="Cubic",Ct.Supersampling="Supersampling",Ct.Lanczos="Lanczos",Ct.Anisotropic4="Anisotropic4",Ct.Anisotropic9="Anisotropic9",Ct.Lanczos3="Lanczos3",(xt=Pt||(Pt={})).Psd="Psd",xt.M3d="M3d",(It=St||(St={})).Mockup2D="Mockup2D",It.Mockup3D="Mockup3D",(Tt=Ot||(Ot={})).Mockup2D="Mockup2D",Tt.Mockup3D="Mockup3D";class Vt extends Error{constructor(t,e,n,r,i){super(),zt(this,"message"),zt(this,"status"),zt(this,"response"),zt(this,"headers"),zt(this,"result"),zt(this,"isApiException",!0),this.message=t,this.status=e,this.response=n,this.headers=r,this.result=i}static isApiException(t){return!0===t.isApiException}}function qt(t,e,n,r,i){throw null!=i?i:new Vt(t,e,n,r,null)}function Gt(t){return t&&!0===t.isAxiosError}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a}));var r=n(518);n(606),function(){function t(){}t.getProductSerializer=function(){return null!=t.jsonProductSerializerFactory?t.jsonProductSerializerFactory():t._defaultJsonProductSerializerFactory()},t._defaultJsonProductSerializerFactory=function(){return new r.a},t.jsonProductSerializerFactory=null}(),n(575)},function(t,e,n){"use strict";var r,i;n.d(e,"a",(function(){return a})),function(t){t[t.ModalOpen=0]="ModalOpen",t[t.ModalClose=1]="ModalClose",t[t.FullScreen=2]="FullScreen",t[t.FullWindow=3]="FullWindow",t[t.OriginalSize=4]="OriginalSize",t[t.AssetManagerOpened=5]="AssetManagerOpened",t[t.AssetManagerClosed=6]="AssetManagerClosed",t[t.RevertProduct=7]="RevertProduct",t[t.ObjectInspectorVisibilityChange=8]="ObjectInspectorVisibilityChange",t[t.OnSurfaceChanged=9]="OnSurfaceChanged",t[t.CanRedoChanged=10]="CanRedoChanged",t[t.CanUndoChanged=11]="CanUndoChanged",t[t.OnImageDpiChanged=12]="OnImageDpiChanged",t[t.PopupOpen=13]="PopupOpen",t[t.PrintAreaBoundsChanged=14]="PrintAreaBoundsChanged",t[t.UndoProduct=15]="UndoProduct",t[t.RedoProduct=16]="RedoProduct",t[t.UIElementStateChange=17]="UIElementStateChange",t[t.CustomButtonClicked=18]="CustomButtonClicked"}(r||(r={})),function(t){t[t.FullScreen=0]="FullScreen",t[t.FullWindow=1]="FullWindow",t[t.OriginalSize=2]="OriginalSize"}(i||(i={}));var o,a=function(){function t(){}return t.ModalOpen=r[r.ModalOpen],t.ModalClose=r[r.ModalClose],t.FullWindow=r[r.FullWindow],t.FullScreen=r[r.FullScreen],t.OriginalSize=r[r.OriginalSize],t.AssetManagerOpened=r[r.AssetManagerOpened],t.AssetManagerClosed=r[r.AssetManagerClosed],t.RevertProduct=r[r.RevertProduct],t.OnSurfaceChanged=r[r.OnSurfaceChanged],t.CanUndoChanged=r[r.CanUndoChanged],t.CanRedoChanged=r[r.CanRedoChanged],t.OnImageDpiChanged=r[r.OnImageDpiChanged],t.PopupOpen=r[r.PopupOpen],t.PrintAreaBoundsChanged=r[r.PrintAreaBoundsChanged],t.UndoProduct=r[r.UndoProduct],t.RedoProduct=r[r.RedoProduct],t.BoundsNotification="BoundsNotification",t.ItemChanged="ItemChanged",t.ItemAdded="ItemAdded",t.ItemRemoved="ItemRemoved",t.SelectedItemsChanged="SelectedItemsChanged",t.UIElementStateChange=r[r.UIElementStateChange],t.CustomButtonClicked=r[r.CustomButtonClicked],t}();!function(t){t[t.Event=0]="Event",t[t.ProcedureResponse=1]="ProcedureResponse"}(o||(o={}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const o=new Uint8Array(16);function a(){if(!i&&(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(o)}const s=[];for(let l=0;l<256;++l)s.push((l+256).toString(16).slice(1));e.a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return function(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(i)}}])]);