liberty-framework 6.0.54__py3-none-any.whl → 6.0.59__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. app/public/frontend/assets/{index-BEQMJlHa.js → index-HlYGfx6q.js} +4 -4
  2. app/public/frontend/assets/{index-BEQMJlHa.js.map → index-HlYGfx6q.js.map} +1 -1
  3. app/public/frontend/assets/{index.es-mB7ZF8OM-DnpXL3xF.js → index.es-mB7ZF8OM-f6QJp5B4.js} +2 -2
  4. app/public/frontend/assets/index.es-mB7ZF8OM-f6QJp5B4.js.map +1 -0
  5. app/public/frontend/assets/{purify.es-CKk_t3XZ-CB-r1fqE.js → purify.es-CKk_t3XZ-DHuNJQNB.js} +3 -3
  6. app/public/frontend/assets/purify.es-CKk_t3XZ-DHuNJQNB.js.map +1 -0
  7. app/public/frontend/index.html +1 -1
  8. app/public/setup/index.html +1 -1
  9. app/public/setup/setup/assets/index-knz6QXph.js +205 -0
  10. app/public/setup/setup/assets/index-knz6QXph.js.map +1 -0
  11. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/METADATA +9 -8
  12. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/RECORD +16 -16
  13. app/public/frontend/assets/index.es-mB7ZF8OM-DnpXL3xF.js.map +0 -1
  14. app/public/frontend/assets/purify.es-CKk_t3XZ-CB-r1fqE.js.map +0 -1
  15. app/public/setup/setup/assets/index-BnpY-7P6.js +0 -196
  16. app/public/setup/setup/assets/index-BnpY-7P6.js.map +0 -1
  17. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/LICENSE +0 -0
  18. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/WHEEL +0 -0
  19. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/entry_points.txt +0 -0
  20. {liberty_framework-6.0.54.dist-info → liberty_framework-6.0.59.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="55a77444-40ce-4b34-ad6d-dfdf5438d35c",e._sentryDebugIdIdentifier="sentry-dbid-55a77444-40ce-4b34-ad6d-dfdf5438d35c")}catch{}{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"5b64bb3f053142df880c01ebb82ae006864bbcf8"}}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function eB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f_={exports:{}},By={};/**
1
+ try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="42f8de04-0cc7-4294-837c-5a7e3672fb18",e._sentryDebugIdIdentifier="sentry-dbid-42f8de04-0cc7-4294-837c-5a7e3672fb18")}catch{}{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"46831f2e911064b17d154db10e03a1131d739e35"}}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function eB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f_={exports:{}},By={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -557,7 +557,7 @@ T* `):ne.join(` Tj
557
557
  `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:fr.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=fr.RadioButton.Cross.YesNormal,t.D[e]=fr.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Gu(e);t.scope=e.scope;var r=[],n=fr.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+on(fr.internal.getWidth(e)-2)+" "+on(fr.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(on(n.x1.x)+" "+on(n.x1.y)+" m"),r.push(on(n.x2.x)+" "+on(n.x2.y)+" l"),r.push(on(n.x4.x)+" "+on(n.x4.y)+" m"),r.push(on(n.x3.x)+" "+on(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
558
558
  `),t},YesPushDown:function(e){var t=Gu(e);t.scope=e.scope;var r=fr.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+on(fr.internal.getWidth(e))+" "+on(fr.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+on(fr.internal.getWidth(e)-2)+" "+on(fr.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(on(r.x1.x)+" "+on(r.x1.y)+" m"),n.push(on(r.x2.x)+" "+on(r.x2.y)+" l"),n.push(on(r.x4.x)+" "+on(r.x4.y)+" m"),n.push(on(r.x3.x)+" "+on(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
559
559
  `),t},OffPushDown:function(e){var t=Gu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+on(fr.internal.getWidth(e))+" "+on(fr.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
560
- `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};fr.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=fr.internal.getWidth(e),r=fr.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},fr.internal.getWidth=function(e){var t=0;return Jn(e)==="object"&&(t=tU(e.Rect[2])),t},fr.internal.getHeight=function(e){var t=0;return Jn(e)==="object"&&(t=tU(e.Rect[3])),t};var JEe=wo.addField=function(e){if(ZEe(this,e),!(e instanceof hu))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};wo.AcroFormChoiceField=KA,wo.AcroFormListBox=GA,wo.AcroFormComboBox=$A,wo.AcroFormEditBox=Q0,wo.AcroFormButton=ta,wo.AcroFormPushButton=H0,wo.AcroFormRadioButton=WA,wo.AcroFormCheckBox=z0,wo.AcroFormTextField=hp,wo.AcroFormPasswordField=V0,wo.AcroFormAppearance=fr,wo.AcroForm={ChoiceField:KA,ListBox:GA,ComboBox:$A,EditBox:Q0,Button:ta,PushButton:H0,RadioButton:WA,CheckBox:z0,TextField:hp,PasswordField:V0,Appearance:fr},Ir.AcroForm={ChoiceField:KA,ListBox:GA,ComboBox:$A,EditBox:Q0,Button:ta,PushButton:H0,RadioButton:WA,CheckBox:z0,TextField:hp,PasswordField:V0,Appearance:fr};var eMe=Ir.AcroForm;function s$(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){e.__addimage__={};var t="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(Q,N){var R,P,T,x,_,k=t;if((N=N||t)==="RGBA"||Q.data!==void 0&&Q.data instanceof Uint8ClampedArray&&"height"in Q&&"width"in Q)return"RGBA";if(E(Q))for(_ in r)for(T=r[_],R=0;R<T.length;R+=1){for(x=!0,P=0;P<T[R].length;P+=1)if(T[R][P]!==void 0&&T[R][P]!==Q[P]){x=!1;break}if(x===!0){k=_;break}}else for(_ in r)for(T=r[_],R=0;R<T.length;R+=1){for(x=!0,P=0;P<T[R].length;P+=1)if(T[R][P]!==void 0&&T[R][P]!==Q.charCodeAt(P)){x=!1;break}if(x===!0){k=_;break}}return k===t&&N!==t&&(k=N),k},i=function Q(N){for(var R=this.internal.write,P=this.internal.putStream,T=(0,this.internal.getFilters)();T.indexOf("FlateEncode")!==-1;)T.splice(T.indexOf("FlateEncode"),1);N.objectId=this.internal.newObject();var x=[];if(x.push({key:"Type",value:"/XObject"}),x.push({key:"Subtype",value:"/Image"}),x.push({key:"Width",value:N.width}),x.push({key:"Height",value:N.height}),N.colorSpace===A.INDEXED?x.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(N.palette.length/3-1)+" "+("sMask"in N&&N.sMask!==void 0?N.objectId+2:N.objectId+1)+" 0 R]"}):(x.push({key:"ColorSpace",value:"/"+N.colorSpace}),N.colorSpace===A.DEVICE_CMYK&&x.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),x.push({key:"BitsPerComponent",value:N.bitsPerComponent}),"decodeParameters"in N&&N.decodeParameters!==void 0&&x.push({key:"DecodeParms",value:"<<"+N.decodeParameters+">>"}),"transparency"in N&&Array.isArray(N.transparency)){for(var _="",k=0,B=N.transparency.length;k<B;k++)_+=N.transparency[k]+" "+N.transparency[k]+" ";x.push({key:"Mask",value:"["+_+"]"})}N.sMask!==void 0&&x.push({key:"SMask",value:N.objectId+1+" 0 R"});var F=N.filter!==void 0?["/"+N.filter]:void 0;if(P({data:N.data,additionalKeyValues:x,alreadyAppliedFilters:F,objectId:N.objectId}),R("endobj"),"sMask"in N&&N.sMask!==void 0){var K="/Predictor "+N.predictor+" /Colors 1 /BitsPerComponent "+N.bitsPerComponent+" /Columns "+N.width,L={width:N.width,height:N.height,colorSpace:"DeviceGray",bitsPerComponent:N.bitsPerComponent,decodeParameters:K,data:N.sMask};"filter"in N&&(L.filter=N.filter),Q.call(this,L)}if(N.colorSpace===A.INDEXED){var z=this.internal.newObject();P({data:D(new Uint8Array(N.palette)),objectId:z}),R("endobj")}},o=function(){var Q=this.internal.collections.addImage_images;for(var N in Q)i.call(this,Q[N])},a=function(){var Q,N=this.internal.collections.addImage_images,R=this.internal.write;for(var P in N)R("/I"+(Q=N[P]).index,Q.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",a))},l=function(){var Q=this.internal.collections.addImage_images;return s.call(this),Q},c=function(){return Object.keys(this.internal.collections.addImage_images).length},u=function(Q){return typeof e["process"+Q.toUpperCase()]=="function"},d=function(Q){return Jn(Q)==="object"&&Q.nodeType===1},h=function(Q,N){if(Q.nodeName==="IMG"&&Q.hasAttribute("src")){var R=""+Q.getAttribute("src");if(R.indexOf("data:image/")===0)return j0(unescape(R).split("base64,").pop());var P=e.loadFile(R,!0);if(P!==void 0)return P}if(Q.nodeName==="CANVAS"){if(Q.width===0||Q.height===0)throw new Error("Given canvas must have data. Canvas width: "+Q.width+", height: "+Q.height);var T;switch(N){case"PNG":T="image/png";break;case"WEBP":T="image/webp";break;case"JPEG":case"JPG":default:T="image/jpeg"}return j0(Q.toDataURL(T,1).split("base64,").pop())}},f=function(Q){var N=this.internal.collections.addImage_images;if(N){for(var R in N)if(Q===N[R].alias)return N[R]}},p=function(Q,N,R){return Q||N||(Q=-96,N=-96),Q<0&&(Q=-1*R.width*72/Q/this.internal.scaleFactor),N<0&&(N=-1*R.height*72/N/this.internal.scaleFactor),Q===0&&(Q=N*R.width/R.height),N===0&&(N=Q*R.height/R.width),[Q,N]},g=function(Q,N,R,P,T,x){var _=p.call(this,R,P,T),k=this.internal.getCoordinateString,B=this.internal.getVerticalCoordinateString,F=l.call(this);if(R=_[0],P=_[1],F[T.index]=T,x){x*=Math.PI/180;var K=Math.cos(x),L=Math.sin(x),z=function(ee){return ee.toFixed(4)},$=[z(K),z(L),z(-1*L),z(K),0,0,"cm"]}this.internal.write("q"),x?(this.internal.write([1,"0","0",1,k(Q),B(N+P),"cm"].join(" ")),this.internal.write($.join(" ")),this.internal.write([k(R),"0","0",k(P),"0","0","cm"].join(" "))):this.internal.write([k(R),"0","0",k(P),k(Q),B(N+P),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+T.index+" Do"),this.internal.write("Q")},A=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var m=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(Q){var N,R,P=0;if(typeof Q=="string")for(R=Q.length,N=0;N<R;N++)P=(P<<5)-P+Q.charCodeAt(N),P|=0;else if(E(Q))for(R=Q.byteLength/2,N=0;N<R;N++)P=(P<<5)-P+Q[N],P|=0;return P},w=e.__addimage__.validateStringAsBase64=function(Q){(Q=Q||"").toString().trim();var N=!0;return Q.length===0&&(N=!1),Q.length%4!=0&&(N=!1),/^[A-Za-z0-9+/]+$/.test(Q.substr(0,Q.length-2))===!1&&(N=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Q.substr(-2))===!1&&(N=!1),N},S=e.__addimage__.extractImageFromDataUrl=function(Q){var N=(Q=Q||"").split("base64,"),R=null;if(N.length===2){var P=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(N[0]);Array.isArray(P)&&(R={mimeType:P[1],charset:P[2],data:N[1]})}return R},C=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(Q){return C()&&Q instanceof ArrayBuffer};var E=e.__addimage__.isArrayBufferView=function(Q){return C()&&typeof Uint32Array<"u"&&(Q instanceof Int8Array||Q instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&Q instanceof Uint8ClampedArray||Q instanceof Int16Array||Q instanceof Uint16Array||Q instanceof Int32Array||Q instanceof Uint32Array||Q instanceof Float32Array||Q instanceof Float64Array)},I=e.__addimage__.binaryStringToUint8Array=function(Q){for(var N=Q.length,R=new Uint8Array(N),P=0;P<N;P++)R[P]=Q.charCodeAt(P);return R},D=e.__addimage__.arrayBufferToBinaryString=function(Q){for(var N="",R=E(Q)?Q:new Uint8Array(Q),P=0;P<R.length;P+=8192)N+=String.fromCharCode.apply(null,R.subarray(P,P+8192));return N};e.addImage=function(){var Q,N,R,P,T,x,_,k,B;if(typeof arguments[1]=="number"?(N=t,R=arguments[1],P=arguments[2],T=arguments[3],x=arguments[4],_=arguments[5],k=arguments[6],B=arguments[7]):(N=arguments[1],R=arguments[2],P=arguments[3],T=arguments[4],x=arguments[5],_=arguments[6],k=arguments[7],B=arguments[8]),Jn(Q=arguments[0])==="object"&&!d(Q)&&"imageData"in Q){var F=Q;Q=F.imageData,N=F.format||N||t,R=F.x||R||0,P=F.y||P||0,T=F.w||F.width||T,x=F.h||F.height||x,_=F.alias||_,k=F.compression||k,B=F.rotation||F.angle||B}var K=this.internal.getFilters();if(k===void 0&&K.indexOf("FlateEncode")!==-1&&(k="SLOW"),isNaN(R)||isNaN(P))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var L=O.call(this,Q,N,_,k);return g.call(this,R,P,T,x,L,B),this};var O=function(Q,N,R,P){var T,x,_;if(typeof Q=="string"&&n(Q)===t){Q=unescape(Q);var k=U(Q,!1);(k!==""||(k=e.loadFile(Q,!0))!==void 0)&&(Q=k)}if(d(Q)&&(Q=h(Q,N)),N=n(Q,N),!u(N))throw new Error("addImage does not support files of type '"+N+"', please ensure that a plugin for '"+N+"' support is added.");if(((_=R)==null||_.length===0)&&(R=function(B){return typeof B=="string"||E(B)?y(B):E(B.data)?y(B.data):null}(Q)),(T=f.call(this,R))||(C()&&(Q instanceof Uint8Array||N==="RGBA"||(x=Q,Q=I(Q))),T=this["process"+N.toUpperCase()](Q,c.call(this),R,function(B){return B&&typeof B=="string"&&(B=B.toUpperCase()),B in e.image_compression?B:m.NONE}(P),x)),!T)throw new Error("An unknown error occurred whilst processing the image.");return T},U=e.__addimage__.convertBase64ToBinaryString=function(Q,N){var R;N=typeof N!="boolean"||N;var P,T="";if(typeof Q=="string"){P=(R=S(Q))!==null?R.data:Q;try{T=j0(P)}catch(x){if(N)throw w(P)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+x.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return T};e.getImageProperties=function(Q){var N,R,P="";if(d(Q)&&(Q=h(Q)),typeof Q=="string"&&n(Q)===t&&((P=U(Q,!1))===""&&(P=e.loadFile(Q)||""),Q=P),R=n(Q),!u(R))throw new Error("addImage does not support files of type '"+R+"', please ensure that a plugin for '"+R+"' support is added.");if(!C()||Q instanceof Uint8Array||(Q=I(Q)),!(N=this["process"+R.toUpperCase()](Q)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=R,N}})(Ir.API),function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Ir.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,o,a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,l=this.internal.getPageInfoByObjId(r.objId),c=r.pageContext.annotations,u=!1,d=0;d<c.length&&!u;d++)switch((n=c[d]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(u!=0){this.internal.write("/Annots [");for(var h=0;h<c.length;h++){n=c[h];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var g=this.internal.newAdditionalObject(),A=this.internal.newAdditionalObject(),m=this.internal.getEncryptor(g.objId),y=n.title||"Note";o="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(m(n.contents))+")",o+=" /Popup "+A.objId+" 0 R",o+=" /P "+l.objId+" 0 R",o+=" /T ("+f(m(y))+") >>",g.content=o;var w=g.objId+" 0 R";o="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(o+=" /Open true"),o+=" >>",A.content=o,this.internal.write(g.objId,"0 R",A.objId,"0 R");break;case"freetext":i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";o="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(n.contents))+")",o+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",o+=" /Border [0 0 0]",o+=" >>",this.internal.write(o);break;case"link":if(n.options.name){var C=this.annotations._nameMap[n.options.name];n.options.pageNumber=C.page,n.options.top=C.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",o="",n.options.url)o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(n.options.url))+") >>";else if(n.options.pageNumber)switch(o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":o+=" /Fit]";break;case"FitH":o+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,o+=" /FitV "+n.options.left+"]";break;case"XYZ":default:var E=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),o+=" /XYZ "+n.options.left+" "+E+" "+n.options.zoom+"]"}o!=""&&(o+=" >>",this.internal.write(o))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,i,o,a){var s=this.internal.getCurrentPageInfo(),l=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:l(r),y:c(n),w:l(r+i),h:c(n+o)},options:a,type:"link"})},e.textWithLink=function(r,n,i,o){var a,s,l=this.getTextWidth(r),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(o.maxWidth!==void 0){s=o.maxWidth;var u=this.splitTextToSize(r,s).length;a=Math.ceil(c*u)}else s=l,a=c;return this.text(r,n,i,o),i+=.2*c,o.align==="center"&&(n-=l/2),o.align==="right"&&(n-=l),this.link(n,i-c,s,a,o),l},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Ir.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(g){return t[g.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(g){return typeof g=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(g)},s=e.__arabicParser__.isArabicEndLetter=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length<=2},l=e.__arabicParser__.isArabicAlfLetter=function(g){return a(g)&&i.indexOf(g.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=1};var c=e.__arabicParser__.arabicLetterHasFinalForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length==4},d=e.__arabicParser__.resolveLigatures=function(g){var A=0,m=r,y="",w=0;for(A=0;A<g.length;A+=1)m[g.charCodeAt(A)]!==void 0?(w++,typeof(m=m[g.charCodeAt(A)])=="number"&&(y+=String.fromCharCode(m),m=r,w=0),A===g.length-1&&(m=r,y+=g.charAt(A-(w-1)),A-=w-1,w=0)):(m=r,y+=g.charAt(A-w),A-=w,w=0);return y};e.__arabicParser__.isArabicDiacritic=function(g){return g!==void 0&&n[g.charCodeAt(0)]!==void 0};var h=e.__arabicParser__.getCorrectForm=function(g,A,m){return a(g)?o(g)===!1?-1:!c(g)||!a(A)&&!a(m)||!a(m)&&s(A)||s(g)&&!a(A)||s(g)&&l(A)||s(g)&&s(A)?0:u(g)&&a(A)&&!s(A)&&a(m)&&c(m)?3:s(g)||!a(m)?1:2:-1},f=function(g){var A=0,m=0,y=0,w="",S="",C="",E=(g=g||"").split("\\s+"),I=[];for(A=0;A<E.length;A+=1){for(I.push(""),m=0;m<E[A].length;m+=1)w=E[A][m],S=E[A][m-1],C=E[A][m+1],a(w)?(y=h(w,S,C),I[A]+=y!==-1?String.fromCharCode(t[w.charCodeAt(0)][y]):w):I[A]+=w;I[A]=d(I[A])}return I.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var g,A=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,m=[];if(Array.isArray(A)){var y=0;for(m=[],y=0;y<A.length;y+=1)Array.isArray(A[y])?m.push([f(A[y][0]),A[y][1],A[y][2]]):m.push([f(A[y])]);g=m}else g=f(A);return typeof arguments[0]=="string"?g:(arguments[0].text=g,arguments[0])};e.events.push(["preProcessText",p])}(Ir.API),Ir.API.autoPrint=function(e){var t;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})}return this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var o=[];Object.defineProperty(this,"childNodes",{get:function(){return o},set:function(s){o=s}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(s){a=s}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Ir.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(g){l=g}});var c=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return c},set:function(g){c=g}});var u=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return u},set:function(g){u=g}});var d=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return d},set:function(g){d=g}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(g){h=g}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(g){f=g}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(g){p=g}}),this};o.prototype.clone=function(){return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},o.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(l){return n.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},e.getTextDimensions=function(l,c){n.call(this);var u=(c=c||{}).fontSize||this.getFontSize(),d=c.font||this.getFont(),h=c.scaleFactor||this.internal.scaleFactor,f=0,p=0,g=0,A=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var m=c.maxWidth;m>0?typeof l=="string"?l=this.splitTextToSize(l,m):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(w,S){return w.concat(A.splitTextToSize(S,m))},[])):l=Array.isArray(l)?l:[l];for(var y=0;y<l.length;y++)f<(g=this.getStringUnitWidth(l[y],{font:d})*u)&&(f=g);return f!==0&&(p=l.length),{w:f/=h,h:Math.max((p*u*this.getLineHeightFactor()-u*(this.getLineHeightFactor()-1))/h,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var l=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var l;l=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var c=this.internal.__cell__.lastCell,u=this.internal.__cell__.padding,d=this.internal.__cell__.margins||t,h=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return c.lineNumber!==void 0&&(c.lineNumber===l.lineNumber?(l.x=(c.x||0)+(c.width||0),l.y=c.y||0):c.y+c.height+l.height+d.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=d.top,f&&h&&(this.printHeaderRow(l.lineNumber,!0),l.y+=h[0].height)):l.y=c.y+c.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,r===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-u,l.y+u,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+u,{align:"center",baseline:"top",maxWidth:l.width-u-u}):this.text(l.text,l.x+u,l.y+u,{align:"left",baseline:"top",maxWidth:l.width-u-u})),this.internal.__cell__.lastCell=l,this};e.table=function(l,c,u,d,h){if(n.call(this),!u)throw new Error("No data for PDF table.");var f,p,g,A,m=[],y=[],w=[],S={},C={},E=[],I=[],D=(h=h||{}).autoSize||!1,O=h.printHeaders!==!1,U=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,Q=h.margins||Object.assign({width:this.getPageWidth()},t),N=typeof h.padding=="number"?h.padding:3,R=h.headerBackgroundColor||"#c8c8c8",P=h.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=O,this.internal.__cell__.margins=Q,this.internal.__cell__.table_font_size=U,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=R,this.internal.__cell__.headerTextColor=P,this.setFontSize(U),d==null)y=m=Object.keys(u[0]),w=m.map(function(){return"left"});else if(Array.isArray(d)&&Jn(d[0])==="object")for(m=d.map(function(F){return F.name}),y=d.map(function(F){return F.prompt||F.name||""}),w=d.map(function(F){return F.align||"left"}),f=0;f<d.length;f+=1)C[d[f].name]=d[f].width*(19.049976/25.4);else Array.isArray(d)&&typeof d[0]=="string"&&(y=m=d,w=m.map(function(){return"left"}));if(D||Array.isArray(d)&&typeof d[0]=="string")for(f=0;f<m.length;f+=1){for(S[A=m[f]]=u.map(function(F){return F[A]}),this.setFont(void 0,"bold"),E.push(this.getTextDimensions(y[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=S[A],this.setFont(void 0,"normal"),g=0;g<p.length;g+=1)E.push(this.getTextDimensions(p[g],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);C[A]=Math.max.apply(null,E)+N+N,E=[]}if(O){var T={};for(f=0;f<m.length;f+=1)T[m[f]]={},T[m[f]].text=y[f],T[m[f]].align=w[f];var x=s.call(this,T,C);I=m.map(function(F){return new o(l,c,C[F],x,T[F].text,void 0,T[F].align)}),this.setTableHeaderRow(I),this.printHeaderRow(1,!1)}var _=d.reduce(function(F,K){return F[K.name]=K.align,F},{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var k=s.call(this,u[f],C);for(g=0;g<m.length;g+=1){var B=u[f][m[g]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:g,data:B},this),a.call(this,new o(l,c,C[m[g]],k,B,f+2,_[m[g]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=c,this};var s=function(l,c){var u=this.internal.__cell__.padding,d=this.internal.__cell__.table_font_size,h=this.internal.scaleFactor;return Object.keys(l).map(function(f){var p=l[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,c[f]-u-u)},this).map(function(f){return this.getLineHeightFactor()*f.length*d/h+u+u},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(l){n.call(this),this.internal.__cell__.tableHeaderRow=l},e.printHeaderRow=function(l,c){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var u;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var d=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(d[0],d[1],d[2],d[3],void 0,-1)}this.setFont(void 0,"bold");for(var h=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){u=this.internal.__cell__.tableHeaderRow[f].clone(),c&&(u.y=this.internal.__cell__.margins.top||0,h.push(u)),u.lineNumber=l;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,u),this.setTextColor(p)}h.length>0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}}(Ir.API);var l$={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},c$=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],u8=s$(c$),u$=[100,200,300,400,500,600,700,800,900],tMe=s$(u$);function d8(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(o){return l$[o=o||"normal"]?o:"normal"}(e.style),n=function(o){if(!o)return 400;if(typeof o=="number")return o>=100&&o<=900&&o%100==0?o:400;if(/^\d00$/.test(o))return parseInt(o);switch(o){case"bold":return 700;case"normal":default:return 400}}(e.weight),i=function(o){return typeof u8[o=o||"normal"]=="number"?o:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function rU(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var rMe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},nU={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iU(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function nMe(e,t,r){for(var n=(r=r||{}).defaultFontFamily||"times",i=Object.assign({},rMe,r.genericFontFamilies||{}),o=null,a=null,s=0;s<t.length;++s)if(i[(o=d8(t[s])).family]&&(o.family=i[o.family]),e.hasOwnProperty(o.family)){a=e[o.family];break}if(!(a=a||e[n]))throw new Error("Could not find a font-family for the rule '"+iU(o)+"' and default family '"+n+"'.");if(a=function(l,c){if(c[l])return c[l];var u=u8[l],d=u<=u8.normal?-1:1,h=rU(c,c$,u,d);if(!h)throw new Error("Could not find a matching font-stretch value for "+l);return h}(o.stretch,a),a=function(l,c){if(c[l])return c[l];for(var u=l$[l],d=0;d<u.length;++d)if(c[u[d]])return c[u[d]];throw new Error("Could not find a matching font-style for "+l)}(o.style,a),!(a=function(l,c){if(c[l])return c[l];if(l===400&&c[500])return c[500];if(l===500&&c[400])return c[400];var u=tMe[l],d=rU(c,u$,u,l<400?-1:1);if(!d)throw new Error("Could not find a matching font-weight for value "+l);return d}(o.weight,a)))throw new Error("Failed to resolve a font for the rule '"+iU(o)+"'.");return a}function oU(e){return e.trimLeft()}function iMe(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function oMe(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var e1,aU,sU,lU=["times"];(function(e){var t,r,n,i,o,a,s,l,c,u=function(L){return L=L||{},this.isStrokeTransparent=L.isStrokeTransparent||!1,this.strokeOpacity=L.strokeOpacity||1,this.strokeStyle=L.strokeStyle||"#000000",this.fillStyle=L.fillStyle||"#000000",this.isFillTransparent=L.isFillTransparent||!1,this.fillOpacity=L.fillOpacity||1,this.font=L.font||"10px sans-serif",this.textBaseline=L.textBaseline||"alphabetic",this.textAlign=L.textAlign||"left",this.lineWidth=L.lineWidth||1,this.lineJoin=L.lineJoin||"miter",this.lineCap=L.lineCap||"butt",this.path=L.path||[],this.transform=L.transform!==void 0?L.transform.clone():new l,this.globalCompositeOperation=L.globalCompositeOperation||"normal",this.globalAlpha=L.globalAlpha||1,this.clip_path=L.clip_path||[],this.currentPoint=L.currentPoint||new a,this.miterLimit=L.miterLimit||10,this.lastPoint=L.lastPoint||new a,this.lineDashOffset=L.lineDashOffset||0,this.lineDash=L.lineDash||[],this.margin=L.margin||[0,0,0,0],this.prevPageLastElemOffset=L.prevPageLastElemOffset||0,this.ignoreClearRect=typeof L.ignoreClearRect!="boolean"||L.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new d(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,a=this.internal.Point,s=this.internal.Rectangle,l=this.internal.Matrix,c=new u}]);var d=function(L){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var z=L;Object.defineProperty(this,"pdf",{get:function(){return z}});var $=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return $},set:function(ae){$=!!ae}});var ee=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ee},set:function(ae){ee=!!ae}});var q=0;Object.defineProperty(this,"posX",{get:function(){return q},set:function(ae){isNaN(ae)||(q=ae)}});var J=0;Object.defineProperty(this,"posY",{get:function(){return J},set:function(ae){isNaN(ae)||(J=ae)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(ae){var ce;typeof ae=="number"?ce=[ae,ae,ae,ae]:((ce=new Array(4))[0]=ae[0],ce[1]=ae.length>=2?ae[1]:ce[0],ce[2]=ae.length>=3?ae[2]:ce[0],ce[3]=ae.length>=4?ae[3]:ce[1]),c.margin=ce}});var V=!1;Object.defineProperty(this,"autoPaging",{get:function(){return V},set:function(ae){V=ae}});var H=0;Object.defineProperty(this,"lastBreak",{get:function(){return H},set:function(ae){H=ae}});var Z=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Z},set:function(ae){Z=ae}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(ae){ae instanceof u&&(c=ae)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(ae){c.path=ae}});var le=[];Object.defineProperty(this,"ctxStack",{get:function(){return le},set:function(ae){le=ae}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ae){var ce;ce=h(ae),this.ctx.fillStyle=ce.style,this.ctx.isFillTransparent=ce.a===0,this.ctx.fillOpacity=ce.a,this.pdf.setFillColor(ce.r,ce.g,ce.b,{a:ce.a}),this.pdf.setTextColor(ce.r,ce.g,ce.b,{a:ce.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ae){var ce=h(ae);this.ctx.strokeStyle=ce.style,this.ctx.isStrokeTransparent=ce.a===0,this.ctx.strokeOpacity=ce.a,ce.a===0?this.pdf.setDrawColor(255,255,255):(ce.a,this.pdf.setDrawColor(ce.r,ce.g,ce.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ae){["butt","round","square"].indexOf(ae)!==-1&&(this.ctx.lineCap=ae,this.pdf.setLineCap(ae))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ae){isNaN(ae)||(this.ctx.lineWidth=ae,this.pdf.setLineWidth(ae))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ae){["bevel","round","miter"].indexOf(ae)!==-1&&(this.ctx.lineJoin=ae,this.pdf.setLineJoin(ae))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ae){isNaN(ae)||(this.ctx.miterLimit=ae,this.pdf.setMiterLimit(ae))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ae){this.ctx.textBaseline=ae}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ae){["right","end","center","left","start"].indexOf(ae)!==-1&&(this.ctx.textAlign=ae)}});var pe=null;function te(ae,ce){if(pe===null){var de=function(Ae){var ue=[];return Object.keys(Ae).forEach(function(ge){Ae[ge].forEach(function(ye){var ve=null;switch(ye){case"bold":ve={family:ge,weight:"bold"};break;case"italic":ve={family:ge,style:"italic"};break;case"bolditalic":ve={family:ge,weight:"bold",style:"italic"};break;case"":case"normal":ve={family:ge}}ve!==null&&(ve.ref={name:ge,style:ye},ue.push(ve))})}),ue}(ae.getFontList());pe=function(Ae){for(var ue={},ge=0;ge<Ae.length;++ge){var ye=d8(Ae[ge]),ve=ye.family,Te=ye.stretch,Ce=ye.style,Fe=ye.weight;ue[ve]=ue[ve]||{},ue[ve][Te]=ue[ve][Te]||{},ue[ve][Te][Ce]=ue[ve][Te][Ce]||{},ue[ve][Te][Ce][Fe]=ye}return ue}(de.concat(ce))}return pe}var se=null;Object.defineProperty(this,"fontFaces",{get:function(){return se},set:function(ae){pe=null,se=ae}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ae){var ce;if(this.ctx.font=ae,(ce=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(ae))!==null){var de=ce[1],Ae=(ce[2],ce[3]),ue=ce[4],ge=(ce[5],ce[6]),ye=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ue)[2];ue=Math.floor(ye==="px"?parseFloat(ue)*this.pdf.internal.scaleFactor:ye==="em"?parseFloat(ue)*this.pdf.getFontSize():parseFloat(ue)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ue);var ve=function(Ue){var Je,rt,Rt=[],ht=Ue.trim();if(ht==="")return lU;if(ht in nU)return[nU[ht]];for(;ht!=="";){switch(rt=null,Je=(ht=oU(ht)).charAt(0)){case'"':case"'":rt=iMe(ht.substring(1),Je);break;default:rt=oMe(ht)}if(rt===null||(Rt.push(rt[0]),(ht=oU(rt[1]))!==""&&ht.charAt(0)!==","))return lU;ht=ht.replace(/^,/,"")}return Rt}(ge);if(this.fontFaces){var Te=nMe(te(this.pdf,this.fontFaces),ve.map(function(Ue){return{family:Ue,stretch:"normal",weight:Ae,style:de}}));this.pdf.setFont(Te.ref.name,Te.ref.style)}else{var Ce="";(Ae==="bold"||parseInt(Ae,10)>=700||de==="bold")&&(Ce="bold"),de==="italic"&&(Ce+="italic"),Ce.length===0&&(Ce="normal");for(var Fe="",Se={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},De=0;De<ve.length;De++){if(this.pdf.internal.getFont(ve[De],Ce,{noFallback:!0,disableWarning:!0})!==void 0){Fe=ve[De];break}if(Ce==="bolditalic"&&this.pdf.internal.getFont(ve[De],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Fe=ve[De],Ce="bold";else if(this.pdf.internal.getFont(ve[De],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Fe=ve[De],Ce="normal";break}}if(Fe===""){for(var _e=0;_e<ve.length;_e++)if(Se[ve[_e]]){Fe=Se[ve[_e]];break}}Fe=Fe===""?"Times":Fe,this.pdf.setFont(Fe,Ce)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ae){this.ctx.globalCompositeOperation=ae}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ae){this.ctx.globalAlpha=ae}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ae){this.ctx.lineDashOffset=ae,K.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ae){this.ctx.lineDash=ae,K.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ae){this.ctx.ignoreClearRect=!!ae}})};d.prototype.setLineDash=function(L){this.lineDash=L},d.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},d.prototype.fill=function(){S.call(this,"fill",!1)},d.prototype.stroke=function(){S.call(this,"stroke",!1)},d.prototype.beginPath=function(){this.path=[{type:"begin"}]},d.prototype.moveTo=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var $=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"mt",x:$.x,y:$.y}),this.ctx.lastPoint=new a(L,z)},d.prototype.closePath=function(){var L=new a(0,0),z=0;for(z=this.path.length-1;z!==-1;z--)if(this.path[z].type==="begin"&&Jn(this.path[z+1])==="object"&&typeof this.path[z+1].x=="number"){L=new a(this.path[z+1].x,this.path[z+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(L.x,L.y)},d.prototype.lineTo=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var $=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"lt",x:$.x,y:$.y}),this.ctx.lastPoint=new a($.x,$.y)},d.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},d.prototype.quadraticCurveTo=function(L,z,$,ee){if(isNaN($)||isNaN(ee)||isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var q=this.ctx.transform.applyToPoint(new a($,ee)),J=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"qct",x1:J.x,y1:J.y,x:q.x,y:q.y}),this.ctx.lastPoint=new a(q.x,q.y)},d.prototype.bezierCurveTo=function(L,z,$,ee,q,J){if(isNaN(q)||isNaN(J)||isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var V=this.ctx.transform.applyToPoint(new a(q,J)),H=this.ctx.transform.applyToPoint(new a(L,z)),Z=this.ctx.transform.applyToPoint(new a($,ee));this.path.push({type:"bct",x1:H.x,y1:H.y,x2:Z.x,y2:Z.y,x:V.x,y:V.y}),this.ctx.lastPoint=new a(V.x,V.y)},d.prototype.arc=function(L,z,$,ee,q,J){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee)||isNaN(q))throw Si.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(J=!!J,!this.ctx.transform.isIdentity){var V=this.ctx.transform.applyToPoint(new a(L,z));L=V.x,z=V.y;var H=this.ctx.transform.applyToPoint(new a(0,$)),Z=this.ctx.transform.applyToPoint(new a(0,0));$=Math.sqrt(Math.pow(H.x-Z.x,2)+Math.pow(H.y-Z.y,2))}Math.abs(q-ee)>=2*Math.PI&&(ee=0,q=2*Math.PI),this.path.push({type:"arc",x:L,y:z,radius:$,startAngle:ee,endAngle:q,counterclockwise:J})},d.prototype.arcTo=function(L,z,$,ee,q){throw new Error("arcTo not implemented.")},d.prototype.rect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(L,z),this.lineTo(L+$,z),this.lineTo(L+$,z+ee),this.lineTo(L,z+ee),this.lineTo(L,z),this.lineTo(L+$,z),this.lineTo(L,z)},d.prototype.fillRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var q={};this.lineCap!=="butt"&&(q.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(q.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(L,z,$,ee),this.fill(),q.hasOwnProperty("lineCap")&&(this.lineCap=q.lineCap),q.hasOwnProperty("lineJoin")&&(this.lineJoin=q.lineJoin)}},d.prototype.strokeRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(L,z,$,ee),this.stroke())},d.prototype.clearRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(L,z,$,ee))},d.prototype.save=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("q");if(this.pdf.setPage(z),L){this.ctx.fontSize=this.pdf.internal.getFontSize();var ee=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ee}},d.prototype.restore=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("Q");this.pdf.setPage(z),L&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},d.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(L){var z,$,ee,q;if(L.isCanvasGradient===!0&&(L=L.getColor()),!L)return{r:0,g:0,b:0,a:0,style:L};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(L))z=0,$=0,ee=0,q=0;else{var J=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(L);if(J!==null)z=parseInt(J[1]),$=parseInt(J[2]),ee=parseInt(J[3]),q=1;else if((J=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(L))!==null)z=parseInt(J[1]),$=parseInt(J[2]),ee=parseInt(J[3]),q=parseFloat(J[4]);else{if(q=1,typeof L=="string"&&L.charAt(0)!=="#"){var V=new t$(L);L=V.ok?V.toHex():"#000000"}L.length===4?(z=L.substring(1,2),z+=z,$=L.substring(2,3),$+=$,ee=L.substring(3,4),ee+=ee):(z=L.substring(1,3),$=L.substring(3,5),ee=L.substring(5,7)),z=parseInt(z,16),$=parseInt($,16),ee=parseInt(ee,16)}}return{r:z,g:$,b:ee,a:q,style:L}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};d.prototype.fillText=function(L,z,$,ee){if(isNaN(z)||isNaN($)||typeof L!="string")throw Si.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ee=isNaN(ee)?void 0:ee,!f.call(this)){var q=k(this.ctx.transform.rotation),J=this.ctx.transform.scaleX;N.call(this,{text:L,x:z,y:$,scale:J,angle:q,align:this.textAlign,maxWidth:ee})}},d.prototype.strokeText=function(L,z,$,ee){if(isNaN(z)||isNaN($)||typeof L!="string")throw Si.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){ee=isNaN(ee)?void 0:ee;var q=k(this.ctx.transform.rotation),J=this.ctx.transform.scaleX;N.call(this,{text:L,x:z,y:$,scale:J,renderingMode:"stroke",angle:q,align:this.textAlign,maxWidth:ee})}},d.prototype.measureText=function(L){if(typeof L!="string")throw Si.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var z=this.pdf,$=this.pdf.internal.scaleFactor,ee=z.internal.getFontSize(),q=z.getStringUnitWidth(L)*ee/z.internal.scaleFactor,J=function(V){var H=(V=V||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return H}}),this};return new J({width:q*=Math.round(96*$/72*1e4)/1e4})},d.prototype.scale=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var $=new l(L,0,0,z,0,0);this.ctx.transform=this.ctx.transform.multiply($)},d.prototype.rotate=function(L){if(isNaN(L))throw Si.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var z=new l(Math.cos(L),Math.sin(L),-Math.sin(L),Math.cos(L),0,0);this.ctx.transform=this.ctx.transform.multiply(z)},d.prototype.translate=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var $=new l(1,0,0,1,L,z);this.ctx.transform=this.ctx.transform.multiply($)},d.prototype.transform=function(L,z,$,ee,q,J){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee)||isNaN(q)||isNaN(J))throw Si.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var V=new l(L,z,$,ee,q,J);this.ctx.transform=this.ctx.transform.multiply(V)},d.prototype.setTransform=function(L,z,$,ee,q,J){L=isNaN(L)?1:L,z=isNaN(z)?0:z,$=isNaN($)?0:$,ee=isNaN(ee)?1:ee,q=isNaN(q)?0:q,J=isNaN(J)?0:J,this.ctx.transform=new l(L,z,$,ee,q,J)};var g=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(L,z,$,ee,q,J,V,H,Z){var le=this.pdf.getImageProperties(L),pe=1,te=1,se=1,ae=1;ee!==void 0&&H!==void 0&&(se=H/ee,ae=Z/q,pe=le.width/ee*H/ee,te=le.height/q*Z/q),J===void 0&&(J=z,V=$,z=0,$=0),ee!==void 0&&H===void 0&&(H=ee,Z=q),ee===void 0&&H===void 0&&(H=le.width,Z=le.height);for(var ce,de=this.ctx.transform.decompose(),Ae=k(de.rotate.shx),ue=new l,ge=(ue=(ue=(ue=ue.multiply(de.translate)).multiply(de.skew)).multiply(de.scale)).applyToRectangle(new s(J-z*se,V-$*ae,ee*pe,q*te)),ye=A.call(this,ge),ve=[],Te=0;Te<ye.length;Te+=1)ve.indexOf(ye[Te])===-1&&ve.push(ye[Te]);if(w(ve),this.autoPaging)for(var Ce=ve[0],Fe=ve[ve.length-1],Se=Ce;Se<Fe+1;Se++){this.pdf.setPage(Se);var De=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],_e=Se===1?this.posY+this.margin[0]:this.margin[0],Ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],rt=Se===1?0:Ue+(Se-2)*Je;if(this.ctx.clip_path.length!==0){var Rt=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(ce,this.posX+this.margin[3],-rt+_e+this.ctx.prevPageLastElemOffset),C.call(this,"fill",!0),this.path=Rt}var ht=JSON.parse(JSON.stringify(ge));ht=y([ht],this.posX+this.margin[3],-rt+_e+this.ctx.prevPageLastElemOffset)[0];var At=(Se>Ce||Se<Fe)&&g.call(this);At&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],De,Je,null).clip().discardPath()),this.pdf.addImage(L,"JPEG",ht.x,ht.y,ht.w,ht.h,null,null,Ae),At&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(L,"JPEG",ge.x,ge.y,ge.w,ge.h,null,null,Ae)};var A=function(L,z,$){var ee=[];z=z||this.pdf.internal.pageSize.width,$=$||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var q=this.posY+this.ctx.prevPageLastElemOffset;switch(L.type){default:case"mt":case"lt":ee.push(Math.floor((L.y+q)/$)+1);break;case"arc":ee.push(Math.floor((L.y+q-L.radius)/$)+1),ee.push(Math.floor((L.y+q+L.radius)/$)+1);break;case"qct":var J=B(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x,L.y);ee.push(Math.floor((J.y+q)/$)+1),ee.push(Math.floor((J.y+J.h+q)/$)+1);break;case"bct":var V=F(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x2,L.y2,L.x,L.y);ee.push(Math.floor((V.y+q)/$)+1),ee.push(Math.floor((V.y+V.h+q)/$)+1);break;case"rect":ee.push(Math.floor((L.y+q)/$)+1),ee.push(Math.floor((L.y+L.h+q)/$)+1)}for(var H=0;H<ee.length;H+=1)for(;this.pdf.internal.getNumberOfPages()<ee[H];)m.call(this);return ee},m=function(){var L=this.fillStyle,z=this.strokeStyle,$=this.font,ee=this.lineCap,q=this.lineWidth,J=this.lineJoin;this.pdf.addPage(),this.fillStyle=L,this.strokeStyle=z,this.font=$,this.lineCap=ee,this.lineWidth=q,this.lineJoin=J},y=function(L,z,$){for(var ee=0;ee<L.length;ee++)switch(L[ee].type){case"bct":L[ee].x2+=z,L[ee].y2+=$;case"qct":L[ee].x1+=z,L[ee].y1+=$;case"mt":case"lt":case"arc":default:L[ee].x+=z,L[ee].y+=$}return L},w=function(L){return L.sort(function(z,$){return z-$})},S=function(L,z){for(var $,ee,q=this.fillStyle,J=this.strokeStyle,V=this.lineCap,H=this.lineWidth,Z=Math.abs(H*this.ctx.transform.scaleX),le=this.lineJoin,pe=JSON.parse(JSON.stringify(this.path)),te=JSON.parse(JSON.stringify(this.path)),se=[],ae=0;ae<te.length;ae++)if(te[ae].x!==void 0)for(var ce=A.call(this,te[ae]),de=0;de<ce.length;de+=1)se.indexOf(ce[de])===-1&&se.push(ce[de]);for(var Ae=0;Ae<se.length;Ae++)for(;this.pdf.internal.getNumberOfPages()<se[Ae];)m.call(this);if(w(se),this.autoPaging)for(var ue=se[0],ge=se[se.length-1],ye=ue;ye<ge+1;ye++){this.pdf.setPage(ye),this.fillStyle=q,this.strokeStyle=J,this.lineCap=V,this.lineWidth=Z,this.lineJoin=le;var ve=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Te=ye===1?this.posY+this.margin[0]:this.margin[0],Ce=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Fe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Se=ye===1?0:Ce+(ye-2)*Fe;if(this.ctx.clip_path.length!==0){var De=this.path;$=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y($,this.posX+this.margin[3],-Se+Te+this.ctx.prevPageLastElemOffset),C.call(this,L,!0),this.path=De}if(ee=JSON.parse(JSON.stringify(pe)),this.path=y(ee,this.posX+this.margin[3],-Se+Te+this.ctx.prevPageLastElemOffset),z===!1||ye===0){var _e=(ye>ue||ye<ge)&&g.call(this);_e&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ve,Fe,null).clip().discardPath()),C.call(this,L,z),_e&&this.pdf.restoreGraphicsState()}this.lineWidth=H}else this.lineWidth=Z,C.call(this,L,z),this.lineWidth=H;this.path=pe},C=function(L,z){if((L!=="stroke"||z||!p.call(this))&&(L==="stroke"||z||!f.call(this))){for(var $,ee,q=[],J=this.path,V=0;V<J.length;V++){var H=J[V];switch(H.type){case"begin":q.push({begin:!0});break;case"close":q.push({close:!0});break;case"mt":q.push({start:H,deltas:[],abs:[]});break;case"lt":var Z=q.length;if(J[V-1]&&!isNaN(J[V-1].x)&&($=[H.x-J[V-1].x,H.y-J[V-1].y],Z>0)){for(;Z>=0;Z--)if(q[Z-1].close!==!0&&q[Z-1].begin!==!0){q[Z-1].deltas.push($),q[Z-1].abs.push(H);break}}break;case"bct":$=[H.x1-J[V-1].x,H.y1-J[V-1].y,H.x2-J[V-1].x,H.y2-J[V-1].y,H.x-J[V-1].x,H.y-J[V-1].y],q[q.length-1].deltas.push($);break;case"qct":var le=J[V-1].x+2/3*(H.x1-J[V-1].x),pe=J[V-1].y+2/3*(H.y1-J[V-1].y),te=H.x+2/3*(H.x1-H.x),se=H.y+2/3*(H.y1-H.y),ae=H.x,ce=H.y;$=[le-J[V-1].x,pe-J[V-1].y,te-J[V-1].x,se-J[V-1].y,ae-J[V-1].x,ce-J[V-1].y],q[q.length-1].deltas.push($);break;case"arc":q.push({deltas:[],abs:[],arc:!0}),Array.isArray(q[q.length-1].abs)&&q[q.length-1].abs.push(H)}}ee=z?null:L==="stroke"?"stroke":"fill";for(var de=!1,Ae=0;Ae<q.length;Ae++)if(q[Ae].arc)for(var ue=q[Ae].abs,ge=0;ge<ue.length;ge++){var ye=ue[ge];ye.type==="arc"?D.call(this,ye.x,ye.y,ye.radius,ye.startAngle,ye.endAngle,ye.counterclockwise,void 0,z,!de):R.call(this,ye.x,ye.y),de=!0}else if(q[Ae].close===!0)this.pdf.internal.out("h"),de=!1;else if(q[Ae].begin!==!0){var ve=q[Ae].start.x,Te=q[Ae].start.y;P.call(this,q[Ae].deltas,ve,Te),de=!0}ee&&O.call(this,ee),z&&U.call(this)}},E=function(L){var z=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,$=z*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return L-$;case"top":return L+z-$;case"hanging":return L+z-2*$;case"middle":return L+z/2-$;case"ideographic":return L;case"alphabetic":default:return L}},I=function(L){return L+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};d.prototype.createLinearGradient=function(){var L=function(){};return L.colorStops=[],L.addColorStop=function(z,$){this.colorStops.push([z,$])},L.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},L.isCanvasGradient=!0,L},d.prototype.createPattern=function(){return this.createLinearGradient()},d.prototype.createRadialGradient=function(){return this.createLinearGradient()};var D=function(L,z,$,ee,q,J,V,H,Z){for(var le=x.call(this,$,ee,q,J),pe=0;pe<le.length;pe++){var te=le[pe];pe===0&&(Z?Q.call(this,te.x1+L,te.y1+z):R.call(this,te.x1+L,te.y1+z)),T.call(this,L,z,te.x2,te.y2,te.x3,te.y3,te.x4,te.y4)}H?U.call(this):O.call(this,V)},O=function(L){switch(L){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},U=function(){this.pdf.clip(),this.pdf.discardPath()},Q=function(L,z){this.pdf.internal.out(r(L)+" "+n(z)+" m")},N=function(L){var z;switch(L.align){case"right":case"end":z="right";break;case"center":z="center";break;case"left":case"start":default:z="left"}var $=this.pdf.getTextDimensions(L.text),ee=E.call(this,L.y),q=I.call(this,ee)-$.h,J=this.ctx.transform.applyToPoint(new a(L.x,ee)),V=this.ctx.transform.decompose(),H=new l;H=(H=(H=H.multiply(V.translate)).multiply(V.skew)).multiply(V.scale);for(var Z,le,pe,te=this.ctx.transform.applyToRectangle(new s(L.x,ee,$.w,$.h)),se=H.applyToRectangle(new s(L.x,q,$.w,$.h)),ae=A.call(this,se),ce=[],de=0;de<ae.length;de+=1)ce.indexOf(ae[de])===-1&&ce.push(ae[de]);if(w(ce),this.autoPaging)for(var Ae=ce[0],ue=ce[ce.length-1],ge=Ae;ge<ue+1;ge++){this.pdf.setPage(ge);var ye=ge===1?this.posY+this.margin[0]:this.margin[0],ve=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Te=this.pdf.internal.pageSize.height-this.margin[2],Ce=Te-this.margin[0],Fe=this.pdf.internal.pageSize.width-this.margin[1],Se=Fe-this.margin[3],De=ge===1?0:ve+(ge-2)*Ce;if(this.ctx.clip_path.length!==0){var _e=this.path;Z=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(Z,this.posX+this.margin[3],-1*De+ye),C.call(this,"fill",!0),this.path=_e}var Ue=y([JSON.parse(JSON.stringify(se))],this.posX+this.margin[3],-De+ye+this.ctx.prevPageLastElemOffset)[0];L.scale>=.01&&(le=this.pdf.internal.getFontSize(),this.pdf.setFontSize(le*L.scale),pe=this.lineWidth,this.lineWidth=pe*L.scale);var Je=this.autoPaging!=="text";if(Je||Ue.y+Ue.h<=Te){if(Je||Ue.y>=ye&&Ue.x<=Fe){var rt=Je?L.text:this.pdf.splitTextToSize(L.text,L.maxWidth||Fe-Ue.x)[0],Rt=y([JSON.parse(JSON.stringify(te))],this.posX+this.margin[3],-De+ye+this.ctx.prevPageLastElemOffset)[0],ht=Je&&(ge>Ae||ge<ue)&&g.call(this);ht&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Se,Ce,null).clip().discardPath()),this.pdf.text(rt,Rt.x,Rt.y,{angle:L.angle,align:z,renderingMode:L.renderingMode}),ht&&this.pdf.restoreGraphicsState()}}else Ue.y<Te&&(this.ctx.prevPageLastElemOffset+=Te-Ue.y);L.scale>=.01&&(this.pdf.setFontSize(le),this.lineWidth=pe)}else L.scale>=.01&&(le=this.pdf.internal.getFontSize(),this.pdf.setFontSize(le*L.scale),pe=this.lineWidth,this.lineWidth=pe*L.scale),this.pdf.text(L.text,J.x+this.posX,J.y+this.posY,{angle:L.angle,align:z,renderingMode:L.renderingMode,maxWidth:L.maxWidth}),L.scale>=.01&&(this.pdf.setFontSize(le),this.lineWidth=pe)},R=function(L,z,$,ee){$=$||0,ee=ee||0,this.pdf.internal.out(r(L+$)+" "+n(z+ee)+" l")},P=function(L,z,$){return this.pdf.lines(L,z,$,null,null)},T=function(L,z,$,ee,q,J,V,H){this.pdf.internal.out([t(i($+L)),t(o(ee+z)),t(i(q+L)),t(o(J+z)),t(i(V+L)),t(o(H+z)),"c"].join(" "))},x=function(L,z,$,ee){for(var q=2*Math.PI,J=Math.PI/2;z>$;)z-=q;var V=Math.abs($-z);V<q&&ee&&(V=q-V);for(var H=[],Z=ee?-1:1,le=z;V>1e-5;){var pe=le+Z*Math.min(V,J);H.push(_.call(this,L,le,pe)),V-=Math.abs(pe-le),le=pe}return H},_=function(L,z,$){var ee=($-z)/2,q=L*Math.cos(ee),J=L*Math.sin(ee),V=q,H=-J,Z=V*V+H*H,le=Z+V*q+H*J,pe=4/3*(Math.sqrt(2*Z*le)-le)/(V*J-H*q),te=V-pe*H,se=H+pe*V,ae=te,ce=-se,de=ee+z,Ae=Math.cos(de),ue=Math.sin(de);return{x1:L*Math.cos(z),y1:L*Math.sin(z),x2:te*Ae-se*ue,y2:te*ue+se*Ae,x3:ae*Ae-ce*ue,y3:ae*ue+ce*Ae,x4:L*Math.cos($),y4:L*Math.sin($)}},k=function(L){return 180*L/Math.PI},B=function(L,z,$,ee,q,J){var V=L+.5*($-L),H=z+.5*(ee-z),Z=q+.5*($-q),le=J+.5*(ee-J),pe=Math.min(L,q,V,Z),te=Math.max(L,q,V,Z),se=Math.min(z,J,H,le),ae=Math.max(z,J,H,le);return new s(pe,se,te-pe,ae-se)},F=function(L,z,$,ee,q,J,V,H){var Z,le,pe,te,se,ae,ce,de,Ae,ue,ge,ye,ve,Te,Ce=$-L,Fe=ee-z,Se=q-$,De=J-ee,_e=V-q,Ue=H-J;for(le=0;le<41;le++)Ae=(ce=(pe=L+(Z=le/40)*Ce)+Z*((se=$+Z*Se)-pe))+Z*(se+Z*(q+Z*_e-se)-ce),ue=(de=(te=z+Z*Fe)+Z*((ae=ee+Z*De)-te))+Z*(ae+Z*(J+Z*Ue-ae)-de),le==0?(ge=Ae,ye=ue,ve=Ae,Te=ue):(ge=Math.min(ge,Ae),ye=Math.min(ye,ue),ve=Math.max(ve,Ae),Te=Math.max(Te,ue));return new s(Math.round(ge),Math.round(ye),Math.round(ve-ge),Math.round(Te-ye))},K=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var L,z,$=(L=this.ctx.lineDash,z=this.ctx.lineDashOffset,JSON.stringify({lineDash:L,lineDashOffset:z}));this.prevLineDash!==$&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=$)}}})(Ir.API),function(e){var t=function(o){var a,s,l,c,u,d,h,f,p,g;for(s=[],l=0,c=(o+=a="\0\0\0\0".slice(o.length%4||4)).length;c>l;l+=4)(u=(o.charCodeAt(l)<<24)+(o.charCodeAt(l+1)<<16)+(o.charCodeAt(l+2)<<8)+o.charCodeAt(l+3))!==0?(d=(u=((u=((u=((u=(u-(g=u%85))/85)-(p=u%85))/85)-(f=u%85))/85)-(h=u%85))/85)%85,s.push(d+33,h+33,f+33,p+33,g+33)):s.push(122);return function(A,m){for(var y=m;y>0;y--)A.pop()}(s,a.length),String.fromCharCode.apply(String,s)+"~>"},r=function(o){var a,s,l,c,u,d=String,h="length",f=255,p="charCodeAt",g="slice",A="replace";for(o[g](-2),o=o[g](0,-2)[A](/\s/g,"")[A]("z","!!!!!"),l=[],c=0,u=(o+=a="uuuuu"[g](o[h]%5||5))[h];u>c;c+=5)s=52200625*(o[p](c)-33)+614125*(o[p](c+1)-33)+7225*(o[p](c+2)-33)+85*(o[p](c+3)-33)+(o[p](c+4)-33),l.push(f&s>>24,f&s>>16,f&s>>8,f&s);return function(m,y){for(var w=y;w>0;w--)m.pop()}(l,a[h]),d.fromCharCode.apply(d,l)},n=function(o){var a=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),a.test(o)===!1)return"";for(var s="",l=0;l<o.length;l+=2)s+=String.fromCharCode("0x"+(o[l]+o[l+1]));return s},i=function(o){for(var a=new Uint8Array(o.length),s=o.length;s--;)a[s]=o.charCodeAt(s);return o=(a=o8(a)).reduce(function(l,c){return l+String.fromCharCode(c)},"")};e.processDataByFilters=function(o,a){var s=0,l=o||"",c=[];for(typeof(a=a||[])=="string"&&(a=[a]),s=0;s<a.length;s+=1)switch(a[s]){case"ASCII85Decode":case"/ASCII85Decode":l=r(l),c.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),c.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=n(l),c.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=l.split("").map(function(u){return("0"+u.charCodeAt().toString(16)).slice(-2)}).join("")+">",c.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=i(l),c.push("/FlateDecode");break;default:throw new Error('The filter: "'+a[s]+'" is not implemented')}return{data:l,reverseChain:c.reverse().join(" ")}}}(Ir.API),function(e){e.loadFile=function(t,r,n){return function(i,o,a){o=o!==!1,a=typeof a=="function"?a:function(){};var s=void 0;try{s=function(l,c,u){var d=new XMLHttpRequest,h=0,f=function(p){var g=p.length,A=[],m=String.fromCharCode;for(h=0;h<g;h+=1)A.push(m(255&p.charCodeAt(h)));return A.join("")};if(d.open("GET",l,!c),d.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(d.onload=function(){d.status===200?u(f(this.responseText)):u(void 0)}),d.send(null),c&&d.status===200)return f(d.responseText)}(i,o,a)}catch{}return s}(t,r,n)},e.loadImageFile=e.loadFile}(Ir.API),function(e){function t(){return(Vr.html2canvas?Promise.resolve(Vr.html2canvas):Promise.resolve().then(()=>NLe)).catch(function(a){return Promise.reject(new Error("Could not load html2canvas: "+a))}).then(function(a){return a.default?a.default:a})}function r(){return(Vr.DOMPurify?Promise.resolve(Vr.DOMPurify):mj(()=>import("./purify.es-CKk_t3XZ-CB-r1fqE.js"),[])).catch(function(a){return Promise.reject(new Error("Could not load dompurify: "+a))}).then(function(a){return a.default?a.default:a})}var n=function(a){var s=Jn(a);return s==="undefined"?"undefined":s==="string"||a instanceof String?"string":s==="number"||a instanceof Number?"number":s==="function"||a instanceof Function?"function":a&&a.constructor===Array?"array":a&&a.nodeType===1?"element":s==="object"?"object":"unknown"},i=function(a,s){var l=document.createElement(a);for(var c in s.className&&(l.className=s.className),s.innerHTML&&s.dompurify&&(l.innerHTML=s.dompurify.sanitize(s.innerHTML)),s.style)l.style[c]=s.style[c];return l},o=function a(s){var l=Object.assign(a.convert(Promise.resolve()),JSON.parse(JSON.stringify(a.template))),c=a.convert(Promise.resolve(),l);return c=(c=c.setProgress(1,a,1,[a])).set(s)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(a,s){return a.__proto__=s||o.prototype,a},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(a,s){return this.then(function(){switch(s=s||function(l){switch(n(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(a)){case"string":return this.then(r).then(function(l){return this.set({src:i("div",{innerHTML:a,dompurify:l})})});case"element":return this.set({src:a});case"canvas":return this.set({canvas:a});case"img":return this.set({img:a});default:return this.error("Unknown source type.")}})},o.prototype.to=function(a){switch(a){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var a={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},s=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),h=c.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(l(h,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d}(this.prop.src,this.opt.html2canvas.javascriptEnabled);s.tagName==="BODY"&&(a.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:a}),this.prop.container.appendChild(s),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(t).then(function(s){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,s(this.prop.container,l)}).then(function(s){(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(t).then(function(s){var l=this.opt.jsPDF,c=this.opt.fontFaces,u=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,d=Object.assign({async:!0,allowTaint:!0,scale:u,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete d.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=c,c)for(var h=0;h<c.length;++h){var f=c[h],p=f.src.find(function(g){return g.format==="truetype"});p&&l.addFont(p.url,f.ref.name,f.ref.style)}return d.windowHeight=d.windowHeight||0,d.windowHeight=d.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):d.windowHeight,l.context2d.save(!0),s(this.prop.container,d)}).then(function(s){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var a=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=a})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(a,s,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(a,s):this.outputPdf(a,s)},o.prototype.outputPdf=function(a,s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(a,s)})},o.prototype.outputImg=function(a){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(a){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+a+'" is not supported.'}})},o.prototype.save=function(a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(a?{filename:a}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(a){if(n(a)!=="object")return this;var s=Object.keys(a||{}).map(function(l){if(l in o.template.prop)return function(){this.prop[l]=a[l]};switch(l){case"margin":return this.setMargin.bind(this,a.margin);case"jsPDF":return function(){return this.opt.jsPDF=a.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,a.pageSize);default:return function(){this.opt[l]=a[l]}}},this);return this.then(function(){return this.thenList(s)})},o.prototype.get=function(a,s){return this.then(function(){var l=a in o.template.prop?this.prop[a]:this.opt[a];return s?s(l):l})},o.prototype.setMargin=function(a){return this.then(function(){switch(n(a)){case"number":a=[a,a,a,a];case"array":if(a.length===2&&(a=[a[0],a[1],a[0],a[1]]),a.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=a}).then(this.setPageSize)},o.prototype.setPageSize=function(a){function s(l,c){return Math.floor(l*c/72*96)}return this.then(function(){(a=a||Ir.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(a.inner={width:a.width-this.opt.margin[1]-this.opt.margin[3],height:a.height-this.opt.margin[0]-this.opt.margin[2]},a.inner.px={width:s(a.inner.width,a.k),height:s(a.inner.height,a.k)},a.inner.ratio=a.inner.height/a.inner.width),this.prop.pageSize=a})},o.prototype.setProgress=function(a,s,l,c){return a!=null&&(this.progress.val=a),s!=null&&(this.progress.state=s),l!=null&&(this.progress.n=l),c!=null&&(this.progress.stack=c),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(a,s,l,c){return this.setProgress(a?this.progress.val+a:null,s||null,l?this.progress.n+l:null,c?this.progress.stack.concat(c):null)},o.prototype.then=function(a,s){var l=this;return this.thenCore(a,s,function(c,u){return l.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(d){return l.updateProgress(null,c),d}).then(c,u).then(function(d){return l.updateProgress(1),d})})},o.prototype.thenCore=function(a,s,l){l=l||Promise.prototype.then,a&&(a=a.bind(this)),s&&(s=s.bind(this));var c=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:o.convert(Object.assign({},this),Promise.prototype),u=l.call(c,a,s);return o.convert(u,this.__proto__)},o.prototype.thenExternal=function(a,s){return Promise.prototype.then.call(this,a,s)},o.prototype.thenList=function(a){var s=this;return a.forEach(function(l){s=s.thenCore(l)}),s},o.prototype.catch=function(a){a&&(a=a.bind(this));var s=Promise.prototype.catch.call(this,a);return o.convert(s,this)},o.prototype.catchExternal=function(a){return Promise.prototype.catch.call(this,a)},o.prototype.error=function(a){return this.then(function(){throw new Error(a)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Ir.getPageSize=function(a,s,l){if(Jn(a)==="object"){var c=a;a=c.orientation,s=c.unit||s,l=c.format||l}s=s||"mm",l=l||"a4",a=(""+(a||"P")).toLowerCase();var u,d=(""+l).toLowerCase(),h={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(s){case"pt":u=1;break;case"mm":u=72/25.4;break;case"cm":u=72/2.54;break;case"in":u=72;break;case"px":u=.75;break;case"pc":case"em":u=12;break;case"ex":u=6;break;default:throw"Invalid unit: "+s}var f,p=0,g=0;if(h.hasOwnProperty(d))p=h[d][1]/u,g=h[d][0]/u;else try{p=l[1],g=l[0]}catch{throw new Error("Invalid format: "+l)}if(a==="p"||a==="portrait")a="p",g>p&&(f=g,g=p,p=f);else{if(a!=="l"&&a!=="landscape")throw"Invalid orientation: "+a;a="l",p>g&&(f=g,g=p,p=f)}return{width:g,height:p,unit:s,k:u,orientation:a}},e.html=function(a,s){(s=s||{}).callback=s.callback||function(){},s.html2canvas=s.html2canvas||{},s.html2canvas.canvas=s.html2canvas.canvas||this.canvas,s.jsPDF=s.jsPDF||this,s.fontFaces=s.fontFaces?s.fontFaces.map(d8):null;var l=new o(s);return s.worker?l:l.from(a).doCallback()}}(Ir.API),Ir.API.addJS=function(e){return sU=e,this.internal.events.subscribe("postPutResources",function(){e1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),aU=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+sU+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e1!==void 0&&aU!==void 0&&this.internal.out("/Names <</JavaScript "+e1+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),o=0;o<i.length;o++){var a=i[o],s=n.exec(a);if(s!=null){var l=s[1];r.internal.newObjectDeferredBegin(l,!1)}r.internal.write(a)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(o=0;o<c;o++){var d=r.internal.newObject();u.push(d);var h=r.internal.getPageInfo(o+1);r.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),o=0;o<u.length;o++)r.internal.write("(page_"+(o+1)+")"+u[o]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,o){var a={title:i,options:o,children:[]};return n==null&&(n=this.root),n.children.push(a),a},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,o=0;o<n.children.length;o++){var a=n.children[o];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(n)),o>0&&this.line("/Prev "+this.makeRef(n.children[o-1])),o<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[o+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var s=this.count=this.count_r({count:0},a);if(s>0&&this.line("/Count "+s),a.options&&a.options.pageNumber){var l=r.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+l.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var c=0;c<n.children.length;c++)this.renderItems(n.children[c])},r.outline.line=function(n){this.ctx.val+=n+`\r
560
+ `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};fr.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=fr.internal.getWidth(e),r=fr.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},fr.internal.getWidth=function(e){var t=0;return Jn(e)==="object"&&(t=tU(e.Rect[2])),t},fr.internal.getHeight=function(e){var t=0;return Jn(e)==="object"&&(t=tU(e.Rect[3])),t};var JEe=wo.addField=function(e){if(ZEe(this,e),!(e instanceof hu))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};wo.AcroFormChoiceField=KA,wo.AcroFormListBox=GA,wo.AcroFormComboBox=$A,wo.AcroFormEditBox=Q0,wo.AcroFormButton=ta,wo.AcroFormPushButton=H0,wo.AcroFormRadioButton=WA,wo.AcroFormCheckBox=z0,wo.AcroFormTextField=hp,wo.AcroFormPasswordField=V0,wo.AcroFormAppearance=fr,wo.AcroForm={ChoiceField:KA,ListBox:GA,ComboBox:$A,EditBox:Q0,Button:ta,PushButton:H0,RadioButton:WA,CheckBox:z0,TextField:hp,PasswordField:V0,Appearance:fr},Ir.AcroForm={ChoiceField:KA,ListBox:GA,ComboBox:$A,EditBox:Q0,Button:ta,PushButton:H0,RadioButton:WA,CheckBox:z0,TextField:hp,PasswordField:V0,Appearance:fr};var eMe=Ir.AcroForm;function s$(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){e.__addimage__={};var t="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(Q,N){var R,P,T,x,_,k=t;if((N=N||t)==="RGBA"||Q.data!==void 0&&Q.data instanceof Uint8ClampedArray&&"height"in Q&&"width"in Q)return"RGBA";if(E(Q))for(_ in r)for(T=r[_],R=0;R<T.length;R+=1){for(x=!0,P=0;P<T[R].length;P+=1)if(T[R][P]!==void 0&&T[R][P]!==Q[P]){x=!1;break}if(x===!0){k=_;break}}else for(_ in r)for(T=r[_],R=0;R<T.length;R+=1){for(x=!0,P=0;P<T[R].length;P+=1)if(T[R][P]!==void 0&&T[R][P]!==Q.charCodeAt(P)){x=!1;break}if(x===!0){k=_;break}}return k===t&&N!==t&&(k=N),k},i=function Q(N){for(var R=this.internal.write,P=this.internal.putStream,T=(0,this.internal.getFilters)();T.indexOf("FlateEncode")!==-1;)T.splice(T.indexOf("FlateEncode"),1);N.objectId=this.internal.newObject();var x=[];if(x.push({key:"Type",value:"/XObject"}),x.push({key:"Subtype",value:"/Image"}),x.push({key:"Width",value:N.width}),x.push({key:"Height",value:N.height}),N.colorSpace===A.INDEXED?x.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(N.palette.length/3-1)+" "+("sMask"in N&&N.sMask!==void 0?N.objectId+2:N.objectId+1)+" 0 R]"}):(x.push({key:"ColorSpace",value:"/"+N.colorSpace}),N.colorSpace===A.DEVICE_CMYK&&x.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),x.push({key:"BitsPerComponent",value:N.bitsPerComponent}),"decodeParameters"in N&&N.decodeParameters!==void 0&&x.push({key:"DecodeParms",value:"<<"+N.decodeParameters+">>"}),"transparency"in N&&Array.isArray(N.transparency)){for(var _="",k=0,B=N.transparency.length;k<B;k++)_+=N.transparency[k]+" "+N.transparency[k]+" ";x.push({key:"Mask",value:"["+_+"]"})}N.sMask!==void 0&&x.push({key:"SMask",value:N.objectId+1+" 0 R"});var F=N.filter!==void 0?["/"+N.filter]:void 0;if(P({data:N.data,additionalKeyValues:x,alreadyAppliedFilters:F,objectId:N.objectId}),R("endobj"),"sMask"in N&&N.sMask!==void 0){var K="/Predictor "+N.predictor+" /Colors 1 /BitsPerComponent "+N.bitsPerComponent+" /Columns "+N.width,L={width:N.width,height:N.height,colorSpace:"DeviceGray",bitsPerComponent:N.bitsPerComponent,decodeParameters:K,data:N.sMask};"filter"in N&&(L.filter=N.filter),Q.call(this,L)}if(N.colorSpace===A.INDEXED){var z=this.internal.newObject();P({data:D(new Uint8Array(N.palette)),objectId:z}),R("endobj")}},o=function(){var Q=this.internal.collections.addImage_images;for(var N in Q)i.call(this,Q[N])},a=function(){var Q,N=this.internal.collections.addImage_images,R=this.internal.write;for(var P in N)R("/I"+(Q=N[P]).index,Q.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",a))},l=function(){var Q=this.internal.collections.addImage_images;return s.call(this),Q},c=function(){return Object.keys(this.internal.collections.addImage_images).length},u=function(Q){return typeof e["process"+Q.toUpperCase()]=="function"},d=function(Q){return Jn(Q)==="object"&&Q.nodeType===1},h=function(Q,N){if(Q.nodeName==="IMG"&&Q.hasAttribute("src")){var R=""+Q.getAttribute("src");if(R.indexOf("data:image/")===0)return j0(unescape(R).split("base64,").pop());var P=e.loadFile(R,!0);if(P!==void 0)return P}if(Q.nodeName==="CANVAS"){if(Q.width===0||Q.height===0)throw new Error("Given canvas must have data. Canvas width: "+Q.width+", height: "+Q.height);var T;switch(N){case"PNG":T="image/png";break;case"WEBP":T="image/webp";break;case"JPEG":case"JPG":default:T="image/jpeg"}return j0(Q.toDataURL(T,1).split("base64,").pop())}},f=function(Q){var N=this.internal.collections.addImage_images;if(N){for(var R in N)if(Q===N[R].alias)return N[R]}},p=function(Q,N,R){return Q||N||(Q=-96,N=-96),Q<0&&(Q=-1*R.width*72/Q/this.internal.scaleFactor),N<0&&(N=-1*R.height*72/N/this.internal.scaleFactor),Q===0&&(Q=N*R.width/R.height),N===0&&(N=Q*R.height/R.width),[Q,N]},g=function(Q,N,R,P,T,x){var _=p.call(this,R,P,T),k=this.internal.getCoordinateString,B=this.internal.getVerticalCoordinateString,F=l.call(this);if(R=_[0],P=_[1],F[T.index]=T,x){x*=Math.PI/180;var K=Math.cos(x),L=Math.sin(x),z=function(ee){return ee.toFixed(4)},$=[z(K),z(L),z(-1*L),z(K),0,0,"cm"]}this.internal.write("q"),x?(this.internal.write([1,"0","0",1,k(Q),B(N+P),"cm"].join(" ")),this.internal.write($.join(" ")),this.internal.write([k(R),"0","0",k(P),"0","0","cm"].join(" "))):this.internal.write([k(R),"0","0",k(P),k(Q),B(N+P),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+T.index+" Do"),this.internal.write("Q")},A=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var m=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(Q){var N,R,P=0;if(typeof Q=="string")for(R=Q.length,N=0;N<R;N++)P=(P<<5)-P+Q.charCodeAt(N),P|=0;else if(E(Q))for(R=Q.byteLength/2,N=0;N<R;N++)P=(P<<5)-P+Q[N],P|=0;return P},w=e.__addimage__.validateStringAsBase64=function(Q){(Q=Q||"").toString().trim();var N=!0;return Q.length===0&&(N=!1),Q.length%4!=0&&(N=!1),/^[A-Za-z0-9+/]+$/.test(Q.substr(0,Q.length-2))===!1&&(N=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Q.substr(-2))===!1&&(N=!1),N},S=e.__addimage__.extractImageFromDataUrl=function(Q){var N=(Q=Q||"").split("base64,"),R=null;if(N.length===2){var P=/^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(N[0]);Array.isArray(P)&&(R={mimeType:P[1],charset:P[2],data:N[1]})}return R},C=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(Q){return C()&&Q instanceof ArrayBuffer};var E=e.__addimage__.isArrayBufferView=function(Q){return C()&&typeof Uint32Array<"u"&&(Q instanceof Int8Array||Q instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&Q instanceof Uint8ClampedArray||Q instanceof Int16Array||Q instanceof Uint16Array||Q instanceof Int32Array||Q instanceof Uint32Array||Q instanceof Float32Array||Q instanceof Float64Array)},I=e.__addimage__.binaryStringToUint8Array=function(Q){for(var N=Q.length,R=new Uint8Array(N),P=0;P<N;P++)R[P]=Q.charCodeAt(P);return R},D=e.__addimage__.arrayBufferToBinaryString=function(Q){for(var N="",R=E(Q)?Q:new Uint8Array(Q),P=0;P<R.length;P+=8192)N+=String.fromCharCode.apply(null,R.subarray(P,P+8192));return N};e.addImage=function(){var Q,N,R,P,T,x,_,k,B;if(typeof arguments[1]=="number"?(N=t,R=arguments[1],P=arguments[2],T=arguments[3],x=arguments[4],_=arguments[5],k=arguments[6],B=arguments[7]):(N=arguments[1],R=arguments[2],P=arguments[3],T=arguments[4],x=arguments[5],_=arguments[6],k=arguments[7],B=arguments[8]),Jn(Q=arguments[0])==="object"&&!d(Q)&&"imageData"in Q){var F=Q;Q=F.imageData,N=F.format||N||t,R=F.x||R||0,P=F.y||P||0,T=F.w||F.width||T,x=F.h||F.height||x,_=F.alias||_,k=F.compression||k,B=F.rotation||F.angle||B}var K=this.internal.getFilters();if(k===void 0&&K.indexOf("FlateEncode")!==-1&&(k="SLOW"),isNaN(R)||isNaN(P))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var L=O.call(this,Q,N,_,k);return g.call(this,R,P,T,x,L,B),this};var O=function(Q,N,R,P){var T,x,_;if(typeof Q=="string"&&n(Q)===t){Q=unescape(Q);var k=U(Q,!1);(k!==""||(k=e.loadFile(Q,!0))!==void 0)&&(Q=k)}if(d(Q)&&(Q=h(Q,N)),N=n(Q,N),!u(N))throw new Error("addImage does not support files of type '"+N+"', please ensure that a plugin for '"+N+"' support is added.");if(((_=R)==null||_.length===0)&&(R=function(B){return typeof B=="string"||E(B)?y(B):E(B.data)?y(B.data):null}(Q)),(T=f.call(this,R))||(C()&&(Q instanceof Uint8Array||N==="RGBA"||(x=Q,Q=I(Q))),T=this["process"+N.toUpperCase()](Q,c.call(this),R,function(B){return B&&typeof B=="string"&&(B=B.toUpperCase()),B in e.image_compression?B:m.NONE}(P),x)),!T)throw new Error("An unknown error occurred whilst processing the image.");return T},U=e.__addimage__.convertBase64ToBinaryString=function(Q,N){var R;N=typeof N!="boolean"||N;var P,T="";if(typeof Q=="string"){P=(R=S(Q))!==null?R.data:Q;try{T=j0(P)}catch(x){if(N)throw w(P)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+x.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return T};e.getImageProperties=function(Q){var N,R,P="";if(d(Q)&&(Q=h(Q)),typeof Q=="string"&&n(Q)===t&&((P=U(Q,!1))===""&&(P=e.loadFile(Q)||""),Q=P),R=n(Q),!u(R))throw new Error("addImage does not support files of type '"+R+"', please ensure that a plugin for '"+R+"' support is added.");if(!C()||Q instanceof Uint8Array||(Q=I(Q)),!(N=this["process"+R.toUpperCase()](Q)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=R,N}})(Ir.API),function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Ir.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,o,a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,l=this.internal.getPageInfoByObjId(r.objId),c=r.pageContext.annotations,u=!1,d=0;d<c.length&&!u;d++)switch((n=c[d]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(u!=0){this.internal.write("/Annots [");for(var h=0;h<c.length;h++){n=c[h];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var g=this.internal.newAdditionalObject(),A=this.internal.newAdditionalObject(),m=this.internal.getEncryptor(g.objId),y=n.title||"Note";o="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(m(n.contents))+")",o+=" /Popup "+A.objId+" 0 R",o+=" /P "+l.objId+" 0 R",o+=" /T ("+f(m(y))+") >>",g.content=o;var w=g.objId+" 0 R";o="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(o+=" /Open true"),o+=" >>",A.content=o,this.internal.write(g.objId,"0 R",A.objId,"0 R");break;case"freetext":i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";o="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(n.contents))+")",o+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",o+=" /Border [0 0 0]",o+=" >>",this.internal.write(o);break;case"link":if(n.options.name){var C=this.annotations._nameMap[n.options.name];n.options.pageNumber=C.page,n.options.top=C.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",o="",n.options.url)o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(n.options.url))+") >>";else if(n.options.pageNumber)switch(o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":o+=" /Fit]";break;case"FitH":o+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,o+=" /FitV "+n.options.left+"]";break;case"XYZ":default:var E=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),o+=" /XYZ "+n.options.left+" "+E+" "+n.options.zoom+"]"}o!=""&&(o+=" >>",this.internal.write(o))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,i,o,a){var s=this.internal.getCurrentPageInfo(),l=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:l(r),y:c(n),w:l(r+i),h:c(n+o)},options:a,type:"link"})},e.textWithLink=function(r,n,i,o){var a,s,l=this.getTextWidth(r),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(o.maxWidth!==void 0){s=o.maxWidth;var u=this.splitTextToSize(r,s).length;a=Math.ceil(c*u)}else s=l,a=c;return this.text(r,n,i,o),i+=.2*c,o.align==="center"&&(n-=l/2),o.align==="right"&&(n-=l),this.link(n,i-c,s,a,o),l},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Ir.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(g){return t[g.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(g){return typeof g=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(g)},s=e.__arabicParser__.isArabicEndLetter=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length<=2},l=e.__arabicParser__.isArabicAlfLetter=function(g){return a(g)&&i.indexOf(g.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=1};var c=e.__arabicParser__.arabicLetterHasFinalForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(g){return a(g)&&o(g)&&t[g.charCodeAt(0)].length==4},d=e.__arabicParser__.resolveLigatures=function(g){var A=0,m=r,y="",w=0;for(A=0;A<g.length;A+=1)m[g.charCodeAt(A)]!==void 0?(w++,typeof(m=m[g.charCodeAt(A)])=="number"&&(y+=String.fromCharCode(m),m=r,w=0),A===g.length-1&&(m=r,y+=g.charAt(A-(w-1)),A-=w-1,w=0)):(m=r,y+=g.charAt(A-w),A-=w,w=0);return y};e.__arabicParser__.isArabicDiacritic=function(g){return g!==void 0&&n[g.charCodeAt(0)]!==void 0};var h=e.__arabicParser__.getCorrectForm=function(g,A,m){return a(g)?o(g)===!1?-1:!c(g)||!a(A)&&!a(m)||!a(m)&&s(A)||s(g)&&!a(A)||s(g)&&l(A)||s(g)&&s(A)?0:u(g)&&a(A)&&!s(A)&&a(m)&&c(m)?3:s(g)||!a(m)?1:2:-1},f=function(g){var A=0,m=0,y=0,w="",S="",C="",E=(g=g||"").split("\\s+"),I=[];for(A=0;A<E.length;A+=1){for(I.push(""),m=0;m<E[A].length;m+=1)w=E[A][m],S=E[A][m-1],C=E[A][m+1],a(w)?(y=h(w,S,C),I[A]+=y!==-1?String.fromCharCode(t[w.charCodeAt(0)][y]):w):I[A]+=w;I[A]=d(I[A])}return I.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var g,A=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,m=[];if(Array.isArray(A)){var y=0;for(m=[],y=0;y<A.length;y+=1)Array.isArray(A[y])?m.push([f(A[y][0]),A[y][1],A[y][2]]):m.push([f(A[y])]);g=m}else g=f(A);return typeof arguments[0]=="string"?g:(arguments[0].text=g,arguments[0])};e.events.push(["preProcessText",p])}(Ir.API),Ir.API.autoPrint=function(e){var t;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})}return this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var o=[];Object.defineProperty(this,"childNodes",{get:function(){return o},set:function(s){o=s}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(s){a=s}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Ir.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(g){l=g}});var c=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return c},set:function(g){c=g}});var u=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return u},set:function(g){u=g}});var d=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return d},set:function(g){d=g}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(g){h=g}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(g){f=g}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(g){p=g}}),this};o.prototype.clone=function(){return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},o.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(l){return n.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},e.getTextDimensions=function(l,c){n.call(this);var u=(c=c||{}).fontSize||this.getFontSize(),d=c.font||this.getFont(),h=c.scaleFactor||this.internal.scaleFactor,f=0,p=0,g=0,A=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var m=c.maxWidth;m>0?typeof l=="string"?l=this.splitTextToSize(l,m):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(w,S){return w.concat(A.splitTextToSize(S,m))},[])):l=Array.isArray(l)?l:[l];for(var y=0;y<l.length;y++)f<(g=this.getStringUnitWidth(l[y],{font:d})*u)&&(f=g);return f!==0&&(p=l.length),{w:f/=h,h:Math.max((p*u*this.getLineHeightFactor()-u*(this.getLineHeightFactor()-1))/h,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var l=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var l;l=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var c=this.internal.__cell__.lastCell,u=this.internal.__cell__.padding,d=this.internal.__cell__.margins||t,h=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return c.lineNumber!==void 0&&(c.lineNumber===l.lineNumber?(l.x=(c.x||0)+(c.width||0),l.y=c.y||0):c.y+c.height+l.height+d.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=d.top,f&&h&&(this.printHeaderRow(l.lineNumber,!0),l.y+=h[0].height)):l.y=c.y+c.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,r===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-u,l.y+u,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+u,{align:"center",baseline:"top",maxWidth:l.width-u-u}):this.text(l.text,l.x+u,l.y+u,{align:"left",baseline:"top",maxWidth:l.width-u-u})),this.internal.__cell__.lastCell=l,this};e.table=function(l,c,u,d,h){if(n.call(this),!u)throw new Error("No data for PDF table.");var f,p,g,A,m=[],y=[],w=[],S={},C={},E=[],I=[],D=(h=h||{}).autoSize||!1,O=h.printHeaders!==!1,U=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,Q=h.margins||Object.assign({width:this.getPageWidth()},t),N=typeof h.padding=="number"?h.padding:3,R=h.headerBackgroundColor||"#c8c8c8",P=h.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=O,this.internal.__cell__.margins=Q,this.internal.__cell__.table_font_size=U,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=R,this.internal.__cell__.headerTextColor=P,this.setFontSize(U),d==null)y=m=Object.keys(u[0]),w=m.map(function(){return"left"});else if(Array.isArray(d)&&Jn(d[0])==="object")for(m=d.map(function(F){return F.name}),y=d.map(function(F){return F.prompt||F.name||""}),w=d.map(function(F){return F.align||"left"}),f=0;f<d.length;f+=1)C[d[f].name]=d[f].width*(19.049976/25.4);else Array.isArray(d)&&typeof d[0]=="string"&&(y=m=d,w=m.map(function(){return"left"}));if(D||Array.isArray(d)&&typeof d[0]=="string")for(f=0;f<m.length;f+=1){for(S[A=m[f]]=u.map(function(F){return F[A]}),this.setFont(void 0,"bold"),E.push(this.getTextDimensions(y[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=S[A],this.setFont(void 0,"normal"),g=0;g<p.length;g+=1)E.push(this.getTextDimensions(p[g],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);C[A]=Math.max.apply(null,E)+N+N,E=[]}if(O){var T={};for(f=0;f<m.length;f+=1)T[m[f]]={},T[m[f]].text=y[f],T[m[f]].align=w[f];var x=s.call(this,T,C);I=m.map(function(F){return new o(l,c,C[F],x,T[F].text,void 0,T[F].align)}),this.setTableHeaderRow(I),this.printHeaderRow(1,!1)}var _=d.reduce(function(F,K){return F[K.name]=K.align,F},{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var k=s.call(this,u[f],C);for(g=0;g<m.length;g+=1){var B=u[f][m[g]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:g,data:B},this),a.call(this,new o(l,c,C[m[g]],k,B,f+2,_[m[g]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=c,this};var s=function(l,c){var u=this.internal.__cell__.padding,d=this.internal.__cell__.table_font_size,h=this.internal.scaleFactor;return Object.keys(l).map(function(f){var p=l[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,c[f]-u-u)},this).map(function(f){return this.getLineHeightFactor()*f.length*d/h+u+u},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(l){n.call(this),this.internal.__cell__.tableHeaderRow=l},e.printHeaderRow=function(l,c){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var u;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var d=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(d[0],d[1],d[2],d[3],void 0,-1)}this.setFont(void 0,"bold");for(var h=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){u=this.internal.__cell__.tableHeaderRow[f].clone(),c&&(u.y=this.internal.__cell__.margins.top||0,h.push(u)),u.lineNumber=l;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,u),this.setTextColor(p)}h.length>0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}}(Ir.API);var l$={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},c$=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],u8=s$(c$),u$=[100,200,300,400,500,600,700,800,900],tMe=s$(u$);function d8(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(o){return l$[o=o||"normal"]?o:"normal"}(e.style),n=function(o){if(!o)return 400;if(typeof o=="number")return o>=100&&o<=900&&o%100==0?o:400;if(/^\d00$/.test(o))return parseInt(o);switch(o){case"bold":return 700;case"normal":default:return 400}}(e.weight),i=function(o){return typeof u8[o=o||"normal"]=="number"?o:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function rU(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var rMe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},nU={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iU(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function nMe(e,t,r){for(var n=(r=r||{}).defaultFontFamily||"times",i=Object.assign({},rMe,r.genericFontFamilies||{}),o=null,a=null,s=0;s<t.length;++s)if(i[(o=d8(t[s])).family]&&(o.family=i[o.family]),e.hasOwnProperty(o.family)){a=e[o.family];break}if(!(a=a||e[n]))throw new Error("Could not find a font-family for the rule '"+iU(o)+"' and default family '"+n+"'.");if(a=function(l,c){if(c[l])return c[l];var u=u8[l],d=u<=u8.normal?-1:1,h=rU(c,c$,u,d);if(!h)throw new Error("Could not find a matching font-stretch value for "+l);return h}(o.stretch,a),a=function(l,c){if(c[l])return c[l];for(var u=l$[l],d=0;d<u.length;++d)if(c[u[d]])return c[u[d]];throw new Error("Could not find a matching font-style for "+l)}(o.style,a),!(a=function(l,c){if(c[l])return c[l];if(l===400&&c[500])return c[500];if(l===500&&c[400])return c[400];var u=tMe[l],d=rU(c,u$,u,l<400?-1:1);if(!d)throw new Error("Could not find a matching font-weight for value "+l);return d}(o.weight,a)))throw new Error("Failed to resolve a font for the rule '"+iU(o)+"'.");return a}function oU(e){return e.trimLeft()}function iMe(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function oMe(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var e1,aU,sU,lU=["times"];(function(e){var t,r,n,i,o,a,s,l,c,u=function(L){return L=L||{},this.isStrokeTransparent=L.isStrokeTransparent||!1,this.strokeOpacity=L.strokeOpacity||1,this.strokeStyle=L.strokeStyle||"#000000",this.fillStyle=L.fillStyle||"#000000",this.isFillTransparent=L.isFillTransparent||!1,this.fillOpacity=L.fillOpacity||1,this.font=L.font||"10px sans-serif",this.textBaseline=L.textBaseline||"alphabetic",this.textAlign=L.textAlign||"left",this.lineWidth=L.lineWidth||1,this.lineJoin=L.lineJoin||"miter",this.lineCap=L.lineCap||"butt",this.path=L.path||[],this.transform=L.transform!==void 0?L.transform.clone():new l,this.globalCompositeOperation=L.globalCompositeOperation||"normal",this.globalAlpha=L.globalAlpha||1,this.clip_path=L.clip_path||[],this.currentPoint=L.currentPoint||new a,this.miterLimit=L.miterLimit||10,this.lastPoint=L.lastPoint||new a,this.lineDashOffset=L.lineDashOffset||0,this.lineDash=L.lineDash||[],this.margin=L.margin||[0,0,0,0],this.prevPageLastElemOffset=L.prevPageLastElemOffset||0,this.ignoreClearRect=typeof L.ignoreClearRect!="boolean"||L.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new d(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,a=this.internal.Point,s=this.internal.Rectangle,l=this.internal.Matrix,c=new u}]);var d=function(L){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var z=L;Object.defineProperty(this,"pdf",{get:function(){return z}});var $=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return $},set:function(ae){$=!!ae}});var ee=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ee},set:function(ae){ee=!!ae}});var q=0;Object.defineProperty(this,"posX",{get:function(){return q},set:function(ae){isNaN(ae)||(q=ae)}});var J=0;Object.defineProperty(this,"posY",{get:function(){return J},set:function(ae){isNaN(ae)||(J=ae)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(ae){var ce;typeof ae=="number"?ce=[ae,ae,ae,ae]:((ce=new Array(4))[0]=ae[0],ce[1]=ae.length>=2?ae[1]:ce[0],ce[2]=ae.length>=3?ae[2]:ce[0],ce[3]=ae.length>=4?ae[3]:ce[1]),c.margin=ce}});var V=!1;Object.defineProperty(this,"autoPaging",{get:function(){return V},set:function(ae){V=ae}});var H=0;Object.defineProperty(this,"lastBreak",{get:function(){return H},set:function(ae){H=ae}});var Z=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Z},set:function(ae){Z=ae}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(ae){ae instanceof u&&(c=ae)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(ae){c.path=ae}});var le=[];Object.defineProperty(this,"ctxStack",{get:function(){return le},set:function(ae){le=ae}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ae){var ce;ce=h(ae),this.ctx.fillStyle=ce.style,this.ctx.isFillTransparent=ce.a===0,this.ctx.fillOpacity=ce.a,this.pdf.setFillColor(ce.r,ce.g,ce.b,{a:ce.a}),this.pdf.setTextColor(ce.r,ce.g,ce.b,{a:ce.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ae){var ce=h(ae);this.ctx.strokeStyle=ce.style,this.ctx.isStrokeTransparent=ce.a===0,this.ctx.strokeOpacity=ce.a,ce.a===0?this.pdf.setDrawColor(255,255,255):(ce.a,this.pdf.setDrawColor(ce.r,ce.g,ce.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ae){["butt","round","square"].indexOf(ae)!==-1&&(this.ctx.lineCap=ae,this.pdf.setLineCap(ae))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ae){isNaN(ae)||(this.ctx.lineWidth=ae,this.pdf.setLineWidth(ae))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ae){["bevel","round","miter"].indexOf(ae)!==-1&&(this.ctx.lineJoin=ae,this.pdf.setLineJoin(ae))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ae){isNaN(ae)||(this.ctx.miterLimit=ae,this.pdf.setMiterLimit(ae))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ae){this.ctx.textBaseline=ae}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ae){["right","end","center","left","start"].indexOf(ae)!==-1&&(this.ctx.textAlign=ae)}});var pe=null;function te(ae,ce){if(pe===null){var de=function(Ae){var ue=[];return Object.keys(Ae).forEach(function(ge){Ae[ge].forEach(function(ye){var ve=null;switch(ye){case"bold":ve={family:ge,weight:"bold"};break;case"italic":ve={family:ge,style:"italic"};break;case"bolditalic":ve={family:ge,weight:"bold",style:"italic"};break;case"":case"normal":ve={family:ge}}ve!==null&&(ve.ref={name:ge,style:ye},ue.push(ve))})}),ue}(ae.getFontList());pe=function(Ae){for(var ue={},ge=0;ge<Ae.length;++ge){var ye=d8(Ae[ge]),ve=ye.family,Te=ye.stretch,Ce=ye.style,Fe=ye.weight;ue[ve]=ue[ve]||{},ue[ve][Te]=ue[ve][Te]||{},ue[ve][Te][Ce]=ue[ve][Te][Ce]||{},ue[ve][Te][Ce][Fe]=ye}return ue}(de.concat(ce))}return pe}var se=null;Object.defineProperty(this,"fontFaces",{get:function(){return se},set:function(ae){pe=null,se=ae}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ae){var ce;if(this.ctx.font=ae,(ce=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(ae))!==null){var de=ce[1],Ae=(ce[2],ce[3]),ue=ce[4],ge=(ce[5],ce[6]),ye=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ue)[2];ue=Math.floor(ye==="px"?parseFloat(ue)*this.pdf.internal.scaleFactor:ye==="em"?parseFloat(ue)*this.pdf.getFontSize():parseFloat(ue)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ue);var ve=function(Ue){var Je,rt,Rt=[],ht=Ue.trim();if(ht==="")return lU;if(ht in nU)return[nU[ht]];for(;ht!=="";){switch(rt=null,Je=(ht=oU(ht)).charAt(0)){case'"':case"'":rt=iMe(ht.substring(1),Je);break;default:rt=oMe(ht)}if(rt===null||(Rt.push(rt[0]),(ht=oU(rt[1]))!==""&&ht.charAt(0)!==","))return lU;ht=ht.replace(/^,/,"")}return Rt}(ge);if(this.fontFaces){var Te=nMe(te(this.pdf,this.fontFaces),ve.map(function(Ue){return{family:Ue,stretch:"normal",weight:Ae,style:de}}));this.pdf.setFont(Te.ref.name,Te.ref.style)}else{var Ce="";(Ae==="bold"||parseInt(Ae,10)>=700||de==="bold")&&(Ce="bold"),de==="italic"&&(Ce+="italic"),Ce.length===0&&(Ce="normal");for(var Fe="",Se={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},De=0;De<ve.length;De++){if(this.pdf.internal.getFont(ve[De],Ce,{noFallback:!0,disableWarning:!0})!==void 0){Fe=ve[De];break}if(Ce==="bolditalic"&&this.pdf.internal.getFont(ve[De],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Fe=ve[De],Ce="bold";else if(this.pdf.internal.getFont(ve[De],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Fe=ve[De],Ce="normal";break}}if(Fe===""){for(var _e=0;_e<ve.length;_e++)if(Se[ve[_e]]){Fe=Se[ve[_e]];break}}Fe=Fe===""?"Times":Fe,this.pdf.setFont(Fe,Ce)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ae){this.ctx.globalCompositeOperation=ae}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ae){this.ctx.globalAlpha=ae}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ae){this.ctx.lineDashOffset=ae,K.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ae){this.ctx.lineDash=ae,K.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ae){this.ctx.ignoreClearRect=!!ae}})};d.prototype.setLineDash=function(L){this.lineDash=L},d.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},d.prototype.fill=function(){S.call(this,"fill",!1)},d.prototype.stroke=function(){S.call(this,"stroke",!1)},d.prototype.beginPath=function(){this.path=[{type:"begin"}]},d.prototype.moveTo=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var $=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"mt",x:$.x,y:$.y}),this.ctx.lastPoint=new a(L,z)},d.prototype.closePath=function(){var L=new a(0,0),z=0;for(z=this.path.length-1;z!==-1;z--)if(this.path[z].type==="begin"&&Jn(this.path[z+1])==="object"&&typeof this.path[z+1].x=="number"){L=new a(this.path[z+1].x,this.path[z+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(L.x,L.y)},d.prototype.lineTo=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var $=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"lt",x:$.x,y:$.y}),this.ctx.lastPoint=new a($.x,$.y)},d.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},d.prototype.quadraticCurveTo=function(L,z,$,ee){if(isNaN($)||isNaN(ee)||isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var q=this.ctx.transform.applyToPoint(new a($,ee)),J=this.ctx.transform.applyToPoint(new a(L,z));this.path.push({type:"qct",x1:J.x,y1:J.y,x:q.x,y:q.y}),this.ctx.lastPoint=new a(q.x,q.y)},d.prototype.bezierCurveTo=function(L,z,$,ee,q,J){if(isNaN(q)||isNaN(J)||isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var V=this.ctx.transform.applyToPoint(new a(q,J)),H=this.ctx.transform.applyToPoint(new a(L,z)),Z=this.ctx.transform.applyToPoint(new a($,ee));this.path.push({type:"bct",x1:H.x,y1:H.y,x2:Z.x,y2:Z.y,x:V.x,y:V.y}),this.ctx.lastPoint=new a(V.x,V.y)},d.prototype.arc=function(L,z,$,ee,q,J){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee)||isNaN(q))throw Si.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(J=!!J,!this.ctx.transform.isIdentity){var V=this.ctx.transform.applyToPoint(new a(L,z));L=V.x,z=V.y;var H=this.ctx.transform.applyToPoint(new a(0,$)),Z=this.ctx.transform.applyToPoint(new a(0,0));$=Math.sqrt(Math.pow(H.x-Z.x,2)+Math.pow(H.y-Z.y,2))}Math.abs(q-ee)>=2*Math.PI&&(ee=0,q=2*Math.PI),this.path.push({type:"arc",x:L,y:z,radius:$,startAngle:ee,endAngle:q,counterclockwise:J})},d.prototype.arcTo=function(L,z,$,ee,q){throw new Error("arcTo not implemented.")},d.prototype.rect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(L,z),this.lineTo(L+$,z),this.lineTo(L+$,z+ee),this.lineTo(L,z+ee),this.lineTo(L,z),this.lineTo(L+$,z),this.lineTo(L,z)},d.prototype.fillRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var q={};this.lineCap!=="butt"&&(q.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(q.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(L,z,$,ee),this.fill(),q.hasOwnProperty("lineCap")&&(this.lineCap=q.lineCap),q.hasOwnProperty("lineJoin")&&(this.lineJoin=q.lineJoin)}},d.prototype.strokeRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(L,z,$,ee),this.stroke())},d.prototype.clearRect=function(L,z,$,ee){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee))throw Si.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(L,z,$,ee))},d.prototype.save=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("q");if(this.pdf.setPage(z),L){this.ctx.fontSize=this.pdf.internal.getFontSize();var ee=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ee}},d.prototype.restore=function(L){L=typeof L!="boolean"||L;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("Q");this.pdf.setPage(z),L&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},d.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(L){var z,$,ee,q;if(L.isCanvasGradient===!0&&(L=L.getColor()),!L)return{r:0,g:0,b:0,a:0,style:L};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(L))z=0,$=0,ee=0,q=0;else{var J=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(L);if(J!==null)z=parseInt(J[1]),$=parseInt(J[2]),ee=parseInt(J[3]),q=1;else if((J=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(L))!==null)z=parseInt(J[1]),$=parseInt(J[2]),ee=parseInt(J[3]),q=parseFloat(J[4]);else{if(q=1,typeof L=="string"&&L.charAt(0)!=="#"){var V=new t$(L);L=V.ok?V.toHex():"#000000"}L.length===4?(z=L.substring(1,2),z+=z,$=L.substring(2,3),$+=$,ee=L.substring(3,4),ee+=ee):(z=L.substring(1,3),$=L.substring(3,5),ee=L.substring(5,7)),z=parseInt(z,16),$=parseInt($,16),ee=parseInt(ee,16)}}return{r:z,g:$,b:ee,a:q,style:L}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};d.prototype.fillText=function(L,z,$,ee){if(isNaN(z)||isNaN($)||typeof L!="string")throw Si.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ee=isNaN(ee)?void 0:ee,!f.call(this)){var q=k(this.ctx.transform.rotation),J=this.ctx.transform.scaleX;N.call(this,{text:L,x:z,y:$,scale:J,angle:q,align:this.textAlign,maxWidth:ee})}},d.prototype.strokeText=function(L,z,$,ee){if(isNaN(z)||isNaN($)||typeof L!="string")throw Si.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){ee=isNaN(ee)?void 0:ee;var q=k(this.ctx.transform.rotation),J=this.ctx.transform.scaleX;N.call(this,{text:L,x:z,y:$,scale:J,renderingMode:"stroke",angle:q,align:this.textAlign,maxWidth:ee})}},d.prototype.measureText=function(L){if(typeof L!="string")throw Si.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var z=this.pdf,$=this.pdf.internal.scaleFactor,ee=z.internal.getFontSize(),q=z.getStringUnitWidth(L)*ee/z.internal.scaleFactor,J=function(V){var H=(V=V||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return H}}),this};return new J({width:q*=Math.round(96*$/72*1e4)/1e4})},d.prototype.scale=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var $=new l(L,0,0,z,0,0);this.ctx.transform=this.ctx.transform.multiply($)},d.prototype.rotate=function(L){if(isNaN(L))throw Si.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var z=new l(Math.cos(L),Math.sin(L),-Math.sin(L),Math.cos(L),0,0);this.ctx.transform=this.ctx.transform.multiply(z)},d.prototype.translate=function(L,z){if(isNaN(L)||isNaN(z))throw Si.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var $=new l(1,0,0,1,L,z);this.ctx.transform=this.ctx.transform.multiply($)},d.prototype.transform=function(L,z,$,ee,q,J){if(isNaN(L)||isNaN(z)||isNaN($)||isNaN(ee)||isNaN(q)||isNaN(J))throw Si.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var V=new l(L,z,$,ee,q,J);this.ctx.transform=this.ctx.transform.multiply(V)},d.prototype.setTransform=function(L,z,$,ee,q,J){L=isNaN(L)?1:L,z=isNaN(z)?0:z,$=isNaN($)?0:$,ee=isNaN(ee)?1:ee,q=isNaN(q)?0:q,J=isNaN(J)?0:J,this.ctx.transform=new l(L,z,$,ee,q,J)};var g=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(L,z,$,ee,q,J,V,H,Z){var le=this.pdf.getImageProperties(L),pe=1,te=1,se=1,ae=1;ee!==void 0&&H!==void 0&&(se=H/ee,ae=Z/q,pe=le.width/ee*H/ee,te=le.height/q*Z/q),J===void 0&&(J=z,V=$,z=0,$=0),ee!==void 0&&H===void 0&&(H=ee,Z=q),ee===void 0&&H===void 0&&(H=le.width,Z=le.height);for(var ce,de=this.ctx.transform.decompose(),Ae=k(de.rotate.shx),ue=new l,ge=(ue=(ue=(ue=ue.multiply(de.translate)).multiply(de.skew)).multiply(de.scale)).applyToRectangle(new s(J-z*se,V-$*ae,ee*pe,q*te)),ye=A.call(this,ge),ve=[],Te=0;Te<ye.length;Te+=1)ve.indexOf(ye[Te])===-1&&ve.push(ye[Te]);if(w(ve),this.autoPaging)for(var Ce=ve[0],Fe=ve[ve.length-1],Se=Ce;Se<Fe+1;Se++){this.pdf.setPage(Se);var De=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],_e=Se===1?this.posY+this.margin[0]:this.margin[0],Ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],rt=Se===1?0:Ue+(Se-2)*Je;if(this.ctx.clip_path.length!==0){var Rt=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(ce,this.posX+this.margin[3],-rt+_e+this.ctx.prevPageLastElemOffset),C.call(this,"fill",!0),this.path=Rt}var ht=JSON.parse(JSON.stringify(ge));ht=y([ht],this.posX+this.margin[3],-rt+_e+this.ctx.prevPageLastElemOffset)[0];var At=(Se>Ce||Se<Fe)&&g.call(this);At&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],De,Je,null).clip().discardPath()),this.pdf.addImage(L,"JPEG",ht.x,ht.y,ht.w,ht.h,null,null,Ae),At&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(L,"JPEG",ge.x,ge.y,ge.w,ge.h,null,null,Ae)};var A=function(L,z,$){var ee=[];z=z||this.pdf.internal.pageSize.width,$=$||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var q=this.posY+this.ctx.prevPageLastElemOffset;switch(L.type){default:case"mt":case"lt":ee.push(Math.floor((L.y+q)/$)+1);break;case"arc":ee.push(Math.floor((L.y+q-L.radius)/$)+1),ee.push(Math.floor((L.y+q+L.radius)/$)+1);break;case"qct":var J=B(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x,L.y);ee.push(Math.floor((J.y+q)/$)+1),ee.push(Math.floor((J.y+J.h+q)/$)+1);break;case"bct":var V=F(this.ctx.lastPoint.x,this.ctx.lastPoint.y,L.x1,L.y1,L.x2,L.y2,L.x,L.y);ee.push(Math.floor((V.y+q)/$)+1),ee.push(Math.floor((V.y+V.h+q)/$)+1);break;case"rect":ee.push(Math.floor((L.y+q)/$)+1),ee.push(Math.floor((L.y+L.h+q)/$)+1)}for(var H=0;H<ee.length;H+=1)for(;this.pdf.internal.getNumberOfPages()<ee[H];)m.call(this);return ee},m=function(){var L=this.fillStyle,z=this.strokeStyle,$=this.font,ee=this.lineCap,q=this.lineWidth,J=this.lineJoin;this.pdf.addPage(),this.fillStyle=L,this.strokeStyle=z,this.font=$,this.lineCap=ee,this.lineWidth=q,this.lineJoin=J},y=function(L,z,$){for(var ee=0;ee<L.length;ee++)switch(L[ee].type){case"bct":L[ee].x2+=z,L[ee].y2+=$;case"qct":L[ee].x1+=z,L[ee].y1+=$;case"mt":case"lt":case"arc":default:L[ee].x+=z,L[ee].y+=$}return L},w=function(L){return L.sort(function(z,$){return z-$})},S=function(L,z){for(var $,ee,q=this.fillStyle,J=this.strokeStyle,V=this.lineCap,H=this.lineWidth,Z=Math.abs(H*this.ctx.transform.scaleX),le=this.lineJoin,pe=JSON.parse(JSON.stringify(this.path)),te=JSON.parse(JSON.stringify(this.path)),se=[],ae=0;ae<te.length;ae++)if(te[ae].x!==void 0)for(var ce=A.call(this,te[ae]),de=0;de<ce.length;de+=1)se.indexOf(ce[de])===-1&&se.push(ce[de]);for(var Ae=0;Ae<se.length;Ae++)for(;this.pdf.internal.getNumberOfPages()<se[Ae];)m.call(this);if(w(se),this.autoPaging)for(var ue=se[0],ge=se[se.length-1],ye=ue;ye<ge+1;ye++){this.pdf.setPage(ye),this.fillStyle=q,this.strokeStyle=J,this.lineCap=V,this.lineWidth=Z,this.lineJoin=le;var ve=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Te=ye===1?this.posY+this.margin[0]:this.margin[0],Ce=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Fe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Se=ye===1?0:Ce+(ye-2)*Fe;if(this.ctx.clip_path.length!==0){var De=this.path;$=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y($,this.posX+this.margin[3],-Se+Te+this.ctx.prevPageLastElemOffset),C.call(this,L,!0),this.path=De}if(ee=JSON.parse(JSON.stringify(pe)),this.path=y(ee,this.posX+this.margin[3],-Se+Te+this.ctx.prevPageLastElemOffset),z===!1||ye===0){var _e=(ye>ue||ye<ge)&&g.call(this);_e&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ve,Fe,null).clip().discardPath()),C.call(this,L,z),_e&&this.pdf.restoreGraphicsState()}this.lineWidth=H}else this.lineWidth=Z,C.call(this,L,z),this.lineWidth=H;this.path=pe},C=function(L,z){if((L!=="stroke"||z||!p.call(this))&&(L==="stroke"||z||!f.call(this))){for(var $,ee,q=[],J=this.path,V=0;V<J.length;V++){var H=J[V];switch(H.type){case"begin":q.push({begin:!0});break;case"close":q.push({close:!0});break;case"mt":q.push({start:H,deltas:[],abs:[]});break;case"lt":var Z=q.length;if(J[V-1]&&!isNaN(J[V-1].x)&&($=[H.x-J[V-1].x,H.y-J[V-1].y],Z>0)){for(;Z>=0;Z--)if(q[Z-1].close!==!0&&q[Z-1].begin!==!0){q[Z-1].deltas.push($),q[Z-1].abs.push(H);break}}break;case"bct":$=[H.x1-J[V-1].x,H.y1-J[V-1].y,H.x2-J[V-1].x,H.y2-J[V-1].y,H.x-J[V-1].x,H.y-J[V-1].y],q[q.length-1].deltas.push($);break;case"qct":var le=J[V-1].x+2/3*(H.x1-J[V-1].x),pe=J[V-1].y+2/3*(H.y1-J[V-1].y),te=H.x+2/3*(H.x1-H.x),se=H.y+2/3*(H.y1-H.y),ae=H.x,ce=H.y;$=[le-J[V-1].x,pe-J[V-1].y,te-J[V-1].x,se-J[V-1].y,ae-J[V-1].x,ce-J[V-1].y],q[q.length-1].deltas.push($);break;case"arc":q.push({deltas:[],abs:[],arc:!0}),Array.isArray(q[q.length-1].abs)&&q[q.length-1].abs.push(H)}}ee=z?null:L==="stroke"?"stroke":"fill";for(var de=!1,Ae=0;Ae<q.length;Ae++)if(q[Ae].arc)for(var ue=q[Ae].abs,ge=0;ge<ue.length;ge++){var ye=ue[ge];ye.type==="arc"?D.call(this,ye.x,ye.y,ye.radius,ye.startAngle,ye.endAngle,ye.counterclockwise,void 0,z,!de):R.call(this,ye.x,ye.y),de=!0}else if(q[Ae].close===!0)this.pdf.internal.out("h"),de=!1;else if(q[Ae].begin!==!0){var ve=q[Ae].start.x,Te=q[Ae].start.y;P.call(this,q[Ae].deltas,ve,Te),de=!0}ee&&O.call(this,ee),z&&U.call(this)}},E=function(L){var z=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,$=z*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return L-$;case"top":return L+z-$;case"hanging":return L+z-2*$;case"middle":return L+z/2-$;case"ideographic":return L;case"alphabetic":default:return L}},I=function(L){return L+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};d.prototype.createLinearGradient=function(){var L=function(){};return L.colorStops=[],L.addColorStop=function(z,$){this.colorStops.push([z,$])},L.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},L.isCanvasGradient=!0,L},d.prototype.createPattern=function(){return this.createLinearGradient()},d.prototype.createRadialGradient=function(){return this.createLinearGradient()};var D=function(L,z,$,ee,q,J,V,H,Z){for(var le=x.call(this,$,ee,q,J),pe=0;pe<le.length;pe++){var te=le[pe];pe===0&&(Z?Q.call(this,te.x1+L,te.y1+z):R.call(this,te.x1+L,te.y1+z)),T.call(this,L,z,te.x2,te.y2,te.x3,te.y3,te.x4,te.y4)}H?U.call(this):O.call(this,V)},O=function(L){switch(L){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},U=function(){this.pdf.clip(),this.pdf.discardPath()},Q=function(L,z){this.pdf.internal.out(r(L)+" "+n(z)+" m")},N=function(L){var z;switch(L.align){case"right":case"end":z="right";break;case"center":z="center";break;case"left":case"start":default:z="left"}var $=this.pdf.getTextDimensions(L.text),ee=E.call(this,L.y),q=I.call(this,ee)-$.h,J=this.ctx.transform.applyToPoint(new a(L.x,ee)),V=this.ctx.transform.decompose(),H=new l;H=(H=(H=H.multiply(V.translate)).multiply(V.skew)).multiply(V.scale);for(var Z,le,pe,te=this.ctx.transform.applyToRectangle(new s(L.x,ee,$.w,$.h)),se=H.applyToRectangle(new s(L.x,q,$.w,$.h)),ae=A.call(this,se),ce=[],de=0;de<ae.length;de+=1)ce.indexOf(ae[de])===-1&&ce.push(ae[de]);if(w(ce),this.autoPaging)for(var Ae=ce[0],ue=ce[ce.length-1],ge=Ae;ge<ue+1;ge++){this.pdf.setPage(ge);var ye=ge===1?this.posY+this.margin[0]:this.margin[0],ve=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Te=this.pdf.internal.pageSize.height-this.margin[2],Ce=Te-this.margin[0],Fe=this.pdf.internal.pageSize.width-this.margin[1],Se=Fe-this.margin[3],De=ge===1?0:ve+(ge-2)*Ce;if(this.ctx.clip_path.length!==0){var _e=this.path;Z=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(Z,this.posX+this.margin[3],-1*De+ye),C.call(this,"fill",!0),this.path=_e}var Ue=y([JSON.parse(JSON.stringify(se))],this.posX+this.margin[3],-De+ye+this.ctx.prevPageLastElemOffset)[0];L.scale>=.01&&(le=this.pdf.internal.getFontSize(),this.pdf.setFontSize(le*L.scale),pe=this.lineWidth,this.lineWidth=pe*L.scale);var Je=this.autoPaging!=="text";if(Je||Ue.y+Ue.h<=Te){if(Je||Ue.y>=ye&&Ue.x<=Fe){var rt=Je?L.text:this.pdf.splitTextToSize(L.text,L.maxWidth||Fe-Ue.x)[0],Rt=y([JSON.parse(JSON.stringify(te))],this.posX+this.margin[3],-De+ye+this.ctx.prevPageLastElemOffset)[0],ht=Je&&(ge>Ae||ge<ue)&&g.call(this);ht&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Se,Ce,null).clip().discardPath()),this.pdf.text(rt,Rt.x,Rt.y,{angle:L.angle,align:z,renderingMode:L.renderingMode}),ht&&this.pdf.restoreGraphicsState()}}else Ue.y<Te&&(this.ctx.prevPageLastElemOffset+=Te-Ue.y);L.scale>=.01&&(this.pdf.setFontSize(le),this.lineWidth=pe)}else L.scale>=.01&&(le=this.pdf.internal.getFontSize(),this.pdf.setFontSize(le*L.scale),pe=this.lineWidth,this.lineWidth=pe*L.scale),this.pdf.text(L.text,J.x+this.posX,J.y+this.posY,{angle:L.angle,align:z,renderingMode:L.renderingMode,maxWidth:L.maxWidth}),L.scale>=.01&&(this.pdf.setFontSize(le),this.lineWidth=pe)},R=function(L,z,$,ee){$=$||0,ee=ee||0,this.pdf.internal.out(r(L+$)+" "+n(z+ee)+" l")},P=function(L,z,$){return this.pdf.lines(L,z,$,null,null)},T=function(L,z,$,ee,q,J,V,H){this.pdf.internal.out([t(i($+L)),t(o(ee+z)),t(i(q+L)),t(o(J+z)),t(i(V+L)),t(o(H+z)),"c"].join(" "))},x=function(L,z,$,ee){for(var q=2*Math.PI,J=Math.PI/2;z>$;)z-=q;var V=Math.abs($-z);V<q&&ee&&(V=q-V);for(var H=[],Z=ee?-1:1,le=z;V>1e-5;){var pe=le+Z*Math.min(V,J);H.push(_.call(this,L,le,pe)),V-=Math.abs(pe-le),le=pe}return H},_=function(L,z,$){var ee=($-z)/2,q=L*Math.cos(ee),J=L*Math.sin(ee),V=q,H=-J,Z=V*V+H*H,le=Z+V*q+H*J,pe=4/3*(Math.sqrt(2*Z*le)-le)/(V*J-H*q),te=V-pe*H,se=H+pe*V,ae=te,ce=-se,de=ee+z,Ae=Math.cos(de),ue=Math.sin(de);return{x1:L*Math.cos(z),y1:L*Math.sin(z),x2:te*Ae-se*ue,y2:te*ue+se*Ae,x3:ae*Ae-ce*ue,y3:ae*ue+ce*Ae,x4:L*Math.cos($),y4:L*Math.sin($)}},k=function(L){return 180*L/Math.PI},B=function(L,z,$,ee,q,J){var V=L+.5*($-L),H=z+.5*(ee-z),Z=q+.5*($-q),le=J+.5*(ee-J),pe=Math.min(L,q,V,Z),te=Math.max(L,q,V,Z),se=Math.min(z,J,H,le),ae=Math.max(z,J,H,le);return new s(pe,se,te-pe,ae-se)},F=function(L,z,$,ee,q,J,V,H){var Z,le,pe,te,se,ae,ce,de,Ae,ue,ge,ye,ve,Te,Ce=$-L,Fe=ee-z,Se=q-$,De=J-ee,_e=V-q,Ue=H-J;for(le=0;le<41;le++)Ae=(ce=(pe=L+(Z=le/40)*Ce)+Z*((se=$+Z*Se)-pe))+Z*(se+Z*(q+Z*_e-se)-ce),ue=(de=(te=z+Z*Fe)+Z*((ae=ee+Z*De)-te))+Z*(ae+Z*(J+Z*Ue-ae)-de),le==0?(ge=Ae,ye=ue,ve=Ae,Te=ue):(ge=Math.min(ge,Ae),ye=Math.min(ye,ue),ve=Math.max(ve,Ae),Te=Math.max(Te,ue));return new s(Math.round(ge),Math.round(ye),Math.round(ve-ge),Math.round(Te-ye))},K=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var L,z,$=(L=this.ctx.lineDash,z=this.ctx.lineDashOffset,JSON.stringify({lineDash:L,lineDashOffset:z}));this.prevLineDash!==$&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=$)}}})(Ir.API),function(e){var t=function(o){var a,s,l,c,u,d,h,f,p,g;for(s=[],l=0,c=(o+=a="\0\0\0\0".slice(o.length%4||4)).length;c>l;l+=4)(u=(o.charCodeAt(l)<<24)+(o.charCodeAt(l+1)<<16)+(o.charCodeAt(l+2)<<8)+o.charCodeAt(l+3))!==0?(d=(u=((u=((u=((u=(u-(g=u%85))/85)-(p=u%85))/85)-(f=u%85))/85)-(h=u%85))/85)%85,s.push(d+33,h+33,f+33,p+33,g+33)):s.push(122);return function(A,m){for(var y=m;y>0;y--)A.pop()}(s,a.length),String.fromCharCode.apply(String,s)+"~>"},r=function(o){var a,s,l,c,u,d=String,h="length",f=255,p="charCodeAt",g="slice",A="replace";for(o[g](-2),o=o[g](0,-2)[A](/\s/g,"")[A]("z","!!!!!"),l=[],c=0,u=(o+=a="uuuuu"[g](o[h]%5||5))[h];u>c;c+=5)s=52200625*(o[p](c)-33)+614125*(o[p](c+1)-33)+7225*(o[p](c+2)-33)+85*(o[p](c+3)-33)+(o[p](c+4)-33),l.push(f&s>>24,f&s>>16,f&s>>8,f&s);return function(m,y){for(var w=y;w>0;w--)m.pop()}(l,a[h]),d.fromCharCode.apply(d,l)},n=function(o){var a=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),a.test(o)===!1)return"";for(var s="",l=0;l<o.length;l+=2)s+=String.fromCharCode("0x"+(o[l]+o[l+1]));return s},i=function(o){for(var a=new Uint8Array(o.length),s=o.length;s--;)a[s]=o.charCodeAt(s);return o=(a=o8(a)).reduce(function(l,c){return l+String.fromCharCode(c)},"")};e.processDataByFilters=function(o,a){var s=0,l=o||"",c=[];for(typeof(a=a||[])=="string"&&(a=[a]),s=0;s<a.length;s+=1)switch(a[s]){case"ASCII85Decode":case"/ASCII85Decode":l=r(l),c.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),c.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=n(l),c.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=l.split("").map(function(u){return("0"+u.charCodeAt().toString(16)).slice(-2)}).join("")+">",c.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=i(l),c.push("/FlateDecode");break;default:throw new Error('The filter: "'+a[s]+'" is not implemented')}return{data:l,reverseChain:c.reverse().join(" ")}}}(Ir.API),function(e){e.loadFile=function(t,r,n){return function(i,o,a){o=o!==!1,a=typeof a=="function"?a:function(){};var s=void 0;try{s=function(l,c,u){var d=new XMLHttpRequest,h=0,f=function(p){var g=p.length,A=[],m=String.fromCharCode;for(h=0;h<g;h+=1)A.push(m(255&p.charCodeAt(h)));return A.join("")};if(d.open("GET",l,!c),d.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(d.onload=function(){d.status===200?u(f(this.responseText)):u(void 0)}),d.send(null),c&&d.status===200)return f(d.responseText)}(i,o,a)}catch{}return s}(t,r,n)},e.loadImageFile=e.loadFile}(Ir.API),function(e){function t(){return(Vr.html2canvas?Promise.resolve(Vr.html2canvas):Promise.resolve().then(()=>NLe)).catch(function(a){return Promise.reject(new Error("Could not load html2canvas: "+a))}).then(function(a){return a.default?a.default:a})}function r(){return(Vr.DOMPurify?Promise.resolve(Vr.DOMPurify):mj(()=>import("./purify.es-CKk_t3XZ-DHuNJQNB.js"),[])).catch(function(a){return Promise.reject(new Error("Could not load dompurify: "+a))}).then(function(a){return a.default?a.default:a})}var n=function(a){var s=Jn(a);return s==="undefined"?"undefined":s==="string"||a instanceof String?"string":s==="number"||a instanceof Number?"number":s==="function"||a instanceof Function?"function":a&&a.constructor===Array?"array":a&&a.nodeType===1?"element":s==="object"?"object":"unknown"},i=function(a,s){var l=document.createElement(a);for(var c in s.className&&(l.className=s.className),s.innerHTML&&s.dompurify&&(l.innerHTML=s.dompurify.sanitize(s.innerHTML)),s.style)l.style[c]=s.style[c];return l},o=function a(s){var l=Object.assign(a.convert(Promise.resolve()),JSON.parse(JSON.stringify(a.template))),c=a.convert(Promise.resolve(),l);return c=(c=c.setProgress(1,a,1,[a])).set(s)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(a,s){return a.__proto__=s||o.prototype,a},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(a,s){return this.then(function(){switch(s=s||function(l){switch(n(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(a)){case"string":return this.then(r).then(function(l){return this.set({src:i("div",{innerHTML:a,dompurify:l})})});case"element":return this.set({src:a});case"canvas":return this.set({canvas:a});case"img":return this.set({img:a});default:return this.error("Unknown source type.")}})},o.prototype.to=function(a){switch(a){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var a={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},s=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),h=c.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(l(h,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d}(this.prop.src,this.opt.html2canvas.javascriptEnabled);s.tagName==="BODY"&&(a.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:a}),this.prop.container.appendChild(s),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(t).then(function(s){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,s(this.prop.container,l)}).then(function(s){(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(t).then(function(s){var l=this.opt.jsPDF,c=this.opt.fontFaces,u=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,d=Object.assign({async:!0,allowTaint:!0,scale:u,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete d.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=c,c)for(var h=0;h<c.length;++h){var f=c[h],p=f.src.find(function(g){return g.format==="truetype"});p&&l.addFont(p.url,f.ref.name,f.ref.style)}return d.windowHeight=d.windowHeight||0,d.windowHeight=d.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):d.windowHeight,l.context2d.save(!0),s(this.prop.container,d)}).then(function(s){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var a=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=a})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(a,s,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(a,s):this.outputPdf(a,s)},o.prototype.outputPdf=function(a,s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(a,s)})},o.prototype.outputImg=function(a){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(a){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+a+'" is not supported.'}})},o.prototype.save=function(a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(a?{filename:a}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(a){if(n(a)!=="object")return this;var s=Object.keys(a||{}).map(function(l){if(l in o.template.prop)return function(){this.prop[l]=a[l]};switch(l){case"margin":return this.setMargin.bind(this,a.margin);case"jsPDF":return function(){return this.opt.jsPDF=a.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,a.pageSize);default:return function(){this.opt[l]=a[l]}}},this);return this.then(function(){return this.thenList(s)})},o.prototype.get=function(a,s){return this.then(function(){var l=a in o.template.prop?this.prop[a]:this.opt[a];return s?s(l):l})},o.prototype.setMargin=function(a){return this.then(function(){switch(n(a)){case"number":a=[a,a,a,a];case"array":if(a.length===2&&(a=[a[0],a[1],a[0],a[1]]),a.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=a}).then(this.setPageSize)},o.prototype.setPageSize=function(a){function s(l,c){return Math.floor(l*c/72*96)}return this.then(function(){(a=a||Ir.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(a.inner={width:a.width-this.opt.margin[1]-this.opt.margin[3],height:a.height-this.opt.margin[0]-this.opt.margin[2]},a.inner.px={width:s(a.inner.width,a.k),height:s(a.inner.height,a.k)},a.inner.ratio=a.inner.height/a.inner.width),this.prop.pageSize=a})},o.prototype.setProgress=function(a,s,l,c){return a!=null&&(this.progress.val=a),s!=null&&(this.progress.state=s),l!=null&&(this.progress.n=l),c!=null&&(this.progress.stack=c),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(a,s,l,c){return this.setProgress(a?this.progress.val+a:null,s||null,l?this.progress.n+l:null,c?this.progress.stack.concat(c):null)},o.prototype.then=function(a,s){var l=this;return this.thenCore(a,s,function(c,u){return l.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(d){return l.updateProgress(null,c),d}).then(c,u).then(function(d){return l.updateProgress(1),d})})},o.prototype.thenCore=function(a,s,l){l=l||Promise.prototype.then,a&&(a=a.bind(this)),s&&(s=s.bind(this));var c=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:o.convert(Object.assign({},this),Promise.prototype),u=l.call(c,a,s);return o.convert(u,this.__proto__)},o.prototype.thenExternal=function(a,s){return Promise.prototype.then.call(this,a,s)},o.prototype.thenList=function(a){var s=this;return a.forEach(function(l){s=s.thenCore(l)}),s},o.prototype.catch=function(a){a&&(a=a.bind(this));var s=Promise.prototype.catch.call(this,a);return o.convert(s,this)},o.prototype.catchExternal=function(a){return Promise.prototype.catch.call(this,a)},o.prototype.error=function(a){return this.then(function(){throw new Error(a)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Ir.getPageSize=function(a,s,l){if(Jn(a)==="object"){var c=a;a=c.orientation,s=c.unit||s,l=c.format||l}s=s||"mm",l=l||"a4",a=(""+(a||"P")).toLowerCase();var u,d=(""+l).toLowerCase(),h={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(s){case"pt":u=1;break;case"mm":u=72/25.4;break;case"cm":u=72/2.54;break;case"in":u=72;break;case"px":u=.75;break;case"pc":case"em":u=12;break;case"ex":u=6;break;default:throw"Invalid unit: "+s}var f,p=0,g=0;if(h.hasOwnProperty(d))p=h[d][1]/u,g=h[d][0]/u;else try{p=l[1],g=l[0]}catch{throw new Error("Invalid format: "+l)}if(a==="p"||a==="portrait")a="p",g>p&&(f=g,g=p,p=f);else{if(a!=="l"&&a!=="landscape")throw"Invalid orientation: "+a;a="l",p>g&&(f=g,g=p,p=f)}return{width:g,height:p,unit:s,k:u,orientation:a}},e.html=function(a,s){(s=s||{}).callback=s.callback||function(){},s.html2canvas=s.html2canvas||{},s.html2canvas.canvas=s.html2canvas.canvas||this.canvas,s.jsPDF=s.jsPDF||this,s.fontFaces=s.fontFaces?s.fontFaces.map(d8):null;var l=new o(s);return s.worker?l:l.from(a).doCallback()}}(Ir.API),Ir.API.addJS=function(e){return sU=e,this.internal.events.subscribe("postPutResources",function(){e1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),aU=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+sU+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e1!==void 0&&aU!==void 0&&this.internal.out("/Names <</JavaScript "+e1+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),o=0;o<i.length;o++){var a=i[o],s=n.exec(a);if(s!=null){var l=s[1];r.internal.newObjectDeferredBegin(l,!1)}r.internal.write(a)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(o=0;o<c;o++){var d=r.internal.newObject();u.push(d);var h=r.internal.getPageInfo(o+1);r.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),o=0;o<u.length;o++)r.internal.write("(page_"+(o+1)+")"+u[o]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,o){var a={title:i,options:o,children:[]};return n==null&&(n=this.root),n.children.push(a),a},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,o=0;o<n.children.length;o++){var a=n.children[o];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(n)),o>0&&this.line("/Prev "+this.makeRef(n.children[o-1])),o<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[o+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var s=this.count=this.count_r({count:0},a);if(s>0&&this.line("/Count "+s),a.options&&a.options.pageNumber){var l=r.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+l.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var c=0;c<n.children.length;c++)this.renderItems(n.children[c])},r.outline.line=function(n){this.ctx.val+=n+`\r
561
561
  `},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r
562
562
  `+n.id+` 0 obj\r
563
563
  <<\r
@@ -653,7 +653,7 @@ endobj\r
653
653
  * http://opensource.org/licenses/mit-license
654
654
  */function Gc(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function hU(e){function t(D){if(!D)throw Error("assert :P")}function r(D,O,U){for(var Q=0;4>Q;Q++)if(D[O+Q]!=U.charCodeAt(Q))return!0;return!1}function n(D,O,U,Q,N){for(var R=0;R<N;R++)D[O+R]=U[Q+R]}function i(D,O,U,Q){for(var N=0;N<Q;N++)D[O+N]=U}function o(D){return new Int32Array(D)}function a(D,O){for(var U=[],Q=0;Q<D;Q++)U.push(new O);return U}function s(D,O){var U=[];return function Q(N,R,P){for(var T=P[R],x=0;x<T&&(N.push(P.length>R+1?[]:new O),!(P.length<R+1));x++)Q(N[x],R+1,P)}(U,0,D),U}var l=function(){var D=this;function O(G,X){for(var oe=1<<X-1>>>0;G&oe;)oe>>>=1;return oe?(G&oe-1)+oe:G}function U(G,X,oe,fe,me){t(!(fe%oe));do G[X+(fe-=oe)]=me;while(0<fe)}function Q(G,X,oe,fe,me){if(t(2328>=me),512>=me)var we=o(512);else if((we=o(me))==null)return 0;return function(xe,ke,Ee,Re,qe,nt){var ot,$e,ct=ke,it=1<<Ee,Qe=o(16),Ke=o(16);for(t(qe!=0),t(Re!=null),t(xe!=null),t(0<Ee),$e=0;$e<qe;++$e){if(15<Re[$e])return 0;++Qe[Re[$e]]}if(Qe[0]==qe)return 0;for(Ke[1]=0,ot=1;15>ot;++ot){if(Qe[ot]>1<<ot)return 0;Ke[ot+1]=Ke[ot]+Qe[ot]}for($e=0;$e<qe;++$e)ot=Re[$e],0<Re[$e]&&(nt[Ke[ot]++]=$e);if(Ke[15]==1)return(Re=new N).g=0,Re.value=nt[0],U(xe,ct,1,it,Re),it;var vt,Ct=-1,kt=it-1,Yt=0,qt=1,Rr=1,Lt=1<<Ee;for($e=0,ot=1,qe=2;ot<=Ee;++ot,qe<<=1){if(qt+=Rr<<=1,0>(Rr-=Qe[ot]))return 0;for(;0<Qe[ot];--Qe[ot])(Re=new N).g=ot,Re.value=nt[$e++],U(xe,ct+Yt,qe,Lt,Re),Yt=O(Yt,ot)}for(ot=Ee+1,qe=2;15>=ot;++ot,qe<<=1){if(qt+=Rr<<=1,0>(Rr-=Qe[ot]))return 0;for(;0<Qe[ot];--Qe[ot]){if(Re=new N,(Yt&kt)!=Ct){for(ct+=Lt,vt=1<<(Ct=ot)-Ee;15>Ct&&!(0>=(vt-=Qe[Ct]));)++Ct,vt<<=1;it+=Lt=1<<(vt=Ct-Ee),xe[ke+(Ct=Yt&kt)].g=vt+Ee,xe[ke+Ct].value=ct-ke-Ct}Re.g=ot-Ee,Re.value=nt[$e++],U(xe,ct+(Yt>>Ee),qe,Lt,Re),Yt=O(Yt,ot)}}return qt!=2*Ke[15]-1?0:it}(G,X,oe,fe,me,we)}function N(){this.value=this.g=0}function R(){this.value=this.g=0}function P(){this.G=a(5,N),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Co,R)}function T(G,X,oe,fe){t(G!=null),t(X!=null),t(2147483648>fe),G.Ca=254,G.I=0,G.b=-8,G.Ka=0,G.oa=X,G.pa=oe,G.Jd=X,G.Yc=oe+fe,G.Zc=4<=fe?oe+fe-4+1:oe,J(G)}function x(G,X){for(var oe=0;0<X--;)oe|=H(G,128)<<X;return oe}function _(G,X){var oe=x(G,X);return V(G)?-oe:oe}function k(G,X,oe,fe){var me,we=0;for(t(G!=null),t(X!=null),t(4294967288>fe),G.Sb=fe,G.Ra=0,G.u=0,G.h=0,4<fe&&(fe=4),me=0;me<fe;++me)we+=X[oe+me]<<8*me;G.Ra=we,G.bb=fe,G.oa=X,G.pa=oe}function B(G){for(;8<=G.u&&G.bb<G.Sb;)G.Ra>>>=8,G.Ra+=G.oa[G.pa+G.bb]<<Od-8>>>0,++G.bb,G.u-=8;$(G)&&(G.h=1,G.u=0)}function F(G,X){if(t(0<=X),!G.h&&X<=Pd){var oe=z(G)&_u[X];return G.u+=X,B(G),oe}return G.h=1,G.u=0}function K(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function L(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function z(G){return G.Ra>>>(G.u&Od-1)>>>0}function $(G){return t(G.bb<=G.Sb),G.h||G.bb==G.Sb&&G.u>Od}function ee(G,X){G.u=X,G.h=$(G)}function q(G){G.u>=nh&&(t(G.u>=nh),B(G))}function J(G){t(G!=null&&G.oa!=null),G.pa<G.Zc?(G.I=(G.oa[G.pa++]|G.I<<8)>>>0,G.b+=8):(t(G!=null&&G.oa!=null),G.pa<G.Yc?(G.b+=8,G.I=G.oa[G.pa++]|G.I<<8):G.Ka?G.b=0:(G.I<<=8,G.b+=8,G.Ka=1))}function V(G){return x(G,1)}function H(G,X){var oe=G.Ca;0>G.b&&J(G);var fe=G.b,me=oe*X>>>8,we=(G.I>>>fe>me)+0;for(we?(oe-=me,G.I-=me+1<<fe>>>0):oe=me+1,fe=oe,me=0;256<=fe;)me+=8,fe>>=8;return fe=7^me+qa[fe],G.b-=fe,G.Ca=(oe<<fe)-1,we}function Z(G,X,oe){G[X+0]=oe>>24&255,G[X+1]=oe>>16&255,G[X+2]=oe>>8&255,G[X+3]=oe>>0&255}function le(G,X){return G[X+0]<<0|G[X+1]<<8}function pe(G,X){return le(G,X)|G[X+2]<<16}function te(G,X){return le(G,X)|le(G,X+2)<<16}function se(G,X){var oe=1<<X;return t(G!=null),t(0<X),G.X=o(oe),G.X==null?0:(G.Mb=32-X,G.Xa=X,1)}function ae(G,X){t(G!=null),t(X!=null),t(G.Xa==X.Xa),n(X.X,0,G.X,0,1<<X.Xa)}function ce(){this.X=[],this.Xa=this.Mb=0}function de(G,X,oe,fe){t(oe!=null),t(fe!=null);var me=oe[0],we=fe[0];return me==0&&(me=(G*we+X/2)/X),we==0&&(we=(X*me+G/2)/G),0>=me||0>=we?0:(oe[0]=me,fe[0]=we,1)}function Ae(G,X){return G+(1<<X)-1>>>X}function ue(G,X){return((4278255360&G)+(4278255360&X)>>>0&4278255360)+((16711935&G)+(16711935&X)>>>0&16711935)>>>0}function ge(G,X){D[X]=function(oe,fe,me,we,xe,ke,Ee){var Re;for(Re=0;Re<xe;++Re){var qe=D[G](ke[Ee+Re-1],me,we+Re);ke[Ee+Re]=ue(oe[fe+Re],qe)}}}function ye(){this.ud=this.hd=this.jd=0}function ve(G,X){return((4278124286&(G^X))>>>1)+(G&X)>>>0}function Te(G){return 0<=G&&256>G?G:0>G?0:255<G?255:void 0}function Ce(G,X){return Te(G+(G-X+.5>>1))}function Fe(G,X,oe){return Math.abs(X-oe)-Math.abs(G-oe)}function Se(G,X,oe,fe,me,we,xe){for(fe=we[xe-1],oe=0;oe<me;++oe)we[xe+oe]=fe=ue(G[X+oe],fe)}function De(G,X,oe,fe,me){var we;for(we=0;we<oe;++we){var xe=G[X+we],ke=xe>>8&255,Ee=16711935&(Ee=(Ee=16711935&xe)+((ke<<16)+ke));fe[me+we]=(4278255360&xe)+Ee>>>0}}function _e(G,X){X.jd=G>>0&255,X.hd=G>>8&255,X.ud=G>>16&255}function Ue(G,X,oe,fe,me,we){var xe;for(xe=0;xe<fe;++xe){var ke=X[oe+xe],Ee=ke>>>8,Re=ke,qe=255&(qe=(qe=ke>>>16)+((G.jd<<24>>24)*(Ee<<24>>24)>>>5));Re=255&(Re=(Re=Re+((G.hd<<24>>24)*(Ee<<24>>24)>>>5))+((G.ud<<24>>24)*(qe<<24>>24)>>>5)),me[we+xe]=(4278255360&ke)+(qe<<16)+Re}}function Je(G,X,oe,fe,me){D[X]=function(we,xe,ke,Ee,Re,qe,nt,ot,$e){for(Ee=nt;Ee<ot;++Ee)for(nt=0;nt<$e;++nt)Re[qe++]=me(ke[fe(we[xe++])])},D[G]=function(we,xe,ke,Ee,Re,qe,nt){var ot=8>>we.b,$e=we.Ea,ct=we.K[0],it=we.w;if(8>ot)for(we=(1<<we.b)-1,it=(1<<ot)-1;xe<ke;++xe){var Qe,Ke=0;for(Qe=0;Qe<$e;++Qe)Qe&we||(Ke=fe(Ee[Re++])),qe[nt++]=me(ct[Ke&it]),Ke>>=ot}else D["VP8LMapColor"+oe](Ee,Re,ct,it,qe,nt,xe,ke,$e)}}function rt(G,X,oe,fe,me){for(oe=X+oe;X<oe;){var we=G[X++];fe[me++]=we>>16&255,fe[me++]=we>>8&255,fe[me++]=we>>0&255}}function Rt(G,X,oe,fe,me){for(oe=X+oe;X<oe;){var we=G[X++];fe[me++]=we>>16&255,fe[me++]=we>>8&255,fe[me++]=we>>0&255,fe[me++]=we>>24&255}}function ht(G,X,oe,fe,me){for(oe=X+oe;X<oe;){var we=(xe=G[X++])>>16&240|xe>>12&15,xe=xe>>0&240|xe>>28&15;fe[me++]=we,fe[me++]=xe}}function At(G,X,oe,fe,me){for(oe=X+oe;X<oe;){var we=(xe=G[X++])>>16&248|xe>>13&7,xe=xe>>5&224|xe>>3&31;fe[me++]=we,fe[me++]=xe}}function bt(G,X,oe,fe,me){for(oe=X+oe;X<oe;){var we=G[X++];fe[me++]=we>>0&255,fe[me++]=we>>8&255,fe[me++]=we>>16&255}}function wt(G,X,oe,fe,me,we){if(we==0)for(oe=X+oe;X<oe;)Z(fe,((we=G[X++])[0]>>24|we[1]>>8&65280|we[2]<<8&16711680|we[3]<<24)>>>0),me+=32;else n(fe,me,G,X,oe)}function Bt(G,X){D[X][0]=D[G+"0"],D[X][1]=D[G+"1"],D[X][2]=D[G+"2"],D[X][3]=D[G+"3"],D[X][4]=D[G+"4"],D[X][5]=D[G+"5"],D[X][6]=D[G+"6"],D[X][7]=D[G+"7"],D[X][8]=D[G+"8"],D[X][9]=D[G+"9"],D[X][10]=D[G+"10"],D[X][11]=D[G+"11"],D[X][12]=D[G+"12"],D[X][13]=D[G+"13"],D[X][14]=D[G+"0"],D[X][15]=D[G+"0"]}function jt(G){return G==cl||G==ul||G==Gl||G==Bg}function Br(){this.eb=[],this.size=this.A=this.fb=0}function Dt(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function _r(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Br,this.f.kb=new Dt,this.sd=null}function kr(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function $t(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Wt(G){return alert("todo:WebPSamplerProcessPlane"),G.T}function Jt(G,X){var oe=G.T,fe=X.ba.f.RGBA,me=fe.eb,we=fe.fb+G.ka*fe.A,xe=Ra[X.ba.S],ke=G.y,Ee=G.O,Re=G.f,qe=G.N,nt=G.ea,ot=G.W,$e=X.cc,ct=X.dc,it=X.Mc,Qe=X.Nc,Ke=G.ka,vt=G.ka+G.T,Ct=G.U,kt=Ct+1>>1;for(Ke==0?xe(ke,Ee,null,null,Re,qe,nt,ot,Re,qe,nt,ot,me,we,null,null,Ct):(xe(X.ec,X.fc,ke,Ee,$e,ct,it,Qe,Re,qe,nt,ot,me,we-fe.A,me,we,Ct),++oe);Ke+2<vt;Ke+=2)$e=Re,ct=qe,it=nt,Qe=ot,qe+=G.Rc,ot+=G.Rc,we+=2*fe.A,xe(ke,(Ee+=2*G.fa)-G.fa,ke,Ee,$e,ct,it,Qe,Re,qe,nt,ot,me,we-fe.A,me,we,Ct);return Ee+=G.fa,G.j+vt<G.o?(n(X.ec,X.fc,ke,Ee,Ct),n(X.cc,X.dc,Re,qe,kt),n(X.Mc,X.Nc,nt,ot,kt),oe--):1&vt||xe(ke,Ee,null,null,Re,qe,nt,ot,Re,qe,nt,ot,me,we+fe.A,null,null,Ct),oe}function lr(G,X,oe){var fe=G.F,me=[G.J];if(fe!=null){var we=G.U,xe=X.ba.S,ke=xe==Fa||xe==Gl;X=X.ba.f.RGBA;var Ee=[0],Re=G.ka;Ee[0]=G.T,G.Kb&&(Re==0?--Ee[0]:(--Re,me[0]-=G.width),G.j+G.ka+G.T==G.o&&(Ee[0]=G.o-G.j-Re));var qe=X.eb;Re=X.fb+Re*X.A,G=$n(fe,me[0],G.width,we,Ee,qe,Re+(ke?0:3),X.A),t(oe==Ee),G&&jt(xe)&&$i(qe,Re,ke,we,Ee,X.A)}return 0}function Sr(G){var X=G.ma,oe=X.ba.S,fe=11>oe,me=oe==Pc||oe==jd||oe==Fa||oe==$a||oe==12||jt(oe);if(X.memory=null,X.Ib=null,X.Jb=null,X.Nd=null,!xu(X.Oa,G,me?11:12))return 0;if(me&&jt(oe)&&Tt(),G.da)alert("todo:use_scaling");else{if(fe){if(X.Ib=Wt,G.Kb){if(oe=G.U+1>>1,X.memory=o(G.U+2*oe),X.memory==null)return 0;X.ec=X.memory,X.fc=0,X.cc=X.ec,X.dc=X.fc+G.U,X.Mc=X.cc,X.Nc=X.dc+oe,X.Ib=Jt,Tt()}}else alert("todo:EmitYUV");me&&(X.Jb=lr,fe&&et())}if(fe&&!hl){for(G=0;256>G;++G)Du[G]=89858*(G-128)+Kp>>Hd,Lc[G]=-22014*(G-128)+Kp,Iu[G]=-45773*(G-128),v2[G]=113618*(G-128)+Kp>>Hd;for(G=zd;G<Gp;++G)X=76283*(G-16)+Kp>>Hd,Bo[G-zd]=Is(X,255),Tg[G-zd]=Is(X+8>>4,15);hl=1}return 1}function Yr(G){var X=G.ma,oe=G.U,fe=G.T;return t(!(1&G.ka)),0>=oe||0>=fe?0:(oe=X.Ib(G,X),X.Jb!=null&&X.Jb(G,X,oe),X.Dc+=oe,1)}function cr(G){G.ma.memory=null}function Qt(G,X,oe,fe){return F(G,8)!=47?0:(X[0]=F(G,14)+1,oe[0]=F(G,14)+1,fe[0]=F(G,1),F(G,3)!=0?0:!G.h)}function Xr(G,X){if(4>G)return G+1;var oe=G-2>>1;return(2+(1&G)<<oe)+F(X,oe)+1}function yr(G,X){return 120<X?X-120:1<=(oe=((oe=dl[X-1])>>4)*G+(8-(15&oe)))?oe:1;var oe}function je(G,X,oe){var fe=z(oe),me=G[X+=255&fe].g-8;return 0<me&&(ee(oe,oe.u+8),fe=z(oe),X+=G[X].value,X+=fe&(1<<me)-1),ee(oe,oe.u+G[X].g),G[X].value}function We(G,X,oe){return oe.g+=G.g,oe.value+=G.value<<X>>>0,t(8>=oe.g),G.g}function lt(G,X,oe){var fe=G.xc;return t((X=fe==0?0:G.vc[G.md*(oe>>fe)+(X>>fe)])<G.Wb),G.Ya[X]}function Ze(G,X,oe,fe){var me=G.ab,we=G.c*X,xe=G.C;X=xe+X;var ke=oe,Ee=fe;for(fe=G.Ta,oe=G.Ua;0<me--;){var Re=G.gc[me],qe=xe,nt=X,ot=ke,$e=Ee,ct=(Ee=fe,ke=oe,Re.Ea);switch(t(qe<nt),t(nt<=Re.nc),Re.hc){case 2:Cg(ot,$e,(nt-qe)*ct,Ee,ke);break;case 0:var it=qe,Qe=nt,Ke=Ee,vt=ke,Ct=(Lt=Re).Ea;it==0&&(Vb(ot,$e,null,null,1,Ke,vt),Se(ot,$e+1,0,0,Ct-1,Ke,vt+1),$e+=Ct,vt+=Ct,++it);for(var kt=1<<Lt.b,Yt=kt-1,qt=Ae(Ct,Lt.b),Rr=Lt.K,Lt=Lt.w+(it>>Lt.b)*qt;it<Qe;){var Rn=Rr,Wn=Lt,Tn=1;for(Lp(ot,$e,Ke,vt-Ct,1,Ke,vt);Tn<Ct;){var bn=(Tn&~Yt)+kt;bn>Ct&&(bn=Ct),(0,Mc[Rn[Wn++]>>8&15])(ot,$e+ +Tn,Ke,vt+Tn-Ct,bn-Tn,Ke,vt+Tn),Tn=bn}$e+=Ct,vt+=Ct,++it&Yt||(Lt+=qt)}nt!=Re.nc&&n(Ee,ke-ct,Ee,ke+(nt-qe-1)*ct,ct);break;case 1:for(ct=ot,Qe=$e,Ct=(ot=Re.Ea)-(vt=ot&~(Ke=($e=1<<Re.b)-1)),it=Ae(ot,Re.b),kt=Re.K,Re=Re.w+(qe>>Re.b)*it;qe<nt;){for(Yt=kt,qt=Re,Rr=new ye,Lt=Qe+vt,Rn=Qe+ot;Qe<Lt;)_e(Yt[qt++],Rr),ku(Rr,ct,Qe,$e,Ee,ke),Qe+=$e,ke+=$e;Qe<Rn&&(_e(Yt[qt++],Rr),ku(Rr,ct,Qe,Ct,Ee,ke),Qe+=Ct,ke+=Ct),++qe&Ke||(Re+=it)}break;case 3:if(ot==Ee&&$e==ke&&0<Re.b){for(Qe=Ee,ot=ct=ke+(nt-qe)*ct-(vt=(nt-qe)*Ae(Re.Ea,Re.b)),$e=Ee,Ke=ke,it=[],vt=(Ct=vt)-1;0<=vt;--vt)it[vt]=$e[Ke+vt];for(vt=Ct-1;0<=vt;--vt)Qe[ot+vt]=it[vt];Ps(Re,qe,nt,Ee,ct,Ee,ke)}else Ps(Re,qe,nt,ot,$e,Ee,ke)}ke=fe,Ee=oe}Ee!=oe&&n(fe,oe,ke,Ee,we)}function xt(G,X){var oe=G.V,fe=G.Ba+G.c*G.C,me=X-G.C;if(t(X<=G.l.o),t(16>=me),0<me){var we=G.l,xe=G.Ta,ke=G.Ua,Ee=we.width;if(Ze(G,me,oe,fe),me=ke=[ke],t((oe=G.C)<(fe=X)),t(we.v<we.va),fe>we.o&&(fe=we.o),oe<we.j){var Re=we.j-oe;oe=we.j,me[0]+=Re*Ee}if(oe>=fe?oe=0:(me[0]+=4*we.v,we.ka=oe-we.j,we.U=we.va-we.v,we.T=fe-oe,oe=1),oe){if(ke=ke[0],11>(oe=G.ca).S){var qe=oe.f.RGBA,nt=(fe=oe.S,me=we.U,we=we.T,Re=qe.eb,qe.A),ot=we;for(qe=qe.fb+G.Ma*qe.A;0<ot--;){var $e=xe,ct=ke,it=me,Qe=Re,Ke=qe;switch(fe){case Ic:Ta($e,ct,it,Qe,Ke);break;case Pc:Wo($e,ct,it,Qe,Ke);break;case cl:Wo($e,ct,it,Qe,Ke),$i(Qe,Ke,0,it,1,0);break;case Qp:Ka($e,ct,it,Qe,Ke);break;case jd:wt($e,ct,it,Qe,Ke,1);break;case ul:wt($e,ct,it,Qe,Ke,1),$i(Qe,Ke,0,it,1,0);break;case Fa:wt($e,ct,it,Qe,Ke,0);break;case Gl:wt($e,ct,it,Qe,Ke,0),$i(Qe,Ke,1,it,1,0);break;case $a:Cu($e,ct,it,Qe,Ke);break;case Bg:Cu($e,ct,it,Qe,Ke),mn(Qe,Ke,it,1,0);break;case Fu:Tc($e,ct,it,Qe,Ke);break;default:t(0)}ke+=Ee,qe+=nt}G.Ma+=we}else alert("todo:EmitRescaledRowsYUVA");t(G.Ma<=oe.height)}}G.C=X,t(G.C<=G.i)}function pt(G){var X;if(0<G.ua)return 0;for(X=0;X<G.Wb;++X){var oe=G.Ya[X].G,fe=G.Ya[X].H;if(0<oe[1][fe[1]+0].g||0<oe[2][fe[2]+0].g||0<oe[3][fe[3]+0].g)return 0}return 1}function Gt(G,X,oe,fe,me,we){if(G.Z!=0){var xe=G.qd,ke=G.rd;for(t(Us[G.Z]!=null);X<oe;++X)Us[G.Z](xe,ke,fe,me,fe,me,we),xe=fe,ke=me,me+=we;G.qd=xe,G.rd=ke}}function ir(G,X){var oe=G.l.ma,fe=oe.Z==0||oe.Z==1?G.l.j:G.C;if(fe=G.C<fe?fe:G.C,t(X<=G.l.o),X>fe){var me=G.l.width,we=oe.ca,xe=oe.tb+me*fe,ke=G.V,Ee=G.Ba+G.c*fe,Re=G.gc;t(G.ab==1),t(Re[0].hc==3),Su(Re[0],fe,X,ke,Ee,we,xe),Gt(oe,fe,X,we,xe,me)}G.C=G.Ma=X}function nr(G,X,oe,fe,me,we,xe){var ke=G.$/fe,Ee=G.$%fe,Re=G.m,qe=G.s,nt=oe+G.$,ot=nt;me=oe+fe*me;var $e=oe+fe*we,ct=280+qe.ua,it=G.Pb?ke:16777216,Qe=0<qe.ua?qe.Wa:null,Ke=qe.wc,vt=nt<$e?lt(qe,Ee,ke):null;t(G.C<we),t($e<=me);var Ct=!1;e:for(;;){for(;Ct||nt<$e;){var kt=0;if(ke>=it){var Yt=nt-oe;t((it=G).Pb),it.wd=it.m,it.xd=Yt,0<it.s.ua&&ae(it.s.Wa,it.s.vb),it=ke+Gb}if(Ee&Ke||(vt=lt(qe,Ee,ke)),t(vt!=null),vt.Qb&&(X[nt]=vt.qb,Ct=!0),!Ct)if(q(Re),vt.jc){kt=Re,Yt=X;var qt=nt,Rr=vt.pd[z(kt)&Co-1];t(vt.jc),256>Rr.g?(ee(kt,kt.u+Rr.g),Yt[qt]=Rr.value,kt=0):(ee(kt,kt.u+Rr.g-256),t(256<=Rr.value),kt=Rr.value),kt==0&&(Ct=!0)}else kt=je(vt.G[0],vt.H[0],Re);if(Re.h)break;if(Ct||256>kt){if(!Ct)if(vt.nd)X[nt]=(vt.qb|kt<<8)>>>0;else{if(q(Re),Ct=je(vt.G[1],vt.H[1],Re),q(Re),Yt=je(vt.G[2],vt.H[2],Re),qt=je(vt.G[3],vt.H[3],Re),Re.h)break;X[nt]=(qt<<24|Ct<<16|kt<<8|Yt)>>>0}if(Ct=!1,++nt,++Ee>=fe&&(Ee=0,++ke,xe!=null&&ke<=we&&!(ke%16)&&xe(G,ke),Qe!=null))for(;ot<nt;)kt=X[ot++],Qe.X[(506832829*kt&4294967295)>>>Qe.Mb]=kt}else if(280>kt){if(kt=Xr(kt-256,Re),Yt=je(vt.G[4],vt.H[4],Re),q(Re),Yt=yr(fe,Yt=Xr(Yt,Re)),Re.h)break;if(nt-oe<Yt||me-nt<kt)break e;for(qt=0;qt<kt;++qt)X[nt+qt]=X[nt+qt-Yt];for(nt+=kt,Ee+=kt;Ee>=fe;)Ee-=fe,++ke,xe!=null&&ke<=we&&!(ke%16)&&xe(G,ke);if(t(nt<=me),Ee&Ke&&(vt=lt(qe,Ee,ke)),Qe!=null)for(;ot<nt;)kt=X[ot++],Qe.X[(506832829*kt&4294967295)>>>Qe.Mb]=kt}else{if(!(kt<ct))break e;for(Ct=kt-280,t(Qe!=null);ot<nt;)kt=X[ot++],Qe.X[(506832829*kt&4294967295)>>>Qe.Mb]=kt;kt=nt,t(!(Ct>>>(Yt=Qe).Xa)),X[kt]=Yt.X[Ct],Ct=!0}Ct||t(Re.h==$(Re))}if(G.Pb&&Re.h&&nt<me)t(G.m.h),G.a=5,G.m=G.wd,G.$=G.xd,0<G.s.ua&&ae(G.s.vb,G.s.Wa);else{if(Re.h)break e;xe!=null&&xe(G,ke>we?we:ke),G.a=0,G.$=nt-oe}return 1}return G.a=3,0}function wr(G){t(G!=null),G.vc=null,G.yc=null,G.Ya=null;var X=G.Wa;X!=null&&(X.X=null),G.vb=null,t(G!=null)}function Ar(){var G=new zb;return G==null?null:(G.a=0,G.xb=Qd,Bt("Predictor","VP8LPredictors"),Bt("Predictor","VP8LPredictors_C"),Bt("PredictorAdd","VP8LPredictorsAdd"),Bt("PredictorAdd","VP8LPredictorsAdd_C"),Cg=De,ku=Ue,Ta=rt,Wo=Rt,Cu=ht,Tc=At,Ka=bt,D.VP8LMapColor32b=Qo,D.VP8LMapColor8b=Up,G)}function Fr(G,X,oe,fe,me){var we=1,xe=[G],ke=[X],Ee=fe.m,Re=fe.s,qe=null,nt=0;e:for(;;){if(oe)for(;we&&F(Ee,1);){var ot=xe,$e=ke,ct=fe,it=1,Qe=ct.m,Ke=ct.gc[ct.ab],vt=F(Qe,2);if(ct.Oc&1<<vt)we=0;else{switch(ct.Oc|=1<<vt,Ke.hc=vt,Ke.Ea=ot[0],Ke.nc=$e[0],Ke.K=[null],++ct.ab,t(4>=ct.ab),vt){case 0:case 1:Ke.b=F(Qe,3)+2,it=Fr(Ae(Ke.Ea,Ke.b),Ae(Ke.nc,Ke.b),0,ct,Ke.K),Ke.K=Ke.K[0];break;case 3:var Ct,kt=F(Qe,8)+1,Yt=16<kt?0:4<kt?1:2<kt?2:3;if(ot[0]=Ae(Ke.Ea,Yt),Ke.b=Yt,Ct=it=Fr(kt,1,0,ct,Ke.K)){var qt,Rr=kt,Lt=Ke,Rn=1<<(8>>Lt.b),Wn=o(Rn);if(Wn==null)Ct=0;else{var Tn=Lt.K[0],bn=Lt.w;for(Wn[0]=Lt.K[0][0],qt=1;qt<1*Rr;++qt)Wn[qt]=ue(Tn[bn+qt],Wn[qt-1]);for(;qt<4*Rn;++qt)Wn[qt]=0;Lt.K[0]=null,Lt.K[0]=Wn,Ct=1}}it=Ct;break;case 2:break;default:t(0)}we=it}}if(xe=xe[0],ke=ke[0],we&&F(Ee,1)&&!(we=1<=(nt=F(Ee,4))&&11>=nt)){fe.a=3;break e}var li;if(li=we)t:{var Xn,Wr,Yi,ci=fe,hn=xe,Zo=ke,Dn=nt,Aa=oe,Da=ci.m,Ai=ci.s,Ao=[null],Jo=1,Wa=0,pl=$l[Dn];r:for(;;){if(Aa&&F(Da,1)){var Mo=F(Da,3)+2,Wl=Ae(hn,Mo),Pu=Ae(Zo,Mo),Vd=Wl*Pu;if(!Fr(Wl,Pu,0,ci,Ao))break r;for(Ao=Ao[0],Ai.xc=Mo,Xn=0;Xn<Vd;++Xn){var Uc=Ao[Xn]>>8&65535;Ao[Xn]=Uc,Uc>=Jo&&(Jo=Uc+1)}}if(Da.h)break r;for(Wr=0;5>Wr;++Wr){var Ei=pa[Wr];!Wr&&0<Dn&&(Ei+=1<<Dn),Wa<Ei&&(Wa=Ei)}var Dg=a(Jo*pl,N),x2=Jo,Zb=a(x2,P);if(Zb==null)var $p=null;else t(65536>=x2),$p=Zb;var dh=o(Wa);if($p==null||dh==null||Dg==null){ci.a=1;break r}var fh=Dg;for(Xn=Yi=0;Xn<Jo;++Xn){var js=$p[Xn],qd=js.G,Kd=js.H,Jb=0,Wp=1,_2=0;for(Wr=0;5>Wr;++Wr){Ei=pa[Wr],qd[Wr]=fh,Kd[Wr]=Yi,!Wr&&0<Dn&&(Ei+=1<<Dn);i:{var Yp,Ou=Ei,Xp=ci,Lu=dh,Ig=fh,S2=Yi,Zp=0,Nc=Xp.m,k2=F(Nc,1);if(i(Lu,0,0,Ou),k2){var C2=F(Nc,1)+1,B2=F(Nc,1),Pg=F(Nc,B2==0?1:8);Lu[Pg]=1,C2==2&&(Lu[Pg=F(Nc,8)]=1);var Jp=1}else{var ey=o(19),Og=F(Nc,4)+4;if(19<Og){Xp.a=3;var eA=0;break i}for(Yp=0;Yp<Og;++Yp)ey[Nn[Yp]]=F(Nc,3);var Lg=void 0,tA=void 0,Ug=Xp,E2=ey,rA=Ou,Ng=Lu,jg=0,jc=Ug.m,M2=8,T2=a(128,N);n:for(;Q(T2,0,7,E2,19);){if(F(jc,1)){var F2=2+2*F(jc,3);if((Lg=2+F(jc,F2))>rA)break n}else Lg=rA;for(tA=0;tA<rA&&Lg--;){q(jc);var hh=T2[0+(127&z(jc))];ee(jc,jc.u+hh.g);var Uu=hh.value;if(16>Uu)Ng[tA++]=Uu,Uu!=0&&(M2=Uu);else{var Qg=Uu==16,ty=Uu-16,R2=Kb[ty],Al=F(jc,qb[ty])+R2;if(tA+Al>rA)break n;for(var Gd=Qg?M2:0;0<Al--;)Ng[tA++]=Gd}}jg=1;break n}jg||(Ug.a=3),Jp=jg}(Jp=Jp&&!Nc.h)&&(Zp=Q(Ig,S2,8,Lu,Ou)),Jp&&Zp!=0?eA=Zp:(Xp.a=3,eA=0)}if(eA==0)break r;if(Wp&&Xo[Wr]==1&&(Wp=fh[Yi].g==0),Jb+=fh[Yi].g,Yi+=eA,3>=Wr){var Qs,Qc=dh[0];for(Qs=1;Qs<Ei;++Qs)dh[Qs]>Qc&&(Qc=dh[Qs]);_2+=Qc}}if(js.nd=Wp,js.Qb=0,Wp&&(js.qb=(qd[3][Kd[3]+0].value<<24|qd[1][Kd[1]+0].value<<16|qd[2][Kd[2]+0].value)>>>0,Jb==0&&256>qd[0][Kd[0]+0].value&&(js.Qb=1,js.qb+=qd[0][Kd[0]+0].value<<8)),js.jc=!js.Qb&&6>_2,js.jc){var ph,gl=js;for(ph=0;ph<Co;++ph){var Hc=ph,zc=gl.pd[Hc],Yl=gl.G[0][gl.H[0]+Hc];256<=Yl.value?(zc.g=Yl.g+256,zc.value=Yl.value):(zc.g=0,zc.value=0,Hc>>=We(Yl,8,zc),Hc>>=We(gl.G[1][gl.H[1]+Hc],16,zc),Hc>>=We(gl.G[2][gl.H[2]+Hc],0,zc),We(gl.G[3][gl.H[3]+Hc],24,zc))}}}Ai.vc=Ao,Ai.Wb=Jo,Ai.Ya=$p,Ai.yc=Dg,li=1;break t}li=0}if(!(we=li)){fe.a=3;break e}if(0<nt){if(Re.ua=1<<nt,!se(Re.Wa,nt)){fe.a=1,we=0;break e}}else Re.ua=0;var Ah=fe,ry=xe,D2=ke,Hg=Ah.s,gh=Hg.xc;if(Ah.c=ry,Ah.i=D2,Hg.md=Ae(ry,gh),Hg.wc=gh==0?-1:(1<<gh)-1,oe){fe.xb=y2;break e}if((qe=o(xe*ke))==null){fe.a=1,we=0;break e}we=(we=nr(fe,qe,0,xe,ke,ke,null))&&!Ee.h;break e}return we?(me!=null?me[0]=qe:(t(qe==null),t(oe)),fe.$=0,oe||wr(Re)):wr(Re),we}function Mn(G,X){var oe=G.c*G.i,fe=oe+X+16*X;return t(G.c<=X),G.V=o(fe),G.V==null?(G.Ta=null,G.Ua=0,G.a=1,0):(G.Ta=G.V,G.Ua=G.Ba+oe+X,1)}function vn(G,X){var oe=G.C,fe=X-oe,me=G.V,we=G.Ba+G.c*oe;for(t(X<=G.l.o);0<fe;){var xe=16<fe?16:fe,ke=G.l.ma,Ee=G.l.width,Re=Ee*xe,qe=ke.ca,nt=ke.tb+Ee*oe,ot=G.Ta,$e=G.Ua;Ze(G,xe,me,we),Ni(ot,$e,qe,nt,Re),Gt(ke,oe,oe+xe,qe,nt,Ee),fe-=xe,me+=xe*G.c,oe+=xe}t(oe==X),G.C=G.Ma=X}function Un(){this.ub=this.yd=this.td=this.Rb=0}function Gn(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function wi(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function Ie(){this.Yb=function(){var G=[];return function X(oe,fe,me){for(var we=me[fe],xe=0;xe<we&&(oe.push(me.length>fe+1?[]:0),!(me.length<fe+1));xe++)X(oe[xe],fe+1,me)}(G,0,[3,11]),G}()}function Xe(){this.jb=o(3),this.Wc=s([4,8],Ie),this.Xc=s([4,17],Ie)}function St(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function Mt(){this.ld=this.La=this.dd=this.tc=0}function tr(){this.Na=this.la=0}function Ot(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Pt(){this.ad=o(384),this.Za=0,this.Ob=o(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function ln(){this.uc=this.M=this.Nb=0,this.wa=Array(new Mt),this.Y=0,this.ya=Array(new Pt),this.aa=0,this.l=new gr}function jr(){this.y=o(16),this.f=o(8),this.ea=o(8)}function qr(){this.cb=this.a=0,this.sc="",this.m=new K,this.Od=new Un,this.Kc=new Gn,this.ed=new St,this.Qa=new wi,this.Ic=this.$c=this.Aa=0,this.D=new ln,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,K),this.ia=0,this.pb=a(4,Ot),this.Pa=new Xe,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new jr),this.Hd=0,this.rb=Array(new tr),this.sb=0,this.wa=Array(new Mt),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Pt),this.L=this.aa=0,this.gd=s([4,2],Mt),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function gr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function An(){var G=new qr;return G!=null&&(G.a=0,G.sc="OK",G.cb=0,G.Xb=0,lh||(lh=Ci)),G}function Er(G,X,oe){return G.a==0&&(G.a=X,G.sc=oe,G.cb=0),0}function rn(G,X,oe){return 3<=oe&&G[X+0]==157&&G[X+1]==1&&G[X+2]==42}function dn(G,X){if(G==null)return 0;if(G.a=0,G.sc="OK",X==null)return Er(G,2,"null VP8Io passed to VP8GetHeaders()");var oe=X.data,fe=X.w,me=X.ha;if(4>me)return Er(G,7,"Truncated header.");var we=oe[fe+0]|oe[fe+1]<<8|oe[fe+2]<<16,xe=G.Od;if(xe.Rb=!(1&we),xe.td=we>>1&7,xe.yd=we>>4&1,xe.ub=we>>5,3<xe.td)return Er(G,3,"Incorrect keyframe parameters.");if(!xe.yd)return Er(G,4,"Frame not displayable.");fe+=3,me-=3;var ke=G.Kc;if(xe.Rb){if(7>me)return Er(G,7,"cannot parse picture header");if(!rn(oe,fe,me))return Er(G,3,"Bad code word");ke.c=16383&(oe[fe+4]<<8|oe[fe+3]),ke.Td=oe[fe+4]>>6,ke.i=16383&(oe[fe+6]<<8|oe[fe+5]),ke.Ud=oe[fe+6]>>6,fe+=7,me-=7,G.za=ke.c+15>>4,G.Ub=ke.i+15>>4,X.width=ke.c,X.height=ke.i,X.Da=0,X.j=0,X.v=0,X.va=X.width,X.o=X.height,X.da=0,X.ib=X.width,X.hb=X.height,X.U=X.width,X.T=X.height,i((we=G.Pa).jb,0,255,we.jb.length),t((we=G.Qa)!=null),we.Cb=0,we.Bb=0,we.Fb=1,i(we.Zb,0,0,we.Zb.length),i(we.Lb,0,0,we.Lb)}if(xe.ub>me)return Er(G,7,"bad partition length");T(we=G.m,oe,fe,xe.ub),fe+=xe.ub,me-=xe.ub,xe.Rb&&(ke.Ld=V(we),ke.Kd=V(we)),ke=G.Qa;var Ee,Re=G.Pa;if(t(we!=null),t(ke!=null),ke.Cb=V(we),ke.Cb){if(ke.Bb=V(we),V(we)){for(ke.Fb=V(we),Ee=0;4>Ee;++Ee)ke.Zb[Ee]=V(we)?_(we,7):0;for(Ee=0;4>Ee;++Ee)ke.Lb[Ee]=V(we)?_(we,6):0}if(ke.Bb)for(Ee=0;3>Ee;++Ee)Re.jb[Ee]=V(we)?x(we,8):255}else ke.Bb=0;if(we.Ka)return Er(G,3,"cannot parse segment header");if((ke=G.ed).zd=V(we),ke.Tb=x(we,6),ke.wb=x(we,3),ke.Pc=V(we),ke.Pc&&V(we)){for(Re=0;4>Re;++Re)V(we)&&(ke.vd[Re]=_(we,6));for(Re=0;4>Re;++Re)V(we)&&(ke.od[Re]=_(we,6))}if(G.L=ke.Tb==0?0:ke.zd?1:2,we.Ka)return Er(G,3,"cannot parse filter header");var qe=me;if(me=Ee=fe,fe=Ee+qe,ke=qe,G.Xb=(1<<x(G.m,2))-1,qe<3*(Re=G.Xb))oe=7;else{for(Ee+=3*Re,ke-=3*Re,qe=0;qe<Re;++qe){var nt=oe[me+0]|oe[me+1]<<8|oe[me+2]<<16;nt>ke&&(nt=ke),T(G.Jc[+qe],oe,Ee,nt),Ee+=nt,ke-=nt,me+=3}T(G.Jc[+Re],oe,Ee,ke),oe=Ee<fe?0:5}if(oe!=0)return Er(G,oe,"cannot parse partitions");for(oe=x(Ee=G.m,7),me=V(Ee)?_(Ee,4):0,fe=V(Ee)?_(Ee,4):0,ke=V(Ee)?_(Ee,4):0,Re=V(Ee)?_(Ee,4):0,Ee=V(Ee)?_(Ee,4):0,qe=G.Qa,nt=0;4>nt;++nt){if(qe.Cb){var ot=qe.Zb[nt];qe.Fb||(ot+=oe)}else{if(0<nt){G.pb[nt]=G.pb[0];continue}ot=oe}var $e=G.pb[nt];$e.Sc[0]=Oc[Is(ot+me,127)],$e.Sc[1]=Eg[Is(ot+0,127)],$e.Eb[0]=2*Oc[Is(ot+fe,127)],$e.Eb[1]=101581*Eg[Is(ot+ke,127)]>>16,8>$e.Eb[1]&&($e.Eb[1]=8),$e.Qc[0]=Oc[Is(ot+Re,117)],$e.Qc[1]=Eg[Is(ot+Ee,127)],$e.lc=ot+Ee}if(!xe.Rb)return Er(G,4,"Not a key frame.");for(V(we),xe=G.Pa,oe=0;4>oe;++oe){for(me=0;8>me;++me)for(fe=0;3>fe;++fe)for(ke=0;11>ke;++ke)Re=H(we,$b[oe][me][fe][ke])?x(we,8):Vp[oe][me][fe][ke],xe.Wc[oe][me].Yb[fe][ke]=Re;for(me=0;17>me;++me)xe.Xc[oe][me]=xe.Wc[oe][b2[me]]}return G.kc=V(we),G.kc&&(G.Bd=x(we,8)),G.cb=1}function Ci(G,X,oe,fe,me,we,xe){var ke=X[me].Yb[oe];for(oe=0;16>me;++me){if(!H(G,ke[oe+0]))return me;for(;!H(G,ke[oe+1]);)if(ke=X[++me].Yb[0],oe=0,me==16)return 16;var Ee=X[me+1].Yb;if(H(G,ke[oe+2])){var Re=G,qe=0;if(H(Re,(ot=ke)[(nt=oe)+3]))if(H(Re,ot[nt+6])){for(ke=0,nt=2*(qe=H(Re,ot[nt+8]))+(ot=H(Re,ot[nt+9+qe])),qe=0,ot=Hp[nt];ot[ke];++ke)qe+=qe+H(Re,ot[ke]);qe+=3+(8<<nt)}else H(Re,ot[nt+7])?(qe=7+2*H(Re,165),qe+=H(Re,145)):qe=5+H(Re,159);else qe=H(Re,ot[nt+4])?3+H(Re,ot[nt+5]):2;ke=Ee[2]}else qe=1,ke=Ee[1];Ee=xe+zp[me],0>(Re=G).b&&J(Re);var nt,ot=Re.b,$e=(nt=Re.Ca>>1)-(Re.I>>ot)>>31;--Re.b,Re.Ca+=$e,Re.Ca|=1,Re.I-=(nt+1&$e)<<ot,we[Ee]=((qe^$e)-$e)*fe[(0<me)+0]}return 16}function eo(G){var X=G.rb[G.sb-1];X.la=0,X.Na=0,i(G.zc,0,0,G.zc.length),G.ja=0}function Lo(G,X){if(G==null)return 0;if(X==null)return Er(G,2,"NULL VP8Io parameter in VP8Decode().");if(!G.cb&&!dn(G,X))return 0;if(t(G.cb),X.ac==null||X.ac(X)){X.ob&&(G.L=0);var oe=Fg[G.L];if(G.L==2?(G.yb=0,G.zb=0):(G.yb=X.v-oe>>4,G.zb=X.j-oe>>4,0>G.yb&&(G.yb=0),0>G.zb&&(G.zb=0)),G.Va=X.o+15+oe>>4,G.Hb=X.va+15+oe>>4,G.Hb>G.za&&(G.Hb=G.za),G.Va>G.Ub&&(G.Va=G.Ub),0<G.L){var fe=G.ed;for(oe=0;4>oe;++oe){var me;if(G.Qa.Cb){var we=G.Qa.Lb[oe];G.Qa.Fb||(we+=fe.Tb)}else we=fe.Tb;for(me=0;1>=me;++me){var xe=G.gd[oe][me],ke=we;if(fe.Pc&&(ke+=fe.vd[0],me&&(ke+=fe.od[0])),0<(ke=0>ke?0:63<ke?63:ke)){var Ee=ke;0<fe.wb&&(Ee=4<fe.wb?Ee>>2:Ee>>1)>9-fe.wb&&(Ee=9-fe.wb),1>Ee&&(Ee=1),xe.dd=Ee,xe.tc=2*ke+Ee,xe.ld=40<=ke?2:15<=ke?1:0}else xe.tc=0;xe.La=me}}}oe=0}else Er(G,6,"Frame setup failed"),oe=G.a;if(oe=oe==0){if(oe){G.$c=0,0<G.Aa||(G.Ic=Eo);e:{oe=G.Ic,fe=4*(Ee=G.za);var Re=32*Ee,qe=Ee+1,nt=0<G.L?Ee*(0<G.Aa?2:1):0,ot=(G.Aa==2?2:1)*Ee;if((xe=fe+832+(me=3*(16*oe+Fg[G.L])/2*Re)+(we=G.Fa!=null&&0<G.Fa.length?G.Kc.c*G.Kc.i:0))!=xe)oe=0;else{if(xe>G.Vb){if(G.Vb=0,G.Ec=o(xe),G.Fc=0,G.Ec==null){oe=Er(G,1,"no memory during frame initialization.");break e}G.Vb=xe}xe=G.Ec,ke=G.Fc,G.Ac=xe,G.Bc=ke,ke+=fe,G.Gd=a(Re,jr),G.Hd=0,G.rb=a(qe+1,tr),G.sb=1,G.wa=nt?a(nt,Mt):null,G.Y=0,G.D.Nb=0,G.D.wa=G.wa,G.D.Y=G.Y,0<G.Aa&&(G.D.Y+=Ee),t(!0),G.oc=xe,G.pc=ke,ke+=832,G.ya=a(ot,Pt),G.aa=0,G.D.ya=G.ya,G.D.aa=G.aa,G.Aa==2&&(G.D.aa+=Ee),G.R=16*Ee,G.B=8*Ee,Ee=(Re=Fg[G.L])*G.R,Re=Re/2*G.B,G.sa=xe,G.ta=ke+Ee,G.qa=G.sa,G.ra=G.ta+16*oe*G.R+Re,G.Ha=G.qa,G.Ia=G.ra+8*oe*G.B+Re,G.$c=0,ke+=me,G.mb=we?xe:null,G.nb=we?ke:null,t(ke+we<=G.Fc+G.Vb),eo(G),i(G.Ac,G.Bc,0,fe),oe=1}}if(oe){if(X.ka=0,X.y=G.sa,X.O=G.ta,X.f=G.qa,X.N=G.ra,X.ea=G.Ha,X.Vd=G.Ia,X.fa=G.R,X.Rc=G.B,X.F=null,X.J=0,!jp){for(oe=-255;255>=oe;++oe)Wi[255+oe]=0>oe?-oe:oe;for(oe=-1020;1020>=oe;++oe)Os[1020+oe]=-128>oe?-128:127<oe?127:oe;for(oe=-112;112>=oe;++oe)Nd[112+oe]=-16>oe?-16:15<oe?15:oe;for(oe=-255;510>=oe;++oe)bs[255+oe]=0>oe?0:255<oe?255:oe;jp=1}Bu=Uo,gs=fn,ih=Ea,io=fa,Yo=Nl,Ui=gn,Eu=Fd,Np=Rd,ll=Hb,Mu=Rp,Tu=Qb,Fc=Wf,Ld=Yf,oh=kg,Ud=yu,Rc=As,ah=Kl,ms=jb,Ls[0]=il,Ls[1]=Fs,Ls[2]=kc,Ls[3]=Hl,Ls[4]=gu,Ls[5]=zl,Ls[6]=qf,Ls[7]=Ds,Ls[8]=Kf,Ls[9]=Fp,fl[0]=Rs,fl[1]=_c,fl[2]=No,fl[3]=Ma,fl[4]=Ki,fl[5]=Ql,fl[6]=Va,ys[0]=Cc,ys[1]=jl,ys[2]=_g,ys[3]=mu,ys[4]=ps,ys[5]=ha,ys[6]=bu,oe=1}else oe=0}oe&&(oe=function($e,ct){for($e.M=0;$e.M<$e.Va;++$e.M){var it,Qe=$e.Jc[$e.M&$e.Xb],Ke=$e.m,vt=$e;for(it=0;it<vt.za;++it){var Ct=Ke,kt=vt,Yt=kt.Ac,qt=kt.Bc+4*it,Rr=kt.zc,Lt=kt.ya[kt.aa+it];if(kt.Qa.Bb?Lt.$b=H(Ct,kt.Pa.jb[0])?2+H(Ct,kt.Pa.jb[2]):H(Ct,kt.Pa.jb[1]):Lt.$b=0,kt.kc&&(Lt.Ad=H(Ct,kt.Bd)),Lt.Za=!H(Ct,145)+0,Lt.Za){var Rn=Lt.Ob,Wn=0;for(kt=0;4>kt;++kt){var Tn,bn=Rr[0+kt];for(Tn=0;4>Tn;++Tn){bn=m2[Yt[qt+Tn]][bn];for(var li=ch[H(Ct,bn[0])];0<li;)li=ch[2*li+H(Ct,bn[li])];bn=-li,Yt[qt+Tn]=bn}n(Rn,Wn,Yt,qt,4),Wn+=4,Rr[0+kt]=bn}}else bn=H(Ct,156)?H(Ct,128)?1:3:H(Ct,163)?2:0,Lt.Ob[0]=bn,i(Yt,qt,bn,4),i(Rr,0,bn,4);Lt.Dd=H(Ct,142)?H(Ct,114)?H(Ct,183)?1:3:2:0}if(vt.m.Ka)return Er($e,7,"Premature end-of-partition0 encountered.");for(;$e.ja<$e.za;++$e.ja){if(vt=Qe,Ct=(Ke=$e).rb[Ke.sb-1],Yt=Ke.rb[Ke.sb+Ke.ja],it=Ke.ya[Ke.aa+Ke.ja],qt=Ke.kc?it.Ad:0)Ct.la=Yt.la=0,it.Za||(Ct.Na=Yt.Na=0),it.Hc=0,it.Gc=0,it.ia=0;else{var Xn,Wr;if(Ct=Yt,Yt=vt,qt=Ke.Pa.Xc,Rr=Ke.ya[Ke.aa+Ke.ja],Lt=Ke.pb[Rr.$b],kt=Rr.ad,Rn=0,Wn=Ke.rb[Ke.sb-1],bn=Tn=0,i(kt,Rn,0,384),Rr.Za)var Yi=0,ci=qt[3];else{li=o(16);var hn=Ct.Na+Wn.Na;if(hn=lh(Yt,qt[1],hn,Lt.Eb,0,li,0),Ct.Na=Wn.Na=(0<hn)+0,1<hn)Bu(li,0,kt,Rn);else{var Zo=li[0]+3>>3;for(li=0;256>li;li+=16)kt[Rn+li]=Zo}Yi=1,ci=qt[0]}var Dn=15&Ct.la,Aa=15&Wn.la;for(li=0;4>li;++li){var Da=1&Aa;for(Zo=Wr=0;4>Zo;++Zo)Dn=Dn>>1|(Da=(hn=lh(Yt,ci,hn=Da+(1&Dn),Lt.Sc,Yi,kt,Rn))>Yi)<<7,Wr=Wr<<2|(3<hn?3:1<hn?2:kt[Rn+0]!=0),Rn+=16;Dn>>=4,Aa=Aa>>1|Da<<7,Tn=(Tn<<8|Wr)>>>0}for(ci=Dn,Yi=Aa>>4,Xn=0;4>Xn;Xn+=2){for(Wr=0,Dn=Ct.la>>4+Xn,Aa=Wn.la>>4+Xn,li=0;2>li;++li){for(Da=1&Aa,Zo=0;2>Zo;++Zo)hn=Da+(1&Dn),Dn=Dn>>1|(Da=0<(hn=lh(Yt,qt[2],hn,Lt.Qc,0,kt,Rn)))<<3,Wr=Wr<<2|(3<hn?3:1<hn?2:kt[Rn+0]!=0),Rn+=16;Dn>>=2,Aa=Aa>>1|Da<<5}bn|=Wr<<4*Xn,ci|=Dn<<4<<Xn,Yi|=(240&Aa)<<Xn}Ct.la=ci,Wn.la=Yi,Rr.Hc=Tn,Rr.Gc=bn,Rr.ia=43690&bn?0:Lt.ia,qt=!(Tn|bn)}if(0<Ke.L&&(Ke.wa[Ke.Y+Ke.ja]=Ke.gd[it.$b][it.Za],Ke.wa[Ke.Y+Ke.ja].La|=!qt),vt.Ka)return Er($e,7,"Premature end-of-file encountered.")}if(eo($e),Ke=ct,vt=1,it=(Qe=$e).D,Ct=0<Qe.L&&Qe.M>=Qe.zb&&Qe.M<=Qe.Va,Qe.Aa==0)e:{if(it.M=Qe.M,it.uc=Ct,Ec(Qe,it),vt=1,it=(Wr=Qe.D).Nb,Ct=(bn=Fg[Qe.L])*Qe.R,Yt=bn/2*Qe.B,li=16*it*Qe.R,Zo=8*it*Qe.B,qt=Qe.sa,Rr=Qe.ta-Ct+li,Lt=Qe.qa,kt=Qe.ra-Yt+Zo,Rn=Qe.Ha,Wn=Qe.Ia-Yt+Zo,Aa=(Dn=Wr.M)==0,Tn=Dn>=Qe.Va-1,Qe.Aa==2&&Ec(Qe,Wr),Wr.uc)for(Da=(hn=Qe).D.M,t(hn.D.uc),Wr=hn.yb;Wr<hn.Hb;++Wr){Yi=Wr,ci=Da;var Ai=(Ao=(Ei=hn).D).Nb;Xn=Ei.R;var Ao=Ao.wa[Ao.Y+Yi],Jo=Ei.sa,Wa=Ei.ta+16*Ai*Xn+16*Yi,pl=Ao.dd,Mo=Ao.tc;if(Mo!=0)if(t(3<=Mo),Ei.L==1)0<Yi&&Rc(Jo,Wa,Xn,Mo+4),Ao.La&&ms(Jo,Wa,Xn,Mo),0<ci&&Ud(Jo,Wa,Xn,Mo+4),Ao.La&&ah(Jo,Wa,Xn,Mo);else{var Wl=Ei.B,Pu=Ei.qa,Vd=Ei.ra+8*Ai*Wl+8*Yi,Uc=Ei.Ha,Ei=Ei.Ia+8*Ai*Wl+8*Yi;Ai=Ao.ld,0<Yi&&(Np(Jo,Wa,Xn,Mo+4,pl,Ai),Mu(Pu,Vd,Uc,Ei,Wl,Mo+4,pl,Ai)),Ao.La&&(Fc(Jo,Wa,Xn,Mo,pl,Ai),oh(Pu,Vd,Uc,Ei,Wl,Mo,pl,Ai)),0<ci&&(Eu(Jo,Wa,Xn,Mo+4,pl,Ai),ll(Pu,Vd,Uc,Ei,Wl,Mo+4,pl,Ai)),Ao.La&&(Tu(Jo,Wa,Xn,Mo,pl,Ai),Ld(Pu,Vd,Uc,Ei,Wl,Mo,pl,Ai))}}if(Qe.ia&&alert("todo:DitherRow"),Ke.put!=null){if(Wr=16*Dn,Dn=16*(Dn+1),Aa?(Ke.y=Qe.sa,Ke.O=Qe.ta+li,Ke.f=Qe.qa,Ke.N=Qe.ra+Zo,Ke.ea=Qe.Ha,Ke.W=Qe.Ia+Zo):(Wr-=bn,Ke.y=qt,Ke.O=Rr,Ke.f=Lt,Ke.N=kt,Ke.ea=Rn,Ke.W=Wn),Tn||(Dn-=bn),Dn>Ke.o&&(Dn=Ke.o),Ke.F=null,Ke.J=null,Qe.Fa!=null&&0<Qe.Fa.length&&Wr<Dn&&(Ke.J=Pp(Qe,Ke,Wr,Dn-Wr),Ke.F=Qe.mb,Ke.F==null&&Ke.F.length==0)){vt=Er(Qe,3,"Could not decode alpha data.");break e}Wr<Ke.j&&(bn=Ke.j-Wr,Wr=Ke.j,t(!(1&bn)),Ke.O+=Qe.R*bn,Ke.N+=Qe.B*(bn>>1),Ke.W+=Qe.B*(bn>>1),Ke.F!=null&&(Ke.J+=Ke.width*bn)),Wr<Dn&&(Ke.O+=Ke.v,Ke.N+=Ke.v>>1,Ke.W+=Ke.v>>1,Ke.F!=null&&(Ke.J+=Ke.v),Ke.ka=Wr-Ke.j,Ke.U=Ke.va-Ke.v,Ke.T=Dn-Wr,vt=Ke.put(Ke))}it+1!=Qe.Ic||Tn||(n(Qe.sa,Qe.ta-Ct,qt,Rr+16*Qe.R,Ct),n(Qe.qa,Qe.ra-Yt,Lt,kt+8*Qe.B,Yt),n(Qe.Ha,Qe.Ia-Yt,Rn,Wn+8*Qe.B,Yt))}if(!vt)return Er($e,6,"Output aborted.")}return 1}(G,X)),X.bc!=null&&X.bc(X),oe&=1}return oe?(G.cb=0,oe):0}function ho(G,X,oe,fe,me){me=G[X+oe+32*fe]+(me>>3),G[X+oe+32*fe]=-256&me?0>me?0:255:me}function da(G,X,oe,fe,me,we){ho(G,X,0,oe,fe+me),ho(G,X,1,oe,fe+we),ho(G,X,2,oe,fe-we),ho(G,X,3,oe,fe-me)}function to(G){return(20091*G>>16)+G}function Li(G,X,oe,fe){var me,we=0,xe=o(16);for(me=0;4>me;++me){var ke=G[X+0]+G[X+8],Ee=G[X+0]-G[X+8],Re=(35468*G[X+4]>>16)-to(G[X+12]),qe=to(G[X+4])+(35468*G[X+12]>>16);xe[we+0]=ke+qe,xe[we+1]=Ee+Re,xe[we+2]=Ee-Re,xe[we+3]=ke-qe,we+=4,X++}for(me=we=0;4>me;++me)ke=(G=xe[we+0]+4)+xe[we+8],Ee=G-xe[we+8],Re=(35468*xe[we+4]>>16)-to(xe[we+12]),ho(oe,fe,0,0,ke+(qe=to(xe[we+4])+(35468*xe[we+12]>>16))),ho(oe,fe,1,0,Ee+Re),ho(oe,fe,2,0,Ee-Re),ho(oe,fe,3,0,ke-qe),we++,fe+=32}function gn(G,X,oe,fe){var me=G[X+0]+4,we=35468*G[X+4]>>16,xe=to(G[X+4]),ke=35468*G[X+1]>>16;da(oe,fe,0,me+xe,G=to(G[X+1]),ke),da(oe,fe,1,me+we,G,ke),da(oe,fe,2,me-we,G,ke),da(oe,fe,3,me-xe,G,ke)}function fn(G,X,oe,fe,me){Li(G,X,oe,fe),me&&Li(G,X+16,oe,fe+4)}function Ea(G,X,oe,fe){gs(G,X+0,oe,fe,1),gs(G,X+32,oe,fe+128,1)}function fa(G,X,oe,fe){var me;for(G=G[X+0]+4,me=0;4>me;++me)for(X=0;4>X;++X)ho(oe,fe,X,me,G)}function Nl(G,X,oe,fe){G[X+0]&&io(G,X+0,oe,fe),G[X+16]&&io(G,X+16,oe,fe+4),G[X+32]&&io(G,X+32,oe,fe+128),G[X+48]&&io(G,X+48,oe,fe+128+4)}function Uo(G,X,oe,fe){var me,we=o(16);for(me=0;4>me;++me){var xe=G[X+0+me]+G[X+12+me],ke=G[X+4+me]+G[X+8+me],Ee=G[X+4+me]-G[X+8+me],Re=G[X+0+me]-G[X+12+me];we[0+me]=xe+ke,we[8+me]=xe-ke,we[4+me]=Re+Ee,we[12+me]=Re-Ee}for(me=0;4>me;++me)xe=(G=we[0+4*me]+3)+we[3+4*me],ke=we[1+4*me]+we[2+4*me],Ee=we[1+4*me]-we[2+4*me],Re=G-we[3+4*me],oe[fe+0]=xe+ke>>3,oe[fe+16]=Re+Ee>>3,oe[fe+32]=xe-ke>>3,oe[fe+48]=Re-Ee>>3,fe+=64}function po(G,X,oe){var fe,me=X-32,we=Ga,xe=255-G[me-1];for(fe=0;fe<oe;++fe){var ke,Ee=we,Re=xe+G[X-1];for(ke=0;ke<oe;++ke)G[X+ke]=Ee[Re+G[me+ke]];X+=32}}function Fs(G,X){po(G,X,4)}function jl(G,X){po(G,X,8)}function _c(G,X){po(G,X,16)}function No(G,X){var oe;for(oe=0;16>oe;++oe)n(G,X+32*oe,G,X-32,16)}function Ma(G,X){var oe;for(oe=16;0<oe;--oe)i(G,X,G[X-1],16),X+=32}function Sc(G,X,oe){var fe;for(fe=0;16>fe;++fe)i(X,oe+32*fe,G,16)}function Rs(G,X){var oe,fe=16;for(oe=0;16>oe;++oe)fe+=G[X-1+32*oe]+G[X+oe-32];Sc(fe>>5,G,X)}function Ki(G,X){var oe,fe=8;for(oe=0;16>oe;++oe)fe+=G[X-1+32*oe];Sc(fe>>4,G,X)}function Ql(G,X){var oe,fe=8;for(oe=0;16>oe;++oe)fe+=G[X+oe-32];Sc(fe>>4,G,X)}function Va(G,X){Sc(128,G,X)}function Tr(G,X,oe){return G+2*X+oe+2>>2}function kc(G,X){var oe,fe=X-32;for(fe=new Uint8Array([Tr(G[fe-1],G[fe+0],G[fe+1]),Tr(G[fe+0],G[fe+1],G[fe+2]),Tr(G[fe+1],G[fe+2],G[fe+3]),Tr(G[fe+2],G[fe+3],G[fe+4])]),oe=0;4>oe;++oe)n(G,X+32*oe,fe,0,fe.length)}function Hl(G,X){var oe=G[X-1],fe=G[X-1+32],me=G[X-1+64],we=G[X-1+96];Z(G,X+0,16843009*Tr(G[X-1-32],oe,fe)),Z(G,X+32,16843009*Tr(oe,fe,me)),Z(G,X+64,16843009*Tr(fe,me,we)),Z(G,X+96,16843009*Tr(me,we,we))}function il(G,X){var oe,fe=4;for(oe=0;4>oe;++oe)fe+=G[X+oe-32]+G[X-1+32*oe];for(fe>>=3,oe=0;4>oe;++oe)i(G,X+32*oe,fe,4)}function gu(G,X){var oe=G[X-1+0],fe=G[X-1+32],me=G[X-1+64],we=G[X-1-32],xe=G[X+0-32],ke=G[X+1-32],Ee=G[X+2-32],Re=G[X+3-32];G[X+0+96]=Tr(fe,me,G[X-1+96]),G[X+1+96]=G[X+0+64]=Tr(oe,fe,me),G[X+2+96]=G[X+1+64]=G[X+0+32]=Tr(we,oe,fe),G[X+3+96]=G[X+2+64]=G[X+1+32]=G[X+0+0]=Tr(xe,we,oe),G[X+3+64]=G[X+2+32]=G[X+1+0]=Tr(ke,xe,we),G[X+3+32]=G[X+2+0]=Tr(Ee,ke,xe),G[X+3+0]=Tr(Re,Ee,ke)}function qf(G,X){var oe=G[X+1-32],fe=G[X+2-32],me=G[X+3-32],we=G[X+4-32],xe=G[X+5-32],ke=G[X+6-32],Ee=G[X+7-32];G[X+0+0]=Tr(G[X+0-32],oe,fe),G[X+1+0]=G[X+0+32]=Tr(oe,fe,me),G[X+2+0]=G[X+1+32]=G[X+0+64]=Tr(fe,me,we),G[X+3+0]=G[X+2+32]=G[X+1+64]=G[X+0+96]=Tr(me,we,xe),G[X+3+32]=G[X+2+64]=G[X+1+96]=Tr(we,xe,ke),G[X+3+64]=G[X+2+96]=Tr(xe,ke,Ee),G[X+3+96]=Tr(ke,Ee,Ee)}function zl(G,X){var oe=G[X-1+0],fe=G[X-1+32],me=G[X-1+64],we=G[X-1-32],xe=G[X+0-32],ke=G[X+1-32],Ee=G[X+2-32],Re=G[X+3-32];G[X+0+0]=G[X+1+64]=we+xe+1>>1,G[X+1+0]=G[X+2+64]=xe+ke+1>>1,G[X+2+0]=G[X+3+64]=ke+Ee+1>>1,G[X+3+0]=Ee+Re+1>>1,G[X+0+96]=Tr(me,fe,oe),G[X+0+64]=Tr(fe,oe,we),G[X+0+32]=G[X+1+96]=Tr(oe,we,xe),G[X+1+32]=G[X+2+96]=Tr(we,xe,ke),G[X+2+32]=G[X+3+96]=Tr(xe,ke,Ee),G[X+3+32]=Tr(ke,Ee,Re)}function Ds(G,X){var oe=G[X+0-32],fe=G[X+1-32],me=G[X+2-32],we=G[X+3-32],xe=G[X+4-32],ke=G[X+5-32],Ee=G[X+6-32],Re=G[X+7-32];G[X+0+0]=oe+fe+1>>1,G[X+1+0]=G[X+0+64]=fe+me+1>>1,G[X+2+0]=G[X+1+64]=me+we+1>>1,G[X+3+0]=G[X+2+64]=we+xe+1>>1,G[X+0+32]=Tr(oe,fe,me),G[X+1+32]=G[X+0+96]=Tr(fe,me,we),G[X+2+32]=G[X+1+96]=Tr(me,we,xe),G[X+3+32]=G[X+2+96]=Tr(we,xe,ke),G[X+3+64]=Tr(xe,ke,Ee),G[X+3+96]=Tr(ke,Ee,Re)}function Fp(G,X){var oe=G[X-1+0],fe=G[X-1+32],me=G[X-1+64],we=G[X-1+96];G[X+0+0]=oe+fe+1>>1,G[X+2+0]=G[X+0+32]=fe+me+1>>1,G[X+2+32]=G[X+0+64]=me+we+1>>1,G[X+1+0]=Tr(oe,fe,me),G[X+3+0]=G[X+1+32]=Tr(fe,me,we),G[X+3+32]=G[X+1+64]=Tr(me,we,we),G[X+3+64]=G[X+2+64]=G[X+0+96]=G[X+1+96]=G[X+2+96]=G[X+3+96]=we}function Kf(G,X){var oe=G[X-1+0],fe=G[X-1+32],me=G[X-1+64],we=G[X-1+96],xe=G[X-1-32],ke=G[X+0-32],Ee=G[X+1-32],Re=G[X+2-32];G[X+0+0]=G[X+2+32]=oe+xe+1>>1,G[X+0+32]=G[X+2+64]=fe+oe+1>>1,G[X+0+64]=G[X+2+96]=me+fe+1>>1,G[X+0+96]=we+me+1>>1,G[X+3+0]=Tr(ke,Ee,Re),G[X+2+0]=Tr(xe,ke,Ee),G[X+1+0]=G[X+3+32]=Tr(oe,xe,ke),G[X+1+32]=G[X+3+64]=Tr(fe,oe,xe),G[X+1+64]=G[X+3+96]=Tr(me,fe,oe),G[X+1+96]=Tr(we,me,fe)}function _g(G,X){var oe;for(oe=0;8>oe;++oe)n(G,X+32*oe,G,X-32,8)}function mu(G,X){var oe;for(oe=0;8>oe;++oe)i(G,X,G[X-1],8),X+=32}function Vl(G,X,oe){var fe;for(fe=0;8>fe;++fe)i(X,oe+32*fe,G,8)}function Cc(G,X){var oe,fe=8;for(oe=0;8>oe;++oe)fe+=G[X+oe-32]+G[X-1+32*oe];Vl(fe>>4,G,X)}function ha(G,X){var oe,fe=4;for(oe=0;8>oe;++oe)fe+=G[X+oe-32];Vl(fe>>3,G,X)}function ps(G,X){var oe,fe=4;for(oe=0;8>oe;++oe)fe+=G[X-1+32*oe];Vl(fe>>3,G,X)}function bu(G,X){Vl(128,G,X)}function ql(G,X,oe){var fe=G[X-oe],me=G[X+0],we=3*(me-fe)+sh[1020+G[X-2*oe]-G[X+oe]],xe=Dc[112+(we+4>>3)];G[X-oe]=Ga[255+fe+Dc[112+(we+3>>3)]],G[X+0]=Ga[255+me-xe]}function Sg(G,X,oe,fe){var me=G[X+0],we=G[X+oe];return ji[255+G[X-2*oe]-G[X-oe]]>fe||ji[255+we-me]>fe}function Gf(G,X,oe,fe){return 4*ji[255+G[X-oe]-G[X+0]]+ji[255+G[X-2*oe]-G[X+oe]]<=fe}function $f(G,X,oe,fe,me){var we=G[X-3*oe],xe=G[X-2*oe],ke=G[X-oe],Ee=G[X+0],Re=G[X+oe],qe=G[X+2*oe],nt=G[X+3*oe];return 4*ji[255+ke-Ee]+ji[255+xe-Re]>fe?0:ji[255+G[X-4*oe]-we]<=me&&ji[255+we-xe]<=me&&ji[255+xe-ke]<=me&&ji[255+nt-qe]<=me&&ji[255+qe-Re]<=me&&ji[255+Re-Ee]<=me}function yu(G,X,oe,fe){var me=2*fe+1;for(fe=0;16>fe;++fe)Gf(G,X+fe,oe,me)&&ql(G,X+fe,oe)}function As(G,X,oe,fe){var me=2*fe+1;for(fe=0;16>fe;++fe)Gf(G,X+fe*oe,1,me)&&ql(G,X+fe*oe,1)}function Kl(G,X,oe,fe){var me;for(me=3;0<me;--me)yu(G,X+=4*oe,oe,fe)}function jb(G,X,oe,fe){var me;for(me=3;0<me;--me)As(G,X+=4,oe,fe)}function vu(G,X,oe,fe,me,we,xe,ke){for(we=2*we+1;0<me--;){if($f(G,X,oe,we,xe))if(Sg(G,X,oe,ke))ql(G,X,oe);else{var Ee=G,Re=X,qe=oe,nt=Ee[Re-2*qe],ot=Ee[Re-qe],$e=Ee[Re+0],ct=Ee[Re+qe],it=Ee[Re+2*qe],Qe=27*(vt=sh[1020+3*($e-ot)+sh[1020+nt-ct]])+63>>7,Ke=18*vt+63>>7,vt=9*vt+63>>7;Ee[Re-3*qe]=Ga[255+Ee[Re-3*qe]+vt],Ee[Re-2*qe]=Ga[255+nt+Ke],Ee[Re-qe]=Ga[255+ot+Qe],Ee[Re+0]=Ga[255+$e-Qe],Ee[Re+qe]=Ga[255+ct-Ke],Ee[Re+2*qe]=Ga[255+it-vt]}X+=fe}}function ol(G,X,oe,fe,me,we,xe,ke){for(we=2*we+1;0<me--;){if($f(G,X,oe,we,xe))if(Sg(G,X,oe,ke))ql(G,X,oe);else{var Ee=G,Re=X,qe=oe,nt=Ee[Re-qe],ot=Ee[Re+0],$e=Ee[Re+qe],ct=Dc[112+((it=3*(ot-nt))+4>>3)],it=Dc[112+(it+3>>3)],Qe=ct+1>>1;Ee[Re-2*qe]=Ga[255+Ee[Re-2*qe]+Qe],Ee[Re-qe]=Ga[255+nt+it],Ee[Re+0]=Ga[255+ot-ct],Ee[Re+qe]=Ga[255+$e-Qe]}X+=fe}}function Fd(G,X,oe,fe,me,we){vu(G,X,oe,1,16,fe,me,we)}function Rd(G,X,oe,fe,me,we){vu(G,X,1,oe,16,fe,me,we)}function Qb(G,X,oe,fe,me,we){var xe;for(xe=3;0<xe;--xe)ol(G,X+=4*oe,oe,1,16,fe,me,we)}function Wf(G,X,oe,fe,me,we){var xe;for(xe=3;0<xe;--xe)ol(G,X+=4,1,oe,16,fe,me,we)}function Hb(G,X,oe,fe,me,we,xe,ke){vu(G,X,me,1,8,we,xe,ke),vu(oe,fe,me,1,8,we,xe,ke)}function Rp(G,X,oe,fe,me,we,xe,ke){vu(G,X,1,me,8,we,xe,ke),vu(oe,fe,1,me,8,we,xe,ke)}function Yf(G,X,oe,fe,me,we,xe,ke){ol(G,X+4*me,me,1,8,we,xe,ke),ol(oe,fe+4*me,me,1,8,we,xe,ke)}function kg(G,X,oe,fe,me,we,xe,ke){ol(G,X+4,1,me,8,we,xe,ke),ol(oe,fe+4,1,me,8,we,xe,ke)}function Xf(){this.ba=new _r,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new $t,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Dp(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Ip(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Zf(){this.ua=0,this.Wa=new ce,this.vb=new ce,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new P,this.yc=new N}function zb(){this.xb=this.a=0,this.l=new gr,this.ca=new _r,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new L,this.Pb=0,this.wd=new L,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Zf,this.ab=0,this.gc=a(4,Ip),this.Oc=0}function Jf(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new gr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Dd(G,X,oe,fe,me,we,xe){for(G=G==null?0:G[X+0],X=0;X<xe;++X)me[we+X]=G+oe[fe+X]&255,G=me[we+X]}function eh(G,X,oe,fe,me,we,xe){var ke;if(G==null)Dd(null,null,oe,fe,me,we,xe);else for(ke=0;ke<xe;++ke)me[we+ke]=G[X+ke]+oe[fe+ke]&255}function wu(G,X,oe,fe,me,we,xe){if(G==null)Dd(null,null,oe,fe,me,we,xe);else{var ke,Ee=G[X+0],Re=Ee,qe=Ee;for(ke=0;ke<xe;++ke)Re=qe+(Ee=G[X+ke])-Re,qe=oe[fe+ke]+(-256&Re?0>Re?0:255:Re)&255,Re=Ee,me[we+ke]=qe}}function Pp(G,X,oe,fe){var me=X.width,we=X.o;if(t(G!=null&&X!=null),0>oe||0>=fe||oe+fe>we)return null;if(!G.Cc){if(G.ga==null){var xe;if(G.ga=new Jf,(xe=G.ga==null)||(xe=X.width*X.o,t(G.Gb.length==0),G.Gb=o(xe),G.Uc=0,G.Gb==null?xe=0:(G.mb=G.Gb,G.nb=G.Uc,G.rc=null,xe=1),xe=!xe),!xe){xe=G.ga;var ke=G.Fa,Ee=G.P,Re=G.qc,qe=G.mb,nt=G.nb,ot=Ee+1,$e=Re-1,ct=xe.l;if(t(ke!=null&&qe!=null&&X!=null),Us[0]=null,Us[1]=Dd,Us[2]=eh,Us[3]=wu,xe.ca=qe,xe.tb=nt,xe.c=X.width,xe.i=X.height,t(0<xe.c&&0<xe.i),1>=Re)X=0;else if(xe.$a=ke[Ee+0]>>0&3,xe.Z=ke[Ee+0]>>2&3,xe.Lc=ke[Ee+0]>>4&3,Ee=ke[Ee+0]>>6&3,0>xe.$a||1<xe.$a||4<=xe.Z||1<xe.Lc||Ee)X=0;else if(ct.put=Yr,ct.ac=Sr,ct.bc=cr,ct.ma=xe,ct.width=X.width,ct.height=X.height,ct.Da=X.Da,ct.v=X.v,ct.va=X.va,ct.j=X.j,ct.o=X.o,xe.$a)e:{t(xe.$a==1),X=Ar();t:for(;;){if(X==null){X=0;break e}if(t(xe!=null),xe.mc=X,X.c=xe.c,X.i=xe.i,X.l=xe.l,X.l.ma=xe,X.l.width=xe.c,X.l.height=xe.i,X.a=0,k(X.m,ke,ot,$e),!Fr(xe.c,xe.i,1,X,null)||(X.ab==1&&X.gc[0].hc==3&&pt(X.s)?(xe.ic=1,ke=X.c*X.i,X.Ta=null,X.Ua=0,X.V=o(ke),X.Ba=0,X.V==null?(X.a=1,X=0):X=1):(xe.ic=0,X=Mn(X,xe.c)),!X))break t;X=1;break e}xe.mc=null,X=0}else X=$e>=xe.c*xe.i;xe=!X}if(xe)return null;G.ga.Lc!=1?G.Ga=0:fe=we-oe}t(G.ga!=null),t(oe+fe<=we);e:{if(X=(ke=G.ga).c,we=ke.l.o,ke.$a==0){if(ot=G.rc,$e=G.Vc,ct=G.Fa,Ee=G.P+1+oe*X,Re=G.mb,qe=G.nb+oe*X,t(Ee<=G.P+G.qc),ke.Z!=0)for(t(Us[ke.Z]!=null),xe=0;xe<fe;++xe)Us[ke.Z](ot,$e,ct,Ee,Re,qe,X),ot=Re,$e=qe,qe+=X,Ee+=X;else for(xe=0;xe<fe;++xe)n(Re,qe,ct,Ee,X),ot=Re,$e=qe,qe+=X,Ee+=X;G.rc=ot,G.Vc=$e}else{if(t(ke.mc!=null),X=oe+fe,t((xe=ke.mc)!=null),t(X<=xe.i),xe.C>=X)X=1;else if(ke.ic||et(),ke.ic){ke=xe.V,ot=xe.Ba,$e=xe.c;var it=xe.i,Qe=(ct=1,Ee=xe.$/$e,Re=xe.$%$e,qe=xe.m,nt=xe.s,xe.$),Ke=$e*it,vt=$e*X,Ct=nt.wc,kt=Qe<vt?lt(nt,Re,Ee):null;t(Qe<=Ke),t(X<=it),t(pt(nt));t:for(;;){for(;!qe.h&&Qe<vt;){if(Re&Ct||(kt=lt(nt,Re,Ee)),t(kt!=null),q(qe),256>(it=je(kt.G[0],kt.H[0],qe)))ke[ot+Qe]=it,++Qe,++Re>=$e&&(Re=0,++Ee<=X&&!(Ee%16)&&ir(xe,Ee));else{if(!(280>it)){ct=0;break t}it=Xr(it-256,qe);var Yt,qt=je(kt.G[4],kt.H[4],qe);if(q(qe),!(Qe>=(qt=yr($e,qt=Xr(qt,qe)))&&Ke-Qe>=it)){ct=0;break t}for(Yt=0;Yt<it;++Yt)ke[ot+Qe+Yt]=ke[ot+Qe+Yt-qt];for(Qe+=it,Re+=it;Re>=$e;)Re-=$e,++Ee<=X&&!(Ee%16)&&ir(xe,Ee);Qe<vt&&Re&Ct&&(kt=lt(nt,Re,Ee))}t(qe.h==$(qe))}ir(xe,Ee>X?X:Ee);break t}!ct||qe.h&&Qe<Ke?(ct=0,xe.a=qe.h?5:3):xe.$=Qe,X=ct}else X=nr(xe,xe.V,xe.Ba,xe.c,xe.i,X,vn);if(!X){fe=0;break e}}oe+fe>=we&&(G.Cc=1),fe=1}if(!fe)return null;if(G.Cc&&((fe=G.ga)!=null&&(fe.mc=null),G.ga=null,0<G.Ga))return alert("todo:WebPDequantizeLevels"),null}return G.nb+oe*me}function ne(G,X,oe,fe,me,we){for(;0<me--;){var xe,ke=G,Ee=X+(oe?1:0),Re=G,qe=X+(oe?0:3);for(xe=0;xe<fe;++xe){var nt=Re[qe+4*xe];nt!=255&&(nt*=32897,ke[Ee+4*xe+0]=ke[Ee+4*xe+0]*nt>>23,ke[Ee+4*xe+1]=ke[Ee+4*xe+1]*nt>>23,ke[Ee+4*xe+2]=ke[Ee+4*xe+2]*nt>>23)}X+=we}}function be(G,X,oe,fe,me){for(;0<fe--;){var we;for(we=0;we<oe;++we){var xe=G[X+2*we+0],ke=15&(Re=G[X+2*we+1]),Ee=4369*ke,Re=(240&Re|Re>>4)*Ee>>16;G[X+2*we+0]=(240&xe|xe>>4)*Ee>>16&240|(15&xe|xe<<4)*Ee>>16>>4&15,G[X+2*we+1]=240&Re|ke}X+=me}}function Oe(G,X,oe,fe,me,we,xe,ke){var Ee,Re,qe=255;for(Re=0;Re<me;++Re){for(Ee=0;Ee<fe;++Ee){var nt=G[X+Ee];we[xe+4*Ee]=nt,qe&=nt}X+=oe,xe+=ke}return qe!=255}function Ve(G,X,oe,fe,me){var we;for(we=0;we<me;++we)oe[fe+we]=G[X+we]>>8}function et(){$i=ne,mn=be,$n=Oe,Ni=Ve}function mt(G,X,oe){D[G]=function(fe,me,we,xe,ke,Ee,Re,qe,nt,ot,$e,ct,it,Qe,Ke,vt,Ct){var kt,Yt=Ct-1>>1,qt=ke[Ee+0]|Re[qe+0]<<16,Rr=nt[ot+0]|$e[ct+0]<<16;t(fe!=null);var Lt=3*qt+Rr+131074>>2;for(X(fe[me+0],255&Lt,Lt>>16,it,Qe),we!=null&&(Lt=3*Rr+qt+131074>>2,X(we[xe+0],255&Lt,Lt>>16,Ke,vt)),kt=1;kt<=Yt;++kt){var Rn=ke[Ee+kt]|Re[qe+kt]<<16,Wn=nt[ot+kt]|$e[ct+kt]<<16,Tn=qt+Rn+Rr+Wn+524296,bn=Tn+2*(Rn+Rr)>>3;Lt=bn+qt>>1,qt=(Tn=Tn+2*(qt+Wn)>>3)+Rn>>1,X(fe[me+2*kt-1],255&Lt,Lt>>16,it,Qe+(2*kt-1)*oe),X(fe[me+2*kt-0],255&qt,qt>>16,it,Qe+(2*kt-0)*oe),we!=null&&(Lt=Tn+Rr>>1,qt=bn+Wn>>1,X(we[xe+2*kt-1],255&Lt,Lt>>16,Ke,vt+(2*kt-1)*oe),X(we[xe+2*kt+0],255&qt,qt>>16,Ke,vt+(2*kt+0)*oe)),qt=Rn,Rr=Wn}1&Ct||(Lt=3*qt+Rr+131074>>2,X(fe[me+Ct-1],255&Lt,Lt>>16,it,Qe+(Ct-1)*oe),we!=null&&(Lt=3*Rr+qt+131074>>2,X(we[xe+Ct-1],255&Lt,Lt>>16,Ke,vt+(Ct-1)*oe)))}}function Tt(){Ra[Ic]=qp,Ra[Pc]=Wb,Ra[Qp]=Mg,Ra[jd]=Yb,Ra[Fa]=Ru,Ra[$a]=Xb,Ra[Fu]=uh,Ra[cl]=Wb,Ra[ul]=Yb,Ra[Gl]=Ru,Ra[Bg]=Xb}function er(G){return G&-16384?0>G?0:255:G>>Ns}function vr(G,X){return er((19077*G>>8)+(26149*X>>8)-14234)}function Zr(G,X,oe){return er((19077*G>>8)-(6419*X>>8)-(13320*oe>>8)+8708)}function Kr(G,X){return er((19077*G>>8)+(33050*X>>8)-17685)}function _n(G,X,oe,fe,me){fe[me+0]=vr(G,oe),fe[me+1]=Zr(G,X,oe),fe[me+2]=Kr(G,X)}function Bi(G,X,oe,fe,me){fe[me+0]=Kr(G,X),fe[me+1]=Zr(G,X,oe),fe[me+2]=vr(G,oe)}function Gi(G,X,oe,fe,me){var we=Zr(G,X,oe);X=we<<3&224|Kr(G,X)>>3,fe[me+0]=248&vr(G,oe)|we>>5,fe[me+1]=X}function ro(G,X,oe,fe,me){var we=240&Kr(G,X)|15;fe[me+0]=240&vr(G,oe)|Zr(G,X,oe)>>4,fe[me+1]=we}function no(G,X,oe,fe,me){fe[me+0]=255,_n(G,X,oe,fe,me+1)}function jo(G,X,oe,fe,me){Bi(G,X,oe,fe,me),fe[me+3]=255}function al(G,X,oe,fe,me){_n(G,X,oe,fe,me),fe[me+3]=255}function Is(G,X){return 0>G?0:G>X?X:G}function sl(G,X,oe){D[G]=function(fe,me,we,xe,ke,Ee,Re,qe,nt){for(var ot=qe+(-2&nt)*oe;qe!=ot;)X(fe[me+0],we[xe+0],ke[Ee+0],Re,qe),X(fe[me+1],we[xe+0],ke[Ee+0],Re,qe+oe),me+=2,++xe,++Ee,qe+=2*oe;1&nt&&X(fe[me+0],we[xe+0],ke[Ee+0],Re,qe)}}function Op(G,X,oe){return oe==0?G==0?X==0?6:5:X==0?4:0:oe}function Bc(G,X,oe,fe,me){switch(G>>>30){case 3:gs(X,oe,fe,me,0);break;case 2:Ui(X,oe,fe,me);break;case 1:io(X,oe,fe,me)}}function Ec(G,X){var oe,fe,me=X.M,we=X.Nb,xe=G.oc,ke=G.pc+40,Ee=G.oc,Re=G.pc+584,qe=G.oc,nt=G.pc+600;for(oe=0;16>oe;++oe)xe[ke+32*oe-1]=129;for(oe=0;8>oe;++oe)Ee[Re+32*oe-1]=129,qe[nt+32*oe-1]=129;for(0<me?xe[ke-1-32]=Ee[Re-1-32]=qe[nt-1-32]=129:(i(xe,ke-32-1,127,21),i(Ee,Re-32-1,127,9),i(qe,nt-32-1,127,9)),fe=0;fe<G.za;++fe){var ot=X.ya[X.aa+fe];if(0<fe){for(oe=-1;16>oe;++oe)n(xe,ke+32*oe-4,xe,ke+32*oe+12,4);for(oe=-1;8>oe;++oe)n(Ee,Re+32*oe-4,Ee,Re+32*oe+4,4),n(qe,nt+32*oe-4,qe,nt+32*oe+4,4)}var $e=G.Gd,ct=G.Hd+fe,it=ot.ad,Qe=ot.Hc;if(0<me&&(n(xe,ke-32,$e[ct].y,0,16),n(Ee,Re-32,$e[ct].f,0,8),n(qe,nt-32,$e[ct].ea,0,8)),ot.Za){var Ke=xe,vt=ke-32+16;for(0<me&&(fe>=G.za-1?i(Ke,vt,$e[ct].y[15],4):n(Ke,vt,$e[ct+1].y,0,4)),oe=0;4>oe;oe++)Ke[vt+128+oe]=Ke[vt+256+oe]=Ke[vt+384+oe]=Ke[vt+0+oe];for(oe=0;16>oe;++oe,Qe<<=2)Ke=xe,vt=ke+w2[oe],Ls[ot.Ob[oe]](Ke,vt),Bc(Qe,it,16*+oe,Ke,vt)}else if(Ke=Op(fe,me,ot.Ob[0]),fl[Ke](xe,ke),Qe!=0)for(oe=0;16>oe;++oe,Qe<<=2)Bc(Qe,it,16*+oe,xe,ke+w2[oe]);for(oe=ot.Gc,Ke=Op(fe,me,ot.Dd),ys[Ke](Ee,Re),ys[Ke](qe,nt),Qe=it,Ke=Ee,vt=Re,255&(ot=oe>>0)&&(170&ot?ih(Qe,256,Ke,vt):Yo(Qe,256,Ke,vt)),ot=qe,Qe=nt,255&(oe>>=8)&&(170&oe?ih(it,320,ot,Qe):Yo(it,320,ot,Qe)),me<G.Ub-1&&(n($e[ct].y,0,xe,ke+480,16),n($e[ct].f,0,Ee,Re+224,8),n($e[ct].ea,0,qe,nt+224,8)),oe=8*we*G.B,$e=G.sa,ct=G.ta+16*fe+16*we*G.R,it=G.qa,ot=G.ra+8*fe+oe,Qe=G.Ha,Ke=G.Ia+8*fe+oe,oe=0;16>oe;++oe)n($e,ct+oe*G.R,xe,ke+32*oe,16);for(oe=0;8>oe;++oe)n(it,ot+oe*G.B,Ee,Re+32*oe,8),n(Qe,Ke+oe*G.B,qe,nt+32*oe,8)}}function th(G,X,oe,fe,me,we,xe,ke,Ee){var Re=[0],qe=[0],nt=0,ot=Ee!=null?Ee.kd:0,$e=Ee??new Dp;if(G==null||12>oe)return 7;$e.data=G,$e.w=X,$e.ha=oe,X=[X],oe=[oe],$e.gb=[$e.gb];e:{var ct=X,it=oe,Qe=$e.gb;if(t(G!=null),t(it!=null),t(Qe!=null),Qe[0]=0,12<=it[0]&&!r(G,ct[0],"RIFF")){if(r(G,ct[0]+8,"WEBP")){Qe=3;break e}var Ke=te(G,ct[0]+4);if(12>Ke||4294967286<Ke){Qe=3;break e}if(ot&&Ke>it[0]-8){Qe=7;break e}Qe[0]=Ke,ct[0]+=12,it[0]-=12}Qe=0}if(Qe!=0)return Qe;for(Ke=0<$e.gb[0],oe=oe[0];;){e:{var vt=G;it=X,Qe=oe;var Ct=Re,kt=qe,Yt=ct=[0];if((Lt=nt=[nt])[0]=0,8>Qe[0])Qe=7;else{if(!r(vt,it[0],"VP8X")){if(te(vt,it[0]+4)!=10){Qe=3;break e}if(18>Qe[0]){Qe=7;break e}var qt=te(vt,it[0]+8),Rr=1+pe(vt,it[0]+12);if(2147483648<=Rr*(vt=1+pe(vt,it[0]+15))){Qe=3;break e}Yt!=null&&(Yt[0]=qt),Ct!=null&&(Ct[0]=Rr),kt!=null&&(kt[0]=vt),it[0]+=18,Qe[0]-=18,Lt[0]=1}Qe=0}}if(nt=nt[0],ct=ct[0],Qe!=0)return Qe;if(it=!!(2&ct),!Ke&&nt)return 3;if(we!=null&&(we[0]=!!(16&ct)),xe!=null&&(xe[0]=it),ke!=null&&(ke[0]=0),xe=Re[0],ct=qe[0],nt&&it&&Ee==null){Qe=0;break}if(4>oe){Qe=7;break}if(Ke&&nt||!Ke&&!nt&&!r(G,X[0],"ALPH")){oe=[oe],$e.na=[$e.na],$e.P=[$e.P],$e.Sa=[$e.Sa];e:{qt=G,Qe=X,Ke=oe;var Lt=$e.gb;Ct=$e.na,kt=$e.P,Yt=$e.Sa,Rr=22,t(qt!=null),t(Ke!=null),vt=Qe[0];var Rn=Ke[0];for(t(Ct!=null),t(Yt!=null),Ct[0]=null,kt[0]=null,Yt[0]=0;;){if(Qe[0]=vt,Ke[0]=Rn,8>Rn){Qe=7;break e}var Wn=te(qt,vt+4);if(4294967286<Wn){Qe=3;break e}var Tn=8+Wn+1&-2;if(Rr+=Tn,0<Lt&&Rr>Lt){Qe=3;break e}if(!r(qt,vt,"VP8 ")||!r(qt,vt,"VP8L")){Qe=0;break e}if(Rn[0]<Tn){Qe=7;break e}r(qt,vt,"ALPH")||(Ct[0]=qt,kt[0]=vt+8,Yt[0]=Wn),vt+=Tn,Rn-=Tn}}if(oe=oe[0],$e.na=$e.na[0],$e.P=$e.P[0],$e.Sa=$e.Sa[0],Qe!=0)break}oe=[oe],$e.Ja=[$e.Ja],$e.xa=[$e.xa];e:if(Lt=G,Qe=X,Ke=oe,Ct=$e.gb[0],kt=$e.Ja,Yt=$e.xa,qt=Qe[0],vt=!r(Lt,qt,"VP8 "),Rr=!r(Lt,qt,"VP8L"),t(Lt!=null),t(Ke!=null),t(kt!=null),t(Yt!=null),8>Ke[0])Qe=7;else{if(vt||Rr){if(Lt=te(Lt,qt+4),12<=Ct&&Lt>Ct-12){Qe=3;break e}if(ot&&Lt>Ke[0]-8){Qe=7;break e}kt[0]=Lt,Qe[0]+=8,Ke[0]-=8,Yt[0]=Rr}else Yt[0]=5<=Ke[0]&&Lt[qt+0]==47&&!(Lt[qt+4]>>5),kt[0]=Ke[0];Qe=0}if(oe=oe[0],$e.Ja=$e.Ja[0],$e.xa=$e.xa[0],X=X[0],Qe!=0)break;if(4294967286<$e.Ja)return 3;if(ke==null||it||(ke[0]=$e.xa?2:1),xe=[xe],ct=[ct],$e.xa){if(5>oe){Qe=7;break}ke=xe,ot=ct,it=we,G==null||5>oe?G=0:5<=oe&&G[X+0]==47&&!(G[X+4]>>5)?(Ke=[0],Lt=[0],Ct=[0],k(kt=new L,G,X,oe),Qt(kt,Ke,Lt,Ct)?(ke!=null&&(ke[0]=Ke[0]),ot!=null&&(ot[0]=Lt[0]),it!=null&&(it[0]=Ct[0]),G=1):G=0):G=0}else{if(10>oe){Qe=7;break}ke=ct,G==null||10>oe||!rn(G,X+3,oe-3)?G=0:(ot=G[X+0]|G[X+1]<<8|G[X+2]<<16,it=16383&(G[X+7]<<8|G[X+6]),G=16383&(G[X+9]<<8|G[X+8]),1&ot||3<(ot>>1&7)||!(ot>>4&1)||ot>>5>=$e.Ja||!it||!G?G=0:(xe&&(xe[0]=it),ke&&(ke[0]=G),G=1))}if(!G||(xe=xe[0],ct=ct[0],nt&&(Re[0]!=xe||qe[0]!=ct)))return 3;Ee!=null&&(Ee[0]=$e,Ee.offset=X-Ee.w,t(4294967286>X-Ee.w),t(Ee.offset==Ee.ha-oe));break}return Qe==0||Qe==7&&nt&&Ee==null?(we!=null&&(we[0]|=$e.na!=null&&0<$e.na.length),fe!=null&&(fe[0]=xe),me!=null&&(me[0]=ct),0):Qe}function xu(G,X,oe){var fe=X.width,me=X.height,we=0,xe=0,ke=fe,Ee=me;if(X.Da=G!=null&&0<G.Da,X.Da&&(ke=G.cd,Ee=G.bd,we=G.v,xe=G.j,11>oe||(we&=-2,xe&=-2),0>we||0>xe||0>=ke||0>=Ee||we+ke>fe||xe+Ee>me))return 0;if(X.v=we,X.j=xe,X.va=we+ke,X.o=xe+Ee,X.U=ke,X.T=Ee,X.da=G!=null&&0<G.da,X.da){if(!de(ke,Ee,oe=[G.ib],we=[G.hb]))return 0;X.ib=oe[0],X.hb=we[0]}return X.ob=G!=null&&G.ob,X.Kb=G==null||!G.Sd,X.da&&(X.ob=X.ib<3*fe/4&&X.hb<3*me/4,X.Kb=0),1}function rh(G){if(G==null)return 2;if(11>G.S){var X=G.f.RGBA;X.fb+=(G.height-1)*X.A,X.A=-X.A}else X=G.f.kb,G=G.height,X.O+=(G-1)*X.fa,X.fa=-X.fa,X.N+=(G-1>>1)*X.Ab,X.Ab=-X.Ab,X.W+=(G-1>>1)*X.Db,X.Db=-X.Db,X.F!=null&&(X.J+=(G-1)*X.lb,X.lb=-X.lb);return 0}function Id(G,X,oe,fe){if(fe==null||0>=G||0>=X)return 2;if(oe!=null){if(oe.Da){var me=oe.cd,we=oe.bd,xe=-2&oe.v,ke=-2&oe.j;if(0>xe||0>ke||0>=me||0>=we||xe+me>G||ke+we>X)return 2;G=me,X=we}if(oe.da){if(!de(G,X,me=[oe.ib],we=[oe.hb]))return 2;G=me[0],X=we[0]}}fe.width=G,fe.height=X;e:{var Ee=fe.width,Re=fe.height;if(G=fe.S,0>=Ee||0>=Re||!(G>=Ic&&13>G))G=2;else{if(0>=fe.Rd&&fe.sd==null){xe=we=me=X=0;var qe=(ke=Ee*Rg[G])*Re;if(11>G||(we=(Re+1)/2*(X=(Ee+1)/2),G==12&&(xe=(me=Ee)*Re)),(Re=o(qe+2*we+xe))==null){G=1;break e}fe.sd=Re,11>G?((Ee=fe.f.RGBA).eb=Re,Ee.fb=0,Ee.A=ke,Ee.size=qe):((Ee=fe.f.kb).y=Re,Ee.O=0,Ee.fa=ke,Ee.Fd=qe,Ee.f=Re,Ee.N=0+qe,Ee.Ab=X,Ee.Cd=we,Ee.ea=Re,Ee.W=0+qe+we,Ee.Db=X,Ee.Ed=we,G==12&&(Ee.F=Re,Ee.J=0+qe+2*we),Ee.Tc=xe,Ee.lb=me)}if(X=1,me=fe.S,we=fe.width,xe=fe.height,me>=Ic&&13>me)if(11>me)G=fe.f.RGBA,X&=(ke=Math.abs(G.A))*(xe-1)+we<=G.size,X&=ke>=we*Rg[me],X&=G.eb!=null;else{G=fe.f.kb,ke=(we+1)/2,qe=(xe+1)/2,Ee=Math.abs(G.fa),Re=Math.abs(G.Ab);var nt=Math.abs(G.Db),ot=Math.abs(G.lb),$e=ot*(xe-1)+we;X&=Ee*(xe-1)+we<=G.Fd,X&=Re*(qe-1)+ke<=G.Cd,X=(X&=nt*(qe-1)+ke<=G.Ed)&Ee>=we&Re>=ke&nt>=ke,X&=G.y!=null,X&=G.f!=null,X&=G.ea!=null,me==12&&(X&=ot>=we,X&=$e<=G.Tc,X&=G.F!=null)}else X=0;G=X?0:2}}return G!=0||oe!=null&&oe.fd&&(G=rh(fe)),G}var Co=64,_u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Pd=24,Od=32,nh=8,qa=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ge("Predictor0","PredictorAdd0"),D.Predictor0=function(){return 4278190080},D.Predictor1=function(G){return G},D.Predictor2=function(G,X,oe){return X[oe+0]},D.Predictor3=function(G,X,oe){return X[oe+1]},D.Predictor4=function(G,X,oe){return X[oe-1]},D.Predictor5=function(G,X,oe){return ve(ve(G,X[oe+1]),X[oe+0])},D.Predictor6=function(G,X,oe){return ve(G,X[oe-1])},D.Predictor7=function(G,X,oe){return ve(G,X[oe+0])},D.Predictor8=function(G,X,oe){return ve(X[oe-1],X[oe+0])},D.Predictor9=function(G,X,oe){return ve(X[oe+0],X[oe+1])},D.Predictor10=function(G,X,oe){return ve(ve(G,X[oe-1]),ve(X[oe+0],X[oe+1]))},D.Predictor11=function(G,X,oe){var fe=X[oe+0];return 0>=Fe(fe>>24&255,G>>24&255,(X=X[oe-1])>>24&255)+Fe(fe>>16&255,G>>16&255,X>>16&255)+Fe(fe>>8&255,G>>8&255,X>>8&255)+Fe(255&fe,255&G,255&X)?fe:G},D.Predictor12=function(G,X,oe){var fe=X[oe+0];return(Te((G>>24&255)+(fe>>24&255)-((X=X[oe-1])>>24&255))<<24|Te((G>>16&255)+(fe>>16&255)-(X>>16&255))<<16|Te((G>>8&255)+(fe>>8&255)-(X>>8&255))<<8|Te((255&G)+(255&fe)-(255&X)))>>>0},D.Predictor13=function(G,X,oe){var fe=X[oe-1];return(Ce((G=ve(G,X[oe+0]))>>24&255,fe>>24&255)<<24|Ce(G>>16&255,fe>>16&255)<<16|Ce(G>>8&255,fe>>8&255)<<8|Ce(G>>0&255,fe>>0&255))>>>0};var Vb=D.PredictorAdd0;D.PredictorAdd1=Se,ge("Predictor2","PredictorAdd2"),ge("Predictor3","PredictorAdd3"),ge("Predictor4","PredictorAdd4"),ge("Predictor5","PredictorAdd5"),ge("Predictor6","PredictorAdd6"),ge("Predictor7","PredictorAdd7"),ge("Predictor8","PredictorAdd8"),ge("Predictor9","PredictorAdd9"),ge("Predictor10","PredictorAdd10"),ge("Predictor11","PredictorAdd11"),ge("Predictor12","PredictorAdd12"),ge("Predictor13","PredictorAdd13");var Lp=D.PredictorAdd2;Je("ColorIndexInverseTransform","MapARGB","32b",function(G){return G>>8&255},function(G){return G}),Je("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(G){return G},function(G){return G>>8&255});var Cg,Ps=D.ColorIndexInverseTransform,Qo=D.MapARGB,Su=D.VP8LColorIndexInverseTransformAlpha,Up=D.MapAlpha,Mc=D.VP8LPredictorsAdd=[];Mc.length=16,(D.VP8LPredictors=[]).length=16,(D.VP8LPredictorsAdd_C=[]).length=16,(D.VP8LPredictors_C=[]).length=16;var ku,Ta,Wo,Cu,Tc,Ka,Bu,gs,Ui,ih,io,Yo,Eu,Np,ll,Mu,Tu,Fc,Ld,oh,Ud,Rc,ah,ms,$i,mn,$n,Ni,Wi=o(511),Os=o(2041),Nd=o(225),bs=o(767),jp=0,sh=Os,Dc=Nd,Ga=bs,ji=Wi,Ic=0,Pc=1,Qp=2,jd=3,Fa=4,$a=5,Fu=6,cl=7,ul=8,Gl=9,Bg=10,qb=[2,3,7],Kb=[3,3,11],pa=[280,256,256,256,40],Xo=[0,1,1,1,0],Nn=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],dl=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],$l=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Gb=8,Oc=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Eg=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],lh=null,Hp=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],zp=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ch=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Vp=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],m2=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],$b=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],b2=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],fl=[],Ls=[],ys=[],y2=1,Qd=2,Us=[],Ra=[];mt("UpsampleRgbLinePair",_n,3),mt("UpsampleBgrLinePair",Bi,3),mt("UpsampleRgbaLinePair",al,4),mt("UpsampleBgraLinePair",jo,4),mt("UpsampleArgbLinePair",no,4),mt("UpsampleRgba4444LinePair",ro,2),mt("UpsampleRgb565LinePair",Gi,2);var qp=D.UpsampleRgbLinePair,Mg=D.UpsampleBgrLinePair,Wb=D.UpsampleRgbaLinePair,Yb=D.UpsampleBgraLinePair,Ru=D.UpsampleArgbLinePair,Xb=D.UpsampleRgba4444LinePair,uh=D.UpsampleRgb565LinePair,Hd=16,Kp=1<<Hd-1,zd=-227,Gp=482,Ns=6,hl=0,Du=o(256),v2=o(256),Iu=o(256),Lc=o(256),Bo=o(Gp-zd),Tg=o(Gp-zd);sl("YuvToRgbRow",_n,3),sl("YuvToBgrRow",Bi,3),sl("YuvToRgbaRow",al,4),sl("YuvToBgraRow",jo,4),sl("YuvToArgbRow",no,4),sl("YuvToRgba4444Row",ro,2),sl("YuvToRgb565Row",Gi,2);var w2=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Fg=[0,2,8],n3=[8,7,6,4,4,2,2,2,1,1,1,1],Eo=1;this.WebPDecodeRGBA=function(G,X,oe,fe,me){var we=Pc,xe=new Xf,ke=new _r;xe.ba=ke,ke.S=we,ke.width=[ke.width],ke.height=[ke.height];var Ee=ke.width,Re=ke.height,qe=new kr;if(qe==null||G==null)var nt=2;else t(qe!=null),nt=th(G,X,oe,qe.width,qe.height,qe.Pd,qe.Qd,qe.format,null);if(nt!=0?Ee=0:(Ee!=null&&(Ee[0]=qe.width[0]),Re!=null&&(Re[0]=qe.height[0]),Ee=1),Ee){ke.width=ke.width[0],ke.height=ke.height[0],fe!=null&&(fe[0]=ke.width),me!=null&&(me[0]=ke.height);e:{if(fe=new gr,(me=new Dp).data=G,me.w=X,me.ha=oe,me.kd=1,X=[0],t(me!=null),((G=th(me.data,me.w,me.ha,null,null,null,X,null,me))==0||G==7)&&X[0]&&(G=4),(X=G)==0){if(t(xe!=null),fe.data=me.data,fe.w=me.w+me.offset,fe.ha=me.ha-me.offset,fe.put=Yr,fe.ac=Sr,fe.bc=cr,fe.ma=xe,me.xa){if((G=Ar())==null){xe=1;break e}if(function(ot,$e){var ct=[0],it=[0],Qe=[0];t:for(;;){if(ot==null)return 0;if($e==null)return ot.a=2,0;if(ot.l=$e,ot.a=0,k(ot.m,$e.data,$e.w,$e.ha),!Qt(ot.m,ct,it,Qe)){ot.a=3;break t}if(ot.xb=Qd,$e.width=ct[0],$e.height=it[0],!Fr(ct[0],it[0],1,ot,null))break t;return 1}return t(ot.a!=0),0}(G,fe)){if(fe=(X=Id(fe.width,fe.height,xe.Oa,xe.ba))==0){t:{fe=G;r:for(;;){if(fe==null){fe=0;break t}if(t(fe.s.yc!=null),t(fe.s.Ya!=null),t(0<fe.s.Wb),t((oe=fe.l)!=null),t((me=oe.ma)!=null),fe.xb!=0){if(fe.ca=me.ba,fe.tb=me.tb,t(fe.ca!=null),!xu(me.Oa,oe,jd)){fe.a=2;break r}if(!Mn(fe,oe.width)||oe.da)break r;if((oe.da||jt(fe.ca.S))&&et(),11>fe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),fe.ca.f.kb.F!=null&&et()),fe.Pb&&0<fe.s.ua&&fe.s.vb.X==null&&!se(fe.s.vb,fe.s.Wa.Xa)){fe.a=1;break r}fe.xb=0}if(!nr(fe,fe.V,fe.Ba,fe.c,fe.i,oe.o,xt))break r;me.Dc=fe.Ma,fe=1;break t}t(fe.a!=0),fe=0}fe=!fe}fe&&(X=G.a)}else X=G.a}else{if((G=new An)==null){xe=1;break e}if(G.Fa=me.na,G.P=me.P,G.qc=me.Sa,dn(G,fe)){if((X=Id(fe.width,fe.height,xe.Oa,xe.ba))==0){if(G.Aa=0,oe=xe.Oa,t((me=G)!=null),oe!=null){if(0<(Ee=0>(Ee=oe.Md)?0:100<Ee?255:255*Ee/100)){for(Re=qe=0;4>Re;++Re)12>(nt=me.pb[Re]).lc&&(nt.ia=Ee*n3[0>nt.lc?0:nt.lc]>>3),qe|=nt.ia;qe&&(alert("todo:VP8InitRandom"),me.ia=1)}me.Ga=oe.Id,100<me.Ga?me.Ga=100:0>me.Ga&&(me.Ga=0)}Lo(G,fe)||(X=G.a)}}else X=G.a}X==0&&xe.Oa!=null&&xe.Oa.fd&&(X=rh(xe.ba))}xe=X}we=xe!=0?null:11>we?ke.f.RGBA.eb:ke.f.kb.y}else we=null;return we};var Rg=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(D,O){for(var U="",Q=0;Q<4;Q++)U+=String.fromCharCode(D[O++]);return U}function u(D,O){return(D[O+0]<<0|D[O+1]<<8|D[O+2]<<16)>>>0}function d(D,O){return(D[O+0]<<0|D[O+1]<<8|D[O+2]<<16|D[O+3]<<24)>>>0}new l;var h=[0],f=[0],p=[],g=new l,A=e,m=function(D,O){var U={},Q=0,N=!1,R=0,P=0;if(U.frames=[],!function(z,$,ee,q){for(var J=0;J<q;J++)if(z[$+J]!=ee.charCodeAt(J))return!0;return!1}(D,O,"RIFF",4)){var T,x;for(d(D,O+=4),O+=8;O<D.length;){var _=c(D,O),k=d(D,O+=4);O+=4;var B=k+(1&k);switch(_){case"VP8 ":case"VP8L":U.frames[Q]===void 0&&(U.frames[Q]={}),(L=U.frames[Q]).src_off=N?P:O-8,L.src_size=R+k+8,Q++,N&&(N=!1,R=0,P=0);break;case"VP8X":(L=U.header={}).feature_flags=D[O];var F=O+4;L.canvas_width=1+u(D,F),F+=3,L.canvas_height=1+u(D,F),F+=3;break;case"ALPH":N=!0,R=B+8,P=O-8;break;case"ANIM":(L=U.header).bgcolor=d(D,O),F=O+4,L.loop_count=(T=D)[(x=F)+0]<<0|T[x+1]<<8,F+=2;break;case"ANMF":var K,L;(L=U.frames[Q]={}).offset_x=2*u(D,O),O+=3,L.offset_y=2*u(D,O),O+=3,L.width=1+u(D,O),O+=3,L.height=1+u(D,O),O+=3,L.duration=u(D,O),O+=3,K=D[O++],L.dispose=1&K,L.blend=K>>1&1}_!="ANMF"&&(O+=B)}return U}}(A,0);m.response=A,m.rgbaoutput=!0,m.dataurl=!1;var y=m.header?m.header:null,w=m.frames?m.frames:null;if(y){y.loop_counter=y.loop_count,h=[y.canvas_height],f=[y.canvas_width];for(var S=0;S<w.length&&w[S].blend!=0;S++);}var C=w[0],E=g.WebPDecodeRGBA(A,C.src_off,C.src_size,f,h);C.rgba=E,C.imgwidth=f[0],C.imgheight=h[0];for(var I=0;I<f[0]*h[0]*4;I++)p[I]=E[I];return this.width=f,this.height=h,this.data=p,this}(function(e){var t=function(){return typeof o8=="function"},r=function(h,f,p,g){var A=4,m=a;switch(g){case e.image_compression.FAST:A=1,m=o;break;case e.image_compression.MEDIUM:A=6,m=s;break;case e.image_compression.SLOW:A=9,m=l}h=n(h,f,p,m);var y=o8(h,{level:A});return e.__addimage__.arrayBufferToBinaryString(y)},n=function(h,f,p,g){for(var A,m,y,w=h.length/f,S=new Uint8Array(h.length+w),C=u(),E=0;E<w;E+=1){if(y=E*f,A=h.subarray(y,y+f),g)S.set(g(A,p,m),y+E);else{for(var I,D=C.length,O=[];I<D;I+=1)O[I]=C[I](A,p,m);var U=d(O.concat());S.set(O[U],y+E)}m=A}return S},i=function(h){var f=Array.apply([],h);return f.unshift(0),f},o=function(h,f){var p,g=[],A=h.length;g[0]=1;for(var m=0;m<A;m+=1)p=h[m-f]||0,g[m+1]=h[m]-p+256&255;return g},a=function(h,f,p){var g,A=[],m=h.length;A[0]=2;for(var y=0;y<m;y+=1)g=p&&p[y]||0,A[y+1]=h[y]-g+256&255;return A},s=function(h,f,p){var g,A,m=[],y=h.length;m[0]=3;for(var w=0;w<y;w+=1)g=h[w-f]||0,A=p&&p[w]||0,m[w+1]=h[w]+256-(g+A>>>1)&255;return m},l=function(h,f,p){var g,A,m,y,w=[],S=h.length;w[0]=4;for(var C=0;C<S;C+=1)g=h[C-f]||0,A=p&&p[C]||0,m=p&&p[C-f]||0,y=c(g,A,m),w[C+1]=h[C]-y+256&255;return w},c=function(h,f,p){if(h===f&&f===p)return h;var g=Math.abs(f-p),A=Math.abs(h-p),m=Math.abs(h+f-p-p);return g<=A&&g<=m?h:A<=m?f:p},u=function(){return[i,o,a,s,l]},d=function(h){var f=h.map(function(p){return p.reduce(function(g,A){return g+Math.abs(A)},0)});return f.indexOf(Math.min.apply(null,f))};e.processPNG=function(h,f,p,g){var A,m,y,w,S,C,E,I,D,O,U,Q,N,R,P,T=this.decode.FLATE_DECODE,x="";if(this.__addimage__.isArrayBuffer(h)&&(h=new Uint8Array(h)),this.__addimage__.isArrayBufferView(h)){if(h=(y=new aMe(h)).imgData,m=y.bits,A=y.colorSpace,S=y.colors,[4,6].indexOf(y.colorType)!==-1){if(y.bits===8){D=(I=y.pixelBitlength==32?new Uint32Array(y.decodePixels().buffer):y.pixelBitlength==16?new Uint16Array(y.decodePixels().buffer):new Uint8Array(y.decodePixels().buffer)).length,U=new Uint8Array(D*y.colors),O=new Uint8Array(D);var _,k=y.pixelBitlength-y.bits;for(R=0,P=0;R<D;R++){for(N=I[R],_=0;_<k;)U[P++]=N>>>_&255,_+=y.bits;O[R]=N>>>_&255}}if(y.bits===16){D=(I=new Uint32Array(y.decodePixels().buffer)).length,U=new Uint8Array(D*(32/y.pixelBitlength)*y.colors),O=new Uint8Array(D*(32/y.pixelBitlength)),Q=y.colors>1,R=0,P=0;for(var B=0;R<D;)N=I[R++],U[P++]=N>>>0&255,Q&&(U[P++]=N>>>16&255,N=I[R++],U[P++]=N>>>0&255),O[B++]=N>>>16&255;m=8}g!==e.image_compression.NONE&&t()?(h=r(U,y.width*y.colors,y.colors,g),E=r(O,y.width,1,g)):(h=U,E=O,T=void 0)}if(y.colorType===3&&(A=this.color_spaces.INDEXED,C=y.palette,y.transparency.indexed)){var F=y.transparency.indexed,K=0;for(R=0,D=F.length;R<D;++R)K+=F[R];if((K/=255)===D-1&&F.indexOf(0)!==-1)w=[F.indexOf(0)];else if(K!==D){for(I=y.decodePixels(),O=new Uint8Array(I.length),R=0,D=I.length;R<D;R++)O[R]=F[I[R]];E=r(O,y.width,1)}}var L=function(z){var $;switch(z){case e.image_compression.FAST:$=11;break;case e.image_compression.MEDIUM:$=13;break;case e.image_compression.SLOW:$=14;break;default:$=12}return $}(g);return T===this.decode.FLATE_DECODE&&(x="/Predictor "+L+" "),x+="/Colors "+S+" /BitsPerComponent "+m+" /Columns "+y.width,(this.__addimage__.isArrayBuffer(h)||this.__addimage__.isArrayBufferView(h))&&(h=this.__addimage__.arrayBufferToBinaryString(h)),(E&&this.__addimage__.isArrayBuffer(E)||this.__addimage__.isArrayBufferView(E))&&(E=this.__addimage__.arrayBufferToBinaryString(E)),{alias:p,data:h,index:f,filter:T,decodeParameters:x,transparency:w,palette:C,sMask:E,predictor:L,width:y.width,height:y.height,bitsPerComponent:m,colorSpace:A}}}})(Ir.API),function(e){e.processGIF89A=function(t,r,n,i){var o=new sMe(t),a=o.width,s=o.height,l=[];o.decodeAndBlitFrameRGBA(0,l);var c={data:l,width:a,height:s},u=new U6(100).encode(c,100);return e.processJPEG.call(this,u,r,n,i)},e.processGIF87A=e.processGIF89A}(Ir.API),Gc.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:n,blue:r,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Gc.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(r){Si.log("bit decode error:"+r)}},Gc.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var l=this.palette[o>>7-s&1];this.data[a+4*s]=l.blue,this.data[a+4*s+1]=l.green,this.data[a+4*s+2]=l.red,this.data[a+4*s+3]=255}r!==0&&(this.pos+=4-r)}},Gc.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<e;i++){var o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+2*i*4,s=o>>4,l=15&o,c=this.palette[s];if(this.data[a]=c.blue,this.data[a+1]=c.green,this.data[a+2]=c.red,this.data[a+3]=255,2*i+1>=this.width)break;c=this.palette[l],this.data[a+4]=c.blue,this.data[a+4+1]=c.green,this.data[a+4+2]=c.red,this.data[a+4+3]=255}t!==0&&(this.pos+=4-t)}},Gc.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+4*n;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red,this.data[o+1]=a.green,this.data[o+2]=a.blue,this.data[o+3]=255}else this.data[o]=255,this.data[o+1]=255,this.data[o+2]=255,this.data[o+3]=255}e!==0&&(this.pos+=4-e)}},Gc.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&t)/t*255|0,s=(o>>5&t)/t*255|0,l=(o>>10&t)/t*255|0,c=o>>15?255:0,u=n*this.width*4+4*i;this.data[u]=l,this.data[u+1]=s,this.data[u+2]=a,this.data[u+3]=c}this.pos+=e}},Gc.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,l=(a>>5&r)/r*255|0,c=(a>>11)/t*255|0,u=i*this.width*4+4*o;this.data[u]=c,this.data[u+1]=l,this.data[u+2]=s,this.data[u+3]=255}this.pos+=e}},Gc.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*r;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=n,this.data[a+3]=255}this.pos+=this.width%4}},Gc.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*r;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=n,this.data[s+3]=a}},Gc.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,r,n,i){var o=new Gc(t,!1),a=o.width,s=o.height,l={data:o.getData(),width:a,height:s},c=new U6(100).encode(l,100);return e.processJPEG.call(this,c,r,n,i)}}(Ir.API),hU.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,r,n,i){var o=new hU(t),a=o.width,s=o.height,l={data:o.getData(),width:a,height:s},c=new U6(100).encode(l,100);return e.processJPEG.call(this,c,r,n,i)}}(Ir.API),Ir.API.processRGBA=function(e,t,r){for(var n=e.data,i=n.length,o=new Uint8Array(i/4*3),a=new Uint8Array(i/4),s=0,l=0,c=0;c<i;c+=4){var u=n[c],d=n[c+1],h=n[c+2],f=n[c+3];o[s++]=u,o[s++]=d,o[s++]=h,a[l++]=f}var p=this.__addimage__.arrayBufferToBinaryString(o);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:p,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Ir.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},hm=Ir.API,t1=hm.getCharWidthsArray=function(e,t){var r,n,i=(t=t||{}).font||this.internal.getFont(),o=t.fontSize||this.internal.getFontSize(),a=t.charSpace||this.internal.getCharSpace(),s=t.widths?t.widths:i.metadata.Unicode.widths,l=s.fof?s.fof:1,c=t.kerning?t.kerning:i.metadata.Unicode.kerning,u=c.fof?c.fof:1,d=t.doKerning!==!1,h=0,f=e.length,p=0,g=s[0]||l,A=[];for(r=0;r<f;r++)n=e.charCodeAt(r),typeof i.metadata.widthOfString=="function"?A.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+a*(1e3/o)||0)/1e3):(h=d&&Jn(c[n])==="object"&&!isNaN(parseInt(c[n][p],10))?c[n][p]/u:0,A.push((s[n]||g)/l+h)),p=n;return A},cU=hm.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return hm.processArabic&&(e=hm.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,i)/r:t1.apply(this,arguments).reduce(function(o,a){return o+a},0)},uU=function(e,t,r,n){for(var i=[],o=0,a=e.length,s=0;o!==a&&s+t[o]<r;)s+=t[o],o++;i.push(e.slice(0,o));var l=o;for(s=0;o!==a;)s+t[o]>n&&(i.push(e.slice(l,o)),s=0,l=o),s+=t[o],o++;return l!==o&&i.push(e.slice(l,o)),i},dU=function(e,t,r){r||(r={});var n,i,o,a,s,l,c,u=[],d=[u],h=r.textIndent||0,f=0,p=0,g=e.split(" "),A=t1.apply(this,[" ",r])[0];if(l=r.lineIndent===-1?g[0].length+2:r.lineIndent||0){var m=Array(l).join(" "),y=[];g.map(function(S){(S=S.split(/\s*\n/)).length>1?y=y.concat(S.map(function(C,E){return(E&&C.length?`
655
655
  `:"")+C})):y.push(S[0])}),g=y,l=cU.apply(this,[m,r])}for(o=0,a=g.length;o<a;o++){var w=0;if(n=g[o],l&&n[0]==`
656
- `&&(n=n.substr(1),w=1),h+f+(p=(i=t1.apply(this,[n,r])).reduce(function(S,C){return S+C},0))>t||w){if(p>t){for(s=uU.apply(this,[n,i,t-(h+f),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);p=i.slice(n.length-(u[0]?u[0].length:0)).reduce(function(S,C){return S+C},0)}else u=[n];d.push(u),h=p+l,f=A}else u.push(n),h+=f+p,f=A}return c=l?function(S,C){return(C?m:"")+S.join(" ")}:function(S){return S.join(" ")},d.map(c)},hm.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),o=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var d=this.internal.getFont(u.fontName,u.fontStyle);return d.metadata.Unicode?{widths:d.metadata.Unicode.widths||{0:1},kerning:d.metadata.Unicode.kerning||{}}:{font:d.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;o.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=r.lineIndent;var s,l,c=[];for(s=0,l=n.length;s<l;s++)c=c.concat(dU.apply(this,[n[s],a,o]));return c},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",r={},n={},i=0;i<t.length;i++)r[t[i]]="0123456789abcdef"[i],n["0123456789abcdef"[i]]=t[i];var o=function(d){return"0x"+parseInt(d,10).toString(16)},a=e.__fontmetrics__.compress=function(d){var h,f,p,g,A=["{"];for(var m in d){if(h=d[m],isNaN(parseInt(m,10))?f="'"+m+"'":(m=parseInt(m,10),f=(f=o(m).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof h=="number")h<0?(p=o(h).slice(3),g="-"):(p=o(h).slice(2),g=""),p=g+p.slice(0,-1)+n[p.slice(-1)];else{if(Jn(h)!=="object")throw new Error("Don't know what to do with value type "+Jn(h)+".");p=a(h)}A.push(f+p)}return A.push("}"),A.join("")},s=e.__fontmetrics__.uncompress=function(d){if(typeof d!="string")throw new Error("Invalid argument passed to uncompress.");for(var h,f,p,g,A={},m=1,y=A,w=[],S="",C="",E=d.length-1,I=1;I<E;I+=1)(g=d[I])=="'"?h?(p=h.join(""),h=void 0):h=[]:h?h.push(g):g=="{"?(w.push([y,p]),y={},p=void 0):g=="}"?((f=w.pop())[0][f[1]]=y,p=void 0,y=f[0]):g=="-"?m=-1:p===void 0?r.hasOwnProperty(g)?(S+=r[g],p=parseInt(S,16)*m,m=1,S=""):S+=g:r.hasOwnProperty(g)?(C+=r[g],y[p]=parseInt(C,16)*m,m=1,p=void 0,C=""):C+=g;return A},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},c={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},u={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":s("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(d){var h=d.font,f=u.Unicode[h.postScriptName];f&&(h.metadata.Unicode={},h.metadata.Unicode.widths=f.widths,h.metadata.Unicode.kerning=f.kerning);var p=c.Unicode[h.postScriptName];p&&(h.metadata.Unicode.encoding=p,h.encoding=p.codePages[0])}])}(Ir.API),function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);return i};e.API.events.push(["addFont",function(r){var n=void 0,i=r.font,o=r.instance;if(!i.isStandardFont){if(o===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=o.existsFileInVFS(i.postScriptName)===!1?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(j0(s)),a.metadata=e.API.TTFFont.open(s),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,n)}}])}(Ir),function(e){function t(){return(Vr.canvg?Promise.resolve(Vr.canvg):mj(()=>import("./index.es-mB7ZF8OM-DnpXL3xF.js"),[])).catch(function(r){return Promise.reject(new Error("Could not load canvg: "+r))}).then(function(r){return r.default?r.default:r})}Ir.API.addSvgAsImage=function(r,n,i,o,a,s,l,c){if(isNaN(n)||isNaN(i))throw Si.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(o)||isNaN(a))throw Si.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=o,u.height=a;var d=u.getContext("2d");d.fillStyle="#fff",d.fillRect(0,0,u.width,u.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return t().then(function(p){return p.fromString(d,r,h)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(p){return p.render(h)}).then(function(){f.addImage(u.toDataURL("image/jpeg",1),n,i,o,a,l,c)})}}(),Ir.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(t,r);return this},Ir.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,i,o,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(a),l=[],c=0,u=0,d=0;function h(p,g){var A,m=!1;for(A=0;A<p.length;A+=1)p[A]===g&&(m=!0);return m}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=s.length;for(d=0;d<f;d+=1)r[s[d]].value=r[s[d]].defaultValue,r[s[d]].explicitSet=!1}if(Jn(e)==="object"){for(i in e)if(o=e[i],h(s,i)&&o!==void 0){if(r[i].type==="boolean"&&typeof o=="boolean")r[i].value=o;else if(r[i].type==="name"&&h(r[i].valueSet,o))r[i].value=o;else if(r[i].type==="integer"&&Number.isInteger(o))r[i].value=o;else if(r[i].type==="array"){for(c=0;c<o.length;c+=1)if(n=!0,o[c].length===1&&typeof o[c][0]=="number")l.push(String(o[c]-1));else if(o[c].length>1){for(u=0;u<o[c].length;u+=1)typeof o[c][u]!="number"&&(n=!1);n===!0&&l.push([o[c][0]-1,o[c][1]-1].join(" "))}r[i].value="["+l.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,g=[];for(p in r)r[p].explicitSet===!0&&(r[p].type==="name"?g.push("/"+p+" /"+r[p].value):g.push("/"+p+" "+r[p].value));g.length!==0&&this.internal.write(`/ViewerPreferences
656
+ `&&(n=n.substr(1),w=1),h+f+(p=(i=t1.apply(this,[n,r])).reduce(function(S,C){return S+C},0))>t||w){if(p>t){for(s=uU.apply(this,[n,i,t-(h+f),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);p=i.slice(n.length-(u[0]?u[0].length:0)).reduce(function(S,C){return S+C},0)}else u=[n];d.push(u),h=p+l,f=A}else u.push(n),h+=f+p,f=A}return c=l?function(S,C){return(C?m:"")+S.join(" ")}:function(S){return S.join(" ")},d.map(c)},hm.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),o=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var d=this.internal.getFont(u.fontName,u.fontStyle);return d.metadata.Unicode?{widths:d.metadata.Unicode.widths||{0:1},kerning:d.metadata.Unicode.kerning||{}}:{font:d.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;o.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=r.lineIndent;var s,l,c=[];for(s=0,l=n.length;s<l;s++)c=c.concat(dU.apply(this,[n[s],a,o]));return c},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",r={},n={},i=0;i<t.length;i++)r[t[i]]="0123456789abcdef"[i],n["0123456789abcdef"[i]]=t[i];var o=function(d){return"0x"+parseInt(d,10).toString(16)},a=e.__fontmetrics__.compress=function(d){var h,f,p,g,A=["{"];for(var m in d){if(h=d[m],isNaN(parseInt(m,10))?f="'"+m+"'":(m=parseInt(m,10),f=(f=o(m).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof h=="number")h<0?(p=o(h).slice(3),g="-"):(p=o(h).slice(2),g=""),p=g+p.slice(0,-1)+n[p.slice(-1)];else{if(Jn(h)!=="object")throw new Error("Don't know what to do with value type "+Jn(h)+".");p=a(h)}A.push(f+p)}return A.push("}"),A.join("")},s=e.__fontmetrics__.uncompress=function(d){if(typeof d!="string")throw new Error("Invalid argument passed to uncompress.");for(var h,f,p,g,A={},m=1,y=A,w=[],S="",C="",E=d.length-1,I=1;I<E;I+=1)(g=d[I])=="'"?h?(p=h.join(""),h=void 0):h=[]:h?h.push(g):g=="{"?(w.push([y,p]),y={},p=void 0):g=="}"?((f=w.pop())[0][f[1]]=y,p=void 0,y=f[0]):g=="-"?m=-1:p===void 0?r.hasOwnProperty(g)?(S+=r[g],p=parseInt(S,16)*m,m=1,S=""):S+=g:r.hasOwnProperty(g)?(C+=r[g],y[p]=parseInt(C,16)*m,m=1,p=void 0,C=""):C+=g;return A},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},c={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},u={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":s("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(d){var h=d.font,f=u.Unicode[h.postScriptName];f&&(h.metadata.Unicode={},h.metadata.Unicode.widths=f.widths,h.metadata.Unicode.kerning=f.kerning);var p=c.Unicode[h.postScriptName];p&&(h.metadata.Unicode.encoding=p,h.encoding=p.codePages[0])}])}(Ir.API),function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);return i};e.API.events.push(["addFont",function(r){var n=void 0,i=r.font,o=r.instance;if(!i.isStandardFont){if(o===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=o.existsFileInVFS(i.postScriptName)===!1?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(j0(s)),a.metadata=e.API.TTFFont.open(s),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,n)}}])}(Ir),function(e){function t(){return(Vr.canvg?Promise.resolve(Vr.canvg):mj(()=>import("./index.es-mB7ZF8OM-f6QJp5B4.js"),[])).catch(function(r){return Promise.reject(new Error("Could not load canvg: "+r))}).then(function(r){return r.default?r.default:r})}Ir.API.addSvgAsImage=function(r,n,i,o,a,s,l,c){if(isNaN(n)||isNaN(i))throw Si.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(o)||isNaN(a))throw Si.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=o,u.height=a;var d=u.getContext("2d");d.fillStyle="#fff",d.fillRect(0,0,u.width,u.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return t().then(function(p){return p.fromString(d,r,h)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(p){return p.render(h)}).then(function(){f.addImage(u.toDataURL("image/jpeg",1),n,i,o,a,l,c)})}}(),Ir.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(t,r);return this},Ir.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,i,o,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(a),l=[],c=0,u=0,d=0;function h(p,g){var A,m=!1;for(A=0;A<p.length;A+=1)p[A]===g&&(m=!0);return m}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=s.length;for(d=0;d<f;d+=1)r[s[d]].value=r[s[d]].defaultValue,r[s[d]].explicitSet=!1}if(Jn(e)==="object"){for(i in e)if(o=e[i],h(s,i)&&o!==void 0){if(r[i].type==="boolean"&&typeof o=="boolean")r[i].value=o;else if(r[i].type==="name"&&h(r[i].valueSet,o))r[i].value=o;else if(r[i].type==="integer"&&Number.isInteger(o))r[i].value=o;else if(r[i].type==="array"){for(c=0;c<o.length;c+=1)if(n=!0,o[c].length===1&&typeof o[c][0]=="number")l.push(String(o[c]-1));else if(o[c].length>1){for(u=0;u<o[c].length;u+=1)typeof o[c][u]!="number"&&(n=!1);n===!0&&l.push([o[c][0]-1,o[c][1]-1].join(" "))}r[i].value="["+l.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,g=[];for(p in r)r[p].explicitSet===!0&&(r[p].type==="name"?g.push("/"+p+" /"+r[p].value):g.push("/"+p+" "+r[p].value));g.length!==0&&this.internal.write(`/ViewerPreferences
657
657
  <<
658
658
  `+g.join(`
659
659
  `)+`
@@ -945,4 +945,4 @@ Content: ${C.content}
945
945
 
946
946
  `)}
947
947
  `,S=await _A(so.ai_prompt,[...f,{role:"system",content:"You are a documentation assistant that provides answers based on provided documentation content."},{role:"user",content:w}],r);a({sender:"Bot",message:S.message,type:"text"}),d(S.isTruncated);return}const m=await _A(so.ai_prompt,[...f,{role:"user",content:h}],r);a({sender:"Bot",message:m.message,type:"text"})}catch(h){new pr({transactionName:"lyChat.handleSendMessage",modulesProperties:r,data:h}).logException("handleSendMessage: Failed to send message to AI"),console.error(h),a({sender:"Bot",message:"An error occurred while processing your request. Please try again.",type:"text"})}finally{c(),u(!1)}}},OUe=(e,t)=>[...e.map(r=>({role:r.sender==="User"?"user":"assistant",content:r.message})),{role:"user",content:t}],LUe=e=>{const{chat:t,addMessageToHistory:r}=e,n=ie.useCallback(i=>{r({sender:"Bot",message:i.message,type:"text"})},[]);return t?W.jsx(hte,{sender:t.sender,children:W.jsx(kne,{chat:t,children:t.type==="action"&&t.action?W.jsxs(Nt,{children:[W.jsx(TI,{markdown:t.message}),t.action.map((i,o)=>W.jsx(mte,{children:W.jsx(F9,{id:i.id,actionID:i.componentID,type:Sf.button,dialogContent:i.dialogContent,dynamic_params:i.dynamic_params,fixed_params:i.fixed_params,label:i.label,status:n,disabled:!1,component:i.component})},o))]}):t.fileName?W.jsxs(Ii,{variant:"body1",fontStyle:"italic",children:["File sent successfully: ",t.fileName]}):W.jsx(TI,{markdown:t.message})})}):null},UUe=ie.memo(e=>{const{chat:t,addMessageToHistory:r}=e;return W.jsx(LUe,{chat:t,addMessageToHistory:r})});function $W(e){const{componentProperties:t}=e,{userProperties:r,appsProperties:n,modulesProperties:i}=si(),[o,a]=ie.useState(""),[s,l]=ie.useState([]),[c,u]=ie.useState(!1),[d,h]=ie.useState(null),[f,p]=ie.useState(!1),[g,A]=ie.useState(!1),[m,y]=ie.useState(!1),[w,S]=ie.useState(!1),C=ie.useRef(!0),E=ie.useRef(null),I=ie.useRef(null),D=ie.useRef(!0),O=100,U=()=>dTe(E),Q=ie.useRef(null);ie.useEffect(()=>{C.current&&(C.current=!1,R())},[t.id]);const N=x=>{var _,k;let B=ut("ai.error");x instanceof Error?B=x.message:typeof x=="object"&&x!==null&&"response"in x&&(B=((k=(_=x.response)==null?void 0:_.data)==null?void 0:k.message)||ut("ai.error")),P({sender:"Bot",message:B,type:"text"}),A(!0)},R=async()=>{u(!0),A(!1);try{const x={sender:"Bot",message:(await _A(so.ai_welcome,[],i)).message,type:"text"};P(x)}catch(x){new pr({transactionName:"FormsAI.initChat",modulesProperties:i,data:x}).logException("AI: Error fetching bot response"),N(x)}u(!1)};ie.useEffect(()=>{D.current&&requestAnimationFrame(()=>U())},[s]);const P=x=>{l(_=>[..._,x])},T=async()=>{await nj(n,r,i,o,d,s,P,a,h,U,u,S)};return W.jsxs(Ene,{children:[W.jsxs(xne,{elevation:1,ref:E,onScroll:()=>hTe(E,D,p,O),children:[s.map((x,_)=>W.jsx(UUe,{chat:x,addMessageToHistory:P},_)),c&&W.jsx(cte,{children:W.jsx(nv,{})}),g&&W.jsx(ute,{children:W.jsx(tn,{variant:"contained",color:xo.error,onClick:async()=>{y(!0),await R(),y(!1)},disabled:m,startIcon:m&&W.jsx(nv,{size:20,color:"inherit"}),children:m?"":ut("ai.tryAgain")})})]}),W.jsx(kUe,{ref:Q,disabled:c,userInput:o,onChange:a,selectedFile:d,onFileChange:x=>{var _;return h(((_=x.target.files)==null?void 0:_[0])??null)},onRemoveFile:()=>h(null),onSend:T,fileInputRef:I,isTruncated:w,scrollBottom:U,showScrollButton:f,onContinue:async()=>{await nj(n,r,i,"Message truncated, continue",null,s,P,a,h,U,u,S)}})]})}function NUe(e){const{isChatOpen:t,handleCloseChat:r}=e,[n,i]=ie.useState(!1),o=yi("(max-width: 600px)"),a=fo(),[s,l]=ie.useState(()=>o||a),[c,u]=ie.useState({width:500,height:ka.height}),d=ie.useRef(null),h=ie.useRef(null);ie.useEffect(()=>{(o||a)&&l(!0)},[o,a]);const[{x:f,y:p},g]=Il(()=>({x:0,y:0})),A=wc(w=>{if(w.event.target===d.current){const S=Math.max(300,w.offset[0]),C=Math.max(200,w.offset[1]);u({width:S,height:C})}else s||h.current&&h.current.contains(w.event.target)&&g.start({x:w.offset[0],y:w.offset[1]})},{from:w=>w.target===d.current?[c.width,c.height]:[f.get(),p.get()]}),m=()=>{s&&!a&&!o&&l(!1),i(w=>!w)},y=()=>{!o&&!a&&l(w=>!w)};return W.jsx(Nt,{children:t&&W.jsx(du,{...A(),style:{x:s?0:f,y:s?0:p,bottom:s?0:10,right:s?0:10,top:s?0:"auto",left:s?0:"auto"},children:W.jsxs(yte,{minimized:n,fullScreen:s,userWidth:s?"100vw":`${c.width}px`,userHeight:s?"100dvh":`${c.height}px`,children:[W.jsxs(su,{ref:h,onDoubleClick:y,children:[W.jsx("span",{style:{fontWeight:"bold",fontSize:"1rem"},children:n?"Ly-AI":"Chat with Liberty AI"}),W.jsxs(bc,{children:[!s&&!n&&W.jsx(fi,{"aria-label":"minimize",onClick:m,icon:n?dre:ure}),!s&&!n&&W.jsx(fi,{"aria-label":"toggle full screen",onClick:y,icon:s?cu:lu}),W.jsx(fi,{"aria-label":"close",onClick:r,icon:Sd})]})]}),W.jsx(bte,{children:W.jsx($W,{componentProperties:{id:9999,componentMode:ur.chat,type:dr.FormsAI,label:"defaultLabel",filters:[],showPreviousButton:!1,isChildren:!1}})}),!s&&W.jsx(bd,{ref:d})]})})})}var kn=(e=>(e.key="KEY_ATTRIBUTES",e.parent="MENU_PARENT_ID",e.child="MENU_CHILD_ID",e.id="MENU_ID",e.label="MENU_LABEL",e.component="MENU_COMPONENT",e.componentID="MENU_COMPONENT_ID",e.dynamic_params="DYNAMIC_PARAMS",e.fixed_params="FIXED_PARAMS",e.visible="AUT_RUN",e.content="MENU_CONTENT",e))(kn||{});function P9(e,t="0",r="0"){let n=[];for(const i of e)if(i[kn.parent]===t&&i[kn.child].includes(r)){const o=P9(e,i[kn.child],i[kn.key]);o.length&&(i.children=o),n.push(i)}return n}const jUe=async e=>{const{appsProperties:t,userProperties:r,modulesProperties:n}=e;let i=[];i.push({header:"",field:Pe.id,value:r[Pe.id],type:"string",operator:"=",defined:!0,rules:null,disabled:!1,values:""});const o=await Zt.get({source:br.Framework,framework_pool:t[Ne.session]===Hi.framework?zt.getDefaultPool:t[Ne.pool],query:zt.getFramework.menus,sessionMode:t[Ne.session],filters:i,language:r[Pe.language],modulesProperties:n,jwt_token:t[Ne.jwt_token]});let a=P9(o.items);return{results:o,tree:a}},QUe=e=>window.open(e,"_blank","noreferrer"),HUe=(e,t,r,n)=>{switch(e){case"admin":n();break;case"documentation":QUe("https://docs.nomana-it.fr/liberty/getting-started/");break;case"lyTools":const i={id:9999,type:dr.FormsTools,label:"Liberty Tools",filters:[],showPreviousButton:!1,componentMode:ur.standard,isChildren:!1};t(e),r(i);break}},zUe=async e=>{const{modulesProperties:t}=e;return await Zt.applications(t)},VUe=async e=>await Zt.put({source:br.Query,framework_pool:e.appsProperties[Ne.pool],query:zt.getQuery.users,sessionMode:Hi.framework,modulesProperties:e.modulesProperties,jwt_token:e.appsProperties[Ne.jwt_token]},JSON.stringify(e.restData)),qUe=async e=>{const{updatedUserData:t,userProperties:r,modulesProperties:n}=e;let i={[Pe.id]:r[Pe.id],[Pe.name]:r[Pe.name],[Pe.password]:r[Pe.password],[Pe.email]:r[Pe.email],[Pe.status]:"Y",[Pe.admin]:r[Pe.admin],[Pe.language]:r[Pe.language],[Pe.displayMode]:r[Pe.displayMode],[Pe.readonly]:r[Pe.readonly],[Pe.audit_user]:r[Pe.id],[Pe.audit_date]:new Date().toISOString(),[Pe.dashboard]:r[Pe.dashboard],[Pe.theme]:r[Pe.theme]},o=r[Pe.password];if(t[Pe.password]!==void 0&&t[Pe.password]!==r[Pe.password]){if(t[Pe.password]!==t[Pe.password_confirm])return{status:rr.error,data:i};o=await Zt.encrypt(t[Pe.password],n)}return i[Pe.id]=r[Pe.id],i[Pe.name]=t[Pe.name]??r[Pe.name],i[Pe.password]=o??r[Pe.password],i[Pe.email]=t[Pe.email]??r[Pe.email],i[Pe.status]="Y",i[Pe.admin]=r[Pe.admin],i[Pe.language]=t[Pe.language]??r[Pe.language],i[Pe.displayMode]=t[Pe.displayMode]??r[Pe.displayMode],i[Pe.readonly]=r[Pe.readonly],i[Pe.audit_user]=r[Pe.id],i[Pe.audit_date]=new Date().toISOString(),i[Pe.dashboard]=t[Pe.dashboard]??r[Pe.dashboard],i[Pe.theme]=t[Pe.theme]??r[Pe.theme],{status:rr.success,data:i}};function KUe(e){const{selectedIndex:t,setSelectedIndex:r,onMenuSelect:n,onToggleMenusDrawer:i}=e,{userProperties:o,appsProperties:a}=si(),s=o[Pe.dashboard]||a[Ne.dashboard],l=ie.useMemo(()=>({selected:t==="dashboard",onClick:()=>{if(s!=null){const c={id:s,type:dr.FormsDashboard,label:ut("dashboard"),filters:[],showPreviousButton:!1,componentMode:ur.find,isChildren:!1};r("dashboard"),i(),n(c)}},disabled:s==null}),[i,t,r,s,n]);return W.jsx(tv,{variant:"text",fullWidth:!0,...l,startIcon:rre,children:ut("dashboard")})}function WW(e){var t;const{item:r,openMenus:n,setOpenMenus:i,selectedIndex:o,setSelectedIndex:a,onMenuSelect:s,onToggleMenusDrawer:l}=e,{[kn.key]:c,[kn.componentID]:u,[kn.component]:d,[kn.label]:h,[kn.fixed_params]:f,[kn.content]:p,menuIcon:g}=r,[A,m]=ie.useState(n.includes(c)),y=ie.useMemo(()=>f?f.split(";").map(I=>{const D=I.split("=");return{header:"",field:D[0],value:D[1],type:"string",operator:"=",defined:!0,rules:"",disabled:!0,values:""}}):[],[f]),w=ie.useCallback(I=>{i(D=>A?D.filter(O=>O!==I):[...D,I]),m(!A)},[A,i]),S=ie.useCallback(I=>{if(u!=null){const D={id:u,type:d,label:h,filters:y,showPreviousButton:!1,componentMode:ur.find,isChildren:!1,content:p};a(I),l(),s(D)}},[l,a,s,u,y,d,h]),C=ie.useMemo(()=>({selected:o===r[kn.key],onClick:()=>{S(c),w(c)}}),[o,S,w,r]),E=ie.useMemo(()=>Array.isArray(r.children)&&r.children.length>0,[r.children]);return W.jsxs(ie.Fragment,{children:[W.jsxs(xa,{children:[!E&&W.jsx(tv,{variant:"text",fullWidth:!0,...C,startIcon:r.menuIcon,children:W.jsx(k5,{selected:C.selected,children:r[kn.label]})}),E&&W.jsx(aie,{variant:"text",fullWidth:!0,...C,startIcon:r.menuIcon,endIcon:A?Xj:Zj,open:A,children:W.jsx(k5,{selected:C.selected,children:r[kn.label]})})]},c),E&&W.jsx(_B,{in:A,children:W.jsx(Sp,{padding:!0,children:(t=r.children)==null?void 0:t.filter(I=>I[kn.visible]==="Y").map(I=>W.jsx(WW,{item:I,openMenus:n,setOpenMenus:i,selectedIndex:o,setSelectedIndex:a,onMenuSelect:s,onToggleMenusDrawer:l},I[kn.key]))})})]})}function GUe(e){const{openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o,onToggleMenusDrawer:a}=e,{userProperties:s,appsProperties:l,modulesProperties:c,getMenus:u}=si(),[d,h]=ie.useState([]),f=ie.useCallback(async()=>{try{const p=u?{results:await u(),tree:P9((await u()).items)}:await jUe({appsProperties:l,userProperties:s,modulesProperties:c});p.results.status===rr.error&&new pr({transactionName:"DynamicMenus.getMenus",modulesProperties:c,data:p}).logException("Menus: Error fetching menus"),h(p.tree)}catch(p){new pr({transactionName:"DynamicMenus.getMenus",modulesProperties:c,data:p}).logException("Menus: Error fetching menus")}},[l,s]);return ie.useEffect(()=>{f()},[f]),W.jsx(Sp,{padding:!1,children:d.filter(p=>p[kn.visible]==="Y").map(p=>W.jsx(WW,{item:p,openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o,onToggleMenusDrawer:a},p[kn.key]))})}function YW(e){var t;const{item:r,openMenus:n,setOpenMenus:i,selectedIndex:o,setSelectedIndex:a,onMenuSelect:s}=e,{userProperties:l,appsProperties:c,session:u}=si(),[d,h]=ie.useState(n.includes(r[kn.key])),f=ie.useCallback(m=>{i(y=>d?y.filter(w=>w!==m):[...y,m]),h(!d)},[d,i]),p=ie.useCallback(m=>{HUe(m,a,s,u),["admin","lyAI","lyTools"].includes(m)||f(m)},[a,s,f,c,l]),g=ie.useMemo(()=>({selected:o===r[kn.key],onClick:()=>p(r[kn.key])}),[o,r[kn.key],p]),A=ie.useMemo(()=>Array.isArray(r.children)&&r.children.length>0,[r.children]);return W.jsxs(ie.Fragment,{children:[W.jsxs(xa,{children:[!A&&W.jsx(tv,{variant:"text",fullWidth:!0,...g,startIcon:r.menuIcon,children:W.jsx(k5,{children:r[kn.label]})}),A&&W.jsx(tv,{variant:"text",fullWidth:!0,...g,startIcon:r.menuIcon,endIcon:d?Xj:Zj,children:W.jsx(k5,{children:r[kn.label]})})]},r[kn.key]),A&&W.jsx(_B,{in:d,children:W.jsx(Sp,{padding:!1,children:(t=r.children)==null?void 0:t.map(m=>W.jsx(YW,{item:m,openMenus:n,setOpenMenus:i,selectedIndex:o,setSelectedIndex:a,onMenuSelect:s},m[kn.key]))})})]})}function $Ue(e){const{openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o}=e,{userProperties:a,appsProperties:s}=si(),l=ie.useMemo(()=>[{[kn.key]:"documentation",[kn.label]:"Documentation",menuIcon:sre,[kn.visible]:!0,children:[]},{[kn.key]:"lyTools",[kn.label]:"Liberty Tools",menuIcon:cre,[kn.visible]:!0,children:[]},{[kn.key]:"admin",[kn.label]:ut("admin"),menuIcon:lre,[kn.visible]:a[Pe.admin]==="Y",children:[]}],[a,s[Ne.session]]);return W.jsx(oie,{padding:!1,children:l.filter(c=>c[kn.visible]).map(c=>W.jsx(YW,{item:c,openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o},c[kn.key]))})}function WUe(e){const{isOpen:t,onMenuSelect:r,onToggleMenusDrawer:n}=e,{userProperties:i,appsProperties:o}=si(),[a,s]=ie.useState([]),[l,c]=ie.useState(null);ie.useEffect(()=>{s([])},[o,i[Pe.language]]);const u=ie.useCallback(()=>{n()},[n]);return W.jsxs(W.Fragment,{children:[W.jsx(Ute,{open:t,onClick:u}),W.jsx(Nte,{open:t,children:W.jsxs(jte,{children:[W.jsxs(Qte,{children:[W.jsxs(Ii,{variant:"body2",align:"center",component:"a",href:"https://nomana-it.fr/",target:"_blank",rel:"noopener noreferrer",children:["Liberty © Nomana-IT ",new Date().getFullYear(),"."]}),W.jsx(fi,{onClick:u,icon:qte})]}),W.jsxs(Hte,{children:[W.jsx(fT,{children:W.jsx(KUe,{selectedIndex:l,setSelectedIndex:c,onMenuSelect:r,onToggleMenusDrawer:n})}),W.jsx(zte,{children:W.jsx(GUe,{openMenus:a,setOpenMenus:s,selectedIndex:l,setSelectedIndex:c,onMenuSelect:r,onToggleMenusDrawer:n})}),W.jsx(fT,{children:W.jsx($Ue,{openMenus:a,setOpenMenus:s,selectedIndex:l,setSelectedIndex:c,onMenuSelect:r,onToggleMenusDrawer:n})})]})]})})]})}const YUe=ie.memo(e=>{const{onToggleChat:t,onToggleDarkMode:r,onToggleUserSettings:n,onSignout:i}=e,{userProperties:o}=si(),a=n4(),s=o[Pe.status]===!0;return W.jsxs(fte,{children:[W.jsx(fi,{"aria-label":"Toggle Dark Mode",onClick:r,icon:a.darkMode?qj:Kj}),s&&W.jsx(fi,{onClick:t,icon:Kte}),s&&W.jsx(fi,{icon:Gte}),s&&W.jsx(fi,{onClick:n,icon:Wte}),s&&W.jsx(fi,{onClick:i,icon:$te})]})});function XUe(e){const{onToggleMenusDrawer:t,onToggleDarkMode:r,onToggleUserSettings:n,onToggleChat:i,onSignout:o}=e,{userProperties:a,appsProperties:s,logout:l,disconnect:c,socket:u}=si(),d=s[Ne.name],h=a[Pe.status]===!0,f=yi("(max-width: 600px)"),p=fo(),g=()=>{l(),c(),o()};return W.jsxs(Lte,{children:[h&&W.jsx(fi,{onClick:t,icon:Vte,style:{marginLeft:"8px"}}),W.jsxs(Ote,{children:[W.jsxs(dte,{children:[W.jsx(aQ,{width:"32px",height:"32px"}),!f&&!p&&W.jsx(Rne,{noWrap:!0,children:d})]}),W.jsx(Ys,{orientation:"vertical",flexItem:!0}),W.jsx(YUe,{onToggleChat:i,onToggleDarkMode:r,onToggleUserSettings:n,onSignout:g})]})]})}const ZUe=({onFieldChange:e})=>W.jsx("form",{}),JUe=e=>{const{onAutocompleteChanged:t,darkMode:r,inputLanguage:n,inputDashboard:i,inputTheme:o,handleButtonClick:a}=e,s=ie.useMemo(()=>[{id:vf.dark,name:r?"Mode: Dark":"Mode: Light",icon:r?Kj:qj}],[r]);return W.jsxs(ie.Fragment,{children:[s.map(l=>W.jsx(yf,{children:W.jsx(ine,{variant:"contained",endIcon:l.icon,onClick:()=>{a(l.id)},children:l.name},l.id)},l.id)),W.jsx(yf,{children:W.jsx(ub,{id:Pe.language,lookupID:zt.getQuery.lookupLanguage,label:"Language",defaultValue:n??"",disabled:!1,onChange:t,displayWhite:!0,sessionMode:Hi.framework},Pe.language)}),W.jsx(yf,{children:W.jsx(ub,{id:Pe.dashboard,lookupID:zt.getQuery.lookupDashboard,label:"Dashboard",defaultValue:i??"",disabled:!1,onChange:t,displayWhite:!0,fixed_params:"COL_COMPONENT=FormsDashboard",sessionMode:Hi.framework},Pe.dashboard)}),W.jsx(yf,{children:W.jsx(xg,{id:Pe.theme,enumID:zt.getQuery.enumTheme,label:"Theme",defaultValue:o??"",disabled:!1,onChange:t,variant:"standard",freeSolo:!0,searchByLabel:!1,sessionMode:Hi.framework,overrideQueryPool:zt.getDefaultPool},Pe.theme)})]})},eNe=({userProperties:e,onFieldChange:t})=>W.jsxs(W.Fragment,{children:[W.jsx(yf,{children:W.jsx(Ln,{variant:"standard",defaultValue:e[Pe.id],required:!0,fullWidth:!0,id:Pe.id,label:ut("login.userid"),name:"user",autoComplete:"user",disabled:!0,onChange:t})}),W.jsx(yf,{children:W.jsx(Ln,{variant:"standard",defaultValue:e[Pe.name],required:!0,fullWidth:!0,id:Pe.name,label:ut("login.username"),name:"user",autoComplete:"user",autoFocus:!0,onChange:t})}),W.jsx(yf,{children:W.jsx(Ln,{variant:"standard",defaultValue:e[Pe.email],required:!0,fullWidth:!0,id:Pe.email,label:ut("login.email"),name:"email",autoComplete:"email",onChange:t})}),W.jsx(yf,{children:W.jsx(Ln,{variant:"standard",required:!0,fullWidth:!0,id:Pe.password,label:ut("login.password"),type:"password",autoComplete:"off",onChange:t})}),W.jsx(yf,{children:W.jsx(Ln,{variant:"standard",required:!0,fullWidth:!0,id:Pe.password_confirm,label:ut("login.confirm_password"),type:"password",autoComplete:"off",onChange:t})})]}),tNe=({children:e,value:t,index:r,...n})=>W.jsx(ie.Fragment,{children:W.jsx(uB,{role:"tabpanel",hidden:t!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...n,children:W.jsx(dB,{children:e})})}),rNe=e=>{const{openDialog:t,setOpenDialog:r,onToggleDarkMode:n}=e,{userProperties:i,appsProperties:o,modulesProperties:a,login:s}=si(),l=yi("(max-width: 600px)"),c=fo(),[u,d]=ie.useState(()=>l||c),[h,f]=ie.useState({width:ka.width,height:ka.height}),p=ie.useRef(null),g=ie.useRef(null),[A,m]=ie.useState({[Pe.id]:i[Pe.id],[Pe.name]:i[Pe.name],[Pe.password]:i[Pe.password],[Pe.password_confirm]:i[Pe.password],[Pe.email]:i[Pe.email],[Pe.status]:"Y",[Pe.admin]:i[Pe.admin],[Pe.language]:i[Pe.language],[Pe.displayMode]:i[Pe.displayMode],[Pe.darkMode]:i[Pe.darkMode],[Pe.readonly]:i[Pe.readonly],[Pe.dashboard]:i[Pe.dashboard],[Pe.theme]:i[Pe.theme]}),[y,w]=ie.useState(!1),[S,C]=ie.useState("user"),[E,I]=ie.useState({message:"",open:!1}),[D,O]=ie.useState(!1),[U,Q]=ie.useState(!1),[N,R]=ie.useState(null),[P,T]=ie.useState(null),[x,_]=ie.useState(null),[k,B]=ie.useState(i[Pe.darkMode]);ie.useEffect(()=>{(async()=>{var de,Ae;i[Pe.status]&&(w(!0),B(i[Pe.darkMode]),R(i[Pe.language]),T(((de=i[Pe.dashboard])==null?void 0:de.toString())||null),_(((Ae=i[Pe.theme])==null?void 0:Ae.toString())||null),m({[Pe.id]:i[Pe.id],[Pe.name]:i[Pe.name],[Pe.password]:i[Pe.password],[Pe.password_confirm]:i[Pe.password],[Pe.email]:i[Pe.email],[Pe.status]:"Y",[Pe.admin]:i[Pe.admin],[Pe.language]:i[Pe.language],[Pe.displayMode]:i[Pe.displayMode],[Pe.darkMode]:i[Pe.darkMode],[Pe.readonly]:i[Pe.readonly],[Pe.dashboard]:i[Pe.dashboard],[Pe.theme]:i[Pe.theme]}),w(!1))})()},[o[Ne.id],i]);const F=ie.useCallback((de,Ae)=>{C(Ae)},[]),K=ie.useCallback(()=>{const de=!k;m(Ae=>({...Ae,[Pe.displayMode]:de?vf.dark:vf.light})),n(),Q(!0),B(!k)},[k,A,m]),L=de=>{switch(de){case vf.dark:K();break}},z=ie.useCallback(async()=>{try{const de=await qUe({updatedUserData:A,userProperties:i,modulesProperties:a});if(de.status===rr.error)I({open:!0,message:ut("login.passwordError"),severity:Or.error});else{const Ae={restData:de.data,appsProperties:o,modulesProperties:a},ue=await VUe(Ae);ue.status===rr.success?(Q(!1),s({[Pe.status]:!0,[Pe.id]:de.data[Pe.id],[Pe.name]:de.data[Pe.name],[Pe.email]:de.data[Pe.email],[Pe.password]:de.data[Pe.password],[Pe.admin]:de.data[Pe.admin],[Pe.language]:de.data[Pe.language],[Pe.displayMode]:de.data[Pe.displayMode],[Pe.darkMode]:de.data[Pe.displayMode]===vf.dark,[Pe.readonly]:de.data[Pe.readonly],[Pe.dashboard]:de.data[Pe.dashboard],[Pe.theme]:de.data[Pe.theme]}),I({open:!1,message:""})):(new pr({transactionName:"AppsUser.handleSave",modulesProperties:a,data:ue}).logException("Users: Save User Settings"),I({open:!0,message:ue.items[0].message,severity:Or.error}))}}catch(de){new pr({transactionName:"AppsUser.handleSave",modulesProperties:a,data:de}).logException("Users: Save User Settings"),I({open:!0,message:ut("unexpectedError"),severity:Or.error})}},[A,o[Ne.pool],i,s,I,a]),$=ie.useCallback(de=>{const{id:Ae,value:ue}=de.target;m(ge=>({...ge,[Ae]:ue})),Q(!0)},[]),ee=ie.useCallback(()=>{U?O(!0):r(!t)},[U,r,O]),q=de=>{const Ae=de.id;m(ue=>({...ue,[Ae]:de.value})),Q(!0)},J=()=>{I({open:!1,message:""})};ie.useEffect(()=>{(l||c)&&d(!0)},[l,c]);const[{x:V,y:H},Z]=Il(()=>({x:0,y:0})),le=wc(de=>{if(de.event.target===p.current){const Ae=Math.max(300,de.offset[0]),ue=Math.max(200,de.offset[1]);f({width:Ae,height:ue})}else u||g.current&&g.current.contains(de.event.target)&&Z.start({x:de.offset[0],y:de.offset[1]})},{from:de=>de.target===p.current?[h.width,h.height]:[V.get(),H.get()]}),pe=()=>{l||d(de=>!de)},te=[{id:"user",label:ut("users_settings"),component:W.jsx(eNe,{userProperties:i,onFieldChange:$})},{id:"ui",label:ut("ui_settings"),component:W.jsx(JUe,{onAutocompleteChanged:q,darkMode:k,inputLanguage:N,inputDashboard:P,inputTheme:x,handleButtonClick:L,appsProperties:o,userProperties:i,modulesProperties:a})},{id:"notification",label:ut("notifications_settings"),component:W.jsx(ZUe,{userProperties:i,onFieldChange:$})}],se=ie.useCallback(()=>{I({open:!1,message:""}),O(!0)},[I,O]),ae=ie.useCallback(()=>{I({open:!1,message:""}),O(!1)},[I,O]),ce=ie.useCallback(()=>{Q(!1),m({[Pe.id]:i[Pe.id],[Pe.name]:i[Pe.name],[Pe.password]:i[Pe.password],[Pe.password_confirm]:i[Pe.password],[Pe.email]:i[Pe.email],[Pe.status]:"Y",[Pe.admin]:i[Pe.admin],[Pe.language]:i[Pe.language],[Pe.displayMode]:i[Pe.displayMode],[Pe.darkMode]:i[Pe.darkMode],[Pe.readonly]:i[Pe.readonly],[Pe.dashboard]:i[Pe.dashboard],[Pe.theme]:i[Pe.theme]}),B(i[Pe.darkMode]),I({open:!1,message:""}),O(!1),r(!t)},[Q,m,i,r,O]);return t?y?W.jsx(fg,{}):Rl.createPortal(W.jsxs(ie.Fragment,{children:[W.jsx(yd,{}),W.jsxs(du,{...le(),style:{x:u?0:V,y:u?0:H,bottom:u?0:"auto",right:u?0:"auto",top:u?0:"50%",left:u?0:"50%"},children:[W.jsx(C5,{open:D,title:ut("dialogs.dataNotSaved"),content:ut("dialogs.confirmCloseDialog"),onClose:se,onDecline:ae,onAccept:ce}),W.jsxs(md,{fullScreen:u,userWidth:u?"100vw":`${h.width}px`,userHeight:u?"100dvh":`${h.height}px`,children:[W.jsxs(su,{ref:g,onDoubleClick:pe,children:[W.jsx("span",{style:{fontWeight:"bold",fontSize:"1rem",fontVariant:"small-caps"},children:ut(i[Pe.name])}),W.jsx(bc,{children:W.jsx(fi,{"aria-label":"toggle full screen",onClick:pe,icon:u?cu:lu})})]}),W.jsx(Vee,{children:W.jsxs(Mf,{elevation:0,children:[W.jsx(kd,{open:E.open,severity:E.severity,message:E.message,onClose:J}),W.jsx(mB,{elevation:0,children:W.jsx(_5,{children:W.jsxs(jx,{children:[W.jsx(tn,{disabled:!1,variant:"outlined",startIcon:Dl,onClick:ee,color:U?xo.error:xo.primary,children:ut("button.cancel")}),W.jsx(tn,{disabled:!U,variant:"outlined",startIcon:Qx,onClick:z,color:U?xo.success:xo.primary,children:ut("button.save")})]})})}),W.jsx(wB,{value:S,onChange:F,"aria-label":"settings tabs",children:te.map(de=>W.jsx(xB,{id:de.id,label:de.label,value:de.id},de.id))}),te.map(de=>W.jsx(tNe,{value:S,index:de.id,children:W.jsx(Nt,{children:de.component})},de.id))]})})]})]})]}),document.body):null};/*! js-cookie v3.0.5 | MIT */function M1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var nNe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function K8(e,t){function r(i,o,a){if(!(typeof document>"u")){a=M1({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in a)a[l]&&(s+="; "+l,a[l]!==!0&&(s+="="+a[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var l=o[s].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(a[u]=e.read(c,u),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",M1({},o,{expires:-1}))},withAttributes:function(i){return K8(this.converter,M1({},this.attributes,i))},withConverter:function(i){return K8(M1({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var XW=K8(nNe,{path:"/"});const iNe=(e,t)=>e.message==="loginError"?(t({open:!0,message:ut("login.loginError"),severity:Or.error}),!1):e.message==="passwordError"?(t({open:!0,message:ut("login.passwordError"),severity:Or.error}),!1):!0,oNe=async(e,t,r,n)=>{try{e(!0),await new Promise(o=>setTimeout(o,300));const i=n?await n():await zUe({modulesProperties:r});return i.status===rr.error&&new pr({transactionName:"loginUtils.getApplications",modulesProperties:r,data:i}).logException("Login: Failed to fetch applications"),t(i.items),i}catch(i){new pr({transactionName:"loginUtils.getApplications",modulesProperties:r,data:i}).logException("Login: Failed to fetch applications"),t([])}finally{e(!1)}},aNe=e=>{const{userProperties:t,login:r,selectedApplication:n,connect:i,jwt_token:o,socket:a}=e,s={[Pe.status]:!0,[Pe.id]:t[Pe.id],[Pe.name]:t[Pe.name],[Pe.email]:t[Pe.email],[Pe.password]:t[Pe.password],[Pe.admin]:t[Pe.admin],[Pe.language]:t[Pe.language],[Pe.displayMode]:t[Pe.displayMode],[Pe.darkMode]:t[Pe.displayMode]===vf.dark,[Pe.readonly]:t[Pe.readonly],[Pe.dashboard]:t[Pe.dashboard],[Pe.theme]:t[Pe.theme]};XW.set("applicationId",n[Ne.id].toString(),{expires:30}),i({[Ne.id]:n[Ne.id],[Ne.pool]:n[Ne.pool],[Ne.name]:n[Ne.name],[Ne.description]:n[Ne.description],[Ne.offset]:n[Ne.offset],[Ne.limit]:n[Ne.limit],[Ne.version]:n[Ne.version],[Ne.session]:Hi.session,[Ne.dashboard]:n[Ne.dashboard],[Ne.theme]:n[Ne.theme],[Ne.jwt_token]:o}),r(s),a&&cd(a).connect({user:t[Pe.id],application:n[Ne.id]})},sNe=()=>{const{auth:e,modulesProperties:t,login:r,connect:n,socket:i,getApplications:o,getToken:a,getUser:s,getEncryptedText:l}=si(),[c,u]=ie.useState(!1),[d,h]=ie.useState(null),[f,p]=ie.useState([]),[g,A]=ie.useState({message:"",open:!1});ie.useEffect(()=>{(async()=>{try{const C=XW.get("applicationId"),E=await oNe(u,p,t,o);if(C){const I=E.items.find(D=>D[Ne.id]===parseInt(C));I&&h(I)}}catch(C){new pr({transactionName:"AppsLogin.initialize",modulesProperties:t,data:C}).logException("Login: Failed to fetch applications")}})()},[t]);const m=ie.useCallback(C=>{h(C)},[]),y=ie.useCallback(async C=>{var E,I,D,O;C.preventDefault();const U=new FormData(C.currentTarget),Q=U.get("user"),N=U.get("password");try{if(e&&!e.isAuthenticated&&!t.login.enabled){A({open:!0,message:ut("login.authRequired"),severity:Or.error}),e.signinPopup();return}if(!d){A({open:!0,message:ut("login.applicationError"),severity:Or.error});return}const R=a?await a(t.login.enabled?Q:(E=e==null?void 0:e.user)==null?void 0:E.profile.preferred_username,l?await l(N):N):await Zt.token(t.login.enabled?Q:(I=e==null?void 0:e.user)==null?void 0:I.profile.preferred_username,t.login.enabled?await Zt.encrypt(N,t):"",d[Ne.pool],Hi.session,t,t.login.enabled?"database":"oidc");if(!iNe(R,A))return;const P=s?await s(t.login.enabled?Q:(D=e==null?void 0:e.user)==null?void 0:D.profile.preferred_username):await Zt.user({user:t.login.enabled?Q:(O=e==null?void 0:e.user)==null?void 0:O.profile.preferred_username,pool:d[Ne.pool],sessionMode:Hi.session,modulesProperties:t,jwt_token:R.access_token});if(P.status===rr.success){let T=P.items[0];if(r&&n){const x={userProperties:T,login:r,selectedApplication:d,connect:n,jwt_token:R.access_token,socket:i};aNe(x)}else A({open:!0,message:"User or Apps properties are not set",severity:Or.error})}else{const T=P.status==="loginerror"?ut("login.loginError"):ut("login.passwordError");A({open:!0,message:T,severity:Or.error})}}catch(R){new pr({transactionName:"AppsLogin.handleSubmit",modulesProperties:t,data:R}).logException("Login: Validate and connect application"),A({open:!0,message:"Unexpected error occurred",severity:Or.error})}},[e,d,t,A]),w=ie.useMemo(()=>f,[f]),S=()=>{A({open:!1,message:""})};return c?W.jsx(fg,{}):W.jsx(Ite,{children:W.jsxs(yne,{elevation:3,children:[W.jsx(aQ,{width:"75px",height:"75px"}),W.jsxs(Nne,{noValidate:!0,onSubmit:y,children:[W.jsx(kd,{open:g.open,severity:g.severity,message:g.message,onClose:S}),t.login&&t.login.enabled&&W.jsxs(ie.Fragment,{children:[W.jsx(uT,{children:W.jsx(AT,{variant:"standard",required:!0,fullWidth:!0,id:"userid",label:ut("login.userid"),name:"user",autoComplete:"user",autoFocus:!0})}),W.jsx(uT,{children:W.jsx(AT,{variant:"standard",required:!0,fullWidth:!0,name:"password",label:ut("login.password"),type:"password",id:"password",autoComplete:"off"})})]}),W.jsx(UB,{spacing:2,py:2,px:1,columns:{xs:1,sm:2},children:w.map(C=>W.jsx(ra,{children:W.jsx(Vne,{isSelected:d===C,children:W.jsxs(hQ,{onClick:()=>m(C),children:[W.jsx(fQ,{title:C[Ne.name]}),W.jsx(vB,{children:C[Ne.description]})]})})},C[Ne.id]))}),W.jsx(nne,{type:"submit",fullWidth:!0,variant:"contained",children:ut("login.loginButton")})]})]})})},lNe=({tabs:e,activeTab:t,onTabChange:r,onCloseTab:n})=>{const i=(o,a)=>{a.stopPropagation(),n(o)};return W.jsx(wB,{variant:"scrollable",scrollButtons:!0,value:t,onChange:r,children:e.map(o=>W.jsx(xB,{label:W.jsxs(Fte,{children:[o[ar.component].label,W.jsx(dne,{onClick:a=>i(o[ar.sequence],a),icon:Sd,size:pi.small})]}),value:o[ar.sequence],id:`tab-${o[ar.sequence]}`},o[ar.sequence]))})},cNe=({children:e,value:t,index:r,...n})=>W.jsx(uB,{role:"tabpanel",hidden:t!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...n,children:W.jsx(dB,{children:e})}),ij="tab-id-",uNe="-table",dNe="-component",fNe=e=>{const{initialTab:t}=e,{userProperties:r,appsProperties:n,modulesProperties:i,socket:o}=si(),[a,s]=ie.useState([]),[l,c]=ie.useState(t?`${ij}${t.type}-${t.id}`:""),u=p=>{const g=`${ij}${p.type}-${p.id}`,A=a.find(m=>m[ar.component].id===p.id&&m[ar.component].type===p.type);if(A)c(A[ar.sequence]);else{const m={[ar.sequence]:g,[ar.component]:p};s(y=>[...y,m]),c(g)}},d=p=>{s(g=>{const A=g.filter(m=>m[ar.sequence]!==p);if(p===l&&A.length>0){const m=A[0][ar.sequence]||"";c(m)}return A})},h=()=>{s([]),c("")},f=ie.useMemo(()=>a.map(p=>({...p,content:pNe({component:p[ar.component],appsProperties:n,userProperties:r,modulesProperties:i,socket:o,children:p[ar.component].content})})),[a]);return{tabs:a,activeTab:l,addTab:u,closeTab:d,clearTabs:h,setActiveTab:c,memoizedContent:f}},bk=e=>{const{component:t,viewMode:r,appsProperties:n,userProperties:i,modulesProperties:o,socket:a}=e;return W.jsx(zh,{elevation:0,children:W.jsx(_f,{viewMode:r,displayMode:Cl.component,viewGrid:r!==Ji.list,componentProperties:t,readonly:!1},t.id+dNe)},t.id+uNe)},hNe=e=>{},pNe=e=>{const{component:t,appsProperties:r,userProperties:n,modulesProperties:i,socket:o,children:a}=e;switch(t.type){case dr.FormsContent:return a;case dr.FormsTable:const s={component:t,viewMode:Ji.table,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return bk(s);case dr.FormsTree:const l={component:t,viewMode:Ji.tree,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return bk(l);case dr.FormsList:const c={component:t,viewMode:Ji.list,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return bk(c);case dr.FormsDialog:return W.jsx(D9,{componentProperties:t,onClose:hNe});case dr.FormsUpload:return W.jsx(x9,{componentProperties:t});case dr.FormsChart:return W.jsx(T9,{componentProperties:t});case dr.FormsDashboard:return W.jsx(QW,{componentProperties:t});case dr.FormsAI:return W.jsx($W,{componentProperties:t});case dr.FormsTools:return W.jsx(jW,{});default:return null}};function ANe(){const[e,t]=ie.useState(!1),{userProperties:r,appsProperties:n}=si(),{toggleDarkMode:i}=n4(),[o,a]=ie.useState(!1),[s,l]=ie.useState(!1),{tabs:c,activeTab:u,addTab:d,closeTab:h,setActiveTab:f,memoizedContent:p,clearTabs:g}=fNe({}),[A,m]=ie.useState(!1),y=()=>{const U=r[Pe.dashboard]||n[Ne.dashboard];if(U){const Q={id:U,type:dr.FormsDashboard,label:ut("dashboard"),filters:[],showPreviousButton:!1,componentMode:ur.find,isChildren:!1};d(Q)}};ie.useEffect(()=>{c.length===0&&A&&(r[Pe.status]&&y(),m(!1))},[c,A,r[Pe.status]]),ie.useEffect(()=>{g(),m(!0)},[n[Ne.session],r[Pe.status]]);const w=U=>d(U),S=(U,Q)=>f(Q),C=()=>{i()},E=()=>{t(!e)},I=()=>{a(!o)},D=()=>{l(!s)},O=()=>{l(!1)};return W.jsxs(Tte,{children:[W.jsx(Q_e,{}),W.jsx(XUe,{onToggleMenusDrawer:E,onToggleDarkMode:C,onToggleChat:D,onToggleUserSettings:I,onSignout:O}),r[Pe.status]&&W.jsxs(hne,{children:[W.jsx(NUe,{isChatOpen:s,handleCloseChat:D}),W.jsx(rNe,{openDialog:o,setOpenDialog:I,onToggleDarkMode:C}),W.jsx(WUe,{onMenuSelect:w,onToggleMenusDrawer:E,isOpen:e}),c.length>0&&W.jsx(lNe,{tabs:c,activeTab:u,onTabChange:S,onCloseTab:h}),p.map(U=>W.jsx(cNe,{value:u,index:U[ar.sequence],children:U.content},U[ar.sequence]))]}),!r[Pe.status]&&W.jsx(pne,{children:W.jsx(sNe,{})})]})}const gNe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mNe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},bNe=e=>mNe[e],yNe=e=>e.replace(gNe,bNe);let oj={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:yNe};const vNe=(e={})=>{oj={...oj,...e}},wNe={type:"3rdParty",init(e){vNe(e.options.react)}},xNe=ie.createContext();function _Ne({i18n:e,defaultNS:t,children:r}){const n=ie.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return ie.createElement(xNe.Provider,{value:n},r)}const{slice:SNe,forEach:kNe}=[];function CNe(e){return kNe.call(SNe.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}const aj=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,BNe=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(t);let i=`${e}=${n}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!aj.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!aj.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},sj={create(e,t,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),n&&(i.domain=n),document.cookie=BNe(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let i=r[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e){this.create(e,"",-1)}};var ENe={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return sj.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:i,cookieOptions:o}=t;r&&typeof document<"u"&&sj.create(r,e,n,i,o)}},MNe={name:"querystring",lookup(e){var t;let{lookupQuerystring:r}=e,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((t=window.location.hash)==null?void 0:t.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let a=0;a<o.length;a++){const s=o[a].indexOf("=");s>0&&o[a].substring(0,s)===r&&(n=o[a].substring(s+1))}}return n}};let r0=null;const lj=()=>{if(r0!==null)return r0;try{r0=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{r0=!1}return r0};var TNe={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(lj()&&t)return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;lj()&&r&&window.localStorage.setItem(r,e)}};let n0=null;const cj=()=>{if(n0!==null)return n0;try{n0=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{n0=!1}return n0};var FNe={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&cj())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&cj()&&window.sessionStorage.setItem(r,e)}},RNe={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:i}=navigator;if(r)for(let o=0;o<r.length;o++)t.push(r[o]);n&&t.push(n),i&&t.push(i)}return t.length>0?t:void 0}},DNe={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},INe={name:"path",lookup(e){var t;let{lookupFromPathIndex:r}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(t=n[typeof r=="number"?r:0])==null?void 0:t.replace("/",""):void 0}},PNe={name:"subdomain",lookup(e){var t,r;let{lookupFromSubdomainIndex:n}=e;const i=typeof n=="number"?n+1:1,o=typeof window<"u"&&((r=(t=window.location)==null?void 0:t.hostname)==null?void 0:r.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(o)return o[i]}};let ZW=!1;try{document.cookie,ZW=!0}catch{}const JW=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ZW||JW.splice(1,1);const ONe=()=>({order:JW,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class eY{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=CNe(r,this.options||{},ONe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(ENe),this.addDetector(MNe),this.addDetector(TNe),this.addDetector(FNe),this.addDetector(RNe),this.addDetector(DNe),this.addDetector(INe),this.addDetector(PNe)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(r=r.concat(i))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}eY.type="languageDetector";const LNe="Loading...",UNe="Content copied to clipboard: ",NNe="Content read from clipboard: ",jNe="Unexpected Error, please contact your admin",QNe="Data saved successfully",HNe="Task executed successfully: ",zNe="Task canceled",VNe="Your changes are not saved, please cancel or save",qNe="UI Settings",KNe="User Settings",GNe="Notifications Settings",$Ne="Dashboard",WNe="Sign out",YNe="Framework",XNe="Links",ZNe={userid:"User ID",username:"Full Name",password:"Password",confirm_password:"Confirm Password",email:"Email",application:"Application",loginError:"Invalid Login",passwordError:"Invalid Password",applicationError:"Application not selected",authRequired:"Authentication required",loginButton:"Sign in",signin:"Sign in",connected:"Connected",anonymous:"Anonymous",mode:"Admin",loading:"Get list of available applications"},JNe={label:"Filters",operator:{eq:"equals",like:"contains",sup:">=",inf:"<="}},eje={help:"Table Properties",confirm:"Confirmation",no_results:"No results found",rows:"Rows",search:"Search...",findSelect:"Search & Select: ",component:"Component: ",id:"Table ID: ",description:"Description: ",query:"Query ID: ",delete:"Are you sure you want to delete this row? This action is irreversible and will permanently remove this data.",SelectedRowsError:"No rows selected",MultipleRowsError:"You should select only one row",FilterDefinitionError:"Filters for contextual menus are incorrectly set, please check definition",copyToClipboard:"Failed to copy to clipboard: ",pasteFromClipoard:"Failed to read from clipboard: "},tje={help:"Dialog Properties",mappingError:"Check your dialog definition, some columns in the query are not mapped :",component:"Component: ",id:"Form ID: ",mode:"Mode: ",saveDialog:"Please close the dialog before moving to another application",dataNotSaved:"Data not saved",confirmCloseDialog:"Data are not saved, are you sure you want to cancel? Unsaved data will be lost",export:{allColumns:"All",visibleColumns:"Visible",selectedRows:"Selected",allRows:"All",visibleRows:"Visible",csv:"Export to CSV",excel:"Export to Excel",pdf:"Export to PDF",columnId:"Column ID",columnName:"Column Name",options:"Export options",header:"Columns Header",columns:"Columns",rows:"Rows"}},rje={confirm:"Do you want to execute the task? ",run:"Run",cancel:"Cancel",params:"Parameters: "},nje={apply:"Apply",reset:"Reset",cancel:"Cancel",yes:"Yes",no:"No",help:"Help",back:"Back to previous",filters:{title:"Filters",add:"Add Filter",remove_all:"Remove All"},density:"Density",columns:"Columns",displayMode:{table:"Table View",tree:"Tree View",chart:"Chart View"},dialogsMode:{add:"Add",edit:"Edit",copy:"Copy",delete:"Delete",reorder:"Reorder Lines",edit_lines:"Edit table"},about:"About",download:"Data export",upload:"Data import",save:"Save",save_close:"Save and close",add_value:"Add",scroll_top:"Scroll to top",discard:"Discard",copy:"Copy",paste:"Paste",autosize:"Autosize",close:"Close",image:"Switch to: Image",text:"Switch to: Text",import:"Import",open:"Open",sort_asc:"Sort Ascending",sort_desc:"Sort Descending",sort_clear:"Clear Sorting",pin_column:"Pin Column",unpin_column:"Unpin Column",pin_left:"Pin Left",pin_right:"Pin Right",autosize_column:"Autosize Column",autosize_all_columns:"Autosize All Columns",group_by:"Group By",ungroup_by:"Ungroup",hide_column:"Hide Column",manage_columns:"Manage Columns",properties:"Properties"},ije={hello:"Hello",error:"AI is not responding, please try later",message:"Message Liberty AI"},oje={size:"File is too large. Please select a file smaller than 5 MB.",type:"Invalid file type. Please select a valid file.",success:"File uploaded successfully"},aje={message:"Type a message..."},sje={help:"Column Properties",dictionary:"Dictionary ID: ",target:"Database ID: ",name:"Column Name: ",type:"Column Type: ",rules:"Rules: ",rulesValues:"Rules ID: "},lje={loading:LNe,copyToClipboard:UNe,pasteFromClipoard:NNe,unexpectedError:jNe,save_ok:QNe,run_ok:HNe,run_cancel:zNe,save_ko:VNe,ui_settings:qNe,users_settings:KNe,notifications_settings:GNe,dashboard:$Ne,signout:WNe,admin:YNe,links:XNe,login:ZNe,filters:JNe,tables:eje,dialogs:tje,tasks:rje,button:nje,ai:ije,files:oje,chat:aje,columns:sje},cje="Chargement...",uje="Contenu copié dans le presse papier",dje="Contenu collé depuis le presse papier",fje="Erreur inconnue, veuillez contacter votre administrateur",hje="Données enregistrées avec succès",pje="Exécution réussie",Aje="Exécution annulée",gje="Vos modifications ne sont pas enregistrées, veuillez annuler ou sauvegarder",mje="Paramètres Affichage",bje="Paramètres utilisateur",yje="Paramètres de notification",vje="Tableau de bord",wje="Déconnexion",xje="admin",_je="Liens",Sje={userid:"Identifiant utilisateur",username:"Nom complet",password:"Mot de passe",confirm_password:"Confirmer le mot de passe",email:"Email",application:"Application",loginError:"Connexion invalide",passwordError:"Mot de passe invalide",applicationError:"Application non sélectionnée",authRequired:"Authentification requise",loginButton:"Connexion",signin:"Se connecter",connected:"Connecté",anonymous:"Anonyme",mode:"Administrateur",loading:"Chargement de la liste des applications"},kje={label:"Filtres",operator:{eq:"égal à",like:"contient",sup:">=",inf:"<="}},Cje={help:"Propriétés de la table",confirm:"Confirmation",rows:"Lignes",no_results:"Aucun résultat trouvé",search:"Rechercher...",findSelect:"Rechercher et sélectionner : ",component:"Composant : ",id:"ID de la table : ",description:"Description : ",query:"ID de la requête : ",delete:"Êtes-vous sûr de vouloir supprimer cette ligne ? Cette action est irréversible et supprimera définitivement ces données.",SelectedRowsError:"Aucune ligne sélectionnée",MultipleRowsError:"Vous devez sélectionner une seule ligne",FilterDefinitionError:"Les filtres des menus contextuels sont mal définis, veuillez vérifier la définition",copyToClipboard:"Échec de la copie dans le presse-papier : ",pasteFromClipoard:"Échec de la lecture du presse-papier : "},Bje={help:"Propriétés du dialogue",mappingError:"Vérifiez la définition de votre dialogue, certaines colonnes dans la requête ne sont pas mappées :",component:"Composant : ",id:"ID du formulaire : ",mode:"Mode : ",saveDialog:"Veuillez fermer le dialogue avant de passer à une autre application",dataNotSaved:"Données non enregistrées",confirmCloseDialog:"Les données ne sont pas enregistrées, êtes-vous sûr de vouloir annuler ? Les données non enregistrées seront perdues",export:{allColumns:"Toutes",visibleColumns:"Visibles",selectedRows:"Sélectionnées",allRows:"Toutes",visibleRows:"Visibles",csv:"Exporter en CSV",excel:"Exporter en Excel",pdf:"Exporter en PDF",columnId:"ID de colonne",columnName:"Nom de colonne",options:"Options d'exportation",header:"En-tête de colonnes",columns:"Colonnes",rows:"Lignes"}},Eje={confirm:"Voulez-vous exécuter la tâche ? ",run:"Exécuter",cancel:"Annuler",params:"Paramètres : "},Mje={apply:"Appliquer",reset:"Réinitialiser",cancel:"Annuler",yes:"Oui",no:"Non",help:"Aide",back:"Retour au précédent",filters:{title:"Filtres",add:"Ajouter Filtre",remove_all:"Tout supprimer"},density:"Densité",columns:"Colonnes",displayMode:{table:"Vue Tableau",tree:"Vue Arborescente",chart:"Vue Graphique"},dialogsMode:{add:"Ajouter",edit:"Modifier",copy:"Copier",delete:"Supprimer",reorder:"Réorganiser les lignes",edit_lines:"Modifier la table"},about:"À propos",download:"Exportation de données",upload:"Importation de données",save:"Enregistrer",save_close:"Enregistrer et fermer",add_value:"Ajouter",scroll_top:"Défiler vers le haut",discard:"Abandonner",copy:"Copier",paste:"Coller",autosize:"Ajuster automatiquement",close:"Fermer",image:"Mode: Image",text:"Mode: Text",import:"Import",open:"Ouvrir",sort_asc:"Tri Croissant",sort_desc:"Tri Décroissant",sort_clear:"Effacer le tri",pin_column:"Épingler la colonne",unpin_column:"Détacher la colonne",pin_left:"Épingler à gauche",pin_right:"Épingler à droite",autosize_column:"Ajuster la colonne",autosize_all_columns:"Ajuster toutes les colonnes",group_by:"Grouper",ungroup_by:"Dégrouper",hide_column:"Masquer la colonne",manage_columns:"Gérer les colonnes",properties:"Propriétés"},Tje={hello:"Bonjour",error:"L'IA ne répond pas, veuillez réesayer ultérieurement",message:"Message Liberty AI"},Fje={size:"Le fichier est trop volumineux. Veuillez sélectionner un fichier de moins de 5 Mo.",type:"Type de fichier invalide. Veuillez sélectionner un fichier valide.",success:"Fichier téléchargé avec succès."},Rje={message:"Ecrire un message..."},Dje={help:"Propriétés de la colonne",dictionary:"ID du dictionnaire: ",target:"ID base de données: ",name:"Nom de la colonne: ",type:"Type de colonne: ",rules:"Règles: ",rulesValues:"Valeurs ID: "},Ije={loading:cje,copyToClipboard:uje,pasteFromClipoard:dje,unexpectedError:fje,save_ok:hje,run_ok:pje,run_cancel:Aje,save_ko:gje,ui_settings:mje,users_settings:bje,notifications_settings:yje,dashboard:vje,signout:wje,admin:xje,links:_je,login:Sje,filters:kje,tables:Cje,dialogs:Bje,tasks:Eje,button:Mje,ai:Tje,files:Fje,chat:Rje,columns:Dje},Pje={en:{translation:lje},fr:{translation:Ije}};ua.use(eY).use(wNe);ua.init({resources:Pje,detection:{order:["path","navigator"]},fallbackLng:"en",debug:!1});ua.t;class Oje extends ie.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){console.error("Error caught by ErrorBoundary:",t,r),En()&&f4(t)}render(){return this.state.hasError?this.props.fallback||W.jsx(Nt,{children:"An unexpected error has occurred."}):this.props.children}}const Lje=({children:e})=>W.jsx(_Ne,{i18n:ua,children:e}),Uje="/assets/background_ly-VdfFMP8a.jpg",Nje=e=>{const{userProperties:t,appsProperties:r,modulesProperties:n}=e,[i,o]=ie.useState([]),a=(t==null?void 0:t[Pe.theme])||(r==null?void 0:r[Ne.theme])||"liberty",s=[{header:"",field:"THM_NAME",value:a,type:"text",operator:"=",defined:!0,rules:null,disabled:!1,values:""}],l=(u,d)=>{const h={};return u.forEach(({TCL_KEY:f,TCL_LIGHT:p,TCL_DARK:g})=>{const A=d?g:p,m=f.split(".");m.length>1?(h[m[0]]||(h[m[0]]={}),h[m[0]][m[1]]=A):h[f]=A}),h};return ie.useEffect(()=>{(async()=>{try{const d=await Zt.themes(n,s,zt.getDefaultPool);o(d.items)}catch(d){console.error("Error fetching theme colors:",d)}})()},[a,n,r,t]),{theme:u=>{const d=l(i,u);return{palette:{mode:u?"dark":"light",primary:{main:typeof d.primary=="string"?d.primary:u?"#607d8b":"#1976d2"},secondary:{main:typeof d.secondary=="string"?d.secondary:u?"#ffc107":"#1976d2"},text:{primary:u?"rgba(255, 255, 255, 0.87)":"rgba(0, 0, 0, 0.87)",secondary:u?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)",disabled:u?"rgba(255, 255, 255, 0.38)":"rgba(0, 0, 0, 0.38)"},background:{default:u?"#121212":"#ffffff",paper:u?"#1d1d1d":"#ffffff"},divider:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.12)",action:{hover:u?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.05)",selected:u?"rgba(255, 255, 255, 0.16)":"rgba(0, 0, 0, 0.08)",disabled:u?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.26)"},grey:{100:u?"#e0e0e0":"#f5f5f5",200:u?"#c7c7c7":"#eeeeee",300:u?"#a4a4a4":"#e0e0e0",400:u?"#8f8f8f":"#bdbdbd",500:u?"#757575":"#9e9e9e",600:u?"#626262":"#757575",700:u?"#515151":"#616161",800:u?"#3a3a3a":"#424242"}},background:{default:typeof d.background=="string"?d.background??(u?"linear-gradient(to left, #2C5364, #203A43, #0F2027)":"linear-gradient(to left, #a1c4fd, #c2e9fb)"):"linear-gradient(to left, #2C5364, #203A43, #0F2027)",loginPage:u?"linear-gradient(to right, rgba(44, 83, 100, 0.7), rgba(32, 58, 67, 0.7), rgba(15, 32, 39, 0.7))":"linear-gradient(to right, rgba(161, 196, 253, 0.7), rgba(194, 233, 251, 0.7))",loginImage:`url(${Uje})`},backgroundShades:{light:{start:"#e0e0e0",middle:"#f5f5f5"},dark:{start:"#424242",middle:"#303030"}},color:{default:typeof d.color=="string"?d.color:u?"#E1D9D1":"#333333"},spacing:h=>`${8*h}px`,shadows:["none","0px 1px 3px rgba(0,0,0,0.2)","0px 3px 6px rgba(0,0,0,0.3)"]}}}};function jje(){const{userProperties:e,appsProperties:t,modulesProperties:r}=si(),{theme:n}=Nje({appsProperties:t,userProperties:e,modulesProperties:r});return pf.jsx(Ime,{customTheme:n,children:pf.jsx(ANe,{})})}class y0 extends Error{}y0.prototype.name="InvalidTokenError";function Qje(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Hje(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Qje(t)}catch{return atob(t)}}function zje(e,t){if(typeof e!="string")throw new y0("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new y0(`Invalid token specified: missing part #${r+1}`);let i;try{i=Hje(n)}catch(o){throw new y0(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new y0(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}var Vje={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Zu,Ju,Rx=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(Rx||{});(e=>{function t(){Zu=3,Ju=Vje}e.reset=t;function r(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Zu=i}e.setLevel=r;function n(i){Ju=i}e.setLogger=n})(Rx||(Rx={}));var Kn=class $u{constructor(t){this._name=t}debug(...t){Zu>=4&&Ju.debug($u._format(this._name,this._method),...t)}info(...t){Zu>=3&&Ju.info($u._format(this._name,this._method),...t)}warn(...t){Zu>=2&&Ju.warn($u._format(this._name,this._method),...t)}error(...t){Zu>=1&&Ju.error($u._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const r=Object.create(this);return r._method=t,r.debug("begin"),r}static createStatic(t,r){const n=new $u(`${t}.${r}`);return n.debug("begin"),n}static _format(t,r){const n=`[${t}]`;return r?`${n} ${r}:`:n}static debug(t,...r){Zu>=4&&Ju.debug($u._format(t),...r)}static info(t,...r){Zu>=3&&Ju.info($u._format(t),...r)}static warn(t,...r){Zu>=2&&Ju.warn($u._format(t),...r)}static error(t,...r){Zu>=1&&Ju.error($u._format(t),...r)}};Rx.reset();var Dx=class{static decode(e){try{return zje(e)}catch(t){throw Kn.error("JwtUtils.decode",t),t}}static async generateSignedJwt(e,t,r){const n=tl.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),i=tl.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),o=`${n}.${i}`,a=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},r,new TextEncoder().encode(o)),s=tl.encodeBase64Url(new Uint8Array(a));return`${o}.${s}`}},qje="10000000-1000-4000-8000-100000000000",G8=e=>btoa([...new Uint8Array(e)].map(t=>String.fromCharCode(t)).join("")),tY=class Wu{static _randomWord(){const t=new Uint32Array(1);return crypto.getRandomValues(t),t[0]}static generateUUIDv4(){return qje.replace(/[018]/g,r=>(+r^Wu._randomWord()&15>>+r/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Wu.generateUUIDv4()+Wu.generateUUIDv4()+Wu.generateUUIDv4()}static async generateCodeChallenge(t){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",n);return G8(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(r){throw Kn.error("CryptoUtils.generateCodeChallenge",r),r}}static generateBasicAuth(t,r){const i=new TextEncoder().encode([t,r].join(":"));return G8(i)}static async hash(t,r){const n=new TextEncoder().encode(r),i=await crypto.subtle.digest(t,n);return new Uint8Array(i)}static async customCalculateJwkThumbprint(t){let r;switch(t.kty){case"RSA":r={e:t.e,kty:t.kty,n:t.n};break;case"EC":r={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":r={crv:t.crv,kty:t.kty,x:t.x};break;case"oct":r={crv:t.k,kty:t.kty};break;default:throw new Error("Unknown jwk type")}const n=await Wu.hash("SHA-256",JSON.stringify(r));return Wu.encodeBase64Url(n)}static async generateDPoPProof({url:t,accessToken:r,httpMethod:n,keyPair:i,nonce:o}){let a,s;const l={jti:window.crypto.randomUUID(),htm:n??"GET",htu:t,iat:Math.floor(Date.now()/1e3)};r&&(a=await Wu.hash("SHA-256",r),s=Wu.encodeBase64Url(a),l.ath=s),o&&(l.nonce=o);try{const c=await crypto.subtle.exportKey("jwk",i.publicKey),u={alg:"ES256",typ:"dpop+jwt",jwk:{crv:c.crv,kty:c.kty,x:c.x,y:c.y}};return await Dx.generateSignedJwt(u,l,i.privateKey)}catch(c){throw c instanceof TypeError?new Error(`Error exporting dpop public key: ${c.message}`):c}}static async generateDPoPJkt(t){try{const r=await crypto.subtle.exportKey("jwk",t.publicKey);return await Wu.customCalculateJwkThumbprint(r)}catch(r){throw r instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${r.message}`):r}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}};tY.encodeBase64Url=e=>G8(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var tl=tY,Wh=class{constructor(t){this._name=t,this._callbacks=[],this._logger=new Kn(`Event('${this._name}')`)}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const r=this._callbacks.lastIndexOf(t);r>=0&&this._callbacks.splice(r,1)}async raise(...t){this._logger.debug("raise:",...t);for(const r of this._callbacks)await r(...t)}},uj=class{static center({...e}){var t,r,n;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(r=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((n=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t}=${typeof r!="boolean"?r:r?"yes":"no"}`).join(",")}},jf=class g5 extends Wh{constructor(){super(...arguments),this._logger=new Kn(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-g5.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=g5.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const r=this._logger.create("init");t=Math.max(Math.floor(t),1);const n=g5.getEpochTime()+t;if(this.expiration===n&&this._timerHandle){r.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),r.debug("using duration",t),this._expiration=n;const i=Math.min(t,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},$8=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(n.slice(1))}},W8=";",lg=class extends Error{constructor(e,t){var r,n,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Kn.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(r=e.error_description)!=null?r:null,this.error_uri=(n=e.error_uri)!=null?n:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},O9=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},Kje=class{constructor(e){this._logger=new Kn("AccessTokenEvents"),this._expiringTimer=new jf("Access token expiring"),this._expiredTimer=new jf("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const r=e.expires_in;if(t.debug("access token present, remaining duration:",r),r>0){let i=r-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const n=r+1;t.debug("registering expired timer, raising in",n,"seconds"),this._expiredTimer.init(n)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},Gje=class{constructor(e,t,r,n,i){this._callback=e,this._client_id=t,this._intervalInSeconds=n,this._stopOnError=i,this._logger=new Kn("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const o=new URL(r);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},rY=class{constructor(){this._logger=new Kn("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},Y8=class extends Error{constructor(e,t){super(t),this.name="ErrorDPoPNonce",this.nonce=e}},L9=class{constructor(e=[],t=null,r={}){this._jwtHandler=t,this._extraHeaders=r,this._logger=new Kn("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:r,...n}=t;if(!r)return await fetch(e,n);const i=new AbortController,o=setTimeout(()=>i.abort(),r*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new O9("Network timed out"):a}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:r,timeoutInSeconds:n}={}){const i=this._logger.create("getJson"),o={Accept:this._contentTypes.join(", ")};t&&(i.debug("token passed, setting Authorization header"),o.Authorization="Bearer "+t),this.appendExtraHeaders(o);let a;try{i.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:o,timeoutInSeconds:n,credentials:r})}catch(c){throw i.error("Network Error"),c}i.debug("HTTP response received, status",a.status);const s=a.headers.get("Content-Type");if(s&&!this._contentTypes.find(c=>s.startsWith(c))&&i.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await a.text());let l;try{l=await a.json()}catch(c){throw i.error("Error parsing JSON response",c),a.ok?c:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw i.error("Error from server:",l),l.error?new lg(l):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(l)}`);return l}async postForm(e,{body:t,basicAuth:r,timeoutInSeconds:n,initCredentials:i,extraHeaders:o}){const a=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...o};r!==void 0&&(s.Authorization="Basic "+r),this.appendExtraHeaders(s);let l;try{a.debug("url:",e),l=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:n,credentials:i})}catch(h){throw a.error("Network error"),h}a.debug("HTTP response received, status",l.status);const c=l.headers.get("Content-Type");if(c&&!this._contentTypes.find(h=>c.startsWith(h)))throw new Error(`Invalid response Content-Type: ${c??"undefined"}, from URL: ${e}`);const u=await l.text();let d={};if(u)try{d=JSON.parse(u)}catch(h){throw a.error("Error parsing JSON response",h),l.ok?h:new Error(`${l.statusText} (${l.status})`)}if(!l.ok){if(a.error("Error from server:",d),l.headers.has("dpop-nonce")){const h=l.headers.get("dpop-nonce");throw new Y8(h,`${JSON.stringify(d)}`)}throw d.error?new lg(d,t):new Error(`${l.statusText} (${l.status}): ${JSON.stringify(d)}`)}return d}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),r=Object.keys(this._extraHeaders),n=["authorization","accept","content-type"];r.length!==0&&r.forEach(i=>{if(n.includes(i.toLocaleLowerCase())){t.warn("Protected header could not be overridden",i,n);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(e[i]=o)})}},$je=class{constructor(e){this._settings=e,this._logger=new Kn("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new L9(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const r=this._logger.create(`_getMetadataProperty('${e}')`),n=await this.getMetadata();if(r.debug("resolved"),n[e]===void 0){if(t===!0){r.warn("Metadata does not contain optional property");return}r.throw(new Error("Metadata does not contain property "+e))}return n[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const r=await this._jsonService.getJson(t,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(e.debug("got key set",r),!Array.isArray(r.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=r.keys,this._signingKeys}},nY=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Kn("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let r=0;r<e;r++){const n=await this._store.key(r);n&&n.indexOf(this._prefix)===0&&t.push(n.substr(this._prefix.length))}return t}},Wje="code",Yje="openid",Xje="client_secret_post",Zje=60*15,X8=class{constructor({authority:e,metadataUrl:t,metadata:r,signingKeys:n,metadataSeed:i,client_id:o,client_secret:a,response_type:s=Wje,scope:l=Yje,redirect_uri:c,post_logout_redirect_uri:u,client_authentication:d=Xje,prompt:h,display:f,max_age:p,ui_locales:g,acr_values:A,resource:m,response_mode:y,filterProtocolClaims:w=!0,loadUserInfo:S=!1,requestTimeoutInSeconds:C,staleStateAgeInSeconds:E=Zje,mergeClaimsStrategy:I={array:"replace"},disablePKCE:D=!1,stateStore:O,revokeTokenAdditionalContentTypes:U,fetchRequestCredentials:Q,refreshTokenAllowedScope:N,extraQueryParams:R={},extraTokenParams:P={},extraHeaders:T={},dpop:x,omitScopeWhenRequesting:_=!1}){var k;if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=r,this.metadataSeed=i,this.signingKeys=n,this.client_id=o,this.client_secret=a,this.response_type=s,this.scope=l,this.redirect_uri=c,this.post_logout_redirect_uri=u,this.client_authentication=d,this.prompt=h,this.display=f,this.max_age=p,this.ui_locales=g,this.acr_values=A,this.resource=m,this.response_mode=y,this.filterProtocolClaims=w??!0,this.loadUserInfo=!!S,this.staleStateAgeInSeconds=E,this.mergeClaimsStrategy=I,this.omitScopeWhenRequesting=_,this.disablePKCE=!!D,this.revokeTokenAdditionalContentTypes=U,this.fetchRequestCredentials=Q||"same-origin",this.requestTimeoutInSeconds=C,O)this.stateStore=O;else{const B=typeof window<"u"?window.localStorage:new rY;this.stateStore=new nY({store:B})}if(this.refreshTokenAllowedScope=N,this.extraQueryParams=R,this.extraTokenParams=P,this.extraHeaders=T,this.dpop=x,this.dpop&&!((k=this.dpop)!=null&&k.store))throw new Error("A DPoPStore is required when dpop is enabled")}},Jje=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Kn("UserInfoService"),this._getClaimsFromJwt=async r=>{const n=this._logger.create("_getClaimsFromJwt");try{const i=Dx.decode(r);return n.debug("JWT decoding successful"),i}catch(i){throw n.error("Error parsing JWT response"),i}},this._jsonService=new L9(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const r=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",r);const n=await this._jsonService.getJson(r,{token:e,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("got claims",n),n}},iY=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Kn("TokenClient"),this._jsonService=new L9(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:r=this._settings.client_id,client_secret:n=this._settings.client_secret,extraHeaders:i,...o}){const a=this._logger.create("exchangeCode");r||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),o.code||a.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[d,h]of Object.entries(o))h!=null&&s.set(d,h);let l;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;l=tl.generateBasicAuth(r,n);break;case"client_secret_post":s.append("client_id",r),n&&s.append("client_secret",n);break}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:s,basicAuth:l,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return a.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,scope:n=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:e});this._settings.omitScopeWhenRequesting||a.set("scope",n);for(const[u,d]of Object.entries(i))d!=null&&a.set(u,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;s=tl.generateBasicAuth(t,r);break;case"client_secret_post":a.append("client_id",t),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,timeoutInSeconds:n,extraHeaders:i,...o}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),o.refresh_token||a.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[d,h]of Object.entries(o))Array.isArray(h)?h.forEach(f=>s.append(d,f)):h!=null&&s.set(d,h);let l;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw a.throw(new Error("A client_secret is required")),null;l=tl.generateBasicAuth(t,r);break;case"client_secret_post":s.append("client_id",t),r&&s.append("client_secret",r);break}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:s,basicAuth:l,timeoutInSeconds:n,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return a.debug("got response"),u}async revoke(e){var t;const r=this._logger.create("revoke");e.token||r.throw(new Error("A token is required"));const n=await this._metadataService.getRevocationEndpoint(!1);r.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,a]of Object.entries(e))a!=null&&i.set(o,a);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(n,{body:i,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),r.debug("got response")}},eQe=class{constructor(e,t,r){this._settings=e,this._metadataService=t,this._claimsService=r,this._logger=new Kn("ResponseValidator"),this._userInfoService=new Jje(this._settings,this._metadataService),this._tokenClient=new iY(this._settings,this._metadataService)}async validateSigninResponse(e,t,r){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t,r),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t==null?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const r=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),r.debug("claims processed")}async validateRefreshResponse(e,t){var r,n;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(r=e.session_state)!=null||(e.session_state=t.session_state),(n=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const r=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&r.throw(new Error("State does not match")),r.debug("state validated"),e.userState=t.data,e.error)throw r.warn("Response was error",e.error),new lg(e)}_processSigninState(e,t){var r;const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(r=e.scope)!=null||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new lg(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,r=!0){const n=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){n.debug("not loading user info");return}n.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);n.debug("user info claims received from user info endpoint"),r&&i.sub!==e.profile.sub&&n.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),n.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t,r){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const i=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,extraHeaders:r,...t.extraTokenParams});Object.assign(e,i)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var r;const n=this._logger.create("_validateIdTokenAttributes");n.debug("decoding ID Token JWT");const i=Dx.decode((r=e.id_token)!=null?r:"");if(i.sub||n.throw(new Error("ID Token is missing a subject claim")),t){const o=Dx.decode(t);i.sub!==o.sub&&n.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&n.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&n.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&n.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},Ix=class Z8{constructor(t){this.id=t.id||tl.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=jf.getEpochTime(),this.request_type=t.request_type,this.url_state=t.url_state}toStorageString(){return new Kn("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return Kn.createStatic("State","fromStorageString"),Promise.resolve(new Z8(JSON.parse(t)))}static async clearStaleState(t,r){const n=Kn.createStatic("State","clearStaleState"),i=jf.getEpochTime()-r,o=await t.getAllKeys();n.debug("got keys",o);for(let a=0;a<o.length;a++){const s=o[a],l=await t.get(s);let c=!1;if(l)try{const u=await Z8.fromStorageString(l);n.debug("got item from key:",s,u.created),u.created<=i&&(c=!0)}catch(u){n.error("Error parsing state for key:",s,u),c=!0}else n.debug("no item in storage for key:",s),c=!0;c&&(n.debug("removed item for key:",s),t.remove(s))}}},oY=class J8 extends Ix{constructor(t){super(t),this.code_verifier=t.code_verifier,this.code_challenge=t.code_challenge,this.authority=t.authority,this.client_id=t.client_id,this.redirect_uri=t.redirect_uri,this.scope=t.scope,this.client_secret=t.client_secret,this.extraTokenParams=t.extraTokenParams,this.response_mode=t.response_mode,this.skipUserInfo=t.skipUserInfo}static async create(t){const r=t.code_verifier===!0?tl.generateCodeVerifier():t.code_verifier||void 0,n=r?await tl.generateCodeChallenge(r):void 0;return new J8({...t,code_verifier:r,code_challenge:n})}toStorageString(){return new Kn("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(t){Kn.createStatic("SigninState","fromStorageString");const r=JSON.parse(t);return J8.create(r)}},aY=class sY{constructor(t){this.url=t.url,this.state=t.state}static async create({url:t,authority:r,client_id:n,redirect_uri:i,response_type:o,scope:a,state_data:s,response_mode:l,request_type:c,client_secret:u,nonce:d,url_state:h,resource:f,skipUserInfo:p,extraQueryParams:g,extraTokenParams:A,disablePKCE:m,dpopJkt:y,omitScopeWhenRequesting:w,...S}){if(!t)throw this._logger.error("create: No url passed"),new Error("url");if(!n)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!i)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!o)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("create: No scope passed"),new Error("scope");if(!r)throw this._logger.error("create: No authority passed"),new Error("authority");const C=await oY.create({data:s,request_type:c,url_state:h,code_verifier:!m,client_id:n,authority:r,redirect_uri:i,response_mode:l,client_secret:u,scope:a,extraTokenParams:A,skipUserInfo:p}),E=new URL(t);E.searchParams.append("client_id",n),E.searchParams.append("redirect_uri",i),E.searchParams.append("response_type",o),w||E.searchParams.append("scope",a),d&&E.searchParams.append("nonce",d),y&&E.searchParams.append("dpop_jkt",y);let I=C.id;h&&(I=`${I}${W8}${h}`),E.searchParams.append("state",I),C.code_challenge&&(E.searchParams.append("code_challenge",C.code_challenge),E.searchParams.append("code_challenge_method","S256")),f&&(Array.isArray(f)?f:[f]).forEach(O=>E.searchParams.append("resource",O));for(const[D,O]of Object.entries({response_mode:l,...S,...g}))O!=null&&E.searchParams.append(D,O.toString());return new sY({url:E.href,state:C})}};aY._logger=new Kn("SigninRequest");var tQe=aY,rQe="openid",yk=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(W8);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(W8))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-jf.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+jf.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(rQe))||!!this.id_token}},nQe=class{constructor({url:e,state_data:t,id_token_hint:r,post_logout_redirect_uri:n,extraQueryParams:i,request_type:o,client_id:a}){if(this._logger=new Kn("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(e);r&&s.searchParams.append("id_token_hint",r),a&&s.searchParams.append("client_id",a),n&&(s.searchParams.append("post_logout_redirect_uri",n),t&&(this.state=new Ix({data:t,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[l,c]of Object.entries({...i}))c!=null&&s.searchParams.append(l,c.toString());this.url=s.href}},iQe=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},oQe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],aQe=["sub","iss","aud","exp","iat"],sQe=class{constructor(e){this._settings=e,this._logger=new Kn("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let r;Array.isArray(this._settings.filterProtocolClaims)?r=this._settings.filterProtocolClaims:r=oQe;for(const n of r)aQe.includes(n)||delete t[n]}return t}mergeClaims(e,t){const r={...e};for(const[n,i]of Object.entries(t))if(r[n]!==i)if(Array.isArray(r[n])||Array.isArray(i))if(this._settings.mergeClaimsStrategy.array=="replace")r[n]=i;else{const o=Array.isArray(r[n])?r[n]:[r[n]];for(const a of Array.isArray(i)?i:[i])o.includes(a)||o.push(a);r[n]=o}else typeof r[n]=="object"&&typeof i=="object"?r[n]=this.mergeClaims(r[n],i):r[n]=i;return r}},lY=class{constructor(e,t){this.keys=e,this.nonce=t}},lQe=class{constructor(e,t){this._logger=new Kn("OidcClient"),this.settings=e instanceof X8?e:new X8(e),this.metadataService=t??new $je(this.settings),this._claimsService=new sQe(this.settings),this._validator=new eQe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new iY(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:r,request_type:n,id_token_hint:i,login_hint:o,skipUserInfo:a,nonce:s,url_state:l,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:h=this.settings.prompt,display:f=this.settings.display,max_age:p=this.settings.max_age,ui_locales:g=this.settings.ui_locales,acr_values:A=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:w=this.settings.extraQueryParams,extraTokenParams:S=this.settings.extraTokenParams,dpopJkt:C,omitScopeWhenRequesting:E=this.settings.omitScopeWhenRequesting}){const I=this._logger.create("createSigninRequest");if(c!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const D=await this.metadataService.getAuthorizationEndpoint();I.debug("Received authorization endpoint",D);const O=await tQe.create({url:D,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:c,scope:u,state_data:e,url_state:l,prompt:h,display:f,max_age:p,ui_locales:g,id_token_hint:i,login_hint:o,acr_values:A,dpopJkt:C,resource:m,request:t,request_uri:r,extraQueryParams:w,extraTokenParams:S,request_type:n,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:E});await this.clearStaleState();const U=O.state;return await this.settings.stateStore.set(U.id,U.toStorageString()),O}async readSigninResponseState(e,t=!1){const r=this._logger.create("readSigninResponseState"),n=new yk($8.readParams(e,this.settings.response_mode));if(!n.state)throw r.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:await oY.fromStorageString(i),response:n}}async processSigninResponse(e,t){const r=this._logger.create("processSigninResponse"),{state:n,response:i}=await this.readSigninResponseState(e,!0);if(r.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const o=await this.getDpopProof(this.settings.dpop.store);t={...t,DPoP:o}}try{await this._validator.validateSigninResponse(i,n,t)}catch(o){if(o instanceof Y8&&this.settings.dpop){const a=await this.getDpopProof(this.settings.dpop.store,o.nonce);t.DPoP=a,await this._validator.validateSigninResponse(i,n,t)}else throw o}return i}async getDpopProof(e,t){let r,n;return(await e.getAllKeys()).includes(this.settings.client_id)?(n=await e.get(this.settings.client_id),n.nonce!==t&&t&&(n.nonce=t,await e.set(this.settings.client_id,n))):(r=await tl.generateDPoPKeys(),n=new lY(r,t),await e.set(this.settings.client_id,n)),await tl.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:n.keys,nonce:n.nonce})}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r=!1,extraTokenParams:n={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...n}),o=new yk(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,r),o}async useRefreshToken({state:e,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,extraTokenParams:o}){var a;const s=this._logger.create("useRefreshToken");let l;if(this.settings.refreshTokenAllowedScope===void 0)l=e.scope;else{const d=this.settings.refreshTokenAllowedScope.split(" ");l=(((a=e.scope)==null?void 0:a.split(" "))||[]).filter(f=>d.includes(f)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const d=await this.getDpopProof(this.settings.dpop.store);i={...i,DPoP:d}}let c;try{c=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:l,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,...o})}catch(d){if(d instanceof Y8&&this.settings.dpop)i.DPoP=await this.getDpopProof(this.settings.dpop.store,d.nonce),c=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:l,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,...o});else throw d}const u=new yk(new URLSearchParams);return Object.assign(u,c),s.debug("validating response",u),await this._validator.validateRefreshResponse(u,{...e,scope:l}),u}async createSignoutRequest({state:e,id_token_hint:t,client_id:r,request_type:n,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",s),!r&&i&&!t&&(r=this.settings.client_id);const l=new nQe({url:s,id_token_hint:t,client_id:r,post_logout_redirect_uri:i,state_data:e,extraQueryParams:o,request_type:n});await this.clearStaleState();const c=l.state;return c&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),l}async readSignoutResponseState(e,t=!1){const r=this._logger.create("readSignoutResponseState"),n=new iQe($8.readParams(e,this.settings.response_mode));if(!n.state){if(r.debug("No state in response"),n.error)throw r.warn("Response was error:",n.error),new lg(n);return{state:void 0,response:n}}const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:await Ix.fromStorageString(i),response:n}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:r,response:n}=await this.readSignoutResponseState(e,!0);return r?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(n,r)):t.debug("No state from storage; skipping response validation"),n}clearStaleState(){return this._logger.create("clearStaleState"),Ix.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},cQe=class{constructor(e){this._userManager=e,this._logger=new Kn("SessionMonitor"),this._start=async t=>{const r=t.session_state;if(!r)return;const n=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,n.debug("session_state",r,", sub",this._sub)):(this._sub=void 0,n.debug("session_state",r,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(r);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){n.debug("initializing check session iframe");const o=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new Gje(this._callback,o,i,a,s);await l.load(),this._checkSessionIFrame=l,l.start(r)}else n.warn("no check session iframe found in the metadata")}catch(i){n.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const r=setInterval(async()=>{clearInterval(r);try{const n=await this._userManager.querySessionStatus();if(n){const i={session_state:n.session_state,profile:n.sub?{sub:n.sub}:null};this._start(i)}}catch(n){t.error("error from querySessionStatus",n instanceof Error?n.message:n)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const r=await this._userManager.querySessionStatus();let n=!0;r&&this._checkSessionIFrame?r.sub===this._sub?(n=!1,this._checkSessionIFrame.start(r.session_state),t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",r.session_state),await this._userManager.events._raiseUserSessionChanged()):t.debug("different subject signed into OP",r.sub):t.debug("subject no longer signed into OP"),n?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(r){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",r),await this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const r={session_state:t.session_state,profile:t.sub?{sub:t.sub}:null};this._start(r)}}}},vk=class cY{constructor(t){var r;this.id_token=t.id_token,this.session_state=(r=t.session_state)!=null?r:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState,this.url_state=t.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-jf.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+jf.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,r;return(r=(t=this.scope)==null?void 0:t.split(" "))!=null?r:[]}toStorageString(){return new Kn("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return Kn.createStatic("User","fromStorageString"),new cY(JSON.parse(t))}},dj="oidc-client",uY=class{constructor(){this._abort=new Wh("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:r,keepOpen:n}=await new Promise((i,o)=>{const a=s=>{var l;const c=s.data,u=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==u||(c==null?void 0:c.source)!==dj)){try{const d=$8.readParams(c.url,e.response_mode).get("state");if(d||t.warn("no state found in response url"),s.source!==this._window&&d!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),o(s)}))});return t.debug("got response from window"),this._dispose(),n||this.close(),{url:r}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,r=!1,n=window.location.origin){e.postMessage({source:dj,url:t,keepOpen:r},n)}},dY={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},fY="_blank",uQe=60,dQe=2,hY=10,fQe=class extends X8{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:r=e.post_logout_redirect_uri,popupWindowFeatures:n=dY,popupWindowTarget:i=fY,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,requestTimeoutInSeconds:c,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:d,automaticSilentRenew:h=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:A=!1,checkSessionIntervalInSeconds:m=dQe,query_status_response_type:y="code",stopCheckSessionOnError:w=!0,revokeTokenTypes:S=["access_token","refresh_token"],revokeTokensOnSignout:C=!1,includeIdTokenInSilentSignout:E=!1,accessTokenExpiringNotificationTimeInSeconds:I=uQe,userStore:D}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=r,this.popupWindowFeatures=n,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=d||c||hY,this.automaticSilentRenew=h,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=p,this.monitorSession=g,this.monitorAnonymousSession=A,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=w,this.query_status_response_type=y,this.revokeTokenTypes=S,this.revokeTokensOnSignout=C,this.includeIdTokenInSilentSignout=E,this.accessTokenExpiringNotificationTimeInSeconds=I,D)this.userStore=D;else{const O=typeof window<"u"?window.sessionStorage:new rY;this.userStore=new nY({store:O})}}},fj=class pY extends uY{constructor({silentRequestTimeoutInSeconds:t=hY}){super(),this._logger=new Kn("IFrameWindow"),this._timeoutInSeconds=t,this._frame=pY.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const r=setTimeout(()=>void this._abort.raise(new O9("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(r)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",r=>{var n;const i=r.target;(n=i.parentNode)==null||n.removeChild(i),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,r){return super._notifyParent(window.parent,t,!1,r)}},hQe=class{constructor(e){this._settings=e,this._logger=new Kn("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new fj({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),fj.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},pQe=500,AQe=1e3,hj=class extends uY{constructor({popupWindowTarget:e=fY,popupWindowFeatures:t={},popupSignal:r}){super(),this._logger=new Kn("PopupWindow");const n=uj.center({...dY,...t});this._window=window.open(void 0,e,uj.serialize(n)),r&&r.addEventListener("abort",()=>{var i;this._abort.raise(new Error((i=r.reason)!=null?i:"Popup aborted"))}),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*AQe)}async navigate(e){var t;(t=this._window)==null||t.focus();const r=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},pQe);return this._disposeHandlers.add(()=>clearInterval(r)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},gQe=class{constructor(e){this._settings=e,this._logger=new Kn("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget,popupSignal:r}){return new hj({popupWindowFeatures:e,popupWindowTarget:t,popupSignal:r})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),hj.notifyOpener(e,t)}},mQe=class{constructor(e){this._settings=e,this._logger=new Kn("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var r;this._logger.create("prepare");let n=window.self;t==="top"&&(n=(r=window.top)!=null?r:window.self);const i=n.location[e].bind(n.location);let o;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,c)=>{o=c});return i(a.url),await s},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),n.stop()}}}async callback(){}},bQe=class extends Kje{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Kn("UserManagerEvents"),this._userLoaded=new Wh("User loaded"),this._userUnloaded=new Wh("User unloaded"),this._silentRenewError=new Wh("Silent renew error"),this._userSignedIn=new Wh("User signed in"),this._userSignedOut=new Wh("User signed out"),this._userSessionChanged=new Wh("User session changed")}async load(e,t=!0){super.load(e),t&&await this._userLoaded.raise(e)}async unload(){super.unload(),await this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}async _raiseSilentRenewError(e){await this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},yQe=class{constructor(e){this._userManager=e,this._logger=new Kn("SilentRenewService"),this._isStarted=!1,this._retryTimer=new jf("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(r){if(r instanceof O9){t.warn("ErrorTimeout from signinSilent:",r,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",r),await this._userManager.events._raiseSilentRenewError(r)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},vQe=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},wQe=class{constructor(e,t,r,n){this._logger=new Kn("UserManager"),this.settings=new fQe(e),this._client=new lQe(e),this._redirectNavigator=t??new mQe(this.settings),this._popupNavigator=r??new gQe(this.settings),this._iframeNavigator=n??new hQe(this.settings),this._events=new bQe(this.settings),this._silentRenewService=new yQe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new cQe(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),await this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),await this._events.unload()}async signinRedirect(e={}){var t;this._logger.create("signinRedirect");const{redirectMethod:r,...n}=e;let i;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(i=await this.generateDPoPJkt(this.settings.dpop));const o=await this._redirectNavigator.prepare({redirectMethod:r});await this._signinStart({request_type:"si:r",dpopJkt:i,...n},o)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),r=await this._signinEnd(e);return r.profile&&r.profile.sub?t.info("success, signed in subject",r.profile.sub):t.info("no subject"),r}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:r=!1}){const n=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r,extraTokenParams:this.settings.extraTokenParams});n.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject"),o}async signinPopup(e={}){var t;const r=this._logger.create("signinPopup");let n;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(n=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:i,popupWindowTarget:o,popupSignal:a,...s}=e,l=this.settings.popup_redirect_uri;l||r.throw(new Error("No popup_redirect_uri configured"));const c=await this._popupNavigator.prepare({popupWindowFeatures:i,popupWindowTarget:o,popupSignal:a}),u=await this._signin({request_type:"si:p",redirect_uri:l,display:"popup",dpopJkt:n,...s},c);return u&&(u.profile&&u.profile.sub?r.info("success, signed in subject",u.profile.sub):r.info("no subject")),u}async signinPopupCallback(e=window.location.href,t=!1){const r=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),r.info("success")}async signinSilent(e={}){var t,r;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:i,...o}=e;let a=await this._loadUser();if(a!=null&&a.refresh_token){n.debug("using refresh token");const d=new vQe(a);return await this._useRefreshToken({state:d,redirect_uri:o.redirect_uri,resource:o.resource,extraTokenParams:o.extraTokenParams,timeoutInSeconds:i})}let s;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(s=await this.generateDPoPJkt(this.settings.dpop));const l=this.settings.silent_redirect_uri;l||n.throw(new Error("No silent_redirect_uri configured"));let c;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),c=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:i});return a=await this._signin({request_type:"si:s",redirect_uri:l,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a==null?void 0:a.id_token:void 0,dpopJkt:s,...o},u,c),a&&((r=a.profile)!=null&&r.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...e}),r=new vk({...e.state,...t});return await this.storeUser(r),await this._events.load(r),r}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":await this.signinPopupCallback(e);break;case"si:s":await this.signinSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:r}=await this._client.readSignoutResponseState(e);if(r)switch(r.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:r,...n}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...n},a);try{const l={},c=await this._client.processSigninResponse(s.url,l);return t.debug("got signin response"),c.session_state&&c.profile.sub?(t.info("success for subject",c.profile.sub),{session_state:c.session_state,sub:c.profile.sub}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof lg)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,r){const n=await this._signinStart(e,t);return await this._signinEnd(n.url,r)}async _signinStart(e,t){const r=this._logger.create("_signinStart");try{const n=await this._client.createSigninRequest(e);return r.debug("got signin request"),await t.navigate({url:n.url,state:n.state.id,response_mode:n.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(n){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),n}}async _signinEnd(e,t){const r=this._logger.create("_signinEnd"),n={},i=await this._client.processSigninResponse(e,n);return r.debug("got signin response"),await this._buildUser(i,t)}async _buildUser(e,t){const r=this._logger.create("_buildUser"),n=new vk(e);if(t){if(t!==n.profile.sub)throw r.debug("current user does not match user returned from signin. sub from signin:",n.profile.sub),new lg({...e,error:"login_required"});r.debug("current user matches user returned from signin")}return await this.storeUser(n),r.debug("user stored"),await this._events.load(n),n}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:r,...n}=e,i=await this._redirectNavigator.prepare({redirectMethod:r});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...n},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),r=await this._signoutEnd(e);return t.info("success"),r}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:r,popupWindowTarget:n,popupSignal:i,...o}=e,a=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n,popupSignal:i});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:a==null?void 0:{},...o},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const r=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),r.info("success")}async _signout(e,t){const r=await this._signoutStart(e,t);return await this._signoutEnd(r.url)}async _signoutStart(e={},t){var r;const n=this._logger.create("_signoutStart");try{const i=await this._loadUser();n.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(n.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),n.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(e);return n.debug("got signout request"),await t.navigate({url:a.url,state:(r=a.state)==null?void 0:r.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),r=await this._client.processSignoutResponse(e);return t.debug("got signout response"),r}async signoutSilent(e={}){var t;const r=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:n,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:o,...i},s),r.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const r=this._logger.create("_revokeInternal");if(!e)return;const n=t.filter(i=>typeof e[i]=="string");if(!n.length){r.debug("no need to revoke due to no token(s)");return}for(const i of n)await this._client.revokeToken(e[i],i),r.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),r.debug("user stored"),await this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),vk.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const r=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,r)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(e,t,r,n){var i,o;const a=await((o=(i=this.settings.dpop)==null?void 0:i.store)==null?void 0:o.get(this.settings.client_id));if(a)return await tl.generateDPoPProof({url:e,accessToken:t==null?void 0:t.access_token,httpMethod:r,keyPair:a.keys,nonce:n})}async generateDPoPJkt(e){let t=await e.store.get(this.settings.client_id);if(!t){const r=await tl.generateDPoPKeys();t=new lY(r),await e.store.set(this.settings.client_id,t)}return await tl.generateDPoPJkt(t.keys)}},U9=He.createContext(void 0);U9.displayName="AuthContext";var xQe={isLoading:!0,isAuthenticated:!1},_Qe=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_SIGNED_OUT":case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},SQe=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},AY=e=>t=>t instanceof Error?t:new Error(e),kQe=AY("Sign-in failed"),CQe=AY("Sign-out failed"),BQe=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],EQe=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],pj=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},Aj=typeof window>"u"?null:wQe,MQe=e=>{const{children:t,onSigninCallback:r,skipSigninCallback:n,matchSignoutCallback:i,onSignoutCallback:o,onRemoveUser:a,userManager:s=null,...l}=e,[c]=He.useState(()=>s??(Aj?new Aj(l):{settings:l})),[u,d]=He.useReducer(_Qe,xQe),h=He.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(BQe.map(A=>{var m,y;return[A,(y=(m=c[A])==null?void 0:m.bind(c))!=null?y:pj(A)]})),Object.fromEntries(EQe.map(A=>[A,c[A]?async m=>{d({type:"NAVIGATOR_INIT",method:A});try{return await c[A](m)}catch(y){return d({type:"ERROR",error:y}),null}finally{d({type:"NAVIGATOR_CLOSE"})}}:pj(A)]))),[c]),f=He.useRef(!1);He.useEffect(()=>{!c||f.current||(f.current=!0,(async()=>{try{let A=null;SQe()&&!n&&(A=await c.signinCallback(),r&&await r(A)),A=A||await c.getUser(),d({type:"INITIALISED",user:A})}catch(A){d({type:"ERROR",error:kQe(A)})}try{if(i&&i(c.settings)){const A=await c.signoutCallback();o&&await o(A)}}catch(A){d({type:"ERROR",error:CQe(A)})}})())},[c,n,r,o,i]),He.useEffect(()=>{if(!c)return;const A=S=>{d({type:"USER_LOADED",user:S})};c.events.addUserLoaded(A);const m=()=>{d({type:"USER_UNLOADED"})};c.events.addUserUnloaded(m);const y=()=>{d({type:"USER_SIGNED_OUT"})};c.events.addUserSignedOut(y);const w=S=>{d({type:"ERROR",error:S})};return c.events.addSilentRenewError(w),()=>{c.events.removeUserLoaded(A),c.events.removeUserUnloaded(m),c.events.removeUserSignedOut(y),c.events.removeSilentRenewError(w)}},[c]);const p=He.useCallback(async()=>{await c.removeUser(),a&&await a()},[c,a]),g=He.useMemo(()=>({...u,...h,removeUser:p}),[u,h,p]);return He.createElement(U9.Provider,{value:g},t)},TQe=()=>{const e=He.useContext(U9);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a <AuthProvider> component."),e};const FQe={authority:window.location.origin+"/oidc/realms/Liberty",client_id:"liberty-framework",redirect_uri:window.location.origin};BX.createRoot(document.getElementById("root")).render(pf.jsx(He.StrictMode,{children:pf.jsx(MQe,{...FQe,children:pf.jsx(P_e,{useAuth:TQe,children:pf.jsx(Oje,{fallback:pf.jsx(Nt,{children:"An error has occurred"}),children:pf.jsx(Lje,{children:pf.jsx(jje,{})})})})})}));export{za as M,zr as _,UH as z};
948
- //# sourceMappingURL=index-BEQMJlHa.js.map
948
+ //# sourceMappingURL=index-HlYGfx6q.js.map