"use strict";(self.webpackChunkstudio_client=self.webpackChunkstudio_client||[]).push([[483],{1749(t,e,o){o.d(e,{CM:()=>a,Qh:()=>l,T7:()=>d,ZP:()=>h,b5:()=>g,fS:()=>f,zN:()=>p});var r,i=o(7448),n=o(2714);!function(t){t.Grayscale="Grayscale",t.RGB="RGB",t.CMYK="CMYK"}(r||(r={}));var a=function(t){return(0,n.Qb)(t,"gray",0,1),{type:r.Grayscale,gray:t}},l=function(t,e,o){return(0,n.Qb)(t,"red",0,1),(0,n.Qb)(e,"green",0,1),(0,n.Qb)(o,"blue",0,1),{type:r.RGB,red:t,green:e,blue:o}},d=function(t,e,o,i){return(0,n.Qb)(t,"cyan",0,1),(0,n.Qb)(e,"magenta",0,1),(0,n.Qb)(o,"yellow",0,1),(0,n.Qb)(i,"key",0,1),{type:r.CMYK,cyan:t,magenta:e,yellow:o,key:i}},s=r.Grayscale,c=r.RGB,u=r.CMYK,p=function(t){return t.type===s?(0,i.Cq)(t.gray):t.type===c?(0,i._u)(t.red,t.green,t.blue):t.type===u?(0,i.J2)(t.cyan,t.magenta,t.yellow,t.key):(0,n.z3)("Invalid color: "+JSON.stringify(t))},h=function(t){return t.type===s?(0,i.U4)(t.gray):t.type===c?(0,i.Ie)(t.red,t.green,t.blue):t.type===u?(0,i.FP)(t.cyan,t.magenta,t.yellow,t.key):(0,n.z3)("Invalid color: "+JSON.stringify(t))},f=function(t,e){return void 0===e&&(e=1),1===(null==t?void 0:t.length)?a(t[0]*e):3===(null==t?void 0:t.length)?l(t[0]*e,t[1]*e,t[2]*e):4===(null==t?void 0:t.length)?d(t[0]*e,t[1]*e,t[2]*e,t[3]*e):void 0},g=function(t){return t.type===s?[t.gray]:t.type===c?[t.red,t.green,t.blue]:t.type===u?[t.cyan,t.magenta,t.yellow,t.key]:(0,n.z3)("Invalid color: "+JSON.stringify(t))}},5182(t,e,o){o.d(e,{A:()=>h,BY:()=>c,KI:()=>f,OY:()=>l,ZT:()=>i,eW:()=>g,iB:()=>a,k0:()=>p,or:()=>s,vs:()=>d,wT:()=>u,xC:()=>n});var r=o(5890),i=function(t){function e(){return t.call(this,"Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.")||this}return(0,r.C6)(e,t),e}(Error),n=function(t){function e(){return t.call(this,"Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.")||this}return(0,r.C6)(e,t),e}(Error),a=function(t){function e(){return t.call(this,"A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.")||this}return(0,r.C6)(e,t),e}(Error),l=function(t){function e(){return t.call(this,"PDFDocument has no pages so `PDFDocument.removePage` cannot be called")||this}return(0,r.C6)(e,t),e}(Error),d=function(t){function e(e){var o='PDFDocument has no form field with the name "'+e+'"';return t.call(this,o)||this}return(0,r.C6)(e,t),e}(Error),s=function(t){function e(e,o,r){var i,n,a='Expected field "'+e+'" to be of type '+(null==o?void 0:o.name)+", but it is actually of type "+(null!==(n=null===(i=null==r?void 0:r.constructor)||void 0===i?void 0:i.name)&&void 0!==n?n:r);return t.call(this,a)||this}return(0,r.C6)(e,t),e}(Error),c=(function(t){function e(e){var o='Failed to select check box due to missing onValue: "'+e+'"';return t.call(this,o)||this}(0,r.C6)(e,t)}(Error),function(t){function e(e){var o='A field already exists with the specified name: "'+e+'"';return t.call(this,o)||this}return(0,r.C6)(e,t),e}(Error)),u=function(t){function e(e){var o='Field name contains invalid component: "'+e+'"';return t.call(this,o)||this}return(0,r.C6)(e,t),e}(Error),p=(function(t){function e(e){var o='A non-terminal field already exists with the specified name: "'+e+'"';return t.call(this,o)||this}(0,r.C6)(e,t)}(Error),function(t){function e(e){var o="Reading rich text fields is not supported: Attempted to read rich text field: "+e;return t.call(this,o)||this}return(0,r.C6)(e,t),e}(Error)),h=function(t){function e(e,o){var r="Failed to layout combed text as lineLength="+e+" is greater than cellCount="+o;return t.call(this,r)||this}return(0,r.C6)(e,t),e}(Error),f=function(t){function e(e,o,r){var i="Attempted to set text with length="+e+" for TextField with maxLength="+o+" and name="+r;return t.call(this,i)||this}return(0,r.C6)(e,t),e}(Error),g=function(t){function e(e,o,r){var i="Attempted to set maxLength="+o+", which is less than "+e+", the length of this field's current value (name="+r+")";return t.call(this,i)||this}return(0,r.C6)(e,t),e}(Error)},398(t,e,o){o.d(e,{A:()=>h});var r=o(5890),i=o(9488),n=o(7134),a=o(7334),l=o(9007),d=o(5304),s=o(1749),c=o(7562),u=o(6501),p=o(2714);const h=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,p.jo)(e,"acroButton",[[u.OR,"PDFAcroPushButton"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.setImage=function(t,e){void 0===e&&(e=a.n.Center);for(var o=this.acroField.getWidgets(),r=0,i=o.length;ru});var r=o(5890),i=o(9488),n=o(9007),a=o(1749),l=o(7562),d=o(5304),s=o(6501),c=o(2714);const u=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,c.jo)(e,"acroCheckBox",[[s.RL,"PDFAcroCheckBox"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.check=function(){var t,e=null!==(t=this.acroField.getOnValue())&&void 0!==t?t:s.S5.of("Yes");this.markAsDirty(),this.acroField.setValue(e)},e.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(s.S5.of("Off"))},e.prototype.isChecked=function(){var t=this.acroField.getOnValue();return!!t&&t===this.acroField.getValue()},e.prototype.addToPage=function(t,e){var o,r,n,u,p,h;(0,c.jo)(t,"page",[[i.A,"PDFPage"]]),(0,d.B)(e),e||(e={}),"textColor"in e||(e.textColor=(0,a.Qh)(0,0,0)),"backgroundColor"in e||(e.backgroundColor=(0,a.Qh)(1,1,1)),"borderColor"in e||(e.borderColor=(0,a.Qh)(0,0,0)),"borderWidth"in e||(e.borderWidth=1);var f=this.createWidget({x:null!==(o=e.x)&&void 0!==o?o:0,y:null!==(r=e.y)&&void 0!==r?r:0,width:null!==(n=e.width)&&void 0!==n?n:50,height:null!==(u=e.height)&&void 0!==u?u:50,textColor:e.textColor,backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:null!==(p=e.borderWidth)&&void 0!==p?p:0,rotate:null!==(h=e.rotate)&&void 0!==h?h:(0,l.uj)(0),hidden:e.hidden,page:t.ref}),g=this.doc.context.register(f.dict);this.acroField.addWidget(g),f.setAppearanceState(s.S5.of("Off")),this.updateWidgetAppearance(f,s.S5.of("Yes")),t.node.addAnnot(g)},e.prototype.needsAppearancesUpdate=function(){for(var t,e=this.acroField.getWidgets(),o=0,r=e.length;op});var r=o(5890),i=o(9488),n=o(7134),a=o(5304),l=o(9007),d=o(1749),s=o(7562),c=o(6501),u=o(2714);const p=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,u.jo)(e,"acroComboBox",[[c.Bi,"PDFAcroComboBox"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.getOptions=function(){for(var t=this.acroField.getOptions(),e=new Array(t.length),o=0,r=e.length;o1||1===o.length&&e)&&this.enableMultiselect();for(var i=new Array(o.length),n=0,a=o.length;np,B:()=>u});var r=o(5890),i=o(394),n=o(1749),a=o(7562),l=o(6501),d=o(2714),s=o(6659),c=o(5091),u=function(t){(0,d.wU)(null==t?void 0:t.x,"options.x",["number"]),(0,d.wU)(null==t?void 0:t.y,"options.y",["number"]),(0,d.wU)(null==t?void 0:t.width,"options.width",["number"]),(0,d.wU)(null==t?void 0:t.height,"options.height",["number"]),(0,d.wU)(null==t?void 0:t.textColor,"options.textColor",[[Object,"Color"]]),(0,d.wU)(null==t?void 0:t.backgroundColor,"options.backgroundColor",[[Object,"Color"]]),(0,d.wU)(null==t?void 0:t.borderColor,"options.borderColor",[[Object,"Color"]]),(0,d.wU)(null==t?void 0:t.borderWidth,"options.borderWidth",["number"]),(0,d.wU)(null==t?void 0:t.rotate,"options.rotate",[[Object,"Rotation"]])};const p=function(){function t(t,e,o){(0,d.jo)(t,"acroField",[[l.AC,"PDFAcroTerminal"]]),(0,d.jo)(e,"ref",[[l.so,"PDFRef"]]),(0,d.jo)(o,"doc",[[i.A,"PDFDocument"]]),this.acroField=t,this.ref=e,this.doc=o}return t.prototype.getName=function(){var t;return null!==(t=this.acroField.getFullyQualifiedName())&&void 0!==t?t:""},t.prototype.isReadOnly=function(){return this.acroField.hasFlag(l.Zo.ReadOnly)},t.prototype.enableReadOnly=function(){this.acroField.setFlagTo(l.Zo.ReadOnly,!0)},t.prototype.disableReadOnly=function(){this.acroField.setFlagTo(l.Zo.ReadOnly,!1)},t.prototype.isRequired=function(){return this.acroField.hasFlag(l.Zo.Required)},t.prototype.enableRequired=function(){this.acroField.setFlagTo(l.Zo.Required,!0)},t.prototype.disableRequired=function(){this.acroField.setFlagTo(l.Zo.Required,!1)},t.prototype.isExported=function(){return!this.acroField.hasFlag(l.Zo.NoExport)},t.prototype.enableExporting=function(){this.acroField.setFlagTo(l.Zo.NoExport,!1)},t.prototype.disableExporting=function(){this.acroField.setFlagTo(l.Zo.NoExport,!0)},t.prototype.needsAppearancesUpdate=function(){throw new l.ju(this.constructor.name,"needsAppearancesUpdate")},t.prototype.defaultUpdateAppearances=function(t){throw new l.ju(this.constructor.name,"defaultUpdateAppearances")},t.prototype.markAsDirty=function(){this.doc.getForm().markFieldAsDirty(this.ref)},t.prototype.markAsClean=function(){this.doc.getForm().markFieldAsClean(this.ref)},t.prototype.isDirty=function(){return this.doc.getForm().fieldIsDirty(this.ref)},t.prototype.createWidget=function(t){var e,o=t.textColor,r=t.backgroundColor,i=t.borderColor,s=t.borderWidth,c=(0,a.xW)(t.rotate),u=t.caption,p=t.x,h=t.y,f=t.width+s,g=t.height+s,F=Boolean(t.hidden),v=t.page;(0,d.vW)(c,"degreesAngle",90);var y=l.Ml.create(this.doc.context,this.ref),m=(0,a.P8)({x:p,y:h,width:f,height:g},s,c);y.setRectangle(m),v&&y.setP(v);var A=y.getOrCreateAppearanceCharacteristics();r&&A.setBackgroundColor((0,n.b5)(r)),A.setRotation(c),u&&A.setCaptions({normal:u}),i&&A.setBorderColor((0,n.b5)(i));var b=y.getOrCreateBorderStyle();if(void 0!==s&&b.setWidth(s),y.setFlagTo(l.bO.Print,!0),y.setFlagTo(l.bO.Hidden,F),y.setFlagTo(l.bO.Invisible,!1),o){var C=(null!==(e=this.acroField.getDefaultAppearance())&&void 0!==e?e:"")+"\n"+(0,n.zN)(o).toString();this.acroField.setDefaultAppearance(C)}return y},t.prototype.updateWidgetAppearanceWithFont=function(t,e,o){var r=o.normal,i=o.rollover,n=o.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceStream(t,r,e),rollover:i&&this.createAppearanceStream(t,i,e),down:n&&this.createAppearanceStream(t,n,e)})},t.prototype.updateOnOffWidgetAppearance=function(t,e,o){var r=o.normal,i=o.rollover,n=o.down;this.updateWidgetAppearances(t,{normal:this.createAppearanceDict(t,r,e),rollover:i&&this.createAppearanceDict(t,i,e),down:n&&this.createAppearanceDict(t,n,e)})},t.prototype.updateWidgetAppearances=function(t,e){var o=e.normal,r=e.rollover,i=e.down;t.setNormalAppearance(o),r?t.setRolloverAppearance(r):t.removeRolloverAppearance(),i?t.setDownAppearance(i):t.removeDownAppearance()},t.prototype.createAppearanceStream=function(t,e,o){var r,i=this.acroField.dict.context,n=t.getRectangle(),a=n.width,l=n.height,d=o&&{Font:(r={},r[o.name]=o.ref,r)},s=i.formXObject(e,{Resources:d,BBox:i.obj([0,0,a,l]),Matrix:i.obj([1,0,0,1,0,0])});return i.register(s)},t.prototype.createImageAppearanceStream=function(t,e,o){var i,n,l=this.acroField.dict.context,d=t.getRectangle(),u=t.getAppearanceCharacteristics(),p=t.getBorderStyle(),h=null!==(n=null==p?void 0:p.getWidth())&&void 0!==n?n:0,f=(0,a.du)(null==u?void 0:u.getRotation()),g=(0,c.Il)((0,r.Cl)((0,r.Cl)({},d),{rotation:f})),F=(0,a.S3)(d,f),v=e.scaleToFit(F.width-2*h,F.height-2*h),y={x:h,y:h,width:v.width,height:v.height,rotate:(0,a.uj)(0),xSkew:(0,a.uj)(0),ySkew:(0,a.uj)(0)};o===s.n.Center?(y.x+=(F.width-2*h)/2-v.width/2,y.y+=(F.height-2*h)/2-v.height/2):o===s.n.Right&&(y.x=F.width-h-v.width,y.y=F.height-h-v.height);var m=this.doc.context.addRandomSuffix("Image",10),A=(0,r.aN)(g,(0,c.aC)(m,y)),b={XObject:(i={},i[m]=e.ref,i)},C=l.formXObject(A,{Resources:b,BBox:l.obj([0,0,d.width,d.height]),Matrix:l.obj([1,0,0,1,0,0])});return l.register(C)},t.prototype.createAppearanceDict=function(t,e,o){var r=this.acroField.dict.context,i=this.createAppearanceStream(t,e.on),n=this.createAppearanceStream(t,e.off),a=r.obj({});return a.set(o,i),a.set(l.S5.of("Off"),n),a},t}()},9896(t,e,o){o.d(e,{A:()=>m});var r=o(5890),i=o(394),n=o(398),a=o(3835),l=o(859),d=o(3063),s=o(8120),c=o(9474),u=o(6785),p=o(5182),h=o(7134),f=o(8256),g=o(5091),F=o(7448),v=o(6501),y=o(2714);const m=function(){function t(t,e){var o=this;this.embedDefaultFont=function(){return o.doc.embedStandardFont(f.q.Helvetica)},(0,y.jo)(t,"acroForm",[[v.In,"PDFAcroForm"]]),(0,y.jo)(e,"doc",[[i.A,"PDFDocument"]]),this.acroForm=t,this.doc=e,this.dirtyFields=new Set,this.defaultFontCache=y.l2.populatedBy(this.embedDefaultFont)}return t.prototype.hasXFA=function(){return this.acroForm.dict.has(v.S5.of("XFA"))},t.prototype.deleteXFA=function(){this.acroForm.dict.delete(v.S5.of("XFA"))},t.prototype.getFields=function(){for(var t=this.acroForm.getAllFields(),e=[],o=0,r=t.length;op});var r=o(5890),i=o(9488),n=o(7134),a=o(5304),l=o(9007),d=o(1749),s=o(7562),c=o(6501),u=o(2714);const p=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,u.jo)(e,"acroListBox",[[c.ld,"PDFAcroListBox"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.getOptions=function(){for(var t=this.acroField.getOptions(),e=new Array(t.length),o=0,r=e.length;o1||1===o.length&&e)&&this.enableMultiselect();for(var i=new Array(o.length),n=0,a=o.length;nu});var r=o(5890),i=o(9488),n=o(5304),a=o(9007),l=o(1749),d=o(7562),s=o(6501),c=o(2714);const u=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,c.jo)(e,"acroRadioButton",[[s.b$,"PDFAcroRadioButton"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.getOptions=function(){var t=this.acroField.getExportValues();if(t){for(var e=new Array(t.length),o=0,r=t.length;ol});var r=o(5890),i=o(5304),n=o(6501),a=o(2714);const l=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,a.jo)(e,"acroSignature",[[n.oz,"PDFAcroSignature"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.needsAppearancesUpdate=function(){return!1},e.of=function(t,o,r){return new e(t,o,r)},e}(i.A)},6785(t,e,o){o.d(e,{A:()=>g});var r=o(5890),i=o(9488),n=o(7134),a=o(5304),l=o(9007),d=o(1749),s=o(7562),c=o(5182),u=o(7334),p=o(772),h=o(6501),f=o(2714);const g=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return(0,f.jo)(e,"acroText",[[h.BM,"PDFAcroText"]]),i.acroField=e,i}return(0,r.C6)(e,t),e.prototype.getText=function(){var t=this.acroField.getValue();if(!t&&this.isRichFormatted())throw new c.k0(this.getName());return null==t?void 0:t.decodeText()},e.prototype.setText=function(t){(0,f.wU)(t,"text",["string"]);var e=this.getMaxLength();if(void 0!==e&&t&&t.length>e)throw new c.KI(t.length,e,this.getName());this.markAsDirty(),this.disableRichFormatting(),t?this.acroField.setValue(h.lv.fromText(t)):this.acroField.removeValue()},e.prototype.getAlignment=function(){var t=this.acroField.getQuadding();return 0===t?p.D.Left:1===t?p.D.Center:2===t?p.D.Right:p.D.Left},e.prototype.setAlignment=function(t){(0,f.Co)(t,"alignment",p.D),this.markAsDirty(),this.acroField.setQuadding(t)},e.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},e.prototype.setMaxLength=function(t){if((0,f.Dw)(t,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),void 0===t)this.acroField.removeMaxLength();else{var e=this.getText();if(e&&e.length>t)throw new c.eW(e.length,t,this.getName());this.acroField.setMaxLength(t)}},e.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},e.prototype.setImage=function(t){for(var e=this.getAlignment(),o=e===p.D.Center?u.n.Center:e===p.D.Right?u.n.Right:u.n.Left,r=this.acroField.getWidgets(),i=0,n=r.length;i