UNPKG

@syncfusion/ej2-pdfviewer

Version:
10 lines 4.17 MB
/*! * filename: ej2-pdfviewer.min.js * version : 29.1.35 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionDrawings"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons"),require("SyncfusionInplaceEditor"),require("SyncfusionNavigations"),require("SyncfusionNotifications"),require("SyncfusionCompression"),require("SyncfusionFileUtils"),require("SyncfusionButtons"),require("SyncfusionDropdowns"),require("SyncfusionData"),require("SyncfusionLists")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionDrawings","SyncfusionInputs","SyncfusionPopups","SyncfusionSplitbuttons","SyncfusionInplaceEditor","SyncfusionNavigations","SyncfusionNotifications","SyncfusionCompression","SyncfusionFileUtils","SyncfusionButtons","SyncfusionDropdowns","SyncfusionData","SyncfusionLists"],t):"object"==typeof exports?exports.SyncfusionPdfviewer=t(require("SyncfusionBase"),require("SyncfusionDrawings"),require("SyncfusionInputs"),require("SyncfusionPopups"),require("SyncfusionSplitbuttons"),require("SyncfusionInplaceEditor"),require("SyncfusionNavigations"),require("SyncfusionNotifications"),require("SyncfusionCompression"),require("SyncfusionFileUtils"),require("SyncfusionButtons"),require("SyncfusionDropdowns"),require("SyncfusionData"),require("SyncfusionLists")):e.SyncfusionPdfviewer=t(e.SyncfusionBase,e.SyncfusionDrawings,e.SyncfusionInputs,e.SyncfusionPopups,e.SyncfusionSplitbuttons,e.SyncfusionInplaceEditor,e.SyncfusionNavigations,e.SyncfusionNotifications,e.SyncfusionCompression,e.SyncfusionFileUtils,e.SyncfusionButtons,e.SyncfusionDropdowns,e.SyncfusionData,e.SyncfusionLists)}(self,((e,t,i,n,o,r,a,s,l,d,h,A,p,c)=>(()=>{"use strict";var g={766:t=>{t.exports=e},741:e=>{e.exports=h},50:e=>{e.exports=l},74:e=>{e.exports=p},984:e=>{e.exports=t},778:e=>{e.exports=A},115:e=>{e.exports=d},914:e=>{e.exports=r},323:e=>{e.exports=i},90:e=>{e.exports=c},215:e=>{e.exports=a},344:e=>{e.exports=s},197:e=>{e.exports=n},295:e=>{e.exports=o}},u={};function f(e){var t=u[e];if(void 0!==t)return t.exports;var i=u[e]={exports:{}};return g[e](i,i.exports,f),i.exports}f.d=(e,t)=>{for(var i in t)f.o(t,i)&&!f.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{f.r(m),f.d(m,{AccessibilityTags:()=>Jh,ActiveElements:()=>we,AjaxHandler:()=>Sd,AjaxRequestSettings:()=>Nd,AllowedInteraction:()=>Qe,AnnotBounds:()=>CA,AnnotBoundsBase:()=>Wt,AnnotBoundsRect:()=>Kt,AnnotColor:()=>BA,AnnotFontBase:()=>Zt,AnnotPoint:()=>SA,AnnotRectBase:()=>Xt,Annotation:()=>Gt,AnnotationBaseSettings:()=>Jt,AnnotationDataFormat:()=>Fe,AnnotationRenderer:()=>lA,AnnotationResizerLocation:()=>ve,AnnotationSelectorSettings:()=>ph,AnnotationSettings:()=>fh,AnnotationToolbar:()=>Md,AnnotationToolbarSettings:()=>Ld,Annotations:()=>iA,AnnotationsBase:()=>ei,AnnotationsInternal:()=>$t,AreaSettings:()=>rh,ArrowSettings:()=>Xd,BlazorUiAdaptor:()=>dd,BookmarkBase:()=>_A,BookmarkDestination:()=>xA,BookmarkStyles:()=>DA,BookmarkView:()=>Rh,CalculateLeaderPoints:()=>pe,CheckBoxFieldSettings:()=>Eh,CircleSettings:()=>qd,CommandManager:()=>Fh,CommentStatus:()=>Ce,ConnectTool:()=>ne,ContextMenu:()=>yd,ContextMenuItem:()=>Ie,ContextMenuSettings:()=>Ih,CursorType:()=>xe,CustomStamp:()=>Rd,CustomStampSettings:()=>ih,CustomToolbarItem:()=>Pd,DisplayMode:()=>_e,DistanceSettings:()=>nh,DocumentTextCollectionSettings:()=>mh,Drawing:()=>X,DropdownFieldSettings:()=>xh,DynamicStampItem:()=>De,ExtractTextOption:()=>Ee,FontBase:()=>IA,FontStyle:()=>Be,FormDesigner:()=>Gh,FormDesignerToolbar:()=>_d,FormDesignerToolbarSettings:()=>Od,FormField:()=>Bh,FormFieldDataFormat:()=>Te,FormFields:()=>jh,FormFieldsBase:()=>aA,FreeTextAnnotation:()=>Ht,FreeTextAnnotationBase:()=>hA,FreeTextSettings:()=>Ah,HandWrittenSignatureSettings:()=>uh,HighlightSettings:()=>Kd,IBounds:()=>qt,ImageStructureBase:()=>MA,InitialFieldSettings:()=>zd,InkAnnotation:()=>hi,InkAnnotationSettings:()=>lh,InkDrawingTool:()=>ie,InkSignatureAnnotation:()=>AA,InputElement:()=>Yt,Item:()=>Mh,KeyGesture:()=>Vh,KeyboardCommand:()=>Qh,LineSettings:()=>Wd,LineTool:()=>se,LinkAnnotation:()=>ni,ListBoxFieldSettings:()=>Dh,Magnification:()=>Id,MeasureAnnotation:()=>ri,MeasureShapeAnnotationBase:()=>cA,MeasurementSettings:()=>hh,ModifierKeys:()=>ke,MoveTool:()=>ee,Navigation:()=>bd,NavigationPane:()=>cl,NodeDrawingTool:()=>re,OrganizeDetails:()=>TA,PageInfo:()=>gh,PageOrganizer:()=>QA,PageOrganizerSettings:()=>Th,PageRenderer:()=>Xh,PageRotation:()=>FA,PasswordFieldSettings:()=>vh,Path:()=>bA,PdfAnnotationBase:()=>s,PdfBounds:()=>r,PdfFont:()=>a,PdfFormFieldBase:()=>l,PdfKeys:()=>Pe,PdfLayer:()=>yA,PdfPageRotateAngle:()=>oA,PdfRenderedFields:()=>sA,PdfRenderer:()=>qh,PdfViewer:()=>Ph,PdfViewerBase:()=>md,PdfiumRunner:()=>Wh,PerimeterSettings:()=>oh,PointBase:()=>dA,PolygonDrawingTool:()=>ae,PolygonSettings:()=>eh,PopupAnnotationBase:()=>mA,Print:()=>Hh,RadioButtonFieldSettings:()=>_h,RadiusSettings:()=>ah,RectBounds:()=>Kh,RectangleBase:()=>vA,RectangleBounds:()=>yh,RectangleSettings:()=>Zd,ResizeTool:()=>oe,RotateTool:()=>le,ScrollSettings:()=>Ch,SearchResult:()=>kh,SelectTool:()=>$,Selector:()=>p,ServerActionSettings:()=>jd,ShapeAnnotation:()=>ai,ShapeAnnotationBase:()=>pA,ShapeLabelSettings:()=>$d,SignStampItem:()=>Me,Signature:()=>Bd,SignatureAnnotationBase:()=>gA,SignatureBase:()=>EA,SignatureDialogSettings:()=>Yd,SignatureFieldSettings:()=>Ud,SignatureIndicatorSettings:()=>Hd,SignatureType:()=>be,SizeBase:()=>tA,Spinner:()=>Yl,StampAnnotation:()=>si,StampAnnotationBase:()=>Zh,StampSettings:()=>th,StampTool:()=>te,StandardBusinessStampItem:()=>Ve,StickyNotesAnnotation:()=>di,StickyNotesSettings:()=>dh,StrikethroughSettings:()=>Gd,TextDataSettings:()=>wh,TextFieldSettings:()=>bh,TextLayer:()=>wd,TextMarkupAnnotation:()=>oi,TextMarkupAnnotationBase:()=>wA,TextSearch:()=>zh,TextSearchColorSettings:()=>ch,TextSelection:()=>Lh,ThumbnailView:()=>vd,TileRenderingSettings:()=>Sh,ToolBase:()=>q,Toolbar:()=>xd,ToolbarSettings:()=>kd,UnderlineSettings:()=>Jd,VolumeSettings:()=>sh,ZOrderPageTable:()=>d,clipDecorator:()=>Q,clipDecorators:()=>V,cloneArray:()=>B,cloneObject:()=>C,createSpinner:()=>jl,createSvg:()=>Se,findActiveElement:()=>de,findActivePage:()=>me,findElementUnderMouse:()=>ce,findNearestPoint:()=>j,findObjectUnderMouse:()=>Ae,findObjects:()=>fe,findObjectsUnderMouse:()=>he,findPerimeterLength:()=>w,findPointsLength:()=>u,findTargetShapeElement:()=>ue,getArialFontData:()=>nA,getBaseShapeAttributes:()=>y,getConnectorPoints:()=>v,getDecoratorElement:()=>M,getDecoratorShape:()=>G,getFunction:()=>S,getInternalProperties:()=>I,getPolygonPath:()=>O,getSegmentElement:()=>x,getSegmentPath:()=>E,hideSpinner:()=>rd,initDistanceLabel:()=>F,initLeader:()=>H,initLeaders:()=>z,initPerimeterLabel:()=>P,insertObject:()=>ge,isLeader:()=>b,isLineShapes:()=>c,isPointOverConnector:()=>Y,removePerimeterLabel:()=>R,renderAdornerLayer:()=>ye,setElementStype:()=>g,setSpinner:()=>ad,showSpinner:()=>nd,textElement:()=>U,updateCalibrateLabel:()=>L,updateDecoratorElement:()=>D,updateDistanceLabel:()=>T,updatePerimeterLabel:()=>N,updateRadiusLabel:()=>k,updateSegmentElement:()=>_});var e,t=f(766),i=f(984),n=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}),o=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},r=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),o([(0,t.Property)(0)],r.prototype,"x",void 0),o([(0,t.Property)(0)],r.prototype,"y",void 0),o([(0,t.Property)(0)],r.prototype,"width",void 0),o([(0,t.Property)(0)],r.prototype,"height",void 0),o([(0,t.Property)(0)],r.prototype,"left",void 0),o([(0,t.Property)(0)],r.prototype,"top",void 0),o([(0,t.Property)(0)],r.prototype,"right",void 0),o([(0,t.Property)(0)],r.prototype,"bottom",void 0),o([(0,t.Complex)({x:0,y:0},i.Point)],r.prototype,"location",void 0),o([(0,t.Complex)(new i.Size(0,0),i.Size)],r.prototype,"size",void 0),r}(t.ChildProperty),a=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),o([(0,t.Property)(!1)],i.prototype,"isBold",void 0),o([(0,t.Property)(!1)],i.prototype,"isItalic",void 0),o([(0,t.Property)(!1)],i.prototype,"isUnderline",void 0),o([(0,t.Property)(!1)],i.prototype,"isStrikeout",void 0),i}(t.ChildProperty),s=function(e){function i(t,i,n,o){return e.call(this,t,i,n,o)||this}return n(i,e),o([(0,t.Property)("")],i.prototype,"id",void 0),o([(0,t.Property)("Rectangle")],i.prototype,"shapeAnnotationType",void 0),o([(0,t.Property)(null)],i.prototype,"formFieldAnnotationType",void 0),o([(0,t.Property)("")],i.prototype,"measureType",void 0),o([(0,t.Property)("")],i.prototype,"author",void 0),o([(0,t.Property)("")],i.prototype,"modifiedDate",void 0),o([(0,t.Property)("")],i.prototype,"subject",void 0),o([(0,t.Property)("")],i.prototype,"notes",void 0),o([(0,t.Property)(!1)],i.prototype,"isCommentLock",void 0),o([(0,t.Property)("black")],i.prototype,"strokeColor",void 0),o([(0,t.Property)("#ffffff00")],i.prototype,"fillColor",void 0),o([(0,t.Property)("#ffffff00")],i.prototype,"stampFillColor",void 0),o([(0,t.Property)("black")],i.prototype,"stampStrokeColor",void 0),o([(0,t.Property)("")],i.prototype,"data",void 0),o([(0,t.Property)(1)],i.prototype,"opacity",void 0),o([(0,t.Property)(1)],i.prototype,"thickness",void 0),o([(0,t.Property)("")],i.prototype,"borderStyle",void 0),o([(0,t.Property)("")],i.prototype,"borderDashArray",void 0),o([(0,t.Property)(0)],i.prototype,"rotateAngle",void 0),o([(0,t.Property)(!1)],i.prototype,"isCloudShape",void 0),o([(0,t.Property)(0)],i.prototype,"cloudIntensity",void 0),o([(0,t.Property)(40)],i.prototype,"leaderHeight",void 0),o([(0,t.Property)(null)],i.prototype,"lineHeadStart",void 0),o([(0,t.Property)(null)],i.prototype,"lineHeadEnd",void 0),o([(0,t.Property)([])],i.prototype,"vertexPoints",void 0),o([(0,t.Property)(null)],i.prototype,"sourcePoint",void 0),o([(0,t.Property)("None")],i.prototype,"sourceDecoraterShapes",void 0),o([(0,t.Property)("None")],i.prototype,"taregetDecoraterShapes",void 0),o([(0,t.Property)(null)],i.prototype,"targetPoint",void 0),o([(0,t.Property)([])],i.prototype,"segments",void 0),o([(0,t.Complex)({x:0,y:0},r)],i.prototype,"bounds",void 0),o([(0,t.Property)(0)],i.prototype,"pageIndex",void 0),o([(0,t.Property)(-1)],i.prototype,"zIndex",void 0),o([(0,t.Property)(null)],i.prototype,"wrapper",void 0),o([(0,t.Property)(!1)],i.prototype,"isDynamicStamp",void 0),o([(0,t.Property)("")],i.prototype,"dynamicText",void 0),o([(0,t.Property)("")],i.prototype,"annotName",void 0),o([(0,t.Property)({})],i.prototype,"review",void 0),o([(0,t.Property)([])],i.prototype,"comments",void 0),o([(0,t.Property)("#000")],i.prototype,"fontColor",void 0),o([(0,t.Property)(16)],i.prototype,"fontSize",void 0),o([(0,t.Property)("Helvetica")],i.prototype,"fontFamily",void 0),o([(0,t.Property)("None")],i.prototype,"fontStyle",void 0),o([(0,t.Property)(!1)],i.prototype,"enableShapeLabel",void 0),o([(0,t.Property)("label")],i.prototype,"labelContent",void 0),o([(0,t.Property)("#ffffff00")],i.prototype,"labelFillColor",void 0),o([(0,t.Property)(15)],i.prototype,"labelMaxLength",void 0),o([(0,t.Property)("")],i.prototype,"template",void 0),o([(0,t.Property)("")],i.prototype,"templateSize",void 0),o([(0,t.Property)(1)],i.prototype,"labelOpacity",void 0),o([(0,t.Property)("")],i.prototype,"annotationSelectorSettings",void 0),o([(0,t.Property)("#ffffff00")],i.prototype,"labelBorderColor",void 0),o([(0,t.Property)("left")],i.prototype,"textAlign",void 0),o([(0,t.Property)("")],i.prototype,"signatureName",void 0),o([(0,t.Property)(0)],i.prototype,"minHeight",void 0),o([(0,t.Property)(0)],i.prototype,"minWidth",void 0),o([(0,t.Property)(0)],i.prototype,"maxHeight",void 0),o([(0,t.Property)(0)],i.prototype,"maxWidth",void 0),o([(0,t.Property)(!1)],i.prototype,"isLock",void 0),o([(0,t.Property)("UI Drawn Annotation")],i.prototype,"annotationAddMode",void 0),o([(0,t.Property)("")],i.prototype,"annotationSettings",void 0),o([(0,t.Property)(16)],i.prototype,"previousFontSize",void 0),o([(0,t.Complex)({isBold:!1,isItalic:!1,isStrikeout:!1,isUnderline:!1},a)],i.prototype,"font",void 0),o([(0,t.Complex)({x:0,y:0},r)],i.prototype,"labelBounds",void 0),o([(0,t.Property)(null)],i.prototype,"customData",void 0),o([(0,t.Property)(["None"])],i.prototype,"allowedInteractions",void 0),o([(0,t.Property)(!0)],i.prototype,"isPrint",void 0),o([(0,t.Property)(!1)],i.prototype,"isReadonly",void 0),o([(0,t.Property)(0)],i.prototype,"pageRotation",void 0),o([(0,t.Property)("")],i.prototype,"icon",void 0),o([(0,t.Property)(!1)],i.prototype,"isAddAnnotationProgrammatically",void 0),o([(0,t.Property)(!1)],i.prototype,"isTransparentSet",void 0),i}(t.ChildProperty),l=function(e){function i(t,i,n,o){return e.call(this,t,i,n,o)||this}return n(i,e),o([(0,t.Property)("")],i.prototype,"id",void 0),o([(0,t.Property)("")],i.prototype,"signatureType",void 0),o([(0,t.Property)("")],i.prototype,"name",void 0),o([(0,t.Property)("")],i.prototype,"value",void 0),o([(0,t.Property)(null)],i.prototype,"formFieldAnnotationType",void 0),o([(0,t.Property)("#daeaf7ff")],i.prototype,"backgroundColor",void 0),o([(0,t.Property)("black")],i.prototype,"color",void 0),o([(0,t.Property)("#303030")],i.prototype,"borderColor",void 0),o([(0,t.Property)("")],i.prototype,"tooltip",void 0),o([(0,t.Property)(1)],i.prototype,"opacity",void 0),o([(0,t.Property)(1)],i.prototype,"thickness",void 0),o([(0,t.Property)(0)],i.prototype,"rotateAngle",void 0),o([(0,t.Complex)({x:0,y:0},r)],i.prototype,"bounds",void 0),o([(0,t.Property)(0)],i.prototype,"pageIndex",void 0),o([(0,t.Property)(1)],i.prototype,"pageNumber",void 0),o([(0,t.Property)(-1)],i.prototype,"zIndex",void 0),o([(0,t.Property)(null)],i.prototype,"wrapper",void 0),o([(0,t.Property)(16)],i.prototype,"fontSize",void 0),o([(0,t.Property)("Helvetica")],i.prototype,"fontFamily",void 0),o([(0,t.Property)("None")],i.prototype,"fontStyle",void 0),o([(0,t.Property)("left")],i.prototype,"alignment",void 0),o([(0,t.Property)(0)],i.prototype,"minHeight",void 0),o([(0,t.Property)(0)],i.prototype,"minWidth",void 0),o([(0,t.Property)(0)],i.prototype,"maxHeight",void 0),o([(0,t.Property)(0)],i.prototype,"maxWidth",void 0),o([(0,t.Property)(0)],i.prototype,"maxLength",void 0),o([(0,t.Property)("visible")],i.prototype,"visibility",void 0),o([(0,t.Property)(!0)],i.prototype,"isPrint",void 0),o([(0,t.Property)(!1)],i.prototype,"isReadonly",void 0),o([(0,t.Property)(!1)],i.prototype,"isChecked",void 0),o([(0,t.Property)(!1)],i.prototype,"isSelected",void 0),o([(0,t.Property)(!1)],i.prototype,"isRequired",void 0),o([(0,t.Property)(!1)],i.prototype,"isMultiline",void 0),o([(0,t.Property)(!1)],i.prototype,"isTransparent",void 0),o([(0,t.Property)(!1)],i.prototype,"insertSpaces",void 0),o([(0,t.Property)("")],i.prototype,"options",void 0),o([(0,t.Property)()],i.prototype,"signatureIndicatorSettings",void 0),o([(0,t.Complex)({isBold:!1,isItalic:!1,isStrikeout:!1,isUnderline:!1},a)],i.prototype,"font",void 0),o([(0,t.Property)()],i.prototype,"selectedIndex",void 0),o([(0,t.Property)(null)],i.prototype,"customData",void 0),i}(t.ChildProperty),d=function(){function e(){this.pageIdTemp=0,this.zIndexTemp=-1,this.childNodesTemp=[],this.objects=[],this.zIndexTemp=-1,this.pageIdTemp=0}return Object.defineProperty(e.prototype,"pageId",{get:function(){return this.pageIdTemp},set:function(e){this.pageIdTemp=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this.zIndexTemp},set:function(e){this.zIndexTemp=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objects",{get:function(){return this.childNodesTemp},set:function(e){this.childNodesTemp=e},enumerable:!0,configurable:!0}),e}(),h=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),A=function(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return h(n,e),n.prototype.init=function(e){var n=new i.Container;if(n.measureChildren=!1,n.children=[],this.formFields&&this.formFields.length>0)for(var o=0;o<this.formFields.length;o++){var r=e.pdfViewer.nameTable[this.formFields[parseInt(o.toString(),10)].id].wrapper;n.children.push(r)}else if(this.annotations)for(o=0;o<this.annotations.length;o++)if(!(0,t.isNullOrUndefined)(this.annotations[parseInt(o.toString(),10)])){r=e.pdfViewer.nameTable[this.annotations[parseInt(o.toString(),10)].id].wrapper;n.children.push(r)}return this.wrapper=n,n},A([(0,t.Property)(null)],n.prototype,"wrapper",void 0),A([(0,t.Collection)([],s)],n.prototype,"annotations",void 0),A([(0,t.Collection)([],l)],n.prototype,"formFields",void 0),A([(0,t.Property)()],n.prototype,"width",void 0),A([(0,t.Property)()],n.prototype,"height",void 0),A([(0,t.Property)(0)],n.prototype,"rotateAngle",void 0),A([(0,t.Property)(0)],n.prototype,"offsetX",void 0),A([(0,t.Property)(0)],n.prototype,"offsetY",void 0),A([(0,t.Complex)({x:.5,y:.5},i.Point)],n.prototype,"pivot",void 0),n}(t.ChildProperty);function c(e){return"Line"===e.shapeAnnotationType||"LineWidthArrowHead"===e.shapeAnnotationType||"Distance"===e.shapeAnnotationType||"Polygon"===e.shapeAnnotationType}function g(e,t){if(e&&t)if(e.formFieldAnnotationType)-1!==e.id.indexOf("diagram_helper")?(t.style.fill="transparent",t.style.strokeWidth=1,t.style.strokeDashArray=e.borderDashArray):(t.style.fill="transparent",t.style.strokeWidth=0);else{var i="#ffffff00"===e.fillColor?"transparent":e.fillColor;t.style.fill=i||"white",t.style.strokeColor=e.strokeColor?e.strokeColor:e.borderColor,t.style.color=e.strokeColor?e.strokeColor:e.borderColor,t.style.strokeWidth=e.thickness,"Image"!==e.shapeAnnotationType&&"SignatureText"!==e.shapeAnnotationType&&"SignatureImage"!==e.shapeAnnotationType||(t.style.strokeWidth=0),t.style.strokeDashArray=e.borderDashArray,t.style.opacity=e.opacity}}function u(e){for(var t=0,n=0;n<e.length-1;n++)t+=i.Point.findLength(e[parseInt(n.toString(),10)],e[n+1]);return t}function w(e){return i.Point.getLengthFromListOfPoints(e)}function y(e,t){var i={width:e.actualSize.width,height:e.actualSize.height,x:e.offsetX-e.actualSize.width*e.pivot.x+.5,y:e.offsetY-e.actualSize.height*e.pivot.y+.5,angle:e.rotateAngle+e.parentTransform,fill:e.style.fill,stroke:e.style.strokeColor,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:1,opacity:e.style.opacity,dashArray:e.style.strokeDashArray||"",visible:e.visible,id:e.id};return t&&(i.x+=t.tx,i.y+=t.ty),i}function S(e){return void 0!==e&&"string"==typeof e&&(e=(0,t.getValue)(e,window)),e}function C(e,t,i){var n={};if(e){i=e.propName;var o=e.properties||e,r=[],a=[];if((r=r.concat(Object.keys(o))).push("version"),i){var s=S(t);a=s?s(i):[],r=r.concat(a)}for(var l=I(i),d=0,h=r=r.concat(l);d<h.length;d++){var A=h[d];if("historyManager"!==A)if("wrapper"!==A)!(!e[""+A]||!Object.prototype.hasOwnProperty.call(e,"observers"))||(e[""+A]instanceof Array?n[""+A]=B(-1===l.indexOf(A)&&e[""+i]?e[""+i][""+A]:e[""+A],t,A):e[""+A]instanceof Array==!1&&e[""+A]instanceof HTMLElement?n[""+A]=e[""+A].cloneNode(!0).innerHtml:e[""+A]instanceof Array==!1&&e[""+A]instanceof Object&&"template"!==A?n[""+A]=C(-1===l.indexOf(A)&&e[""+i]?e[""+i][""+A]:e[""+A]):n[""+A]=e[""+A]);else e[""+A]&&(n[""+A]={actualSize:{width:e[""+A].actualSize.width,height:e[""+A].actualSize.height},offsetX:e[""+A].offsetX,offsetY:e[""+A].offsetY})}}return n}function B(e,t,i){var n;if(e){n=[];for(var o=0;o<e.length;o++)e[parseInt(o.toString(),10)]instanceof Array?n.push(e[parseInt(o.toString(),10)]):e[parseInt(o.toString(),10)]instanceof Object?n.push(C(e[parseInt(o.toString(),10)],t,i)):n.push(e[parseInt(o.toString(),10)])}return n}function I(e){switch(e){case"nodes":case"children":return["inEdges","outEdges","parentId","processId","nodeId","umlIndex","isPhase","isLane"];case"connectors":return["parentId"];case"annotation":case"annotations":return["nodeId"];case"shape":return["hasHeader"]}return[]}function b(e,t){var n;if("Distance"===e.shapeAnnotationType)for(var o=0,r=void 0,a=0;a<e.wrapper.children.length;a++){var s=i.Point.findAngle(e.sourcePoint,e.targetPoint);if(e.wrapper.children[parseInt(a.toString(),10)].id.indexOf("leader")>-1){var l=e.wrapper.children[0].bounds.center;0===o?(r={x:e.sourcePoint.x,y:e.sourcePoint.y-e.leaderHeight},l=e.sourcePoint):(r={x:e.targetPoint.x,y:e.targetPoint.y-e.leaderHeight},l=e.targetPoint);var d=(0,i.identityMatrix)();if((0,i.rotateMatrix)(d,s,l.x,l.y),n=(0,i.transformPointByMatrix)(d,{x:r.x,y:r.y}),t==="Leader"+o)return{leader:"leader"+o,point:n};o++}}return{leader:"",point:n}}function v(e,t){var i=e.vertexPoints.slice(0);return i&&i.length>0&&(e.sourcePoint=i[0],e.targetPoint=i[i.length-1]),i}function E(e,t){for(var i,n="",o=[],r=0;r<t.length;)o.push({x:t[parseInt(r.toString(),10)].x,y:t[parseInt(r.toString(),10)].y}),r++;o=V(e,o);for(var a=0;a<o.length;a++)i=o[parseInt(a.toString(),10)],0===a&&(n="M"+i.x+" "+i.y),a>0&&(n+=" L"+i.x+" "+i.y);return n}function _(e,t,n){var o=new i.Rect,r=E(e,t);if(o=i.Rect.toBounds(t),n.width=o.width,n.height=o.height,n.offsetX=o.x+n.width/2,n.offsetY=o.y+n.height/2,n.data=r,e.wrapper){e.wrapper.offsetX=n.offsetX,e.wrapper.offsetY=n.offsetY;var a=o.width;a=o.width<o.height?o.height:o.width,e.wrapper.width=e.enableShapeLabel?a/2:a,e.wrapper.height=o.height}return n}function x(e,t){var i;return i=v(e),t.staticSize=!0,g(e,t=_(e,i,t)),t}function D(e,t,n,o,r){t.offsetX=n.x,t.offsetY=n.y;var a,s=i.Point.findAngle(n,o),l=G(r?e.sourceDecoraterShapes:e.taregetDecoraterShapes),d=0;"LineWidthArrowHead"===e.shapeAnnotationType||"Line"===e.shapeAnnotationType?(d=e.thickness,a=new i.Size(12*d,12*d)):(d=e.thickness<=5?5:e.thickness,a=new i.Size(2*d,2*d)),t.transform=i.RotateTransform.Self,g(e,t),t.style.fill="tranparent"!==e.fillColor?e.fillColor:"white",t.rotateAngle=s,t.data=l,t.canMeasurePath=!0,t.width=a.width,t.height=a.height,"Butt"===e.sourceDecoraterShapes&&(t.width=a.width-10,t.height=a.height+10)}function M(e,t,n,o){var r=new i.PathElement;return D(e,r,t,n,o),r}function V(e,t){return t[0]=Q(e,t,!0),t[t.length-1]=Q(e,t,!1),t}function Q(e,t,n){var o,r,a={x:0,y:0},s=t.length;o=n?t[0]:t[s-1],r=n?t[1]:t[s-2];var l=i.Point.distancePoints(o,r);l=0===l?1:l;var d=e.thickness;a.x=Math.round(o.x+d*(r.x-o.x)/l),a.y=Math.round(o.y+d*(r.y-o.y)/l);return a=i.Point.adjustPoint(a,r,!0,.5)}function F(e,t,n,o){var r=[],a=i.Point.findAngle(t[0],t[1]),s=U(e,a);return!o.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?s.content=e.notes:s.content=n.setConversion(u([t[0],t[1]])*n.pixelToPointFactor,e),s.rotateValue={y:-10,angle:a},!0===e.enableShapeLabel&&(s.style.strokeColor=e.labelBorderColor,s.style.fill=e.labelFillColor,s.style.fontSize=e.fontSize,s.style.color=e.fontColor,s.style.fontFamily=e.fontFamily),r.push(s),r}function T(e,i,n){for(var o,r=0;r<e.wrapper.children.length;r++){var a=e.wrapper.children[parseInt(r.toString(),10)];a&&!(0,t.isNullOrUndefined)(a.content)&&(o=n.setConversion(u([i[0],i[1]])*n.pixelToPointFactor,e),a.content=o,a.childNodes[0].text=a.content,a.refreshTextElement())}return o}function k(e,i){for(var n,o=0;o<e.wrapper.children.length;o++){var r=e.wrapper.children[parseInt(o.toString(),10)];r&&!(0,t.isNullOrUndefined)(r.content)&&(n=i.setConversion(e.bounds.width/2*i.pixelToPointFactor,e),r.content=n,2===r.childNodes.length?(r.childNodes[0].text=n,r.childNodes.splice(r.childNodes.length-1,1)):r.childNodes[0].text=n,r.refreshTextElement())}return n}function P(e,t,n,o){var r=[],a=i.Point.findAngle(t[0],t[1]),s=U(e,a);return!o.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?s.content=e.notes:s.content=n.calculatePerimeter(e),!0===e.enableShapeLabel&&(s.style.strokeColor=e.labelBorderColor,s.style.fill=e.labelFillColor,s.style.fontSize=e.fontSize,s.style.color=e.fontColor,s.style.fontFamily=e.fontFamily),s.rotateValue={y:-10,angle:a},r.push(s),r}function N(e,i,n){for(var o,r=0;r<e.wrapper.children.length;r++){var a=e.wrapper.children[parseInt(r.toString(),10)];a&&!(0,t.isNullOrUndefined)(a.content)&&(o=n.calculatePerimeter(e),a.content=o,a.childNodes[0].text=a.content,a.refreshTextElement())}return o}function R(e){for(var i=0;i<e.wrapper.children.length;i++){var n=e.wrapper.children[parseInt(i.toString(),10)];n&&!(0,t.isNullOrUndefined)(n.content)&&e.wrapper.children.splice(i,1)}}function L(e){if(e.wrapper&&e.wrapper.children)for(var i=0;i<e.wrapper.children.length;i++){var n=e.wrapper.children[parseInt(i.toString(),10)];n&&!(0,t.isNullOrUndefined)(n.content)&&(n.content=e.notes,n.childNodes[0].text=n.content,n.refreshTextElement())}}function O(e){var t,i,n="";for(n="M"+e[0].x+" "+e[0].y,i=1;i<e.length;i++)n+="L"+(t=e[parseInt(i.toString(),10)]).x+" "+t.y;return n+="Z"}function U(e,t){var n=new i.TextElement;return g(e,n),n.style.fill="transparent",n.id=(0,i.randomId)(),n.horizontalAlignment="Center",n.rotateValue={y:10,angle:t},n.verticalAlignment="Top",n.relativeMode="Object",n.setOffsetWithRespectToBounds(.5,.5,"Absolute"),n.offsetX,n.style.textWrapping="NoWrap",n}function z(e,t){var i=[],n=H(e,t[0],t[1]);return i.push(n),n=H(e,t[1],t[0],!0),i.push(n),i}function H(e,t,n,o){var r=new i.PathElement;r.offsetX=t.x,r.offsetY=t.y;var a=i.Point.findAngle(t,n),s={x:(t.x+n.x)/2,y:(t.y+n.y)/2},l=(0,i.identityMatrix)();(0,i.rotateMatrix)(l,0-a,s.x,s.y);var d=(0,i.transformPointByMatrix)(l,t),h={x:d.x,y:d.y-e.leaderHeight};l=(0,i.identityMatrix)(),(0,i.rotateMatrix)(l,a,r.offsetX,r.offsetY),d=(0,i.transformPointByMatrix)(l,h);var A={x:t.x,y:t.y};r.offsetX=A.x,r.offsetY=A.y,r.transform=i.RotateTransform.Self;var p="M"+t.x+","+t.y+",L"+d.x+","+d.y+"Z",c=new i.Size(0,e.leaderHeight);return r.pivot.x=.5,o?(r.id="leader2_"+(0,i.randomId)(),r.pivot.y=0):(r.id="leader1_"+(0,i.randomId)(),r.pivot.y=1),g(e,r),r.rotateAngle=a,r.data=p,r.canMeasurePath=!0,r.width=c.width,r.height=c.height,r}function Y(e,n){var o=e.vertexPoints;if(!(0,t.isNullOrUndefined)(o))for(var r=0;r<o.length-1;r++){var a=o[parseInt(r.toString(),10)],s=o[r+1],l=i.Rect.toBounds([a,s]);if(l.Inflate(10),l.containsPoint(n)){var d=j(n,a,s),h={x1:a.x,x2:s.x,y1:a.y,y2:s.y},A={x1:n.x,x2:d.x,y1:n.y,y2:d.y},p=(0,i.intersect3)(h,A);if(p.enabled){var c=i.Point.findLength(n,p.intersectPt);if(Math.abs(c)<10)return!0}else{var g=i.Rect.toBounds([n,n]);if(g.Inflate(3),g.containsPoint(a)||g.containsPoint(s))return!0}if(i.Point.equals(n,d))return!0}}return!1}function j(e,t,n){var o;o=i.Point.findLength(t,e)>i.Point.findLength(n,e)?n:t;var r=i.Point.findAngle(t,n),a=i.Point.findAngle(o,e),s=i.Point.findLength(o,e),l=a+2*(r-a);return{x:o.x+s*Math.cos(l*Math.PI/180),y:o.y+s*Math.sin(l*Math.PI/180)}}function G(e){return J[""+e]}var J={OpenArrow:"M15.9,23 L5,16 L15.9,9 L17,10.7 L8.7,16 L17,21.3Z",Square:"M0,0 L10,0 L10,10 L0,10 z",Fletch:"M14.8,10c0,0-3.5,6,0.2,12c0,0-2.5-6-10.9-6C4.1,16,11.3,16,14.8,10z",OpenFetch:"M6,17c-0.6,0-1-0.4-1-1s0.4-1,1-1c10.9,0,11-5,11-5c0-0.6,0.4-1,1-1s1,0.4,1,1C19,10.3,18.9,17,6,17C6,17,6,17,6,17z M18,23c-0.5,0-1-0.4-1-1c0-0.2-0.3-5-11-5c-0.6,0-1-0.5-1-1s0.4-1,1-1c0,0,0,0,0,0c12.9,0,13,6.7,13,7 C19,22.6,18.6,23,18,23z",IndentedArrow:"M17,10c0,0-4.5,5.5,0,12L5,16L17,10z",OutdentedArrow:"M14.6,10c0,0,5.4,6,0,12L5,16L14.6,10z",DoubleArrow:"M19,10 L19,22 L13,16Z M12,10 L12,22 L6,16Z",Arrow:"M15,10 L15,22 L5,16Z",Diamond:"M12,23l-7-7l7-7l6.9,7L12,23z",Circle:"M0,50 A50,50,0 1 1 100,50 A50,50,0 1 1 0,50 Z",Butt:"M0,0 L0,90"},K=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),W=function(e){function i(t){var i=e.call(this)||this;return i.templateFn=i.templateCompiler(t),i}return K(i,e),i.prototype.templateCompiler=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(i){return(0,t.compile)(e)}},i.prototype.getNodeTemplate=function(){return this.templateFn},i}(i.DrawingElement),X=function(){function e(e){this.isDynamicStamps=!1,this.copiedElementID="",this.isPasted=!1,this.pdfViewer=e,this.renderer=new i.DrawingRenderer("this.pdfViewer.element.id",!1),this.svgRenderer=new i.SvgRenderer}return e.prototype.renderLabels=function(e){var t=e.annotations;if(t)for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];this.initObject(n)}},e.prototype.createNewZindexTable=function(e){var t=new d;return this.pdfViewer.zIndex++,t.pageId=this.pdfViewer.zIndex,this.pdfViewer.zIndexTable.push(t),t},e.prototype.getPageTable=function(e){var t;if(void 0!==this.pdfViewer.zIndexTable.length){for(var i=!0,n=0;n<this.pdfViewer.zIndexTable.length;n++)if(this.pdfViewer.zIndexTable[parseInt(n.toString(),10)].pageId===e){i=!1,t=this.pdfViewer.zIndexTable[parseInt(n.toString(),10)];break}i&&((t=this.createNewZindexTable(e)).pageId=e)}else t=this.createNewZindexTable(e);return t},e.prototype.setZIndex=function(e,t){if(void 0!==t.pageIndex){var i=this.getPageTable(t.pageIndex),n=!1;if("Polygon"!==t.shapeAnnotationType)for(var o=0;o<i.objects.length;o++)if(t.id===i.objects[parseInt(o.toString(),10)].id){i.objects.splice(parseInt(o.toString(),10),1),i.objects.splice(parseInt(o.toString(),10),0,t),n=!0;break}if(!n)if(-1===t.zIndex)i.zIndex++,t.zIndex=i.zIndex,i.objects.push(t);else{var r=i.objects.length;t.zIndex=r++,i.objects.push(t)}}},e.prototype.initObject=function(e){return this.setZIndex(this.pdfViewer.zIndex,e),(0,i.createMeasureElements)(),c(e)?(this.initLine(e),e.wrapper.measure(new i.Size(void 0,void 0)),e.wrapper.arrange(e.wrapper.desiredSize)):this.initNode(e),e.wrapper,this.pdfViewer.nameTable[e.id]=e,e.formFieldAnnotationType&&this.nodePropertyChange(e,{bounds:{width:e.bounds.width,height:e.bounds.height}}),e},e.prototype.initNode=function(e){var t,n=this.initContainer(e);n.children||(n.children=[]),t||(t=this.init(e,n)),n.rotateAngle=e.rotateAngle,n.measure(new i.Size(e.wrapper.width,e.wrapper.height)),n.arrange(n.desiredSize),this.isDynamicStamps&&(this.pdfViewer.annotation.stampAnnotationModule.updateSessionStorage(e,null,"dynamicStamp"),this.isDynamicStamps=!1)},e.prototype.init=function(e,t){var n;n=new i.DrawingElement;var o=this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.findAnnotationSettings(e):{},r=0,a=0,s=0,l=0;(o.minWidth||o.maxWidth||o.minHeight||o.maxHeight)&&(r=o.maxHeight?o.maxHeight:2e3,a=o.maxWidth?o.maxWidth:2e3,s=o.minHeight?o.minHeight:0,l=o.minWidth?o.minWidth:0);var d=!1;return(s||l||r||a)&&(d=!0),(n=e.formFieldAnnotationType?this.initFormFields(e,n,t):this.initAnnotationObject(e,undefined,n,t,!1,undefined,d,r,a,l,s)).id=e.id+"_content",n.relativeMode="Object","Stamp"!==e.shapeAnnotationType&&(void 0!==e.bounds.width&&(n.width=e.bounds.width,d&&(n.width<l||n.width>a)&&(n.width<l&&(n.width=l),n.width>a&&(n.width=a))),n.horizontalAlignment="Stretch",void 0!==e.bounds.height&&(n.height=e.bounds.height,d&&(n.height<s||n.width>r)&&(n.height<s&&(n.height=s),n.height>r&&(n.height=r))),g(e,n),this.pdfViewer.viewerBase.drawSignatureWithTool&&"SignatureText"===e.shapeAnnotationType&&(n.style.strokeWidth=0)),n.isRectElement=!0,n.verticalAlignment="Stretch",n},e.prototype.initFormFields=function(e,t,i){switch(e.formFieldAnnotationType){case"Textbox":case"PasswordField":case"Checkbox":case"RadioButton":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":(t=new W).id=e.id+"_content",i.children.push(t)}return t},e.prototype.initAnnotationObject=function(e,t,n,o,r,a,s,l,d,h,A){switch(e.shapeAnnotationType){case"Ellipse":if((t=new i.PathElement).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",n=t,o.children.push(n),e.enableShapeLabel)(w=this.textElement(e)).content=e.labelContent,w.style.color=e.fontColor,w.style.strokeColor=e.labelBorderColor,w.style.fill=e.labelFillColor,w.style.fontSize=e.fontSize,w.style.fontFamily=e.fontFamily,w.style.opacity=e.labelOpacity,o.children.push(w);break;case"Path":(t=new i.PathElement).data=e.data,n=t,o.children.push(n);break;case"HandWrittenSignature":case"Ink":(t=new i.PathElement).data=e.data,t.style.strokeColor=e.strokeColor,t.style.strokeWidth=e.thickness,t.style.opacity=e.opacity,n=t,o.children.push(n);break;case"Polygon":(t=new i.PathElement).data=O(e.vertexPoints),n=t,o.children.push(n);break;case"Stamp":if(r=!0,this.isDynamicStamps=!0,e&&e.annotationAddMode&&("Existing Annotation"===e.annotationAddMode||"Imported Annotation"===e.annotationAddMode)&&(e.bounds.width=e.bounds.width-20,e.bounds.height=e.bounds.height-20),e.isDynamicStamp){o.horizontalAlignment="Left",(n=a=new i.DrawingElement).cornerRadius=10,n.style.fill=e.stampFillColor,n.style.strokeColor=e.stampStrokeColor,o.children.push(n);var p=this.textElement(e);(p=new i.TextElement).style.fontFamily="Helvetica",p.style.fontSize=14,p.style.italic=!0,p.style.bold=!0,p.style.color=e.fillColor,p.rotateValue=void 0,p.content=e.dynamicText,p.relativeMode="Point",p.margin.left=10,p.margin.bottom=-7,p.setOffsetWithRespectToBounds(0,.57,null),p.relativeMode="Point","Existing Annotation"!==e.annotationAddMode&&"Imported Annotation"!==e.annotationAddMode||(p.style.fontSize=this.fontSizeCalculation(e,p,e.bounds.width-10)),o.children.push(p),(f=new i.PathElement).id=(0,i.randomId)()+"_stamp",f.data=e.data,f.width=e.bounds.width,s&&e.bounds.width>d&&(f.width=d,e.bounds.width=d),f.height=e.bounds.height/2,s&&e.bounds.height>l&&(f.height=l/2,e.bounds.height=l/2),f.rotateValue=void 0,f.margin.left=10,f.margin.bottom=-5,f.relativeMode="Point",f.setOffsetWithRespectToBounds(0,.1,null);var c=f;f.style.fill=e.fillColor,f.style.strokeColor=e.strokeColor,f.style.opacity=e.opacity,n.width=e.bounds.width+20,n.height=e.bounds.height+20,n.style.opacity=e.opacity,o.children.push(c)}else{var f;o.horizontalAlignment="Left",(n=a=new i.DrawingElement).cornerRadius=10,n.style.fill=e.stampFillColor,n.style.strokeColor=e.stampStrokeColor,o.children.push(n),(f=new i.PathElement).id=(0,i.randomId)()+"_stamp",f.data=e.data,f.width=e.bounds.width,s&&e.bounds.width>d&&(f.width=d,e.bounds.width=d),f.height=e.bounds.height,s&&e.bounds.height>l&&(f.height=l,e.bounds.height=l),f.minWidth=f.width/2,f.minHeight=f.height/2;c=f;f.style.fill=e.fillColor,f.style.strokeColor=e.strokeColor,f.style.opacity=e.opacity,n.width=e.bounds.width+20,n.height=e.bounds.height+20,n.minWidth=f.width/2,n.minHeight=f.height/2,n.style.opacity=e.opacity,o.children.push(c),o.minHeight=n.minHeight+20,o.minWidth=n.minWidth+20}break;case"Image":case"SignatureImage":var m=new i.ImageElement;m.source=e.data,(n=m).style.strokeWidth=0,o.children.push(n);break;case"Rectangle":var w;if(n=a=new i.DrawingElement,o.children.push(n),e.enableShapeLabel)(w=this.textElement(e)).content=e.labelContent,w.style.color=e.fontColor,w.style.strokeColor=e.labelBorderColor,w.style.fill=e.labelFillColor,w.style.fontSize=e.fontSize,w.style.fontFamily=e.fontFamily,w.style.opacity=e.labelOpacity,o.children.push(w);break;case"Perimeter":(t=new i.PathElement).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",n=t,g(e,t),o.children.push(n),(a=new i.DrawingElement).id="perimeter_"+(0,i.randomId)(),a.height=.2,a.width=.2,a.transform=i.RotateTransform.Self,a.horizontalAlignment="Stretch",this.setNodePosition(a,e),a.rotateAngle=e.rotateAngle,g(e,a),o.children.push(a);p=this.textElement(e);(p=new i.TextElement).content=p.content=u([{x:e.bounds.x,y:e.bounds.y},{x:e.bounds.x+e.bounds.width,y:e.bounds.y+e.bounds.height}]).toString(),p.rotateValue={y:-10,angle:e.rotateAngle},o.children.push(p);break;case"Radius":(t=new i.PathElement).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",n=t,g(e,t),o.children.push(n),(a=new i.DrawingElement).id="radius_"+(0,i.randomId)(),a.height=.2,a.width=e.bounds.width/2,a.transform=i.RotateTransform.Self,this.setNodePosition(a,e),a.rotateAngle=e.rotateAngle,g(e,a),o.children.push(a);var y=this.textElement(e);e.enableShapeLabel&&(y.style.color=e.fontColor,y.style.strokeColor=e.labelBorderColor,y.style.fill=e.labelFillColor,y.style.fontSize=e.fontSize,y.style.fontFamily=e.fontFamily,y.style.opacity=e.labelOpacity);u([{x:e.bounds.x,y:e.bounds.y},{x:e.bounds.x+e.bounds.width,y:e.bounds.y+e.bounds.height}]);!this.pdfViewer.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?y.content=e.notes:y.content=this.pdfViewer.annotation.measureAnnotationModule.setConversion(e.bounds.width/2*this.pdfViewer.annotation.measureAnnotationModule.pixelToPointFactor,e),y.rotateValue={y:-10,x:e.bounds.width/4,angle:e.rotateAngle},o.children.push(y);break;case"StickyNotes":var S=new i.ImageElement;S.source=e.data,S.width=e.bounds.width,S.height=e.bounds.height,S.style.strokeColor=e.strokeColor,S.style.strokeWidth=0,n=S,o.children.push(n);break;case"SignatureText":var C=new i.DrawingElement;C.style.strokeWidth=0,(n=C).style.strokeWidth=0,o.style.strokeWidth=0,o.children.push(n);var B=this.textElement(e);B.style.fontFamily=e.fontFamily,B.style.fontSize=e.fontSize,B.style.textAlign="Left",B.rotateValue=void 0,B.content=e.data,B.style.strokeWidth=0,o.children.push(B);break;case"FreeText":n=new i.DrawingElement,o.children.push(n);var I=this.textElement(e);(I=new i.TextElement).style.fontFamily=e.fontFamily,I.style.fontSize=e.fontSize,I.style.textAlign="Left","center"===e.textAlign.toLowerCase()?I.style.textAlign="Center":"right"===e.textAlign.toLowerCase()?I.style.textAlign="Right":"justify"===e.textAlign.toLowerCase()&&(I.style.textAlign="Justify"),I.style.color=e.fontColor,I.style.bold=e.font.isBold,I.style.italic=e.font.isItalic,!0===e.font.isUnderline?I.style.textDecoration="Underline":!0===e.font.isStrikeout&&(I.style.textDecoration="LineThrough"),I.rotateValue=void 0,I.content=e.dynamicText,I.style.opacity=e.opacity,I.margin.left=4,I.margin.right=5,I.margin.top=e.fontSize/16*5,this.pdfViewer.freeTextSettings.enableAutoFit?I.style.textWrapping="Wrap":I.style.textWrapping="WrapWithOverflow",I.relativeMode="Point",I.setOffsetWithRespectToBounds(0,0,null),I.relativeMode="Point",o.children.push(I)}return n.id=e.id+"_content",n.relativeMode="Object",r||(void 0!==e.bounds.width&&(n.width=e.bounds.width,s&&(n.width<h||n.width>d)&&(n.width<h&&(n.width=h),n.width>d&&(n.width=d))),n.horizontalAlignment="Stretch",void 0!==e.bounds.height&&(n.height=e.bounds.height,s&&(n.height<A||n.width>l)&&(n.height<A&&(n.height=A),n.height>l&&(n.height=l))),g(e,n)),n.isRectElement=!0,n.verticalAlignment="Stretch",n},e.prototype.textElement=function(e){var t=new i.TextElement;return g(e,t),t.horizontalAlignment="Center",t.verticalAlignment="SignatureText"===e.shapeAnnotationType?"Center":"Top",t.relativeMode="Object",t.setOffsetWithRespectToBounds(.5,.5,"Absolute"),t},e.prototype.setNodePosition=function(e,t){if("Perimeter"===t.shapeAnnotationType)e.offsetX=t.bounds.x+t.bounds.width/2,e.offsetY=t.bounds.y+t.bounds.height/2;else if("Radius"===t.shapeAnnotationType){var n={x:t.bounds.x+t.bounds.width/2+t.bounds.width/4,y:t.bounds.y+t.bounds.height/2},o={x:t.bounds.x+t.bounds.width/2,y:t.bounds.y+t.bounds.height/2},r=(0,i.identityMatrix)();(0,i.rotateMatrix)(r,t.rotateAngle,o.x,o.y);var a=(0,i.transformPointByMatrix)(r,n),s={x:a.x,y:a.y};e.offsetX=s.x,e.offsetY=s.y,e.width=t.bounds.width/2}},e.prototype.initContainer=function(e){e.id||(e.id=(0,i.randomId)());var t=new i.Canvas;return t.id=e.id,t.offsetX=e.bounds.x+.5*e.bounds.width,t.offsetY=e.bounds.y+.5*e.bounds.height,t.style.fill="transparent",t.style.strokeColor="transparent",t.rotateAngle=e.rotateAngle,e.wrapper=t,t},e.prototype.initLine=function(e){e.id||(e.id=(0,i.randomId)());var t=new i.Canvas,n=new i.PathElement;n.id=e.id+"_path";var o=new i.PathElement,r=new i.PathElement;if(e.vertexPoints.length){e.sourcePoint=e.vertexPoints[0],e.targetPoint=e.vertexPoints[e.vertexPoints.length-1];for(var a=0;a<e.vertexPoints.length;a++)0!==a&&a!==e.vertexPoints.length-1&&e.segments.push(e.vertexPoints[parseInt(a.toString(),10)])}n=x(e,n);var s=[];s=v(e);var l=[],d=[];if("Distance"===e.shapeAnnotationType&&(l=z(e,s),d=F(e,s,this.pdfViewer.annotation.measureAnnotationModule,this.pdfViewer)),"Line"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType||"Perimeter"!==e.measureType||(d=P(e,s,this.pdfViewer.annotation.measureAnnotationModule,this.pdfViewer)),!0===e.enableShapeLabel&&"Distance"!==e.shapeAnnotationType&&"Perimeter"!==e.measureType){var h=i.Point.findAngle(s[0],s[1]),A=this.textElement(e);A.id=(0,i.randomId)(),!this.pdfViewer.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?A.content=e.notes:A.content=e.labelContent,A.style.strokeColor=e.labelBorderColor,A.style.fill=e.labelFillColor,A.style.fontSize=e.fontSize,A.style.color=e.fontColor,A.style.fontFamily=e.fontFamily,A.style.opacity=e.labelOpacity,A.rotateValue={y:-10,angle:h},d.push(A)}s=V(e,s);var p=i.Rect.toBounds(s);t.width=p.width,t.height=p.height,t.offsetX=p.x+t.pivot.x*p.width,t.offsetY=p.y+t.pivot.y*p.height;var c=e.vertexPoints;if("Line"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType&&"Distance"!==e.shapeAnnotationType||(o=M(e,s[0],c[1],!0),r=M(e,s[s.length-1],c[c.length-2],!1)),o.id=e.id+"_srcDec",r.id=e.id+"_tarDec",n.style.fill="transparent",t.style.strokeColor="transparent",t.style.fill="transparent",t.style.strokeWidth=0,t.children=[],g(e,n),t.children.push(n),l.length>0)for(a=0;a<l.length;a++)t.children.push(l[parseInt(a.toString(),10)]);if(d.length>0)for(a=0;a<d.length;a++)t.children.push(d[parseInt(a.toString(),10)]);if(t.children.push(o),t.children.push(r),"LineWidthArrowHead"===e.shapeAnnotationType)for(a=0;a<t.children.length;a++){var u=t.children[parseInt(a.toString(),10)];(u.id.includes("srcDec")||u.id.includes("tarDec"))&&(u.width=12*e.thickness,u.height=12*e.thickness)}return t.id=e.id,t.offsetX=n.offsetX,t.offsetY=n.offsetY,t.width=n.width,t.height=n.height,s=v(e),e.wrapper=t,t},e.prototype.add=function(e){var t=this.pdfViewer.allowServerDataBinding;return this.pdfViewer.enableServerDataBinding(!1),e.formFieldAnnotationType&&this.pdfViewer.formDesignerModule?(e=new l(this.pdfViewer,"formFields",e,!0),e=this.initObject(e),this.pdfViewer.formFields.push(e)):(e=new s(this.pdfViewer,"annotations",e,!0),e=this.initObject(e),this.pdfViewer.annotations.push(e)),this.pdfViewer.enableServerDataBinding(t,!0),e},e.prototype.remove=function(e){var i=this.pdfViewer.allowServerDataBinding;this.pdfViewer.enableServerDataBinding(!1);for(var n=e.pageIndex,o=0;o<this.pdfViewer.annotations.length;o++){var r=this.pdfViewer.annotations[parseInt(o.toString(),10)];if(r.id&&(r.id===e.id||r.id.split("_")[0]===e.id)||r.wrapper&&r.wrapper.id===e.id){this.pdfViewer.annotations.splice(o,1);for(var a=this.getPageObjects(e.pageIndex),s=0;s<a.length;s++)a[parseInt(s.toString(),10)].id===e.id&&(a.splice(s,1),"Path"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType?this.refreshCanvasDiagramLayer(void 0,n,e.id):this.pdfViewer.renderDrawing(void 0,n))}}for(o=0;o<this.pdfViewer.formFields.length;o++){if((d=this.pdfViewer.formFields[parseInt(o.toString(),10)]).id===e.id||d.wrapper.id===e.id){this.pdfViewer.formFields.splice(o,1),this.pdfViewer.formDesignerModule&&e.formFieldAnnotationType&&this.pdfViewer.formFieldCollection.splice(o,1);for(a=this.getPageObjects(e.pageIndex),s=0;s<a.length;s++){if(a[parseInt(s.toString(),10)].id===e.id){a.splice(s,1);break}a[parseInt(s.toString(),10)]&&a[parseInt(s.toString(),10)].id&&-1!==a[parseInt(s.toString(),10)].id.indexOf(e.id)&&a.splice(s,1)}}}if("Textbox"===e.formFieldAnnotationType||"Checkbox"===e.formFieldAnnotationType||"RadioButton"===e.formFieldAnnotationType||"PasswordField"===e.formFieldAnnotationType||"DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType||"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType){var l=document.getElementById("form_field_"+e.id+"_content_html_element");l&&(l.remove(),this.pdfViewer.renderDrawing(void 0,n));for(o=0;o<this.pdfViewer.formFieldCollections.length;o++){var d;(d=this.pdfViewer.formFieldCollections[parseInt(o.toString(),10)]).id===e.id&&this.pdfViewer.formFieldCollections.splice(o,1)}for(o=0;o<this.pdfViewer.viewerBase.formFieldCollection.length;o++)e.id==this.pdfViewer.viewerBase.formFieldCollection[parseInt(o.toString(),10)]&&this.pdfViewer.viewerBase.formFieldCollection.splice(o,1);var h={name:e.name,id:e.id,value:e.value,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,alignment:e.alignment,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:e.rotateAngle,tooltip:e.tooltip,options:e.options,isChecked:e.isChecked,isSelected:e.isSelected};(0,t.isNullOrUndefined)(h)||"diagram_helper"===h.id||(this.pdfViewer.fireFormFieldRemoveEvent("formFieldRemove",h,e.pageIndex),this.pdfViewer.formDesignerModule.removeFieldsFromAnnotationCollections(e.id,h.name))}this.pdfViewer.enableServerDataBinding(i,!0)},e.prototype.getPageObjects=function(e){return this.getPageTable(e).objects},e.prototype.refreshCanvasDiagramLayer=function(e,n,o){var r=this;if(e||(e=this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",n)),e){var a=void 0;a=e.id===this.pdfViewer.element.id+"_print_annotation_layer_"+n?1:this.pdfViewer.viewerBase.getZoomFactor();var s=e.width/a,l=e.height/a,d=e.getContext("2d");d.lineCap="round",d.lineJoin="round",a<1&&(d.lineWidth=d.lineWidth/a);var h=a*this.pdfViewer.viewerBase.getWindowDevicePixelRatio();!t.Browser.isDevice||t.Browser.isDevice&&a<=.7?d.setTransform(h,0,0,h,0,0):d.setTransform(a,0,0,a,0,0),d.clearRect(0,0,s,l);for(var A=this.getPageObjects(n).filter((function(e,i,n){return"free"===e.id.split("_")[0]||((0,t.isNullOrUndefined)(r.pdfViewer.formDesignerModule)?i===n.findIndex((function(t){return t.id===e.id})):i===n.findIndex((function(t){return t.id.split("_")[0]===e.id.split("_")[0]})))})),p=0;p<A.length;p++){var c=void 0;if(e.id===this.pdfViewer.element.id+"_print_annotation_layer_"+n)A[parseInt(p.toString(),10)].isPrint&&(c=this.pdfViewer.nameTable[A[parseInt(p.toString(),10)].id].wrapper,(0,t.isNullOrUndefined)(c)||(0,i.refreshDiagramElements)(e,[c],this.renderer));else{c=this.pdfViewer.nameTable[A[parseInt(p.toString(),10)].id].wrapper;var g=A[parseInt(p.toString(),10)].id,u=this.pdfViewer.nameTable[""+g];if(c&&this.shouldRefreshElement(u)||(0,t.isNullOrUndefined)(this.pdfViewer.formDesignerModule)){if(!(0,t.isNullOrUndefined)(u.properties.data)&&u.properties.data.includes("base64")){var f=new Image;f.src=u.properties.data,null==window.customStampCollection&&void 0===window.customStampCollection&&(window.customStampCollection=new Map),window.customStampCollection&&!window.customStampCollection.get(c.id)&&window.customStampCollection.set(c.id,f)}(0,i.refreshDiagramElements)(e,[c],this.renderer)}}}}},e.prototype.shouldRefreshElement=function(e){var i=this.pdfViewer.nameTable[e.id.split("_")[0]];return!(0,t.isNullOrUndefined)(i)&&"visible"===e.visibility||!(0,t.isNullOrUndefined)(e.subject)&&"SignatureField"!==e.annotName&&(0,t.isNullOrUndefined)(e.visibility)||"annotations"===e.propName&&"Path"!==e.shapeAnnotationType&&"SignatureText"!==e.shapeAnnotationType&&"SignatureImage"!==e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType&&"formFields"!==e.propName||"SignatureText"===e.shapeAnnotationType&&"formFields"!==e.propName||(0,t.isNullOrUndefined)(i)&&"diagram_helper"===e.id},e.prototype.clearHighlighter=function(e){var t=this.getAdornerLayerSvg(this.pdfViewer.element.id+e+"_diagramAdornerLayer",e);if(t){var i=t.getElementById(t.id+"_highlighter");i&&i.parentNode.removeChild(i)}},e.prototype.getSelectorElement=function(e,t){var i=null,n=this.getAdornerLayerSvg(e,t);return n&&(i=n.getElementById(e+t+"_SelectorElement")),i},e.prototype.getAdornerLayerSvg=function(e,t){var n=null,o=(0,i.getDiagramElement)(e+t+"_diagramAdornerLayer");return o&&(n=o.getElementsByClassName("e-adorner-layer"+t)[0]),n},e.prototype.clearSelectorLayer=functio